[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:
mtrofin 2016-09-04 21:06:15 -07:00 committed by Commit bot
parent aa4c328198
commit f1a6e5e79b
2 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -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();