[llvm] r267951 - [LoopDist] Improve debug messages

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 16:08:31 PDT 2016


Author: anemet
Date: Thu Apr 28 18:08:30 2016
New Revision: 267951

URL: http://llvm.org/viewvc/llvm-project?rev=267951&view=rev
Log:
[LoopDist] Improve debug messages

The next patch will start using these for -Rpass-analysis so they won't
be internal-only anymore.

Move the 'Skipping; ' prefix that some of the message are using into the
'fail' function.  We don't want to include this prefix in
the -Rpass-analysis report.

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp?rev=267951&r1=267950&r2=267951&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp Thu Apr 28 18:08:30 2016
@@ -602,19 +602,19 @@ public:
 
     BasicBlock *PH = L->getLoopPreheader();
     if (!PH)
-      return fail("Skipping; no preheader");
+      return fail("no preheader");
     if (!L->getExitBlock())
-      return fail("Skipping; multiple exit blocks");
+      return fail("multiple exit blocks");
     // LAA will check that we only have a single exiting block.
 
     // Currently, we only distribute to isolate the part of the loop with
     // dependence cycles to enable partial vectorization.
     if (LAI.canVectorizeMemory())
-      return fail("Skipping; memory operations are safe for vectorization");
+      return fail("memory operations are safe for vectorization");
 
     auto *Dependences = LAI.getDepChecker().getDependences();
     if (!Dependences || Dependences->empty())
-      return fail("Skipping; No unsafe dependences to isolate");
+      return fail("no unsafe dependences to isolate");
 
     InstPartitionContainer Partitions(L, LI, DT);
 
@@ -694,7 +694,7 @@ public:
     if (Pred.getComplexity() > (IsForced.getValueOr(false)
                                     ? PragmaDistributeSCEVCheckThreshold
                                     : DistributeSCEVCheckThreshold))
-      return fail("Too many SCEV run-time checks needed.\n");
+      return fail("too many SCEV run-time checks needed.\n");
 
     DEBUG(dbgs() << "\nDistributing loop: " << *L << "\n");
     // We're done forming the partitions set up the reverse mapping from
@@ -745,7 +745,7 @@ public:
 
   /// \brief Provide diagnostics then \return with false.
   bool fail(llvm::StringRef Message) {
-    DEBUG(dbgs() << Message << "\n");
+    DEBUG(dbgs() << "Skipping; " << Message << "\n");
     return false;
   }
 




More information about the llvm-commits mailing list