[Mlir-commits] [mlir] [mlir][vector] Add Vector-dialect interleave-to-shuffle pattern, enable in VectorToSPIRV (PR #91800)

Jakub Kuderski llvmlistbot at llvm.org
Mon May 13 07:28:51 PDT 2024


================
@@ -0,0 +1,21 @@
+// RUN: mlir-opt %s --transform-interpreter | FileCheck %s
+
+// CHECK-LABEL: @vector_interleave_to_shuffle
+func.func @vector_interleave_to_shuffle(%a: vector<7xi16>, %b: vector<7xi16>) -> vector<14xi16>
+{
+  %0 = vector.interleave %a, %b : vector<7xi16>
+  return %0 : vector<14xi16>
+}
+// CHECK: vector.shuffle %arg0, %arg1 [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6] : vector<7xi16>, vector<7xi16>
----------------
kuhar wrote:

As for shuffle, the llvm and spir-v docs are pretty clear about indexing:
* https://llvm.org/docs/LangRef.html#shufflevector-instruction
* https://mlir.llvm.org/docs/Dialects/SPIR-V/#spirvvectorshuffle-spirvvectorshuffleop

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


More information about the Mlir-commits mailing list