[Mlir-commits] [mlir] [mlir][vector] Add more tests for ConvertVectorToLLVM (5/n) (PR #104784)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Mon Aug 19 13:01:06 PDT 2024
================
@@ -1049,104 +1049,103 @@ func.func @shuffle_2D(%a: vector<1x4xf32>, %b: vector<2x4xf32>) -> vector<3x4xf3
// -----
-// CHECK-LABEL: @extractelement_0d
-func.func @extractelement_0d(%a: vector<f32>) -> f32 {
- // CHECK: %[[C0:.*]] = llvm.mlir.constant(0 : index) : i64
- // CHECK: llvm.extractelement %{{.*}}[%[[C0]] : {{.*}}] : vector<1xf32>
- %1 = vector.extractelement %a[] : vector<f32>
+func.func @extractelement_from_vec_0d(%arg0: vector<f32>) -> f32 {
+ %1 = vector.extractelement %arg0[] : vector<f32>
return %1 : f32
}
+// CHECK-LABEL: @extractelement_from_vec_0d
+// CHECK: %[[C0:.*]] = llvm.mlir.constant(0 : index) : i64
+// CHECK: llvm.extractelement %{{.*}}[%[[C0]] : {{.*}}] : vector<1xf32>
// -----
-func.func @extractelement(%arg0: vector<16xf32>) -> f32 {
+func.func @extractelement_from_vec_1d(%arg0: vector<16xf32>) -> f32 {
%0 = arith.constant 15 : i32
%1 = vector.extractelement %arg0[%0 : i32]: vector<16xf32>
return %1 : f32
}
-// CHECK-LABEL: @extractelement(
-// CHECK-SAME: %[[A:.*]]: vector<16xf32>)
+// CHECK-LABEL: @extractelement_from_vec_1d(
+// CHECK-SAME: %[[A:.*]]: vector<16xf32>)
// CHECK: %[[c:.*]] = arith.constant 15 : i32
// CHECK: %[[x:.*]] = llvm.extractelement %[[A]][%[[c]] : i32] : vector<16xf32>
// CHECK: return %[[x]] : f32
-func.func @extractelement_scalable(%arg0: vector<[16]xf32>) -> f32 {
+func.func @extractelement_from_vec_1d_scalable(%arg0: vector<[16]xf32>) -> f32 {
%0 = arith.constant 15 : i32
%1 = vector.extractelement %arg0[%0 : i32]: vector<[16]xf32>
return %1 : f32
}
-// CHECK-LABEL: @extractelement_scalable(
-// CHECK-SAME: %[[A:.*]]: vector<[16]xf32>)
+// CHECK-LABEL: @extractelement_from_vec_1d_scalable(
+// CHECK-SAME: %[[A:.*]]: vector<[16]xf32>)
// CHECK: %[[c:.*]] = arith.constant 15 : i32
// CHECK: %[[x:.*]] = llvm.extractelement %[[A]][%[[c]] : i32] : vector<[16]xf32>
// CHECK: return %[[x]] : f32
// -----
-
-func.func @extractelement_index(%arg0: vector<16xf32>) -> f32 {
+func.func @extractelement_index_position(%arg0: vector<16xf32>) -> f32 {
----------------
banach-space wrote:
```suggestion
func.func @extractelement_from_vec_1d_idx_as_index(%arg0: vector<16xf32>) -> f32 {
```
https://github.com/llvm/llvm-project/pull/104784
More information about the Mlir-commits
mailing list