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

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

Issue 1301393012: [turbofan] Split before loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | « src/compiler/greedy-allocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/greedy-allocator.cc
diff --git a/src/compiler/greedy-allocator.cc b/src/compiler/greedy-allocator.cc
index d6f48a2716e2be223b05c46c526dcbc4ca5a7a79..4eb6f16da950b85579a01173c01e1eb5900dc39c 100644
--- a/src/compiler/greedy-allocator.cc
+++ b/src/compiler/greedy-allocator.cc
@@ -476,9 +476,25 @@ LifetimePosition GreedyAllocator::FindSplitPositionAfterCall(
}
+LifetimePosition GreedyAllocator::FindSplitPositionBeforeLoops(
+ LiveRange* range) {
+ LifetimePosition end = range->End();
+ if (end.ToInstructionIndex() >= code()->LastInstructionIndex()) {
+ end =
+ LifetimePosition::GapFromInstructionIndex(end.ToInstructionIndex() - 1);
+ }
+ LifetimePosition pos = FindOptimalSplitPos(range->Start(), end);
+ pos = GetSplitPositionForInstruction(range, pos.ToInstructionIndex());
+ return pos;
+}
+
+
void GreedyAllocator::SplitOrSpillBlockedRange(LiveRange* range) {
if (TrySplitAroundCalls(range)) return;
- auto pos = GetLastResortSplitPosition(range, code());
+
+ LifetimePosition pos = FindSplitPositionBeforeLoops(range);
+
+ if (!pos.IsValid()) pos = GetLastResortSplitPosition(range, code());
if (pos.IsValid()) {
LiveRange* tail = Split(range, data(), pos);
DCHECK(tail != range);
« no previous file with comments | « src/compiler/greedy-allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698