[turbofan] Fix small redundancy in register allocator per TODO.
R=mtrofin@chromium.org BUG= Review URL: https://codereview.chromium.org/1690863006 Cr-Commit-Position: refs/heads/master@{#33957}
This commit is contained in:
parent
821c603e0c
commit
92b9424ff3
@ -2442,12 +2442,15 @@ LifetimePosition RegisterAllocator::FindOptimalSplitPos(LifetimePosition start,
|
||||
|
||||
const InstructionBlock* block = end_block;
|
||||
// Find header of outermost loop.
|
||||
// TODO(titzer): fix redundancy below.
|
||||
while (GetContainingLoop(code(), block) != nullptr &&
|
||||
GetContainingLoop(code(), block)->rpo_number().ToInt() >
|
||||
start_block->rpo_number().ToInt()) {
|
||||
block = GetContainingLoop(code(), block);
|
||||
do {
|
||||
const InstructionBlock* loop = GetContainingLoop(code(), block);
|
||||
if (loop == nullptr ||
|
||||
loop->rpo_number().ToInt() <= start_block->rpo_number().ToInt()) {
|
||||
// No more loops or loop starts before the lifetime start.
|
||||
break;
|
||||
}
|
||||
block = loop;
|
||||
} while (true);
|
||||
|
||||
// We did not find any suitable outer loop. Split at the latest possible
|
||||
// position unless end_block is a loop header itself.
|
||||
|
Loading…
Reference in New Issue
Block a user