Han-Chung Wang 7a310b4c5a
[mlir][linalg] Upstream PackOp/UnPackOp's generateScalarImplementation. (#182838)
The revision upstreams the implementation from IREE. The ops were
upstreamed some time ago, and they are the remaining implementation. The
core implementation is mirrored from IREE and some cleanups and style
nits are fixed.

The mirror is not a pure copy-paste because the op accessors are
different:

| IREE | llvm-project |
|------|--------------|
| `getInputRank()` | `packOp.getSourceRank()` |
| `getOutputRank()` | `packOp.getDestRank()` |
| `getInput()` | `packOp.getSource()` |
| `getOutput()` | `packOp.getDest()` |

And it uses `linalg::createOrFoldDimOp` and `createFoldedDimOp` from
upstream to create DimOp ops.

Closes https://github.com/llvm/llvm-project/pull/128816
Closes https://github.com/llvm/llvm-project/pull/178222

Co-authored-by: lorenzo chelini <l.chelini@icloud.com>

---------

Signed-off-by: hanhanW <hanhan0912@gmail.com>
2026-03-03 09:47:55 -08:00
..