diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-05-12 16:11:02 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-05-13 09:06:14 +0100 |
commit | 622d9c31febd950255b36a48b47e1f630197c5fe (patch) | |
tree | 8a7f14ce3c6c087955ad5fe91a3ce7d5b5a82461 /compiler/optimizing/pretty_printer.h | |
parent | 98a8a542f95e41c09d214a329a940b270f08f5b3 (diff) | |
download | art-622d9c31febd950255b36a48b47e1f630197c5fe.zip art-622d9c31febd950255b36a48b47e1f630197c5fe.tar.gz art-622d9c31febd950255b36a48b47e1f630197c5fe.tar.bz2 |
Add loop recognition and CFG simplifications in new compiler.
We do three simplifications:
- Split critical edges, for code generation from SSA (new).
- Ensure one back edge per loop, to simplify loop recognition (new).
- Ensure only one pre header for a loop, to simplify SSA creation (existing).
Change-Id: I9bfccd4b236a00486a261078627b091c8a68be33
Diffstat (limited to 'compiler/optimizing/pretty_printer.h')
-rw-r--r-- | compiler/optimizing/pretty_printer.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/compiler/optimizing/pretty_printer.h b/compiler/optimizing/pretty_printer.h index c82d0cc..dfeafe7 100644 --- a/compiler/optimizing/pretty_printer.h +++ b/compiler/optimizing/pretty_printer.h @@ -70,23 +70,23 @@ class HPrettyPrinter : public HGraphVisitor { virtual void VisitBasicBlock(HBasicBlock* block) { PrintString("BasicBlock "); PrintInt(block->GetBlockId()); - const GrowableArray<HBasicBlock*>* blocks = block->GetPredecessors(); - if (!blocks->IsEmpty()) { + const GrowableArray<HBasicBlock*>& predecessors = block->GetPredecessors(); + if (!predecessors.IsEmpty()) { PrintString(", pred: "); - for (size_t i = 0; i < blocks->Size() -1; i++) { - PrintInt(blocks->Get(i)->GetBlockId()); + for (size_t i = 0; i < predecessors.Size() -1; i++) { + PrintInt(predecessors.Get(i)->GetBlockId()); PrintString(", "); } - PrintInt(blocks->Peek()->GetBlockId()); + PrintInt(predecessors.Peek()->GetBlockId()); } - blocks = block->GetSuccessors(); - if (!blocks->IsEmpty()) { + const GrowableArray<HBasicBlock*>& successors = block->GetSuccessors(); + if (!successors.IsEmpty()) { PrintString(", succ: "); - for (size_t i = 0; i < blocks->Size() - 1; i++) { - PrintInt(blocks->Get(i)->GetBlockId()); + for (size_t i = 0; i < successors.Size() - 1; i++) { + PrintInt(successors.Get(i)->GetBlockId()); PrintString(", "); } - PrintInt(blocks->Peek()->GetBlockId()); + PrintInt(successors.Peek()->GetBlockId()); } PrintNewLine(); HGraphVisitor::VisitBasicBlock(block); |