[llvm] [polly] [DA] Add batch delinearization support for improved precision (PR #170519)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 4 10:08:38 PST 2025


================
@@ -0,0 +1,147 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
+; RUN: | FileCheck %s
+
+; Test case for batch delinearization. When multiple accesses to the same
+; base pointer are analyzed together, terms from all accesses are collected
+; to determine array dimensions, leading to better precision.
+;
+; This test has three accesses to array A:
+;   A[i*m + j]  (in the write)
+;   A[i*m + j]  (in the read)
+;   A[k*m + l]  (third access that provides additional context)
+;
+; The third access helps provide more terms for delinearization,
+; which can improve precision when analyzing the first two accesses.
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+; Three accesses to the same 2D array A[n][m].
+; Batch delinearization collects terms from all accesses.
----------------
kasuga-fj wrote:

Maybe delinearization fails as we cannot prove `(%i * %m + %j) * sizeof(double)` doesn't overflow. I believe  that theoretically we can prove it, but I don't have any good idea.

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


More information about the llvm-commits mailing list