]> granicus.if.org Git - llvm/commitdiff
NFC: Add debug tracing for more cases where loop unrolling fails.
authorAnna Thomas <anna@azul.com>
Fri, 27 Jan 2017 17:57:05 +0000 (17:57 +0000)
committerAnna Thomas <anna@azul.com>
Fri, 27 Jan 2017 17:57:05 +0000 (17:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293313 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/LoopUnroll.cpp

index 5c3c94008d3271a566f1958e442bd17216a30880..4fc7f410412560d33c1ce9e30d8048d74b82eaaa 100644 (file)
@@ -306,8 +306,10 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount, bool Force,
     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 Count, unsigned TripCount, bool Force,
                                   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,