diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-11-07 10:48:10 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-11-07 14:43:19 +0000 |
commit | f43083d560565aea46c602adb86423daeefe589d (patch) | |
tree | 6c812e88723c40ee77ab5c9ba38625a10cc9b364 /compiler/optimizing/code_generator.cc | |
parent | de87f405a5f8a4ffd57f01d0d667188e8f0ca8cd (diff) |
Do not update Out after it has a valid location.
Slow paths use LocationSummary to know where to move
things around, and they are executed at the end of the
code generation.
This fix is needed for https://android-review.googlesource.com/#/c/113345/.
Change-Id: Id336c6409479b1de6dc839b736a7234d08a7774a
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); + } } } } |