[Mlir-commits] [mlir] Refactor LoopFuseSiblingOp and support parallel fusion (PR #94391)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Jun 4 17:26:29 PDT 2024


srcarroll wrote:

> I'm concerned about difference of semantics for `fuse_sibling` transform, which do only the structural checks for the `scf.for` and `scf.forall` but will try to do an aliasing checks for `scf.parallel`. We probably should split `fuseIfLegal` func into 3:
> 
> * `checkFusionStructuralLegality` - doing only the structural checks (interation domain and dominace), used both in transform  and in `naivelyFuseParallelOps`
> * `fuseParallel` - fuses 2 `scf.parallel` without any checks, also used both in transform  and in `naivelyFuseParallelOps`
> * `checkParallelAliasing` - nested parallel, `haveNoReadsAfterWriteExceptSameIndex` and aliasing checks, used only in `naivelyFuseParallelOps` - also you can keep this func in `ParallelLoopFusion.cpp` and avoid introducing memref dependency to utils.

sounds good. this was just a first atttempt with minimal changes but I agree with you and will refactor per your suggestions. I'll let you know if i come across problems with the suggestion

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


More information about the Mlir-commits mailing list