Commit 5f4828a1 authored by bmeurer's avatar bmeurer Committed by Commit bot

Revert of [turbofan] Remove redundant code. (patchset #1 id:1 of...

Revert of [turbofan] Remove redundant code. (patchset #1 id:1 of https://codereview.chromium.org/1428943004/ )

Reason for revert:
This CL reintroduces all kinds of funny moves for Merges of deferred code, which makes jump threading ineffective.

Original issue's description:
> [turbofan] Remove redundant code.
>
> When I centralized the treatment of memory operands, I forgot to delete
> the old code.
>
> There is a semantic difference between the old and new code. The old
> code was handling either memory operands, or ranges that had a spilled
> predecessor. The new code handles just memory operands. It may
> happen that (using LinearScan) an active range is spilled when trying
> to allocate another range (see SplitAndSpillIntersecting). That may make
> it a candidate for the old version of the code, however, since we would
> have spilled up to a register use, the old code wouldn't have had taken
> effect.
>
> Perf data shows this nuance doesn't make a difference in perf.
>
> BUG=
>
> Committed: https://crrev.com/c03d7a7f03657a452f71277d84e435ed73566327
> Cr-Commit-Position: refs/heads/master@{#31729}

TBR=jarin@chromium.org,mtrofin@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1416293004

Cr-Commit-Position: refs/heads/master@{#31732}
parent 608ed2e2
...@@ -2443,6 +2443,28 @@ void LinearScanAllocator::AllocateRegisters() { ...@@ -2443,6 +2443,28 @@ void LinearScanAllocator::AllocateRegisters() {
TRACE("Processing interval %d:%d start=%d\n", current->TopLevel()->vreg(), TRACE("Processing interval %d:%d start=%d\n", current->TopLevel()->vreg(),
current->relative_id(), position.value()); current->relative_id(), position.value());
if (current->IsTopLevel() && !current->TopLevel()->HasNoSpillType()) {
TRACE("Live range %d:%d already has a spill operand\n",
current->TopLevel()->vreg(), current->relative_id());
auto next_pos = position;
if (next_pos.IsGapPosition()) {
next_pos = next_pos.NextStart();
}
auto pos = current->NextUsePositionRegisterIsBeneficial(next_pos);
// If the range already has a spill operand and it doesn't need a
// register immediately, split it and spill the first part of the range.
if (pos == nullptr) {
Spill(current);
continue;
} else if (pos->pos() > current->Start().NextStart()) {
// Do not spill live range eagerly if use position that can benefit from
// the register is too close to the start of live range.
SpillBetween(current, current->Start(), pos->pos());
DCHECK(UnhandledIsSorted());
continue;
}
}
if (current->IsTopLevel() && TryReuseSpillForPhi(current->TopLevel())) if (current->IsTopLevel() && TryReuseSpillForPhi(current->TopLevel()))
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment