Quick: Improve the BBCombine pass.
Eliminate exception edges for insns that cannot throw even
when inside a try-block. Run the BBCombine pass before the
SSA transformation to reduce the compilation time.
Bug: 16398693
Change-Id: I8e91df593e316c994679b9d482b0ae20700b9499
diff --git a/compiler/dex/bb_optimizations.h b/compiler/dex/bb_optimizations.h
index 3b1be51..fba0863 100644
--- a/compiler/dex/bb_optimizations.h
+++ b/compiler/dex/bb_optimizations.h
@@ -271,7 +271,8 @@
DCHECK(data != nullptr);
CompilationUnit* c_unit = down_cast<const PassMEDataHolder*>(data)->c_unit;
DCHECK(c_unit != nullptr);
- return ((c_unit->disable_opt & (1 << kSuppressExceptionEdges)) != 0);
+ return c_unit->mir_graph->HasTryCatchBlocks() ||
+ ((c_unit->disable_opt & (1 << kSuppressExceptionEdges)) != 0);
}
bool Worker(PassDataHolder* data) const;