Commit 57ae3dbf authored by mtrofin's avatar mtrofin Committed by Commit bot

[turbofan] Pre-spill ranges that have a slot use.

BUG=

Review-Url: https://codereview.chromium.org/2355373002
Cr-Commit-Position: refs/heads/master@{#39634}
parent a124feb0
......@@ -2385,15 +2385,15 @@ LifetimePosition RegisterAllocator::GetSplitPositionForInstruction(
return ret;
}
void RegisterAllocator::SplitAndSpillRangesDefinedByMemoryOperand(
bool operands_only) {
void RegisterAllocator::SplitAndSpillRangesDefinedByMemoryOperand() {
size_t initial_range_count = data()->live_ranges().size();
for (size_t i = 0; i < initial_range_count; ++i) {
TopLevelLiveRange* range = data()->live_ranges()[i];
if (!CanProcessRange(range)) continue;
if (!range->HasSpillOperand()) continue;
if (range->HasNoSpillType() ||
(range->HasSpillRange() && !range->has_slot_use())) {
continue;
}
LifetimePosition start = range->Start();
TRACE("Live range %d:%d is defined by a spill operand.\n",
range->TopLevel()->vreg(), range->relative_id());
......@@ -2571,8 +2571,7 @@ void LinearScanAllocator::AllocateRegisters() {
DCHECK(active_live_ranges().empty());
DCHECK(inactive_live_ranges().empty());
SplitAndSpillRangesDefinedByMemoryOperand(code()->VirtualRegisterCount() <=
num_allocatable_registers());
SplitAndSpillRangesDefinedByMemoryOperand();
for (TopLevelLiveRange* range : data()->live_ranges()) {
if (!CanProcessRange(range)) continue;
......
......@@ -965,7 +965,7 @@ class RegisterAllocator : public ZoneObject {
// Find the optimal split for ranges defined by a memory operand, e.g.
// constants or function parameters passed on the stack.
void SplitAndSpillRangesDefinedByMemoryOperand(bool operands_only);
void SplitAndSpillRangesDefinedByMemoryOperand();
// Split the given range at the given position.
// If range starts at or after the given position then the
......
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