Commit f2fe2c67 authored by Yolanda Chen's avatar Yolanda Chen Committed by Commit Bot

[regalloc] Do not pick state from ranges end before the predecessor does

When pick state from predecessor, we should consider live ranges that were split out by the backwards spilling heurisitics and already end before the predecessor does.

Bug: chromium:1066869
Change-Id: I9ff85e73059a7c07f1e212fdc041450c79a4d70c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2174337Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Yolanda Chen <yolanda.chen@intel.com>
Cr-Commit-Position: refs/heads/master@{#67665}
parent 1d8d6742
......@@ -3848,11 +3848,15 @@ void LinearScanAllocator::AllocateRegisters() {
auto& spill_state = data()->GetSpillState(pred);
TRACE("Not a fallthrough. Adding %zu elements...\n",
spill_state.size());
LifetimePosition pred_end =
LifetimePosition::GapFromInstructionIndex(
this->code()->InstructionBlockAt(pred)->code_end());
for (const auto range : spill_state) {
// Filter out ranges that had their register stolen by backwards
// working spill heuristics. These have been spilled after the
// fact, so ignore them.
if (!range->HasRegisterAssigned()) continue;
// Filter out ranges that were split or had their register
// stolen by backwards working spill heuristics. These have
// been spilled after the fact, so ignore them.
if (range->End() < pred_end || !range->HasRegisterAssigned())
continue;
to_be_live->emplace(range);
}
}
......
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