diff options
author | Adam Nemet <anemet@apple.com> | 2015-04-17 22:43:10 +0000 |
---|---|---|
committer | Adam Nemet <anemet@apple.com> | 2015-04-17 22:43:10 +0000 |
commit | 8dcb3b6a5978b18a6038600e85524cd88157bb25 (patch) | |
tree | 04100aab62289ae7944a8b7119fdf1d16eb21f8a /llvm/lib/Analysis/LoopAccessAnalysis.cpp | |
parent | 4b08354b0ebb5551048138148f61911bc1232491 (diff) | |
download | bcm5719-llvm-8dcb3b6a5978b18a6038600e85524cd88157bb25.tar.gz bcm5719-llvm-8dcb3b6a5978b18a6038600e85524cd88157bb25.zip |
[LoopAccesses] Improve debug output
llvm-svn: 235238
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index 724c21f18c9..cd94583c9e2 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -890,14 +890,20 @@ void MemoryDepChecker::Dependence::print( } bool LoopAccessInfo::canAnalyzeLoop() { + // We need to have a loop header. + DEBUG(dbgs() << "LAA: Found a loop: " << + TheLoop->getHeader()->getName() << '\n'); + // We can only analyze innermost loops. if (!TheLoop->empty()) { + DEBUG(dbgs() << "LAA: loop is not the innermost loop\n"); emitAnalysis(LoopAccessReport() << "loop is not the innermost loop"); return false; } // We must have a single backedge. if (TheLoop->getNumBackEdges() != 1) { + DEBUG(dbgs() << "LAA: loop control flow is not understood by analyzer\n"); emitAnalysis( LoopAccessReport() << "loop control flow is not understood by analyzer"); @@ -906,6 +912,7 @@ bool LoopAccessInfo::canAnalyzeLoop() { // We must have a single exiting block. if (!TheLoop->getExitingBlock()) { + DEBUG(dbgs() << "LAA: loop control flow is not understood by analyzer\n"); emitAnalysis( LoopAccessReport() << "loop control flow is not understood by analyzer"); @@ -916,16 +923,13 @@ bool LoopAccessInfo::canAnalyzeLoop() { // checked at the end of each iteration. With that we can assume that all // instructions in the loop are executed the same number of times. if (TheLoop->getExitingBlock() != TheLoop->getLoopLatch()) { + DEBUG(dbgs() << "LAA: loop control flow is not understood by analyzer\n"); emitAnalysis( LoopAccessReport() << "loop control flow is not understood by analyzer"); return false; } - // We need to have a loop header. - DEBUG(dbgs() << "LAA: Found a loop: " << - TheLoop->getHeader()->getName() << '\n'); - // ScalarEvolution needs to be able to find the exit count. const SCEV *ExitCount = SE->getBackedgeTakenCount(TheLoop); if (ExitCount == SE->getCouldNotCompute()) { |