From d1643e41ef242ae656f667bf3c8b0324635cefd3 Mon Sep 17 00:00:00 2001 From: buzbee Date: Wed, 5 Sep 2012 14:06:51 -0700 Subject: 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 --- src/compiler/codegen/MethodCodegenDriver.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/compiler/codegen/MethodCodegenDriver.cc') diff --git a/src/compiler/codegen/MethodCodegenDriver.cc b/src/compiler/codegen/MethodCodegenDriver.cc index b4e14ce52a..e76834d7c6 100644 --- a/src/compiler/codegen/MethodCodegenDriver.cc +++ b/src/compiler/codegen/MethodCodegenDriver.cc @@ -881,14 +881,7 @@ bool methodBlockCodeGen(CompilationUnit* cUnit, BasicBlock* bb) 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 @@ bool methodBlockCodeGen(CompilationUnit* cUnit, BasicBlock* bb) /* 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; -- cgit v1.2.3-59-g8ed1b