[Mlir-commits] [mlir] [mlir][vector] Add result type to `interleave` assembly format (PR #93392)

Jakub Kuderski llvmlistbot at llvm.org
Mon May 27 08:00:42 PDT 2024


================
@@ -513,24 +514,23 @@ def Vector_InterleaveOp :
 
     Example:
     ```mlir
-    %0 = vector.interleave %a, %b
-               : vector<[4]xi32>     ; yields vector<[8]xi32>
-    %1 = vector.interleave %c, %d
-               : vector<8xi8>        ; yields vector<16xi8>
-    %2 = vector.interleave %e, %f
-               : vector<f16>         ; yields vector<2xf16>
-    %3 = vector.interleave %g, %h
-               : vector<2x4x[2]xf64> ; yields vector<2x4x[4]xf64>
-    %4 = vector.interleave %i, %j
-               : vector<6x3xf32>     ; yields vector<6x6xf32>
+    %a = arith.constant dense<[0, 1]> : vector<2xi32>
+    %b = arith.constant dense<[2, 3]> : vector<2xi32>
+    %0 = vector.interleave %a, %b : vector<2xi32> -> vector<4xi32>
+    // The value of `%0` is `[0, 2, 1, 3]`.
+
+    %1 = vector.interleave %c, %d : vector<f16> -> vector<2xf16>
+    %2 = vector.interleave %e, %f : vector<6x3xf32> -> vector<6x6xf32>
+    %3 = vector.interleave %g, %h : vector<[4]xi32> -> vector<[8]xi32>
+    %4 = vector.interleave %i, %j : vector<2x4x[2]xf64> -> vector<2x4x[4]xf64>
----------------
kuhar wrote:

I added something along these lines but avoiding the 'how output type changes' wording, to avoid giving impression that types change.

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


More information about the Mlir-commits mailing list