summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/parallel_move_resolver.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-01-14 10:45:05 +0000
committerNicolas Geoffray <ngeoffray@google.com>2015-01-14 14:45:40 +0000
commit48c310c431b110f6ab54907da20c4fa39a8f76b8 (patch)
tree3f8e75544539544feda353a1f225145e5ee41fa0 /compiler/optimizing/parallel_move_resolver.cc
parentc40a4350daac81ddbfc5f6ceab934f2180dc4ec6 (diff)
downloadart-48c310c431b110f6ab54907da20c4fa39a8f76b8.tar.gz
art-48c310c431b110f6ab54907da20c4fa39a8f76b8.tar.bz2
art-48c310c431b110f6ab54907da20c4fa39a8f76b8.zip
Remove constant moves after emitting them in parallel resolver.
This fixes the case where a constant move requires a scratch register. Note that there is no backend that needs this for now, but X86 might with the move to hard float. Change-Id: I37f6b8961b48f2cf6fbc0cd281e70d58466d018e
Diffstat (limited to 'compiler/optimizing/parallel_move_resolver.cc')
-rw-r--r--compiler/optimizing/parallel_move_resolver.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/optimizing/parallel_move_resolver.cc b/compiler/optimizing/parallel_move_resolver.cc
index 1e93ece2ef..b8f5070999 100644
--- a/compiler/optimizing/parallel_move_resolver.cc
+++ b/compiler/optimizing/parallel_move_resolver.cc
@@ -37,10 +37,12 @@ void ParallelMoveResolver::EmitNativeCode(HParallelMove* parallel_move) {
// Perform the moves with constant sources.
for (size_t i = 0; i < moves_.Size(); ++i) {
- const MoveOperands& move = *moves_.Get(i);
- if (!move.IsEliminated()) {
- DCHECK(move.GetSource().IsConstant());
+ MoveOperands* move = moves_.Get(i);
+ if (!move->IsEliminated()) {
+ DCHECK(move->GetSource().IsConstant());
EmitMove(i);
+ // Eliminate the move, in case following moves need a scratch register.
+ move->Eliminate();
}
}