aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/arm/CodegenDriver.cpp
diff options
context:
space:
mode:
authorBen Cheng <bccheng@android.com>2011-04-22 17:16:42 -0700
committerbuzbee <buzbee@google.com>2011-04-23 10:34:13 -0700
commit243db252574a78ff7326e7446d9042e321314c4f (patch)
tree6a31b4b9a5dcee556b2a6b8767cf78a0ce642463 /vm/compiler/codegen/arm/CodegenDriver.cpp
parent0ed5b9bf184b97b0d3fa2ef5a9f3dacd3e186e46 (diff)
Local optimization fixes for diverences found by self verification.
1) Only optimize each block once. Strictly speaking this is not a correctness issue however it triggers the subsequent problem. 2) Ignore dead instructions. 1: ldr r2, [r5, #8] 2: ldr r3, [r5, #8](nop) 3: str r3, [r5, #4] 4: movs r3, r2 When using instruction 1 to initiate redundant ld/st eliminations, if instruction 2 (which is already dead) is not ignored, it will be turned into a "mov r3, r2" and that will clobber r3 used by the str. Change-Id: I6b9a88d3688889d917b90f4b8f55278df1701c6a
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.cpp')
-rw-r--r--vm/compiler/codegen/arm/CodegenDriver.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm/compiler/codegen/arm/CodegenDriver.cpp b/vm/compiler/codegen/arm/CodegenDriver.cpp
index a722289eb..d170c8b4c 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.cpp
+++ b/vm/compiler/codegen/arm/CodegenDriver.cpp
@@ -4572,6 +4572,8 @@ void dvmCompilerMIR2LIR(CompilationUnit *cUnit)
*/
dvmCompilerApplyLocalOptimizations(cUnit, (LIR *) headLIR,
cUnit->lastLIRInsn);
+ /* Reset headLIR which is also the optimization boundary */
+ headLIR = NULL;
}
gen_fallthrough: