[llvm-commits] [polly] r141461 - /polly/trunk/lib/Analysis/ScopDetection.cpp

Tobias Grosser grosser at fim.uni-passau.de
Fri Oct 7 17:49:30 PDT 2011


Author: grosser
Date: Fri Oct  7 19:49:30 2011
New Revision: 141461

URL: http://llvm.org/viewvc/llvm-project?rev=141461&view=rev
Log:
ScopDetection: Improve error messages and add another INVALID case.

Modified:
    polly/trunk/lib/Analysis/ScopDetection.cpp

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=141461&r1=141460&r2=141461&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Fri Oct  7 19:49:30 2011
@@ -278,7 +278,7 @@
   // FIXME: Alias Analysis thinks IntToPtrInst aliases with alloca instructions
   // created by IndependentBlocks Pass.
   if (isa<IntToPtrInst>(BasePtr))
-    INVALID(Other, "Find bad intoptr prt: " << *BasePtr);
+    INVALID(Other, "Find bad intToptr prt: " << *BasePtr);
 
   // Check if the base pointer of the memory access does alias with
   // any other pointer. This cannot be handled at the moment.
@@ -334,12 +334,8 @@
                                        DetectionContext &Context) const {
   // Only canonical IVs are allowed.
   if (PHINode *PN = dyn_cast<PHINode>(&Inst))
-    if (!isIndVar(PN, LI)) {
-      DEBUG(dbgs() << "Non canonical PHI node found: ";
-            WriteAsOperand(dbgs(), &Inst, false);
-            dbgs() << "\n");
-      return false;
-    }
+    if (!isIndVar(PN, LI))
+      INVALID(IndVar, "Non canonical PHI node: " << Inst);
 
   // Scalar dependencies are not allowed.
   if (hasScalarDependency(Inst, Context.CurRegion))
@@ -350,16 +346,16 @@
     if (isValidCallInst(*CI))
       return true;
 
-    INVALID(FuncCall, "Call instruction not allowed: " << Inst);
+    INVALID(FuncCall, "Call instruction: " << Inst);
   }
 
   if (!Inst.mayWriteToMemory() && !Inst.mayReadFromMemory()) {
     // Handle cast instruction.
     if (isa<IntToPtrInst>(Inst) || isa<BitCastInst>(Inst))
-      INVALID(Other, "Cast instruction not allowed: " << Inst);
+      INVALID(Other, "Cast instruction: " << Inst);
 
     if (isa<AllocaInst>(Inst))
-      INVALID(Other, "Alloca instruction not allowed: " << Inst);
+      INVALID(Other, "Alloca instruction: " << Inst);
 
     return true;
   }
@@ -393,13 +389,13 @@
   PHINode *IndVar = L->getCanonicalInductionVariable();
   // No canonical induction variable.
   if (!IndVar)
-    INVALID(IndVar, "No single induction variable for loop: "
+    INVALID(IndVar, "No canonical IV at loop header: "
                     << L->getHeader()->getNameStr());
 
   // Is the loop count affine?
   const SCEV *LoopCount = SE->getBackedgeTakenCount(L);
   if (!isValidAffineFunction(LoopCount, Context.CurRegion))
-    INVALID(LoopBound, "Non affine loop bound for loop: "
+    INVALID(LoopBound, "Non affine loop bound '" << LoopCount << "'for loop: "
                        << L->getHeader()->getNameStr());
 
   return true;





More information about the llvm-commits mailing list