From 05b3fa02ed8ef62841a92cd96526ba3a06bf1f63 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 4 May 2016 12:05:56 +0100 Subject: Do not look at dead phis during SsaRedundantPhiElimination. Otherwise, we may replace a dead loop phi with its incoming input. This broke an assumption during liveness analysis in the presence of irreducible loops. bug:28256552 Change-Id: Ia9e82026555e6b7f6a2cd37df4b765cd3684079d --- compiler/optimizing/ssa_phi_elimination.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing') diff --git a/compiler/optimizing/ssa_phi_elimination.cc b/compiler/optimizing/ssa_phi_elimination.cc index aeb31094d4..0978ae17f8 100644 --- a/compiler/optimizing/ssa_phi_elimination.cc +++ b/compiler/optimizing/ssa_phi_elimination.cc @@ -139,8 +139,9 @@ void SsaRedundantPhiElimination::Run() { continue; } - if (phi->InputCount() == 0) { - DCHECK(phi->IsDead()); + // If the phi is dead, we know we won't revive it and it will be removed, + // so don't process it. + if (phi->IsDead()) { continue; } -- cgit v1.2.3-59-g8ed1b