[Mlir-commits] [mlir] [mlir][vector] Add n-d deinterleave lowering (PR #94237)
Benjamin Maxwell
llvmlistbot at llvm.org
Thu Jun 6 04:53:41 PDT 2024
================
@@ -79,6 +79,73 @@ class UnrollInterleaveOp final : public OpRewritePattern<vector::InterleaveOp> {
int64_t targetRank = 1;
};
+/// A one-shot unrolling of vector.deinterleave to the `targetRank`.
+///
+/// Example:
+///
+/// ```mlir
+/// %0, %1 = vector.deinterleave %a : vector<1x2x3x8xi64> -> vector<1x2x3x4xi64>
+/// ```
+/// Would be unrolled to:
+/// ```mlir
+/// %result = arith.constant dense<0> : vector<1x2x3x4xi64>
+/// %0 = vector.extract %a[0, 0, 0] ─┐
+/// : vector<8xi64> from vector<1x2x3x8xi64> |
+/// %1, %2 = vector.deinterleave %0 : |
+/// : vector<8xi64> -> vector<4xi64> | -- Initial deinterleave
----------------
MacDue wrote:
```suggestion
/// %1, %2 = vector.deinterleave %0 |
/// : vector<8xi64> -> vector<4xi64> | -- Initial deinterleave
```
https://github.com/llvm/llvm-project/pull/94237
More information about the Mlir-commits
mailing list