Skip to content

Commit 4e40088

Browse files
committed
!fixup address latest comments, thanks!
1 parent 1a61c4f commit 4e40088

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -868,10 +868,11 @@ static bool isNoWrap(PredicatedScalarEvolution &PSE,
868868
return true;
869869

870870
const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(PtrScev);
871-
if (Assume && !AR)
871+
if (!AR) {
872+
if (!Assume)
873+
return false;
872874
AR = PSE.getAsAddRec(Ptr);
873-
if (!AR)
874-
return false;
875+
}
875876

876877
// The address calculation must not wrap. Otherwise, a dependence could be
877878
// inverted.
@@ -887,15 +888,15 @@ static bool isNoWrap(PredicatedScalarEvolution &PSE,
887888
GEP && GEP->hasNoUnsignedSignedWrap())
888889
return true;
889890

890-
// If the null pointer is undefined, then a access sequence which would
891-
// otherwise access it can be assumed not to unsigned wrap. Note that this
892-
// assumes the object in memory is aligned to the natural alignment.
893891
if (!Stride)
894892
Stride = getStrideFromAddRec(AR, L, AccessTy, Ptr, PSE);
895893
if (Stride) {
894+
// If the null pointer is undefined, then a access sequence which would
895+
// otherwise access it can be assumed not to unsigned wrap. Note that this
896+
// assumes the object in memory is aligned to the natural alignment.
896897
unsigned AddrSpace = Ptr->getType()->getPointerAddressSpace();
897898
if (!NullPointerIsDefined(L->getHeader()->getParent(), AddrSpace) &&
898-
(*Stride == 1 || *Stride == -1))
899+
(Stride == 1 || Stride == -1))
899900
return true;
900901
}
901902

0 commit comments

Comments
 (0)