[Mlir-commits] [mlir] [MLIR] Make 1-D memref flattening a prerequisite for vector narrow type emulation (PR #157771)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Sep 11 12:38:23 PDT 2025


================
@@ -0,0 +1,38 @@
+// RUN: mlir-opt --test-memref-flatten-and-vector-narrow-type-emulation --split-input-file %s | FileCheck %s
+
+// -----
+
+func.func @vector_load_2d_i4(%arg0: index, %arg1: index) -> vector<8xi4> {
+    %0 = memref.alloc() : memref<4x8xi4>
+    %1 = vector.load %0[%arg0, %arg1] : memref<4x8xi4>, vector<8xi4>
+    return %1 : vector<8xi4>
+}
+//      CHECK: func @vector_load_2d_i4
+//      CHECK:   vector.load
+// CHECK-SAME:   memref<16xi8>
----------------
banach-space wrote:

[nit] I would keep this on one line, but this might be a matter of personal preference ("less is more", i.e. "fewer lines to parse is better" :) ).

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


More information about the Mlir-commits mailing list