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

[turbofan] Readjust has_slot_use after splintering

has_slot_use is computed early, and we need it to determine if we need
to generate SpillRanges. After splintering, however, the information may
be incorrect - e.g. just the splinter may have slot uses, and not the
original.

BUG=

Review-Url: https://codereview.chromium.org/2312523002
Cr-Commit-Position: refs/heads/master@{#39147}
parent aa4c3281
......@@ -58,6 +58,15 @@ void CreateSplinter(TopLevelLiveRange *range, RegisterAllocationData *data,
}
}
void SetSlotUse(TopLevelLiveRange *range) {
range->set_has_slot_use(false);
for (const UsePosition *pos = range->first_pos();
!range->has_slot_use() && pos != nullptr; pos = pos->next()) {
if (pos->type() == UsePositionType::kRequiresSlot) {
range->set_has_slot_use(true);
}
}
}
void SplinterLiveRange(TopLevelLiveRange *range, RegisterAllocationData *data) {
const InstructionSequence *code = data->code();
......@@ -99,7 +108,14 @@ void SplinterLiveRange(TopLevelLiveRange *range, RegisterAllocationData *data) {
if (first_cut.IsValid()) {
CreateSplinter(range, data, first_cut, last_cut);
}
// Redo has_slot_use
if (range->has_slot_use() && range->splinter() != nullptr) {
SetSlotUse(range);
SetSlotUse(range->splinter());
}
}
} // namespace
......
......@@ -1041,6 +1041,8 @@ void TopLevelLiveRange::Merge(TopLevelLiveRange* other, Zone* zone) {
TopLevel()->UpdateParentForAllChildren(TopLevel());
TopLevel()->UpdateSpillRangePostMerge(other);
TopLevel()->set_has_slot_use(TopLevel()->has_slot_use() ||
other->has_slot_use());
#if DEBUG
Verify();
......
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