[Mlir-commits] [mlir] [mlir][vector] Add more tests for ConvertVectorToLLVM (4/n) (PR #103391)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Fri Aug 16 04:34:08 PDT 2024
================
@@ -1258,18 +1258,30 @@ func.func @insert_element_0d(%a: f32, %b: vector<f32>) -> vector<f32> {
// -----
-func.func @insert_element(%arg0: f32, %arg1: vector<4xf32>) -> vector<4xf32> {
+func.func @insertelement(%arg0: f32, %arg1: vector<4xf32>) -> vector<4xf32> {
%0 = arith.constant 3 : i32
%1 = vector.insertelement %arg0, %arg1[%0 : i32] : vector<4xf32>
return %1 : vector<4xf32>
}
-// CHECK-LABEL: @insert_element(
+// CHECK-LABEL: @insertelement(
// CHECK-SAME: %[[A:.*]]: f32,
// CHECK-SAME: %[[B:.*]]: vector<4xf32>)
// CHECK: %[[c:.*]] = arith.constant 3 : i32
// CHECK: %[[x:.*]] = llvm.insertelement %[[A]], %[[B]][%[[c]] : i32] : vector<4xf32>
// CHECK: return %[[x]] : vector<4xf32>
+func.func @insertelement_scalable(%arg0: f32, %arg1: vector<[4]xf32>) -> vector<[4]xf32> {
+ %0 = arith.constant 3 : i32
+ %1 = vector.insertelement %arg0, %arg1[%0 : i32] : vector<[4]xf32>
+ return %1 : vector<[4]xf32>
+}
+// CHECK-LABEL: @insertelement_scalable(
+// CHECK-SAME: %[[A:.*]]: f32,
+// CHECK-SAME: %[[B:.*]]: vector<[4]xf32>)
+// CHECK: %[[c:.*]] = arith.constant 3 : i32
+// CHECK: %[[x:.*]] = llvm.insertelement %[[A]], %[[B]][%[[c]] : i32] : vector<[4]xf32>
+// CHECK: return %[[x]] : vector<[4]xf32>
+
// -----
func.func @insert_element_index(%arg0: f32, %arg1: vector<4xf32>) -> vector<4xf32> {
----------------
banach-space wrote:
Good catch, thanks!
https://github.com/llvm/llvm-project/pull/103391
More information about the Mlir-commits
mailing list