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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 09:17:12 PDT 2025


================
@@ -2067,14 +2064,17 @@ MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx,
     return Dependence::NoDep;
 
   // Attempt to prove strided accesses independent.
-  const APInt *ConstDist = nullptr;
-  if (match(Dist, m_scev_APInt(ConstDist))) {
-    uint64_t Distance = ConstDist->abs().getZExtValue();
----------------
fhahn wrote:

I think the uses in `isDependent` rely on `ConstDist` being at most 64 bits, which should be checked earlier. If so, it should be safe to keep the current code using `getZExtValue`, which also has the benefit of asserting if the calling code changes, e.g. after being extended to support wider widths?

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


More information about the llvm-commits mailing list