[Mlir-commits] [mlir] [mlir][scf] Add simple LICM pattern for `scf.while` (PR #76370)

Mehdi Amini llvmlistbot at llvm.org
Fri Jan 19 15:37:54 PST 2024


joker-eph wrote:

Chatted with @ThomasRaoux and this topic came up, felt like reporting some more on some canonicalization aspects. The argument against this as a canonicalization may come down to the definition and purpose of `scf.for`. There is a case to be made that `scf.for` is "unopinionated" and generic, intended to structurally represent a loop at multiple levels of abstractions. So for composability purposes, you want to be able to run canonicalization on your abstraction level without incurring drastic changes on the structure of the loop. Making LICM part of the `scf.for` canonical form is on the other hand making `scf.for` opinionated in terms of representing an overly abstract loop form, reducing its applicability. The motion of operations from arbitrary dialects across execution paths may be a step too far for something structural like `scf.for`.


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


More information about the Mlir-commits mailing list