Basic block combine pass
Combine basic blocks terminated by instruction that we have since
proven not to throw. This change is intended to relieve some of the
computational load for llvm by reducing the number of basic blocks
it has to contend with.
Also:
Add stats to show how successful check elimination is.
Restore mechanism to disable some expensive optimization passes when
compiling large methods.
Change-Id: I7fae22160988cbefb90ea9fb1cc26d7364e8d229
diff --git a/src/compiler/codegen/MethodCodegenDriver.cc b/src/compiler/codegen/MethodCodegenDriver.cc
index b4e14ce..e76834d 100644
--- a/src/compiler/codegen/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/MethodCodegenDriver.cc
@@ -881,14 +881,7 @@
oatResetRegPool(cUnit);
oatResetDefTracking(cUnit);
- /*
- * If control reached us from our immediate predecessor via
- * fallthrough and we have no other incoming arcs we can
- * reuse existing liveness. Otherwise, reset.
- */
- if (!bb->fallThroughTarget || bb->predecessors->numUsed != 1) {
- oatClobberAllRegs(cUnit);
- }
+ oatClobberAllRegs(cUnit);
LIR* headLIR = NULL;
@@ -922,9 +915,7 @@
/* Mark the beginning of a Dalvik instruction for line tracking */
char* instStr = cUnit->printMe ?
oatGetDalvikDisassembly(cUnit, mir->dalvikInsn, "") : NULL;
- boundaryLIR = newLIR1(cUnit, kPseudoDalvikByteCodeBoundary,
- (intptr_t) instStr);
- cUnit->boundaryMap.Overwrite(mir->offset, boundaryLIR);
+ boundaryLIR = markBoundary(cUnit, mir->offset, instStr);
/* Remember the first LIR for this block */
if (headLIR == NULL) {
headLIR = boundaryLIR;