Skip to content

Commit b876910

Browse files
committed
[LAA] Address follow-up suggestions for llvm#128061.
Adjust naming and add argument comments as suggested.
1 parent e8976e9 commit b876910

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ RuntimeCheckingPtrGroup::RuntimeCheckingPtrGroup(
190190

191191
/// Returns \p A + \p B, if it is guaranteed not to unsigned wrap. Otherwise
192192
/// return nullptr. \p A and \p B must have the same type.
193-
static const SCEV *addSCEVOverflow(const SCEV *A, const SCEV *B,
194-
ScalarEvolution &SE) {
195-
if (!SE.willNotOverflow(Instruction::Add, false, A, B))
193+
static const SCEV *addSCEVNoOverflow(const SCEV *A, const SCEV *B,
194+
ScalarEvolution &SE) {
195+
if (!SE.willNotOverflow(Instruction::Add, /*IsSigned=*/false, A, B))
196196
return nullptr;
197197
return SE.getAddExpr(A, B);
198198
}
@@ -201,7 +201,7 @@ static const SCEV *addSCEVOverflow(const SCEV *A, const SCEV *B,
201201
/// return nullptr. \p A and \p B must have the same type.
202202
static const SCEV *mulSCEVOverflow(const SCEV *A, const SCEV *B,
203203
ScalarEvolution &SE) {
204-
if (!SE.willNotOverflow(Instruction::Mul, false, A, B))
204+
if (!SE.willNotOverflow(Instruction::Mul, /*IsSigned=*/false, A, B))
205205
return nullptr;
206206
return SE.getMulExpr(A, B);
207207
}
@@ -240,11 +240,11 @@ static bool evaluatePtrAddRecAtMaxBTCWillNotWrap(const SCEVAddRecExpr *AR,
240240
SE.getMinusSCEV(AR->getStart(), StartPtr), WiderTy);
241241

242242
const SCEV *OffsetAtLastIter =
243-
mulSCEVOverflow(MaxBTC, SE.getAbsExpr(Step, false), SE);
243+
mulSCEVOverflow(MaxBTC, SE.getAbsExpr(Step, /*IsNSW=*/false), SE);
244244
if (!OffsetAtLastIter)
245245
return false;
246246

247-
const SCEV *OffsetEndBytes = addSCEVOverflow(
247+
const SCEV *OffsetEndBytes = addSCEVNoOverflow(
248248
OffsetAtLastIter, SE.getNoopOrZeroExtend(EltSize, WiderTy), SE);
249249
if (!OffsetEndBytes)
250250
return false;
@@ -253,7 +253,7 @@ static bool evaluatePtrAddRecAtMaxBTCWillNotWrap(const SCEVAddRecExpr *AR,
253253
// For positive steps, check if
254254
// (AR->getStart() - StartPtr) + (MaxBTC * Step) + EltSize <= DerefBytes,
255255
// while making sure none of the computations unsigned wrap themselves.
256-
const SCEV *EndBytes = addSCEVOverflow(StartOffset, OffsetEndBytes, SE);
256+
const SCEV *EndBytes = addSCEVNoOverflow(StartOffset, OffsetEndBytes, SE);
257257
if (!EndBytes)
258258
return false;
259259
return SE.isKnownPredicate(CmpInst::ICMP_ULE, EndBytes,

0 commit comments

Comments
 (0)