Chromium Code Reviews| Index: src/compiler/register-allocator.cc |
| diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc |
| index 0368380b8cdf93fb4ea8976ad35e6ea07247559e..81775679968ac6fe584f2a9ee75c130bee089cec 100644 |
| --- a/src/compiler/register-allocator.cc |
| +++ b/src/compiler/register-allocator.cc |
| @@ -3411,6 +3411,8 @@ void LiveRangeConnector::ResolveControlFlow(Zone* local_zone) { |
| BitVector* live = live_in_sets[block->rpo_number().ToInt()]; |
| BitVector::Iterator iterator(live); |
| while (!iterator.Done()) { |
| + int vreg = iterator.Current(); |
|
Benedikt Meurer
2016/04/23 12:04:49
Stale change?
Mircea Trofin
2016/04/23 16:27:07
Ya, I meant to use vreg in the finder.ArrayFor cal
|
| + USE(vreg); |
| LiveRangeBoundArray* array = finder.ArrayFor(iterator.Current()); |
| for (const RpoNumber& pred : block->predecessors()) { |
| FindResult result; |
| @@ -3628,6 +3630,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 +3657,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(); |
| + } |
| } |
| } |
| } |