summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2015-11-21 05:48:15 +0000
committer android-build-merger <android-build-merger@google.com> 2015-11-21 05:48:15 +0000
commit594b4469ed2a08072c4b5db86cc229df89d0a945 (patch)
treeb192c4698c4889ae90db6abe2652199802213fe6 /compiler/optimizing/graph_checker.cc
parent52e3b91163dc37d38901bae1915f44235abf8f9b (diff)
parent08a96a5a4f6c78c9639af884228d28c7fb0c30fc (diff)
Merge "Revert "Dynamic BCE (based on induction range analysis)"" am: d83b9042d6
am: 08a96a5a4f * commit '08a96a5a4f6c78c9639af884228d28c7fb0c30fc': Revert "Dynamic BCE (based on induction range analysis)"
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc41
1 files changed, 19 insertions, 22 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index b3b09d2155..5814d7556f 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -735,29 +735,26 @@ void SSAChecker::VisitPhi(HPhi* phi) {
}
}
- // Test phi equivalents. There should not be two of the same type and they should only be
- // created for constants which were untyped in DEX. Note that this test can be skipped for
- // a synthetic phi (indicated by lack of a virtual register).
- if (phi->GetRegNumber() != kNoRegNumber) {
- for (HInstructionIterator phi_it(phi->GetBlock()->GetPhis()); !phi_it.Done(); phi_it.Advance()) {
- HPhi* other_phi = phi_it.Current()->AsPhi();
- if (phi != other_phi && phi->GetRegNumber() == other_phi->GetRegNumber()) {
- if (phi->GetType() == other_phi->GetType()) {
- std::stringstream type_str;
- type_str << phi->GetType();
- AddError(StringPrintf("Equivalent phi (%d) found for VReg %d with type: %s.",
+ // Test phi equivalents. There should not be two of the same type and they
+ // should only be created for constants which were untyped in DEX.
+ for (HInstructionIterator phi_it(phi->GetBlock()->GetPhis()); !phi_it.Done(); phi_it.Advance()) {
+ HPhi* other_phi = phi_it.Current()->AsPhi();
+ if (phi != other_phi && phi->GetRegNumber() == other_phi->GetRegNumber()) {
+ if (phi->GetType() == other_phi->GetType()) {
+ std::stringstream type_str;
+ type_str << phi->GetType();
+ AddError(StringPrintf("Equivalent phi (%d) found for VReg %d with type: %s.",
+ phi->GetId(),
+ phi->GetRegNumber(),
+ type_str.str().c_str()));
+ } else {
+ ArenaBitVector visited(GetGraph()->GetArena(), 0, /* expandable */ true);
+ if (!IsConstantEquivalent(phi, other_phi, &visited)) {
+ AddError(StringPrintf("Two phis (%d and %d) found for VReg %d but they "
+ "are not equivalents of constants.",
phi->GetId(),
- phi->GetRegNumber(),
- type_str.str().c_str()));
- } else {
- ArenaBitVector visited(GetGraph()->GetArena(), 0, /* expandable */ true);
- if (!IsConstantEquivalent(phi, other_phi, &visited)) {
- AddError(StringPrintf("Two phis (%d and %d) found for VReg %d but they "
- "are not equivalents of constants.",
- phi->GetId(),
- other_phi->GetId(),
- phi->GetRegNumber()));
- }
+ other_phi->GetId(),
+ phi->GetRegNumber()));
}
}
}