[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:16 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)
----------------
kasuga-fj wrote:

The purpose of this condition (and similar ones in other cases) is to avoid UB caused by the combination of [the size limitation of allocated objects](https://llvm.org/docs/LangRef.html#allocated-objects) and `inbounds`. However, I'm not sure if the presence of these branches affects DA, or simply dropping `inbounds` would be sufficient.

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


More information about the llvm-commits mailing list