summaryrefslogtreecommitdiff
path: root/compiler/optimizing/ssa_builder.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2015-09-28 14:37:25 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-09-28 14:37:25 +0000
commite60c633e2843282ff528ca73366aab6af059bfa8 (patch)
tree33943c964ae1b4aa2ed2e9d27ee5aeed5599acc2 /compiler/optimizing/ssa_builder.cc
parent6adb995d8e0177189bf77e9a0f6fce7ded87d993 (diff)
parent1d0a03c2eb0e26ded029b84e011458e8466f87de (diff)
Merge "ART: Fix DeadPhiHandling creating >2 equivalents"
Diffstat (limited to 'compiler/optimizing/ssa_builder.cc')
-rw-r--r--compiler/optimizing/ssa_builder.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/optimizing/ssa_builder.cc b/compiler/optimizing/ssa_builder.cc
index ad8c682b3a..fb11d76320 100644
--- a/compiler/optimizing/ssa_builder.cc
+++ b/compiler/optimizing/ssa_builder.cc
@@ -145,8 +145,14 @@ void DeadPhiHandling::VisitBasicBlock(HBasicBlock* block) {
if (phi->IsDead() && phi->HasEnvironmentUses()) {
phi->SetLive();
if (block->IsLoopHeader()) {
- // Give a type to the loop phi, to guarantee convergence of the algorithm.
- phi->SetType(phi->InputAt(0)->GetType());
+ // Give a type to the loop phi to guarantee convergence of the algorithm.
+ // Note that the dead phi may already have a type if it is an equivalent
+ // generated for a typed LoadLocal. In that case we do not change the
+ // type because it could lead to an unsupported PrimNot/Float/Double ->
+ // PrimInt/Long transition and create same type equivalents.
+ if (phi->GetType() == Primitive::kPrimVoid) {
+ phi->SetType(phi->InputAt(0)->GetType());
+ }
AddToWorklist(phi);
} else {
// Because we are doing a reverse post order visit, all inputs of