summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Zheng Xu <zheng.xu@arm.com> 2014-12-08 18:18:01 +0800
committer Zheng Xu <zheng.xu@arm.com> 2014-12-08 19:03:03 +0800
commitb218c858606641050d13f35a2365168b89b44841 (patch)
tree4fc577f5573be610d0925c827b14e2080453ef3f
parentab6572b564db69e2877456ca6fbd3a00f4cc4b6b (diff)
ART: Clear use count for unused VRs.
The use count of temp VR should be cleared when we replace "CMP_XXX vA, vB, vC" and "IF_XXX vA" with "kMirOpFusedCmpXXX vB, vC". Otherwise, the backend may allocate a physical register for the unused vA. Change-Id: I43ad37d0e7161ec3de154de8888caa94603f7715
-rw-r--r--compiler/dex/mir_optimization.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc
index 3c6b61de89..fd4c3d7d77 100644
--- a/compiler/dex/mir_optimization.cc
+++ b/compiler/dex/mir_optimization.cc
@@ -526,6 +526,9 @@ bool MIRGraph::BasicBlockOpt(BasicBlock* bb) {
default: LOG(ERROR) << "Unexpected opcode: " << opcode;
}
mir->dalvikInsn.opcode = static_cast<Instruction::Code>(kMirOpNop);
+ // Clear use count of temp VR.
+ use_counts_[mir->ssa_rep->defs[0]] = 0;
+ raw_use_counts_[mir->ssa_rep->defs[0]] = 0;
// Copy the SSA information that is relevant.
mir_next->ssa_rep->num_uses = mir->ssa_rep->num_uses;
mir_next->ssa_rep->uses = mir->ssa_rep->uses;