[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}
This commit is contained in:
parent
aa4c328198
commit
f1a6e5e79b
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user