Chromium Code Reviews| Index: src/compiler/register-allocator.cc |
| diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc |
| index 02ba1f17c24c640d6865f5c5805ec267b85828a6..de0b48404d78162ba932852ca9fb590f0f42e3ae 100644 |
| --- a/src/compiler/register-allocator.cc |
| +++ b/src/compiler/register-allocator.cc |
| @@ -2197,8 +2197,21 @@ void LiveRangeBuilder::ProcessPhis(const InstructionBlock* block, |
| int phi_vreg = phi->virtual_register(); |
| live->Remove(phi_vreg); |
| InstructionOperand* hint = nullptr; |
| - Instruction* instr = GetLastInstruction( |
| - code(), code()->InstructionBlockAt(block->predecessors()[0])); |
| + const InstructionBlock::Predecessors& predecessors = block->predecessors(); |
|
Jarin
2016/02/25 11:13:42
Could you add a comment with an explanation here?
Mircea Trofin
2016/02/25 15:22:52
Done.
|
| + const InstructionBlock* predecessor_block = |
| + code()->InstructionBlockAt(predecessors[0]); |
| + const Instruction* instr = GetLastInstruction(code(), predecessor_block); |
| + if (predecessor_block->IsDeferred()) { |
| + for (size_t i = 1; i < predecessors.size(); ++i) { |
|
titzer
2016/02/25 12:14:42
Could also simplify to
for (size_t i = 0; i < pre
Mircea Trofin
2016/02/25 15:22:51
Done.
|
| + predecessor_block = code()->InstructionBlockAt(predecessors[i]); |
| + if (predecessor_block->IsDeferred()) continue; |
| + |
| + instr = GetLastInstruction(code(), predecessor_block); |
| + break; |
| + } |
| + } |
| + DCHECK_NOT_NULL(instr); |
| + |
| for (MoveOperands* move : *instr->GetParallelMove(Instruction::END)) { |
| InstructionOperand& to = move->destination(); |
| if (to.IsUnallocated() && |