[Mlir-commits] [mlir] [mlir][vector] Add support for scalable vectors to VectorLinearize (PR #86786)
Cullen Rhodes
llvmlistbot at llvm.org
Thu Mar 28 01:40:54 PDT 2024
================
@@ -97,3 +97,47 @@ func.func @test_tensor_no_linearize(%arg0: tensor<2x2xf32>, %arg1: tensor<2x2xf3
return %0, %arg0 : tensor<2x2xf32>, tensor<2x2xf32>
}
+
+// -----
+
+// ALL-LABEL: func.func @test_1_scalable_dim(
+// ALL-SAME: %[[ARG_0:.*]]: vector<2x[4]xf32>) -> vector<2x[4]xf32> {
+func.func @test_1_scalable_dim(%arg0: vector<2x[4]xf32>) -> vector<2x[4]xf32> {
+ // DEFAULT: %[[SC:.*]] = vector.shape_cast %[[ARG_0]] : vector<2x[4]xf32> to vector<[8]xf32>
+ // DEFAULT: %[[CST:.*]] = arith.constant dense<3.000000e+00> : vector<[8]xf32>
+ // BW-128: %[[CST:.*]] = arith.constant dense<3.000000e+00> : vector<2x[4]xf32>
----------------
c-rhodes wrote:
> and -test-vector-linearize=target-vector-bitwidth=128 does not.
`-test-vector-linearize=target-vector-bitwidth=0` is also testing that.
At the moment there's a positive test to check linearization happens by default and 2 negatives tests it doesn't happen when target bitwidth is set. It would be good to have a positive test linearization happens when target bitwidth is set.
https://github.com/llvm/llvm-project/pull/86786
More information about the Mlir-commits
mailing list