[llvm] r293313 - NFC: Add debug tracing for more cases where loop unrolling fails.
Anna Thomas via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 27 09:57:06 PST 2017
Author: annat
Date: Fri Jan 27 11:57:05 2017
New Revision: 293313
URL: http://llvm.org/viewvc/llvm-project?rev=293313&view=rev
Log:
NFC: Add debug tracing for more cases where loop unrolling fails.
Modified:
llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp?rev=293313&r1=293312&r2=293313&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp Fri Jan 27 11:57:05 2017
@@ -306,8 +306,10 @@ bool llvm::UnrollLoop(Loop *L, unsigned
Count = TripCount;
// Don't enter the unroll code if there is nothing to do.
- if (TripCount == 0 && Count < 2 && PeelCount == 0)
+ if (TripCount == 0 && Count < 2 && PeelCount == 0) {
+ DEBUG(dbgs() << "Won't unroll; almost nothing to do\n");
return false;
+ }
assert(Count > 0);
assert(TripMultiple > 0);
@@ -362,8 +364,12 @@ bool llvm::UnrollLoop(Loop *L, unsigned
PreserveLCSSA)) {
if (Force)
RuntimeTripCount = false;
- else
+ else {
+ DEBUG(
+ dbgs() << "Wont unroll; prolog and epilog code could not be inserted "
+ "when assuming runtime trip count\n");
return false;
+ }
}
// Notify ScalarEvolution that the loop will be substantially changed,
More information about the llvm-commits
mailing list