Revert "ART: Update DCE to work with try/catch"
This reverts commit ce52901e2c8377fc1c331ae0faf7fbcb46b9da97.
Change-Id: I6b3a1f2a3dc036030b089b0df2005ecefa66b949
diff --git a/compiler/optimizing/dead_code_elimination.cc b/compiler/optimizing/dead_code_elimination.cc
index 02e5dab..9754043 100644
--- a/compiler/optimizing/dead_code_elimination.cc
+++ b/compiler/optimizing/dead_code_elimination.cc
@@ -123,21 +123,20 @@
}
// If we removed at least one block, we need to recompute the full
- // dominator tree and try block membership.
+ // dominator tree.
if (removed_one_or_more_blocks) {
graph_->ClearDominanceInformation();
graph_->ComputeDominanceInformation();
- graph_->ComputeTryBlockInformation();
}
// Connect successive blocks created by dead branches. Order does not matter.
for (HReversePostOrderIterator it(*graph_); !it.Done();) {
HBasicBlock* block = it.Current();
- if (block->IsEntryBlock() || !block->GetLastInstruction()->IsGoto()) {
+ if (block->IsEntryBlock() || block->GetSuccessors().size() != 1u) {
it.Advance();
continue;
}
- HBasicBlock* successor = block->GetSingleSuccessor();
+ HBasicBlock* successor = block->GetSuccessors()[0];
if (successor->IsExitBlock() || successor->GetPredecessors().size() != 1u) {
it.Advance();
continue;
@@ -177,7 +176,10 @@
}
void HDeadCodeElimination::Run() {
- RemoveDeadBlocks();
+ if (!graph_->HasTryCatch()) {
+ // TODO: Update dead block elimination and enable for try/catch.
+ RemoveDeadBlocks();
+ }
SsaRedundantPhiElimination(graph_).Run();
RemoveDeadInstructions();
}