diff options
| author | Florian Hahn <flo@fhahn.com> | 2019-12-03 11:58:31 +0000 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2019-12-03 11:59:10 +0000 |
| commit | e9c68422dee9d2883b201580867c2edc4f55d49e (patch) | |
| tree | 96604d06f72fd12eb28a3218f8897aa0607aca6e /llvm/lib/Transforms/Vectorize/VPlan.cpp | |
| parent | aa189ed25fbd861b07eb5d5116dfd8e33e2b1991 (diff) | |
| download | bcm5719-llvm-e9c68422dee9d2883b201580867c2edc4f55d49e.tar.gz bcm5719-llvm-e9c68422dee9d2883b201580867c2edc4f55d49e.zip | |
[VPlan] Add dump function to VPlan class.
This adds a dump() function to VPlan, which uses the existing
operator<<.
This method provides a convenient way to dump a VPlan while debugging,
e.g. from lldb.
Reviewers: hsaito, Ayal, gilr, rengolin
Reviewed By: hsaito
Differential Revision: https://reviews.llvm.org/D70920
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VPlan.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlan.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp index 123477cd620..b15c5d0f7da 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp @@ -468,6 +468,11 @@ void VPlan::execute(VPTransformState *State) { updateDominatorTree(State->DT, VectorPreHeaderBB, VectorLatchBB); } +#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +LLVM_DUMP_METHOD +void VPlan::dump() const { dbgs() << *this << '\n'; } +#endif + void VPlan::updateDominatorTree(DominatorTree *DT, BasicBlock *LoopPreHeaderBB, BasicBlock *LoopLatchBB) { BasicBlock *LoopHeaderBB = LoopPreHeaderBB->getSingleSuccessor(); @@ -527,8 +532,7 @@ void VPlanPrinter::dump() { if (!Plan.Value2VPValue.empty() || Plan.BackedgeTakenCount) { OS << ", where:"; if (Plan.BackedgeTakenCount) - OS << "\\n" - << *Plan.getOrCreateBackedgeTakenCount() << " := BackedgeTakenCount"; + OS << "\\n" << *Plan.BackedgeTakenCount << " := BackedgeTakenCount"; for (auto Entry : Plan.Value2VPValue) { OS << "\\n" << *Entry.second; OS << DOT::EscapeString(" := "); @@ -540,7 +544,7 @@ void VPlanPrinter::dump() { OS << "edge [fontname=Courier, fontsize=30]\n"; OS << "compound=true\n"; - for (VPBlockBase *Block : depth_first(Plan.getEntry())) + for (const VPBlockBase *Block : depth_first(Plan.getEntry())) dumpBlock(Block); OS << "}\n"; |

