diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-05-02 08:46:00 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-05-07 10:32:11 +0100 |
commit | 804d09372cc3d80d537da1489da4a45e0e19aa5d (patch) | |
tree | b226350fdf3dc0c55a11e1615010c8475f167f90 /compiler/optimizing/ssa_builder.cc | |
parent | 0095e0b8380a8802f40a21928800b9df6e11f1d7 (diff) | |
download | art-804d09372cc3d80d537da1489da4a45e0e19aa5d.zip art-804d09372cc3d80d537da1489da4a45e0e19aa5d.tar.gz art-804d09372cc3d80d537da1489da4a45e0e19aa5d.tar.bz2 |
Build live-in, live-out and kill sets for each block.
This information will be used when computing live ranges of
instructions.
Change-Id: I345ee833c1ccb4a8e725c7976453f6d58d350d74
Diffstat (limited to 'compiler/optimizing/ssa_builder.cc')
-rw-r--r-- | compiler/optimizing/ssa_builder.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/optimizing/ssa_builder.cc b/compiler/optimizing/ssa_builder.cc index bfb4f38..ee1e1e4 100644 --- a/compiler/optimizing/ssa_builder.cc +++ b/compiler/optimizing/ssa_builder.cc @@ -20,11 +20,11 @@ namespace art { void SsaBuilder::BuildSsa() { - // 1) Visit in dominator order. We need to have all predecessors of a block visited + // 1) Visit in reverse post order. We need to have all predecessors of a block visited // (with the exception of loops) in order to create the right environment for that // block. For loops, we create phis whose inputs will be set in 2). - for (size_t i = 0; i < GetGraph()->GetDominatorOrder()->Size(); i++) { - VisitBasicBlock(GetGraph()->GetDominatorOrder()->Get(i)); + for (HReversePostOrderIterator it(*GetGraph()); !it.Done(); it.Advance()) { + VisitBasicBlock(it.Current()); } // 2) Set inputs of loop phis. @@ -59,7 +59,7 @@ void SsaBuilder::VisitBasicBlock(HBasicBlock* block) { if (block->IsLoopHeader()) { // If the block is a loop header, we know we only have visited the pre header - // because we are visiting in dominator order. We create phis for all initialized + // because we are visiting in reverse post order. We create phis for all initialized // locals from the pre header. Their inputs will be populated at the end of // the analysis. for (size_t local = 0; local < current_locals_->Size(); local++) { @@ -76,7 +76,7 @@ void SsaBuilder::VisitBasicBlock(HBasicBlock* block) { // blocks need to be updated. loop_headers_.Add(block); } else if (block->GetPredecessors()->Size() > 0) { - // All predecessors have already been visited because we are visiting in dominator order. + // All predecessors have already been visited because we are visiting in reverse post order. // We merge the values of all locals, creating phis if those values differ. for (size_t local = 0; local < current_locals_->Size(); local++) { bool is_different = false; |