[llvm] [polly] [delinearize] Extract array dimensions from alloca and global declarations (PR #156342)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 12:10:16 PDT 2025


================
@@ -5,12 +5,13 @@
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.6.0"
 
+ at A.global = global [100 x [100 x i32]] zeroinitializer
 
 ;;  for (long int i = 0; i < 50; i++) {
 ;;    A[i][i] = i;
 ;;    *B++ = A[i + 10][i + 9];
 
-define void @couple0(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
+define void @couple0(ptr %B, i32 %n) nounwind uwtable ssp {
----------------
kasuga-fj wrote:

So you're saying the following, right?

- Some test cases were added to test specific features (e.g., strongSIV, exactSIV), and they depend on the results of delinearization. If delinearization fails, these tests no longer make sense.
- To keep these tests meaningful, we need to ensure that delinearization continues to work.

Assuming that's correct, I'd suggest the following approach:

- Could you separate these test changes into another PR? I believe we can make this patch a dedicated one that focuses solely on the new feature (i.e., using type information from global type declarations as hints).
- I think such large changes to regression tests are not needed, because
    - Some of them will be removed at all in https://github.com/llvm/llvm-project/pull/160924.
    - I've not checked the details yet, but https://github.com/llvm/llvm-project/pull/161822 seems to cover a fair number of existing tests.

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


More information about the llvm-commits mailing list