From 87409144af4e2d9b98807a6ac16d7ec0d2e98cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Warzy=C5=84ski?= Date: Fri, 9 Aug 2024 13:49:49 +0100 Subject: [PATCH] [mlir][vector] Add tests for scalable vectors in one-shot-bufferize.mlir (#102361) --- mlir/test/Dialect/Vector/one-shot-bufferize.mlir | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mlir/test/Dialect/Vector/one-shot-bufferize.mlir b/mlir/test/Dialect/Vector/one-shot-bufferize.mlir index 64238c3c08a6f1e..c2d699b9b013a10 100644 --- a/mlir/test/Dialect/Vector/one-shot-bufferize.mlir +++ b/mlir/test/Dialect/Vector/one-shot-bufferize.mlir @@ -12,6 +12,17 @@ func.func @mask(%t0: tensor, %val: vector<16xf32>, %idx: index, %m0: vect return %0 : tensor } +// CHECK-LABEL: func @mask_scalable( +// CHECK-SAME: %[[t0:.*]]: memref> +func.func @mask_scalable(%t0: tensor, %val: vector<[16]xf32>, %idx: index, %m0: vector<[16]xi1>) -> tensor { + // CHECK-NOT: alloc + // CHECK-NOT: copy + // CHECK: vector.mask %{{.*}} { vector.transfer_write %{{.*}}, %[[t0]][%{{.*}}] : vector<[16]xf32>, memref> } : vector<[16]xi1> + %0 = vector.mask %m0 { vector.transfer_write %val, %t0[%idx] : vector<[16]xf32>, tensor } : vector<[16]xi1> -> tensor + // CHECK: return %[[t0]] + return %0 : tensor +} + // ----- // CHECK-ANALYSIS-LABEL: func @non_reading_xfer_write(