[llvm-commits] [polly] r143691 - /polly/trunk/lib/Analysis/ScopInfo.cpp

Tobias Grosser grosser at fim.uni-passau.de
Fri Nov 4 03:08:03 PDT 2011


Author: grosser
Date: Fri Nov  4 05:08:03 2011
New Revision: 143691

URL: http://llvm.org/viewvc/llvm-project?rev=143691&view=rev
Log:
ScopInfo: Add two new asserts.

They show a bug recently reported by Marcello Maggioni <hayarms at gmail.com>

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

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=143691&r1=143690&r2=143691&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Fri Nov  4 05:08:03 2011
@@ -201,11 +201,14 @@
   int getLoopDepth(const Loop *L) {
     Loop *outerLoop =
       scop->getRegion().outermostLoopInRegion(const_cast<Loop*>(L));
+    assert(outerLoop && "Scop does not contain this loop");
     return L->getLoopDepth() - outerLoop->getLoopDepth();
   }
 
   __isl_give isl_pw_aff *visitAddRecExpr(const SCEVAddRecExpr* Expr) {
     assert(Expr->isAffine() && "Only affine AddRecurrences allowed");
+    assert(scop->getRegion().contains(Expr->getLoop())
+           && "Scop does not contain the loop referenced in this AddRec");
 
     isl_pw_aff *Start = visit(Expr->getStart());
     isl_pw_aff *Step = visit(Expr->getOperand(1));





More information about the llvm-commits mailing list