[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 08:38:24 PST 2025


================
@@ -512,3 +528,45 @@ for.body:                                         ; preds = %entry, %for.body
 for.end:                                          ; preds = %for.body
   ret void
 }
+
+
+;;  for (long unsigned i = 0; i < 9223372036854775806; i++)
+;;    for (long unsigned j = 0; j < 2147483640; j++)
+;;      if (i < 3000000000)
+;;        A[i] = 0;
+;
+; FIXME: DependenceAnalysis fails to detect the dependency between A[i] and
+; itself, while Strong SIV has been able to prove it.
----------------
1997alireza wrote:

In general you are correct. If a test returns false it just mean that it couldn't prove anything. But in this case it is different. Sometime when StrongSIV is providing a distance or direction, it actually means that StrongSIV has been able to prove a dependency by providing their difference or direction. More specifically, whenever we have `StrongSIVsuccesses++` in the StrongSIV test, it means that the test could successfully prove (returning false) or disprove a dependency (returning true).

This is something I had mentioned before on another discussion. When StrongSIV is successful to prove a dependency, DA does not need to check other tests anymore.

Anyway, meanwhile I think StrongSIV is actually capable to prove a dependency, I am fine to change the comment to something like this:

`FIXME: DependenceAnalysis fails to detect the dependency between A[i] and itself, and Strong SIV is not the reason of this failure.`

Let me know what you think or suggest. Thanks.

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


More information about the llvm-commits mailing list