[MLIR][Transform] Introduce loop.coalesce transform op.
This patch made a minor refactor of LoopCoalescing.cpp's walkLoops templated method and placed it in Affine's LoopUtils.cpp/h. This method is also renamed as coalescePerfectlyNestedLoops method. This minor change enables this method to be invoked by both the original LoopCoalescing pass as well as the newly introduced loop.coalesce transform op. The loop.coalesce transform op has the ability to coalesce affine, and scf loop nests, leveraging existing LoopCoalescing mechanism. I have created it inside the SCFTransformOps.td instead of AffineTransformOps.td as it feels to be similar in spirit as the loop.unroll op that can handle both scf and affine loops. Please let me know if you feel that this op should be moved into AffineTransformOps.td instead. The testcase added illustrates loop.coalesce transform op working for scf, affine loops (inner, outer) as well as coalesced loop can be further unrolled (achieving composibility). Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D141202
Loading
Please sign in to comment