aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 8b6c9eb..fd0e81c5 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -232,6 +232,9 @@ void RuntimePointerChecking::insert(Loop *Lp, Value *Ptr, const SCEV *PtrExpr,
ScEnd = SE->getUMaxExpr(AR->getStart(), ScEnd);
}
}
+ assert(SE->isLoopInvariant(ScStart, Lp) && "ScStart needs to be invariant");
+ assert(SE->isLoopInvariant(ScEnd, Lp)&& "ScEnd needs to be invariant");
+
// Add the size of the pointed element to ScEnd.
auto &DL = Lp->getHeader()->getModule()->getDataLayout();
Type *IdxTy = DL.getIndexType(Ptr->getType());