@@ -190,9 +190,9 @@ RuntimeCheckingPtrGroup::RuntimeCheckingPtrGroup(
190
190
191
191
// / Returns \p A + \p B, if it is guaranteed not to unsigned wrap. Otherwise
192
192
// / 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))
196
196
return nullptr ;
197
197
return SE.getAddExpr (A, B);
198
198
}
@@ -201,7 +201,7 @@ static const SCEV *addSCEVOverflow(const SCEV *A, const SCEV *B,
201
201
// / return nullptr. \p A and \p B must have the same type.
202
202
static const SCEV *mulSCEVOverflow (const SCEV *A, const SCEV *B,
203
203
ScalarEvolution &SE) {
204
- if (!SE.willNotOverflow (Instruction::Mul, false , A, B))
204
+ if (!SE.willNotOverflow (Instruction::Mul, /* IsSigned= */ false , A, B))
205
205
return nullptr ;
206
206
return SE.getMulExpr (A, B);
207
207
}
@@ -240,11 +240,11 @@ static bool evaluatePtrAddRecAtMaxBTCWillNotWrap(const SCEVAddRecExpr *AR,
240
240
SE.getMinusSCEV (AR->getStart (), StartPtr), WiderTy);
241
241
242
242
const SCEV *OffsetAtLastIter =
243
- mulSCEVOverflow (MaxBTC, SE.getAbsExpr (Step, false ), SE);
243
+ mulSCEVOverflow (MaxBTC, SE.getAbsExpr (Step, /* IsNSW= */ false ), SE);
244
244
if (!OffsetAtLastIter)
245
245
return false ;
246
246
247
- const SCEV *OffsetEndBytes = addSCEVOverflow (
247
+ const SCEV *OffsetEndBytes = addSCEVNoOverflow (
248
248
OffsetAtLastIter, SE.getNoopOrZeroExtend (EltSize, WiderTy), SE);
249
249
if (!OffsetEndBytes)
250
250
return false ;
@@ -253,7 +253,7 @@ static bool evaluatePtrAddRecAtMaxBTCWillNotWrap(const SCEVAddRecExpr *AR,
253
253
// For positive steps, check if
254
254
// (AR->getStart() - StartPtr) + (MaxBTC * Step) + EltSize <= DerefBytes,
255
255
// 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);
257
257
if (!EndBytes)
258
258
return false ;
259
259
return SE.isKnownPredicate (CmpInst::ICMP_ULE, EndBytes,
0 commit comments