[llvm] [DA] Add tests where dependencies are missed due to overflow (NFC) (PR #164246)
Ryotaro Kasuga via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 29 03:53:15 PDT 2025
================
@@ -0,0 +1,68 @@
+; 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=strong-siv 2>&1 \
+; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-STRONG-SIV
+
+; offset0 = -2;
+; offset1 = -4;
+; for (i = 0; i < (1LL << 62); i++, offset0 += 2, offset1 += 2) {
+; if (0 <= offset0)
+; A[offset0] = 1;
+; if (0 <= offset1)
+; A[offset1] = 2;
+; }
+;
+; FIXME: DependenceAnalysis currently detects no dependency between the two
+; stores, but it does exist.
----------------
kasuga-fj wrote:
I thought the dependency in this case is trivial, but using `offset0` and `offset1` makes it unclear. I've rewritten the pseudo code and add brief comments to clarify the dependency.
https://github.com/llvm/llvm-project/pull/164246
More information about the llvm-commits
mailing list