diff options
author | 2015-07-15 15:22:01 +0000 | |
---|---|---|
committer | 2015-07-15 15:22:02 +0000 | |
commit | 5c03f3698f5e2e0d762e2e15ec00310b6cdab4fe (patch) | |
tree | 9b990552fbf7e0ba91954758b07e2a51d95da9cd /compiler/optimizing/ssa_phi_elimination.cc | |
parent | 045da88bd0230ddf48aaf037b3d6c16fbb97ba65 (diff) | |
parent | ffee3d33f3ea39aa6031c3d2ff29c4806c8dcc51 (diff) |
Merge "ART: Build SSA form when try/catch is present"
Diffstat (limited to 'compiler/optimizing/ssa_phi_elimination.cc')
-rw-r--r-- | compiler/optimizing/ssa_phi_elimination.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/optimizing/ssa_phi_elimination.cc b/compiler/optimizing/ssa_phi_elimination.cc index 2f2e2d1fab..917341a1e7 100644 --- a/compiler/optimizing/ssa_phi_elimination.cc +++ b/compiler/optimizing/ssa_phi_elimination.cc @@ -114,6 +114,12 @@ void SsaRedundantPhiElimination::Run() { continue; } + if (phi->InputCount() == 0) { + DCHECK(phi->IsCatchPhi()); + DCHECK(phi->IsDead()); + continue; + } + // Find if the inputs of the phi are the same instruction. HInstruction* candidate = phi->InputAt(0); // A loop phi cannot have itself as the first phi. Note that this @@ -137,6 +143,11 @@ void SsaRedundantPhiElimination::Run() { continue; } + // The candidate may not dominate a phi in a catch block. + if (phi->IsCatchPhi() && !candidate->StrictlyDominates(phi)) { + continue; + } + if (phi->IsInLoop()) { // Because we're updating the users of this phi, we may have new // phis candidate for elimination if this phi is in a loop. Add phis that |