[Mlir-commits] [mlir] [mlir][mem2reg] Promote buffers accessed via dynamic subviews, reshapes and memref.copy (PR #217793)
Renato Golin
llvmlistbot at llvm.org
Tue Sep 29 02:12:37 PDT 2026
================
@@ -0,0 +1,474 @@
+// RUN: mlir-opt %s -mem2reg -split-input-file | FileCheck %s
+
+// Reading a static buffer through a DYNAMIC subview: the read returns the value
+// that was written, and takes the transfer's padding wherever it reads past the
+// subview's extent.
+
+// CHECK-LABEL: func.func @read_dyn_subview(
+// CHECK-SAME: %[[V:.*]]: vector<8x16xf32>, %[[N:.*]]: index, %[[PAD:.*]]: f32
+// CHECK-NOT: memref.alloca
+// CHECK-NOT: memref.subview
+// CHECK-NOT: vector.transfer_read
+// CHECK-NOT: vector.transfer_write
+// CHECK: %[[MASK:.*]] = vector.create_mask %{{.*}}, %[[N]] : vector<8x16xi1>
+// CHECK: %[[PS:.*]] = vector.broadcast %[[PAD]] : f32 to vector<8x16xf32>
----------------
rengolin wrote:
Will this always materialize the pad value no matter how large is the vector?
https://github.com/llvm/llvm-project/pull/217793
More information about the Mlir-commits
mailing list