[Mlir-commits] [mlir] [MLIR] Add a utility pass to linearize `memref` (PR #136797)
Alan Li
llvmlistbot at llvm.org
Thu May 1 11:36:13 PDT 2025
================
@@ -0,0 +1,225 @@
+// RUN: mlir-opt --flatten-memref %s --split-input-file --verify-diagnostics | FileCheck %s
+
+func.func @load_scalar_from_memref(%input: memref<4x8xf32, strided<[8, 1], offset: 100>>) -> f32 {
+ %c1 = arith.constant 1 : index
+ %c2 = arith.constant 2 : index
+ %value = memref.load %input[%c1, %c2] : memref<4x8xf32, strided<[8, 1], offset: 100>>
+ return %value : f32
+}
+// CHECK: func @load_scalar_from_memref
----------------
lialan wrote:
yeah `CHECK-LABEL` does not work with affine maps. But I tried to update a few that do not emit maps.
https://github.com/llvm/llvm-project/pull/136797
More information about the Mlir-commits
mailing list