[llvm] [Delinearization] Precommit test. NFC. (PR #175173)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 11 04:18:04 PST 2026


================
@@ -0,0 +1,52 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
+; RUN: opt < %s -passes='print<delinearization>' -disable-output 2>&1 | FileCheck %s
+
+; Pseudo-code:
+;
+;   arr[10][20];
+;
+;   for i=0 to 10
+;     for j=0 to 20
+;       a[i][j];  // arr + i*20 + j
+;
+
+ at test_array_10x20 = global [10 x [20 x i32]] zeroinitializer
+
+; Function that accesses a 2D array with dimensions [10][20].
+define void @test_2d_array(i64 %i, i64 %j) {
+; CHECK-LABEL: 'test_2d_array'
+; CHECK-NEXT:  Inst: %val = load i32, ptr %ptr, align 4
+; CHECK-NEXT:  AccessFunction: {{\{\{}}0,+,80}<nuw><nsw><%for.i>,+,4}<%for.j>
+; CHECK-NEXT:  failed to delinearize
+;
+entry:
+  %arr = getelementptr inbounds [10 x [20 x i32]], ptr @test_array_10x20, i32 0, i32 0
----------------
nikic wrote:

Drop non-canonical zero-index GEP.

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


More information about the llvm-commits mailing list