summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/dead_code_elimination.cc
diff options
context:
space:
mode:
authorAart Bik <ajcbik@google.com>2018-04-26 10:28:51 -0700
committerAart Bik <ajcbik@google.com>2018-04-26 10:28:51 -0700
commit2477320a8d9de58ede68e2645ea53c10f71dcd57 (patch)
treef428a6856e10d8ebaff0bb2da544a8d41c35ab77 /compiler/optimizing/dead_code_elimination.cc
parent5a87e19e4bf1b6719c2aad3effde1b38d2c3085c (diff)
downloadart-2477320a8d9de58ede68e2645ea53c10f71dcd57.tar.gz
art-2477320a8d9de58ede68e2645ea53c10f71dcd57.tar.bz2
art-2477320a8d9de58ede68e2645ea53c10f71dcd57.zip
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
Diffstat (limited to 'compiler/optimizing/dead_code_elimination.cc')
-rw-r--r--compiler/optimizing/dead_code_elimination.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/optimizing/dead_code_elimination.cc b/compiler/optimizing/dead_code_elimination.cc
index 9fa0f72e80..1dc10948cc 100644
--- a/compiler/optimizing/dead_code_elimination.cc
+++ b/compiler/optimizing/dead_code_elimination.cc
@@ -508,7 +508,7 @@ void HDeadCodeElimination::RemoveDeadInstructions() {
}
}
-void HDeadCodeElimination::Run() {
+bool HDeadCodeElimination::Run() {
// Do not eliminate dead blocks if the graph has irreducible loops. We could
// support it, but that would require changes in our loop representation to handle
// multiple entry points. We decided it was not worth the complexity.
@@ -526,6 +526,7 @@ void HDeadCodeElimination::Run() {
}
SsaRedundantPhiElimination(graph_).Run();
RemoveDeadInstructions();
+ return true;
}
} // namespace art