[Mlir-commits] [flang] [mlir] [mlir][CSE] Introduce hoist-pure-ops logic to CSE pass (PR #180556)

Slava Zakharin llvmlistbot at llvm.org
Wed Feb 25 09:34:49 PST 2026


vzakhari wrote:

> > Given that LLVM's `gvn-hoist` (and not the regular CSE) is doing the same transformation, I would recommend adding an extra option to the CSE pass that would enable such hoisting in top of the current CSE logic.
> 
> I verified this point in the RFC; it indeed behaves differently from CSE in LLVM. I have considered this approach before(add a option), but my concern is that the pass results might expose some underlying op design issues, similar to what we are discussing here.

Note that I only suggested adding the option, but we can enable it by default. The option might be needed to schedule different flavors of CSE pass at different points in the pipeline or according to the compilation options (e.g. if the extra hoisting adds too much of the compilation time, we can think of enabling it only for higher opt-levels). So the option gives us options, but it can be enabled by default for the time being.

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


More information about the Mlir-commits mailing list