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/CodegenUtil.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/compiler/codegen/CodegenUtil.cc') diff --git a/src/compiler/codegen/CodegenUtil.cc b/src/compiler/codegen/CodegenUtil.cc index 3aea76a4cc..bdc2c8b207 100644 --- a/src/compiler/codegen/CodegenUtil.cc +++ b/src/compiler/codegen/CodegenUtil.cc @@ -998,5 +998,20 @@ void dumpPackedSwitchTable(const u2* table) } } +/* + * Set up special LIR to mark a Dalvik byte-code instruction start and + * record it in the boundaryMap. NOTE: in cases such as kMirOpCheck in + * which we split a single Dalvik instruction, only the first MIR op + * associated with a Dalvik PC should be entered into the map. + */ +LIR* markBoundary(CompilationUnit* cUnit, int offset, const char* instStr) +{ + LIR* res = newLIR1(cUnit, kPseudoDalvikByteCodeBoundary, (intptr_t) instStr); + if (cUnit->boundaryMap.find(offset) == cUnit->boundaryMap.end()) { + cUnit->boundaryMap.Put(offset, res); + } + return res; +} -} // namespace art +} + // namespace art -- cgit v1.2.3-59-g8ed1b