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

Renato Golin llvmlistbot at llvm.org
Sat Jan 6 06:22:23 PST 2024


rengolin wrote:

> Unless we freeze the set of patterns, we're necessarily in the situation you're describing, as far as I understand.

This is key: the _canonical form_ isn't a static form, but an agreed-upon form that the following passes agree to operate on. This form can change with time and passes need to adapt to it, but this change can be expensive and needs to be agreed upon again.

In our project we use a lot of upstream passes. Before we used to have trouble with the shapes that the passes leave in IR, but after we started running canonicalization in between every "bundle", the changes to the canonical shapes became minimal and easily treatable, without loss of information.

We may not even agree what a _"bundle"_ looks like across different projects, but if we run canonicalization to a fixed point in between them locally, the likelihood that there is loss of information is very low, if we agree what a _"canonical form"_ is.

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


More information about the Mlir-commits mailing list