[Mlir-commits] [mlir] [mlir][vector] Add 1D vector.deinterleave lowering (PR #93042)
Benjamin Maxwell
llvmlistbot at llvm.org
Wed May 29 02:50:43 PDT 2024
================
@@ -2546,3 +2546,25 @@ func.func @vector_interleave_2d_scalable(%a: vector<2x[8]xi16>, %b: vector<2x[8]
%0 = vector.interleave %a, %b : vector<2x[8]xi16>
return %0 : vector<2x[16]xi16>
}
+
+// -----
+
+// CHECK-LABEL: @vector_deinterleave_1d
+// CHECK-SAME: (%[[SRC:.*]]: vector<4xi32>) -> (vector<2xi32>, vector<2xi32>)
+func.func @vector_deinterleave_1d(%a: vector<4xi32>) -> (vector<2xi32>, vector<2xi32>) {
+ // CHECK: %[[POISON:.*]] = llvm.mlir.poison : vector<4xi32>
+ // CHECK: llvm.shufflevector %[[SRC]], %[[POISON]] [0, 2] : vector<4xi32>
+ // CHECK: llvm.shufflevector %[[SRC]], %[[POISON]] [1, 3] : vector<4xi32>
+ %0, %1 = vector.deinterleave %a : vector<4xi32> -> vector<2xi32>
+ return %0, %1 : vector<2xi32>, vector<2xi32>
+}
+
+// CHECK-LABEL: @vector_deinterleave_1d_scalable
+// CHECK-SAME: %[[SRC:.*]]: vector<[4]xi32>) -> (vector<[2]xi32>, vector<[2]xi32>)
+func.func @vector_deinterleave_1d_scalable(%a: vector<[4]xi32>) -> (vector<[2]xi32>, vector<[2]xi32>) {
+ // CHECK: %[[RES:.*]] = "llvm.intr.vector.deinterleave2"
----------------
MacDue wrote:
Also show how `SRC` is used by `deinterleave2`
https://github.com/llvm/llvm-project/pull/93042
More information about the Mlir-commits
mailing list