diff options
| author | 2015-11-02 19:30:51 +0000 | |
|---|---|---|
| committer | 2015-11-02 19:30:51 +0000 | |
| commit | 923c78b5601b2cb78fea8f3a67c7469f6b80523c (patch) | |
| tree | 19dca428a4e5e30d70c9e96d85acc99ae01ba8e4 /compiler/optimizing/dead_code_elimination.cc | |
| parent | 08e679a904980b81cb55699345a5555ec5ea3733 (diff) | |
| parent | 808e7524918da5f7f41d2ceaa58dbb381e5708ff (diff) | |
Merge "ART: Update DCE to work with try/catch"
am: 808e752491
* commit '808e7524918da5f7f41d2ceaa58dbb381e5708ff':
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(); } |