[Mlir-commits] [mlir] [mlir][Transform dial] Expose convert-linalg-to-affine-loops transf (PR #211308)

Guillaume Iooss llvmlistbot at llvm.org
Fri Jul 31 07:25:59 PDT 2026


================
@@ -0,0 +1,94 @@
+// RUN: mlir-opt  %s --transform-interpreter -verify-diagnostics \
+// RUN:     --split-input-file | FileCheck %s
+
+//     CHECK: #[[MAP:.+]] = affine_map<(d0) -> (d0)>
+//     CHECK: func.func @convert_affine_matmul_buffer(%arg0: memref<16x8xf32>, %arg1: memref<8x32xf32>, %arg2: memref<16x32xf32>)
+// CHECK-DAG:   affine.for %[[arg3:.*]] = 0 to 16
+// CHECK-DAG:   affine.for %[[arg4:.*]] = 0 to 32
+// CHECK-DAG:   affine.for %[[arg5:.*]] = 0 to 8
+// CHECK-DAG:   %[[v0:.*]] = affine.apply #[[MAP]](%[[arg3]])
+// CHECK-DAG:   %[[v1:.*]] = affine.apply #[[MAP]](%[[arg5]])
+// CHECK-DAG:   %[[v2:.*]] = affine.load %arg0[%[[v0]], %[[v1]]] : memref<16x8xf32>
+// CHECK-DAG:   %[[v3:.*]] = affine.apply #[[MAP]](%[[arg5]])
+// CHECK-DAG:   %[[v4:.*]] = affine.apply #[[MAP]](%[[arg4]])
+// CHECK-DAG:   %[[v5:.*]] = affine.load %arg1[%[[v3]], %[[v4]]] : memref<8x32xf32>
+// CHECK-DAG:   %[[v6:.*]] = affine.apply #[[MAP]](%[[arg3]])
+// CHECK-DAG:   %[[v7:.*]] = affine.apply #[[MAP]](%[[arg4]])
+// CHECK-DAG:   %[[v8:.*]] = affine.load %arg2[%[[v6]], %[[v7]]] : memref<16x32xf32>
+// CHECK-DAG:   %[[v9:.*]] = affine.apply #[[MAP]](%[[arg3]])
+// CHECK-DAG:   %[[v10:.*]] = affine.apply #[[MAP]](%[[arg4]])
+// CHECK-DAG:   %[[v11:.*]] = arith.mulf %[[v2]], %[[v5]] : f32
+// CHECK-DAG:   %[[v12:.*]] = arith.addf %[[v8]], %[[v11]] : f32
----------------
guillaumeiooss wrote:

Corrected. All "CHECK-DAG" were changed into classical "CHECK" (that are enough).

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


More information about the Mlir-commits mailing list