[llvm] [DA] Check for overflow in strong SIV test (PR #166223)

Alireza Torabian via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 07:34:48 PST 2025


================
@@ -1686,7 +1695,11 @@ bool DependenceInfo::strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst,
   assert(0 < Level && Level <= CommonLevels && "level out of range");
   Level--;
 
-  const SCEV *Delta = SE->getMinusSCEV(SrcConst, DstConst);
+  const SCEV *Delta = minusSCEVNoSignedOverflow(SrcConst, DstConst, *SE);
+  if (!Delta) {
+    Result.Consistent = false;
----------------
1997alireza wrote:

Yes, otherwise we will add the `Consistent` attribute to a few test cases that do not currently have this attribute. As you are also aware, the attribute `Consistent` seems to not be well defined. If it is true, we may need to try to remove it in other patches.

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


More information about the llvm-commits mailing list