Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: src/compiler/register-allocator.cc

Issue 1690863006: [turbofan] Fix small redundancy in register allocator per TODO. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator.cc
diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc
index 0465139bba3fdedd614d5b4a06d2be2fcc4999c6..7610cd71015131f8a734601aa24f81b60759bba0 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698