Step 1 of 2: conditional passes.
Rationale:
The change adds a return value to Run() in preparation of
conditional pass execution. The value returned by Run() is
best effort, returning false means no optimizations were
applied or no useful information was obtained. I filled
in a few cases with more exact information, others
still just return true. In addition, it integrates inlining
as a regular pass, avoiding the ugly "break" into
optimizations1 and optimziations2.
Bug: b/78171933, b/74026074
Test: test-art-host,target
Change-Id: Ia39c5c83c01dcd79841e4b623917d61c754cf075
diff --git a/compiler/optimizing/ssa_phi_elimination.cc b/compiler/optimizing/ssa_phi_elimination.cc
index cb27ded..5370f43 100644
--- a/compiler/optimizing/ssa_phi_elimination.cc
+++ b/compiler/optimizing/ssa_phi_elimination.cc
@@ -23,9 +23,10 @@
namespace art {
-void SsaDeadPhiElimination::Run() {
+bool SsaDeadPhiElimination::Run() {
MarkDeadPhis();
EliminateDeadPhis();
+ return true;
}
void SsaDeadPhiElimination::MarkDeadPhis() {
@@ -122,7 +123,7 @@
}
}
-void SsaRedundantPhiElimination::Run() {
+bool SsaRedundantPhiElimination::Run() {
// Use local allocator for allocating memory used by this optimization.
ScopedArenaAllocator allocator(graph_->GetArenaStack());
@@ -255,6 +256,7 @@
current->GetBlock()->RemovePhi(current);
}
}
+ return true;
}
} // namespace art