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

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

Issue 810013002: [turbofan] simplify gap ordering (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/instruction.cc ('k') | test/cctest/compiler/test-instruction.cc » ('j') | 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 9eb4a470f298359c1ae5cbb14d9cf314bf13d737..416b970865f6bd95d9bdfee0bb90c8b2775bb320 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -1078,7 +1078,7 @@ void RegisterAllocator::MeetRegisterConstraintsForLastInstructionInBlock(
for (auto succ : block->successors()) {
const InstructionBlock* successor = code()->InstructionBlockAt(succ);
DCHECK(successor->PredecessorCount() == 1);
- int gap_index = successor->first_instruction_index() + 1;
+ int gap_index = successor->first_instruction_index();
DCHECK(code()->IsGapAt(gap_index));
// Create an unconstrained operand for the same virtual register
@@ -1095,7 +1095,7 @@ void RegisterAllocator::MeetRegisterConstraintsForLastInstructionInBlock(
for (auto succ : block->successors()) {
const InstructionBlock* successor = code()->InstructionBlockAt(succ);
DCHECK(successor->PredecessorCount() == 1);
- int gap_index = successor->first_instruction_index() + 1;
+ int gap_index = successor->first_instruction_index();
range->SpillAtDefinition(local_zone(), gap_index, output);
range->SetSpillStartIndex(gap_index);
}
@@ -2376,7 +2376,8 @@ void RegisterAllocator::SplitAndSpillIntersecting(LiveRange* current) {
bool RegisterAllocator::IsBlockBoundary(LifetimePosition pos) {
return pos.IsInstructionStart() &&
- InstructionAt(pos.InstructionIndex())->IsBlockStart();
+ code()->GetInstructionBlock(pos.InstructionIndex())->code_start() ==
+ pos.InstructionIndex();
}
@@ -2474,9 +2475,13 @@ void RegisterAllocator::SpillBetweenUntil(LiveRange* range,
// The split result intersects with [start, end[.
// Split it at position between ]start+1, end[, spill the middle part
// and put the rest to unhandled.
+ auto third_part_end = end.PrevInstruction().InstructionEnd();
+ if (IsBlockBoundary(end.InstructionStart())) {
+ third_part_end = end.InstructionStart();
+ }
auto third_part = SplitBetween(
second_part, Max(second_part->Start().InstructionEnd(), until),
- end.PrevInstruction().InstructionEnd());
+ third_part_end);
if (!AllocationOk()) return;
DCHECK(third_part != second_part);
« no previous file with comments | « src/compiler/instruction.cc ('k') | test/cctest/compiler/test-instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698