[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]`.
----------------
banach-space wrote:
[nit] This would be a bit clearer to me with the comment "above" the code that it's referring to:
```suggestion
%a = arith.constant dense<[0, 1]> : vector<2xi32>
%b = arith.constant dense<[2, 3]> : vector<2xi32>
// The value of `%0` will be `[0, 2, 1, 3]`.
%0 = vector.interleave %a, %b : vector<2xi32> -> vector<4xi32>
```
https://github.com/llvm/llvm-project/pull/93392
More information about the Mlir-commits
mailing list