Commit c03d7a7f authored by mtrofin's avatar mtrofin Committed by Commit bot

[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=

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

Cr-Commit-Position: refs/heads/master@{#31729}
parent a080d4c5
......@@ -2443,28 +2443,6 @@ void LinearScanAllocator::AllocateRegisters() {
TRACE("Processing interval %d:%d start=%d\n", current->TopLevel()->vreg(),
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()))
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