[Mlir-commits] [mlir] [MLIR][SCF] Sink scf.if from scf.while before region into after region. (PR #165216)
Jacques Pienaar
llvmlistbot at llvm.org
Sat Nov 8 22:46:24 PST 2025
jpienaar wrote:
> What I’m currently worried about is an extreme case where the number of operands to scf.condition could grow significantly, and likewise the number of result values of scf.while could increase substantially. This might make the scf.while look more complex, and I’m not sure whether this would violate the principles of canonicalization.
That is valid concern. I think you are saying appearance to also mean ability to analyze. It could result in more complicated liveness analysis than pre-transform (and to Kumar's point, trade off between recomputing or increasing high water mark).
As a general pattern though that is something that could be analyzed in different flows. It seems desirable/useful pattern but not always on/non canonical, so currently proposed as pattern seems sensible. We don't have a big corpus upstream to measure cost, so I don't think we can put that bar here (of course if folks can find cases where bad and file issues great). It seems useful pattern that can be further refined here.
https://github.com/llvm/llvm-project/pull/165216
More information about the Mlir-commits
mailing list