[Mlir-commits] [mlir] [mlir][scf] Extend consumer fuse to nested loop structure (PR #94190)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Jul 16 20:15:07 PDT 2024


Yun-Fly wrote:

> Skimmed through this change, this is looking better, but my main concern is that it is adding a lot of complexity to an already complex code path. Is it possible to "layer" these things differently? Ill leave some comments along the way, but I think this might be along the right path.

Thanks for your suggestion! I exactly know your concern. Let me try to break down what this PR added for your convenience.

- Previous `tileAndFuseConsumerOfSlice` deals with only single level loop, just rename it to `tileAndFuseConsumerOfSliceImpl` as basic functional for later iterative call. And also extend it to deal with nest `scf.for`. (involving `getOuterNestLoopsWhile`)
- Add new `tileAndFuseConsumerOfSlice` to address multiple level candidates, and each candidate represents one iterative call of `tileAndFuseConsumerOfSliceImpl`. (involving `getRealConsumersFromInsertSliceOp`)
- Allow multiple uses of result shared with consumer. (involving `getConsumerFromUses` and `checkAssumptionForLoop`)

If you have any question, please let me know.


https://github.com/llvm/llvm-project/pull/94190


More information about the Mlir-commits mailing list