summaryrefslogtreecommitdiff
path: root/compiler/dex/mir_optimization.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-01-16 16:04:43 +0000
committer Vladimir Marko <vmarko@google.com> 2015-01-16 19:38:01 +0000
commit066f9e4b87d875f02a10fd43d8a251b3c17a64a3 (patch)
tree357dbd03b2ff2893469bc2dc7a8d0b658a699245 /compiler/dex/mir_optimization.cc
parentd16d76ac64b1b9ed17e9cc17a6afb85f16ce4b51 (diff)
Quick: Clean up optimization pass order.
Move the TypeInference pass to post-opt passes and make it a PassMEMirSsaRep as we need to rerun the pass if the SSA representation has changed. (Though we currently don't have any pass that would require it.) The results of MethodUseCount and ConstantPropagation passes are used only in the BBOptimization and codegen and stay valid across BBOptimization and SuspendCheckElimination, so move them out of post-opt passes to just before the BBOpt (and reverse the dependency between ConstantPropagation and init reg locations passes). Change-Id: If02c087107cef48d5f9f7c18b0a0ace370fe2647
Diffstat (limited to 'compiler/dex/mir_optimization.cc')
-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 15b83413b7..ebbd28f6c4 100644
--- a/compiler/dex/mir_optimization.cc
+++ b/compiler/dex/mir_optimization.cc
@@ -35,6 +35,7 @@ static unsigned int Predecessors(BasicBlock* bb) {
void MIRGraph::SetConstant(int32_t ssa_reg, int32_t value) {
is_constant_v_->SetBit(ssa_reg);
constant_values_[ssa_reg] = value;
+ reg_location_[ssa_reg].is_const = true;
}
void MIRGraph::SetConstantWide(int32_t ssa_reg, int64_t value) {
@@ -42,6 +43,8 @@ void MIRGraph::SetConstantWide(int32_t ssa_reg, int64_t value) {
is_constant_v_->SetBit(ssa_reg + 1);
constant_values_[ssa_reg] = Low32Bits(value);
constant_values_[ssa_reg + 1] = High32Bits(value);
+ reg_location_[ssa_reg].is_const = true;
+ reg_location_[ssa_reg + 1].is_const = true;
}
void MIRGraph::DoConstantPropagation(BasicBlock* bb) {