[Mlir-commits] [mlir] [mlir][vector] Account for vector.mask in transfer RAW/WAW checks (PR #228328)

Federico Bruzzone llvmlistbot at llvm.org
Sat Oct 3 00:52:36 PDT 2026


================
@@ -2039,6 +2058,27 @@ func.func @store_to_load_tensor_broadcast(%arg0 : tensor<4x4xf32>,
 
 // -----
 
+// Same as above, but the read is under vector.mask: its masked-off lanes get
+// the padding value, so it must not become a broadcast of the stored vector.
+// CHECK-LABEL: func @negative_store_to_load_tensor_broadcast_region_masked
+//       CHECK:   vector.transfer_write
+//       CHECK:   %[[R:.*]] = vector.mask %{{.*}} { vector.transfer_read
+//   CHECK-NOT:   vector.broadcast
+//       CHECK:   return %[[R]] : vector<4x2x6xf32>
+func.func @negative_store_to_load_tensor_broadcast_region_masked(%arg0 : tensor<4x4xf32>,
+  %v0 : vector<4x2xf32>, %mask : vector<4x2xi1>) -> vector<4x2x6xf32> {
----------------
FedericoBruzzone wrote:

Perfect, it makes perfect sense. For future reference:
https://github.com/llvm/llvm-project/blob/12d96a9969858138c5d032d314d0ca74ff71e86b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp#L5860-L5862
https://github.com/llvm/llvm-project/blob/12d96a9969858138c5d032d314d0ca74ff71e86b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp#L5872-L5875

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


More information about the Mlir-commits mailing list