aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopAccessAnalysis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 0d2ee6f..6f00d50 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -1407,9 +1407,9 @@ static bool isNoWrapAddRec(Value *Ptr, const SCEVAddRecExpr *AR,
// Look through the potentially overflowing instruction to try to prove
// non-wrapping for the *specific* value of Ptr.
- // The arithmetic implied by an inbounds GEP can't overflow.
+ // The arithmetic implied by an nusw GEP can't overflow.
const auto *GEP = dyn_cast<GetElementPtrInst>(Ptr);
- if (!GEP || !GEP->isInBounds())
+ if (!GEP || !GEP->hasNoUnsignedSignedWrap())
return false;
// Make sure there is only one non-const index and analyze that.
@@ -1511,12 +1511,12 @@ llvm::getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, Value *Ptr,
if (isNoWrapAddRec(Ptr, AR, PSE, Lp))
return Stride;
- // An inbounds getelementptr that is a AddRec with a unit stride
+ // An nusw getelementptr that is a AddRec with a unit stride
// cannot wrap per definition. If it did, the result would be poison
// and any memory access dependent on it would be immediate UB
// when executed.
if (auto *GEP = dyn_cast<GetElementPtrInst>(Ptr);
- GEP && GEP->isInBounds() && (Stride == 1 || Stride == -1))
+ GEP && GEP->hasNoUnsignedSignedWrap() && (Stride == 1 || Stride == -1))
return Stride;
// If the null pointer is undefined, then a access sequence which would