[Mlir-commits] [mlir] [mlir][memref]: Add expand/collapse rewrite pattern to MemRef::CopyOp (PR #67808)
Aviad Cohen
llvmlistbot at llvm.org
Tue Oct 3 04:57:14 PDT 2023
AviadCo wrote:
Hi @nicolasvasilache
**The rational for this pattern is this:**
1. Due to HW limitations, compute operations must use local memory space (we need to DMA import/export).
2. We use [PromoteOp](https://mlir.llvm.org/docs/Dialects/Transform/#transformstructuredpromote-transformpromoteop) to inject memref copies from global memory to local memory (copy between memory spaces).
3. Due to HW limitations, not every shape / strides are supported in the DMA engine, for that we need to expand/collapse the memref copies that are considered as DMA import/export - which is the rewrite pattern motivation.
I can refactor PromoteOp and this pattern to be based on `linalg.copy` (instead of memref::copy) and add this pattern as new transform operation. If this would be useful, we can generalize it to any `linalg.generic` operation. I couldn't find any pattern/transform that does such job as expand/collapse according to rank parameters.
https://github.com/llvm/llvm-project/pull/67808
More information about the Mlir-commits
mailing list