[llvm] [DA] Add option to dump delinearization result in printing analysis (PR #157859)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 10 08:03:21 PDT 2025


================
@@ -1,10 +1,14 @@
 ; 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
+; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa \
+; RUN:     -da-dump-delinearization-result 2>&1 | FileCheck %s
 
 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
 target triple = "thumbv8m.main-arm-none-eabi"
 
+; FIXME: It seems that we cannot prove that %m * %o doesn't signed wrap in
+; almost all cases. If it wraps, the delinearization result should be
+; discarded, otherwise the result can be incorrect.
+
----------------
kasuga-fj wrote:

If I'm correct, `(%m, %o) = (2^16 - 1, 2^16)` would introduce loop-carried dependencies in almost all cases in this file.

Side note: The test cases appear to have been generated from C code written based on pseudo-code. If so, in principal `m * o` doesn't overflow, and we should know that from `nsw` flag on the `mul` instruction. However, such information seems to have been lost due to other transformations, like `A*C + B*C` -> `(A+B)*C`

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


More information about the llvm-commits mailing list