[llvm] improve debug messages in delinearization and dependence analysis (PR #156339)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 1 17:44:12 PDT 2025


================
@@ -11,10 +11,9 @@
 define void @foo(i64 %n, i64 %m, i64 %o, ptr nocapture %A) #0 {
 ; CHECK-LABEL: 'foo'
 ; CHECK-NEXT:  Inst: store i32 1, ptr %arrayidx11.us.us, align 4
-; CHECK-NEXT:  In Loop with Header: for.k
-; CHECK-NEXT:  AccessFunction: {{\{\{\{}}(28 + (4 * (-4 + (3 * %m)) * %o)),+,(8 * %m * %o)}<%for.i>,+,(12 * %o)}<%for.j>,+,20}<%for.k>
+; CHECK-NEXT:  LinearAccessFunction: {{\{\{\{}}(28 + (4 * (-4 + (3 * %m)) * %o)),+,(8 * %m * %o)}<%for.i>,+,(12 * %o)}<%for.j>,+,20}<%for.k>
----------------
kasuga-fj wrote:

In Delinearization, I think the term "linear" is used in both senses:

- Linear function: a polynomial function whose variable(s) have a degree of at most one 
    - Delinearization supports only linear functions
- Linearized memory access expression: an array access with single dimensional offset, as you mentioned

So when I saw the term like "LinearFunction", I assumed it referred to the former meaning of "linear". However, at the stage when this debug message is dumped, non-linear functions have not yet been excluded. Therefore it can print non-linear functions (e.g., see [godbolt](https://godbolt.org/z/dMqcWsdx9)).

> We don't deal with (filter out / reject) exponential functions like "i*i".

(I don't think it is an exponential function...)

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


More information about the llvm-commits mailing list