[llvm] [DA] Add tests where dependencies are missed due to overflow (NFC) (PR #164246)
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 28 08:15:50 PDT 2025
================
@@ -0,0 +1,125 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -disable-output "-passes=print<da>" 2>&1 \
+; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-ALL
+; RUN: opt < %s -disable-output "-passes=print<da>" -da-enable-dependence-test=weak-crossing-siv 2>&1 \
+; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-WEAK-CROSSING-SIV
+
+; max_i = INT64_MAX/3 // 3074457345618258602
+; for (long long i = 0; i <= max_i; i++) {
+; A[-3*i + INT64_MAX] = 0;
+; if (i)
+; A[3*i - 2] = 1;
+; }
+;
+; FIXME: DependencyAnalsysis currently detects no dependency between
+; `A[-3*i + INT64_MAX]` and `A[3*i - 2]`, but it does exist. For example,
+;
+; memory location | -3*i + INT64_MAX | 3*i - 2
+; ------------------|------------------|-----------
+; A[1] | i = max_i | i = 1
+; A[INT64_MAX - 3] | i = 1 | i = max_i
----------------
Meinersbur wrote:
```suggestion
; memory access | i == 1 | i == max_i
; ---------------------|------------------|-----------
; A[-3*i + INT64_MAX] | A[INT64_MAX - 3] | A[1]
; A[3*i - 2] | A[1] | A[INT64_MAX - 3]
```
It is not clear that the columns represent the memory access at line 9, respectively at line 11.
I find a table with entries per values of `i` for each memory access more intiuitive.
https://github.com/llvm/llvm-project/pull/164246
More information about the llvm-commits
mailing list