diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2016-01-05 15:55:41 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2016-01-14 15:00:20 +0000 |
commit | 15bd22849ee6a1ffb3fb3630f686c2870bdf1bbc (patch) | |
tree | a261601589163faa4538bcf1c9d156e8ec4a42b3 /compiler/optimizing/graph_visualizer.cc | |
parent | 5b7b5ddb515828c93f0c2aec67aa513c32d0de22 (diff) |
Implement irreducible loop support in optimizing.
So we don't fallback to the interpreter in the presence of
irreducible loops.
Implications:
- A loop pre-header does not necessarily dominate a loop header.
- Non-constant redundant phis will be kept in loop headers, to
satisfy our linear scan register allocation algorithm.
- while-graph optimizations, such as gvn, licm, lse, and dce
need to know when they are dealing with irreducible loops.
Change-Id: I2cea8934ce0b40162d215353497c7f77d6c9137e
Diffstat (limited to 'compiler/optimizing/graph_visualizer.cc')
-rw-r--r-- | compiler/optimizing/graph_visualizer.cc | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index 5f1328f545..32c3a925e0 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -486,7 +486,9 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { StartAttributeStream("is_low") << interval->IsLowInterval(); StartAttributeStream("is_high") << interval->IsHighInterval(); } - } else if (IsPass(RegisterAllocator::kRegisterAllocatorPassName) && is_after_pass_) { + } + + if (IsPass(RegisterAllocator::kRegisterAllocatorPassName) && is_after_pass_) { StartAttributeStream("liveness") << instruction->GetLifetimePosition(); LocationSummary* locations = instruction->GetLocations(); if (locations != nullptr) { @@ -498,15 +500,29 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor { attr << inputs << "->"; DumpLocation(attr, locations->Out()); } - } else if (IsPass(LICM::kLoopInvariantCodeMotionPassName) - || IsPass(HDeadCodeElimination::kFinalDeadCodeEliminationPassName)) { + } + + if (IsPass(LICM::kLoopInvariantCodeMotionPassName) + || IsPass(HDeadCodeElimination::kFinalDeadCodeEliminationPassName) + || IsPass(HDeadCodeElimination::kInitialDeadCodeEliminationPassName) + || IsPass(SsaBuilder::kSsaBuilderPassName)) { HLoopInformation* info = instruction->GetBlock()->GetLoopInformation(); if (info == nullptr) { StartAttributeStream("loop") << "none"; } else { StartAttributeStream("loop") << "B" << info->GetHeader()->GetBlockId(); + HLoopInformation* outer = info->GetPreHeader()->GetLoopInformation(); + if (outer != nullptr) { + StartAttributeStream("outer_loop") << "B" << outer->GetHeader()->GetBlockId(); + } else { + StartAttributeStream("outer_loop") << "none"; + } + StartAttributeStream("irreducible") + << std::boolalpha << info->IsIrreducible() << std::noboolalpha; } - } else if ((IsPass(SsaBuilder::kSsaBuilderPassName) + } + + if ((IsPass(SsaBuilder::kSsaBuilderPassName) || IsPass(HInliner::kInlinerPassName)) && (instruction->GetType() == Primitive::kPrimNot)) { ReferenceTypeInfo info = instruction->IsLoadClass() |