diff options
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index c75980d856..0dfbad25f5 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -281,16 +281,22 @@ void CodeGenerator::InitLocations(HInstruction* instruction) { HInstruction* previous = instruction->GetPrevious(); Location temp_location = GetTemporaryLocation(instruction->AsTemporary()); Move(previous, temp_location, instruction); - previous->GetLocations()->SetOut(temp_location); } return; } AllocateRegistersLocally(instruction); for (size_t i = 0, e = instruction->InputCount(); i < e; ++i) { Location location = instruction->GetLocations()->InAt(i); + HInstruction* input = instruction->InputAt(i); if (location.IsValid()) { // Move the input to the desired location. - Move(instruction->InputAt(i), location, instruction); + if (input->GetNext()->IsTemporary()) { + // If the input was stored in a temporary, use that temporary to + // perform the move. + Move(input->GetNext(), location, instruction); + } else { + Move(input, location, instruction); + } } } } |