diff options
| author | 2014-11-07 14:43:52 +0000 | |
|---|---|---|
| committer | 2014-11-07 14:43:53 +0000 | |
| commit | 86fe4e41720cab85e3e40c45c0436521e56b25d5 (patch) | |
| tree | 913101e647d8ec3c0284d98c49e6dad88d11f612 /compiler/optimizing/code_generator.cc | |
| parent | a07dcd90b54ba708616b0d5d06238d491bf671ed (diff) | |
| parent | f43083d560565aea46c602adb86423daeefe589d (diff) | |
Merge "Do not update Out after it has a valid location."
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); + } } } } |