[llvm] [LAA] Clean up APInt-overflow related code (NFC) (PR #140048)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 23 04:39:53 PDT 2025


================
@@ -842,19 +842,12 @@ getStrideFromAddRec(const SCEVAddRecExpr *AR, const Loop *Lp, Type *AccessTy,
   TypeSize AllocSize = DL.getTypeAllocSize(AccessTy);
   int64_t Size = AllocSize.getFixedValue();
 
-  // Huge step value - give up.
-  if (APStepVal->getBitWidth() > 64)
----------------
fhahn wrote:

This condition being true doesn't seem to happen in practice (and not covered by existing tests), but could the new could change behavior, e.g. if we have an AddRec with type i128 and a constant step of 1, for which `trySExtValue` would succeed, but the original check fail?

https://github.com/llvm/llvm-project/pull/140048


More information about the llvm-commits mailing list