[Mlir-commits] [mlir] [mlir][Vector] Fix an assertion on failing cast in vector-transfer-flatten-patterns (PR #86030)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Mar 25 10:25:00 PDT 2024


================
@@ -93,13 +93,16 @@ func.func @test_index_no_linearize(%arg0: vector<2x2xindex>, %arg1: vector<2x2xi
 
 // -----
 
-// This test exists to make sure it doesn't hit an assert and compiles through.
-func.func @simple_mul(%arg0: tensor<4xf32>, %arg1: tensor<4xf32>) -> (tensor<4xf32>, tensor<4xf32>) {
+// CHECK-LABEL: func.func @nonvec_result
+// CHECK128-LABEL: func.func @nonvec_result
+// CHECK0-LABEL: func.func @nonvec_result
+// CHECK-SAME: (%[[ARG0:.*]]: tensor<4xf32>, %[[ARG1:.*]]: tensor<4xf32>)
+// CHECK128-SAME: (%[[ARG0:.*]]: tensor<4xf32>, %[[ARG1:.*]]: tensor<4xf32>)
+// CHECK0-SAME: (%[[ARG0:.*]]: tensor<4xf32>, %[[ARG1:.*]]: tensor<4xf32>)
+func.func @nonvec_result(%arg0: tensor<4xf32>, %arg1: tensor<4xf32>) -> (tensor<4xf32>, tensor<4xf32>) {
+    // CHECK: %[[MULF:.*]] = arith.mulf %[[ARG0]], %[[ARG1]]
+    // CHECK128: %[[MULF:.*]] = arith.mulf %[[ARG0]], %[[ARG1]]
+    // CHECK0: %[[MULF:.*]] = arith.mulf %[[ARG0]], %[[ARG1]]
----------------
banach-space wrote:

This is much better, thanks! Now, this example doesn't linearise, because:

1. inputs are already linear (this is tested elsewhere),
2. inputs are tensors (this is unique).

In order to avoid mixing 1. and 2. in one test, could you make the tensors 2D? 

This is my final comment, I'll approve once this comment is addressed. Thanks!

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


More information about the Mlir-commits mailing list