diff options
| author | 2015-11-02 20:24:24 +0000 | |
|---|---|---|
| committer | 2015-11-02 20:24:24 +0000 | |
| commit | fb552d7061746f7a90fdd5002696e255e2e15c35 (patch) | |
| tree | 6ac0a1698ef53c7bb7258d471816b4edf6fb9212 /compiler/optimizing/dead_code_elimination.cc | |
| parent | ce52901e2c8377fc1c331ae0faf7fbcb46b9da97 (diff) | |
Revert "ART: Update DCE to work with try/catch"
This reverts commit ce52901e2c8377fc1c331ae0faf7fbcb46b9da97.
Change-Id: I6b3a1f2a3dc036030b089b0df2005ecefa66b949
Diffstat (limited to 'compiler/optimizing/dead_code_elimination.cc')
| -rw-r--r-- | compiler/optimizing/dead_code_elimination.cc | 12 | 
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/optimizing/dead_code_elimination.cc b/compiler/optimizing/dead_code_elimination.cc index 02e5dab3d4..9754043f32 100644 --- a/compiler/optimizing/dead_code_elimination.cc +++ b/compiler/optimizing/dead_code_elimination.cc @@ -123,21 +123,20 @@ void HDeadCodeElimination::RemoveDeadBlocks() {    }    // 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::RemoveDeadInstructions() {  }  void HDeadCodeElimination::Run() { -  RemoveDeadBlocks(); +  if (!graph_->HasTryCatch()) { +    // TODO: Update dead block elimination and enable for try/catch. +    RemoveDeadBlocks(); +  }    SsaRedundantPhiElimination(graph_).Run();    RemoveDeadInstructions();  }  |