diff options
| author | 2015-11-10 13:01:28 +0000 | |
|---|---|---|
| committer | 2015-11-10 13:01:28 +0000 | |
| commit | 83dcccb96ff8424fb4ab46bcda7c422d59a8c135 (patch) | |
| tree | 8951c2aeef6489bdd53b26f78d3ff2400154b81a /compiler/optimizing/dead_code_elimination.cc | |
| parent | 1963759e84664b51b617b00e15728f439895033b (diff) | |
| parent | 8a7c0fe837bb00b02dfcfc678910d81d07fb2136 (diff) | |
Merge "Revert "Revert "ART: Update DCE to work with try/catch"""
Diffstat (limited to 'compiler/optimizing/dead_code_elimination.cc')
| -rw-r--r-- | compiler/optimizing/dead_code_elimination.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/optimizing/dead_code_elimination.cc b/compiler/optimizing/dead_code_elimination.cc index 9754043f32..02e5dab3d4 100644 --- a/compiler/optimizing/dead_code_elimination.cc +++ b/compiler/optimizing/dead_code_elimination.cc @@ -123,20 +123,21 @@ void HDeadCodeElimination::RemoveDeadBlocks() { } // If we removed at least one block, we need to recompute the full - // dominator tree. + // dominator tree and try block membership. 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->GetSuccessors().size() != 1u) { + if (block->IsEntryBlock() || !block->GetLastInstruction()->IsGoto()) { it.Advance(); continue; } - HBasicBlock* successor = block->GetSuccessors()[0]; + HBasicBlock* successor = block->GetSingleSuccessor(); if (successor->IsExitBlock() || successor->GetPredecessors().size() != 1u) { it.Advance(); continue; @@ -176,10 +177,7 @@ void HDeadCodeElimination::RemoveDeadInstructions() { } void HDeadCodeElimination::Run() { - if (!graph_->HasTryCatch()) { - // TODO: Update dead block elimination and enable for try/catch. - RemoveDeadBlocks(); - } + RemoveDeadBlocks(); SsaRedundantPhiElimination(graph_).Run(); RemoveDeadInstructions(); } |