[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:49 PDT 2025


================
@@ -0,0 +1,124 @@
+; 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-zero-siv 2>&1 \
+; RUN:     | FileCheck %s --check-prefixes=CHECK,CHECK-WEAK-ZERO-SIV
+
+; offset = -2;
+; for (i = 0; i < (1LL << 62); i++, offset += 2) {
+;   if (0 <= offset)
+;     A[offset] = 1;
+;   A[2] = 2;
+; }
+;
+; FIXME: DependenceAnalysis currently detects no dependency between the two
+; stores, but it does exist. The root cause is that the product of the BTC and
+; the coefficient triggers an overflow.
----------------
Meinersbur wrote:

```suggestion
; stores, but it does exist. The root cause is that the product of the BTC and
; the coefficient overflows.
```
in the signed integer space? Is the BTC `1LL << 62 - 1` and coefficient the access stride, i.e. `2`?

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


More information about the llvm-commits mailing list