[Mlir-commits] [mlir] [mlir][vector] Update tests for xfer permutation lowering (3/N) (PR #127320)
Andrzej Warzyński
llvmlistbot at llvm.org
Mon Feb 17 11:30:20 PST 2025
================
@@ -319,24 +315,26 @@ func.func @xfer_read_minor_identity_tranposed_with_mask_scalable(
// Masked version is not supported
// CHECK-LABEL: func @xfer_read_minor_identity_transposed_masked(
-// CHECK-SAME: %[[DEST:.*]]: tensor<?x1xf32>,
-// CHECK-SAME: %[[MASK:.*]]: vector<4x1xi1>
+// CHECK-SAME: %[[DEST:.*]]: tensor<?x?xf32>,
+// CHECK-SAME: %[[MASK:.*]]: vector<2x4xi1>
+// CHECK-SAME: %[[IDX:.*]]: index
// CHECK-NOT: vector.transpose
-// CHECK: vector.mask %[[MASK]] { vector.transfer_read %[[DEST]]{{.*}}: tensor<?x1xf32>, vector<1x4x4xf32> } : vector<4x1xi1> -> vector<1x4x4xf32>
+// CHECK: vector.mask %[[MASK]] { vector.transfer_read %[[DEST]]{{.*}}: tensor<?x?xf32>, vector<8x4x2xf32> } : vector<2x4xi1> -> vector<8x4x2xf32>
func.func @xfer_read_minor_identity_transposed_masked(
- %dest: tensor<?x1xf32>,
- %mask : vector<4x1xi1>,
- %idx: index) {
+ %dest: tensor<?x?xf32>,
+ %mask: vector<2x4xi1>,
+ %idx: index) -> (vector<8x4x2xf32>) {
%pad = arith.constant 0.000000e+00 : f32
- %3 = vector.mask %mask {
- vector.transfer_read %dest[%idx, %idx], %pad {
- permutation_map = affine_map<(d0, d1) -> (d1, 0, d0)>
- } : tensor<?x1xf32>, vector<1x4x4xf32>
- } : vector<4x1xi1> -> vector<1x4x4xf32>
- "test.some_use"(%3) : (vector<1x4x4xf32>) -> ()
- return
+ %res = vector.mask %mask {
+ vector.transfer_read %dest[%idx, %idx], %pad, %mask {
----------------
banach-space wrote:
> it seems %mask has been added to the transfer_read here on top of using it in the vector.mask.
Copy and paste error. I wanted to make this test a variation of `@xfer_read_minor_identity_transposed_with_mask`, but forgot to delete that `%mask` 😅
`in_bounds` was also added for consistency. Note that it doesn't change the output - the pattern won't apply as the "masked" version is not supported.
https://github.com/llvm/llvm-project/pull/127320
More information about the Mlir-commits
mailing list