[Mlir-commits] [mlir] [mlir][vector] Add result type to `interleave` assembly format (PR #93392)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Mon May 27 01:34:56 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>
----------------
banach-space wrote:
[nit] The first example above shows what the **output value** will be. These examples show what the **output type** will be. Could you add a comment explaining this split? Otherwise it's not clear.
```suggestion
// Examples showing how output type changes based on the source vector type
%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>
```
https://github.com/llvm/llvm-project/pull/93392
More information about the Mlir-commits
mailing list