[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
Wed Oct 29 07:16:26 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)
----------------
Meinersbur wrote:

I've seen it in the other cases to avoid the subscripts becoming negative. In this case, `A[-3*0 + INT64_MAX] == A[INT64_MAX]` still seems to be valid, at least no less than other values of `i`. E.g. with `&A == nullptr` (valid in Linux kernel code), the resulting address is still within the half-address space bound.

However, I see the point, we can/should leave it to be on the safe side.

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


More information about the llvm-commits mailing list