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

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

Issue 1912093005: [turbofan] Single entry into deferred regions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/raw-machine-assembler.cc ('k') | src/compiler/register-allocator-verifier.h » ('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 0368380b8cdf93fb4ea8976ad35e6ea07247559e..4adc81514e5018ff458820bc81e863b1ba4d2fbd 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -3411,7 +3411,8 @@ void LiveRangeConnector::ResolveControlFlow(Zone* local_zone) {
BitVector* live = live_in_sets[block->rpo_number().ToInt()];
BitVector::Iterator iterator(live);
while (!iterator.Done()) {
- LiveRangeBoundArray* array = finder.ArrayFor(iterator.Current());
+ int vreg = iterator.Current();
+ LiveRangeBoundArray* array = finder.ArrayFor(vreg);
for (const RpoNumber& pred : block->predecessors()) {
FindResult result;
const InstructionBlock* pred_block = code()->InstructionBlockAt(pred);
@@ -3628,6 +3629,7 @@ void LiveRangeConnector::CommitSpillsInDeferredBlocks(
worklist.push(iterator.Current());
}
+ ZoneSet<std::pair<RpoNumber, int>> done_moves(temp_zone);
// Seek the deferred blocks that dominate locations requiring spill operands,
// and spill there. We only need to spill at the start of such blocks.
BitVector done_blocks(
@@ -3654,10 +3656,15 @@ void LiveRangeConnector::CommitSpillsInDeferredBlocks(
InstructionOperand pred_op = bound->range_->GetAssignedOperand();
- data()->AddGapMove(spill_block->first_instruction_index(),
- Instruction::GapPosition::START, pred_op,
- spill_operand);
- spill_block->mark_needs_frame();
+ RpoNumber spill_block_number = spill_block->rpo_number();
+ if (done_moves.find(std::make_pair(
+ spill_block_number, range->vreg())) == done_moves.end()) {
+ data()->AddGapMove(spill_block->first_instruction_index(),
+ Instruction::GapPosition::START, pred_op,
+ spill_operand);
+ done_moves.insert(std::make_pair(spill_block_number, range->vreg()));
+ spill_block->mark_needs_frame();
+ }
}
}
}
« no previous file with comments | « src/compiler/raw-machine-assembler.cc ('k') | src/compiler/register-allocator-verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698