summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/ssa_liveness_analysis.cc
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2015-03-16 17:31:52 +0000
committerDavid Brazdil <dbrazdil@google.com>2015-03-24 17:28:37 +0000
commit46e2a3915aa68c77426b71e95b9f3658250646b7 (patch)
tree2b0a4470b05291894db73c631fe94f0fdff8c46b /compiler/optimizing/ssa_liveness_analysis.cc
parentbce0855ca1dbb1fa226c5b6a81760272ce0b64ef (diff)
downloadart-46e2a3915aa68c77426b71e95b9f3658250646b7.tar.gz
art-46e2a3915aa68c77426b71e95b9f3658250646b7.tar.bz2
art-46e2a3915aa68c77426b71e95b9f3658250646b7.zip
ART: Boolean simplifier
The optimization recognizes the negation pattern generated by 'javac' and replaces it with a single condition. To this end, boolean values are now consistently assumed to be represented by an integer. This is a first optimization which deletes blocks from the HGraph and does so by replacing the corresponding entries with null. Hence, existing code can continue indexing the list of blocks with the block ID, but must check for null when iterating over the list. Change-Id: I7779da69cfa925c6521938ad0bcc11bc52335583
Diffstat (limited to 'compiler/optimizing/ssa_liveness_analysis.cc')
-rw-r--r--compiler/optimizing/ssa_liveness_analysis.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/optimizing/ssa_liveness_analysis.cc b/compiler/optimizing/ssa_liveness_analysis.cc
index c0d6f42ca5..56ccd717cf 100644
--- a/compiler/optimizing/ssa_liveness_analysis.cc
+++ b/compiler/optimizing/ssa_liveness_analysis.cc
@@ -71,8 +71,8 @@ void SsaLivenessAnalysis::LinearizeGraph() {
// for it.
GrowableArray<uint32_t> forward_predecessors(graph_.GetArena(), graph_.GetBlocks().Size());
forward_predecessors.SetSize(graph_.GetBlocks().Size());
- for (size_t i = 0, e = graph_.GetBlocks().Size(); i < e; ++i) {
- HBasicBlock* block = graph_.GetBlocks().Get(i);
+ for (HReversePostOrderIterator it(graph_); !it.Done(); it.Advance()) {
+ HBasicBlock* block = it.Current();
size_t number_of_forward_predecessors = block->GetPredecessors().Size();
if (block->IsLoopHeader()) {
// We rely on having simplified the CFG.