[Mlir-commits] [mlir] [mlir][vector] Use notifyMatchFailure instead of assert in VectorLinearize (PR #93590)

Andrzej WarzyƄski llvmlistbot at llvm.org
Sun Jun 9 11:02:40 PDT 2024


================
@@ -129,8 +129,8 @@ func.func @test_scalable_linearize(%arg0: vector<2x[2]xf32>) -> vector<2x[2]xf32
 // -----
 
 // ALL-LABEL:   func.func @test_scalable_no_linearize(
-// ALL-SAME:     %[[VAL_0:.*]]: vector<[2]x[2]xf32>) -> vector<[2]x[2]xf32> {
-func.func @test_scalable_no_linearize(%arg0: vector<[2]x[2]xf32>) -> vector<[2]x[2]xf32> {
+// ALL-SAME:     %[[VAL_0:.*]]: vector<[2]x[2]xf32>,  %[[VAL_1:.*]]: vector<2x[2]xf32>) -> vector<[2]x[2]xf32> {
+func.func @test_scalable_no_linearize(%arg0: vector<[2]x[2]xf32>, %arg1: vector<2x[2]xf32>) -> vector<[2]x[2]xf32> {
----------------
banach-space wrote:

I introduced this "function" to complement `test_linearize`: https://github.com/llvm/llvm-project/blob/e090bac638e56ff9db87e622cdf925f2b99dfc30/mlir/test/Dialect/Vector/linearize.mlir#L7-L31. This way, for a set of tests for "fixed width" vectors it's quite easy to find to corresponding tests for "scalable vectors". I should've moved it next to `test_linearize` to make this clear - that's my bad, sorry for that!

With this in mind, would you be OK writing:
* `@test_extract_strided_slice_1_scalable`,
* `@test_extract_strided_slice_2_scalable,

and so on? The check lines could be as simple as:
```
// CHECK-LABEL:
// CHECK-NOT: vector.shuffle
// CHECK-NOT: vector.shape_cast
// CHECK: vector.extract_strided_slice
```

(as in, the main thing to check would be that e.g. `vector.shuffle` Ops are not inserted). 

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


More information about the Mlir-commits mailing list