[Mlir-commits] [mlir] [MLIR][SCF] Add an API to fuse consumer to a producer within scf loop (PR #88712)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun May 12 23:28:55 PDT 2024


Yun-Fly wrote:

> A couple of pointers to consider while implementing the above use-case :

Hi, @Abhishek-Varma, thanks for your points on this. 

> 1. While we're at it - the nested structure can just be any block of an SCF region. Even if we fixate on scf.yield - its parent can be anything ForOp, IfOp, etc.
> 2. Let's, for now, keep it for the following case :-
a. scf.for -> scf.for -> .... -> scf.for
a. scf.for -> scf.for -> .... -> scf.forall

Yes, exactly, we need a powerful utility function to get real consumer of `candidateSliceOp`, which can walk through nested structure either scf `loop` or `if`.

> 4. Now, the old candidate slice should be replaced by the cloned loop's candidate slice - this again requires you to traverse through the loop structure to find out exactly which insert slice op is going to be the new "old" candidate slice op

Could you detail this with an example if possible? 

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


More information about the Mlir-commits mailing list