[Mlir-commits] [mlir] [mlir] Enable decoupling two kinds of greedy behavior. (PR #104649)

Jacques Pienaar llvmlistbot at llvm.org
Thu Aug 22 11:28:35 PDT 2024


jpienaar wrote:

> I don’t understand what this means, or how it relates to greedy, or what is the actual problem to solve right now…

If one has a set of patterns that have to all be applied before another set of patterns, then one needs to split it into multiple passes today (the priorities are not sufficient depending on iteration order). Now one ends up with trying to do the same folding multiple times needlessly vs if you just did it in one. This enables using different sets of patterns relatively cheaply, rather than all checks for folding being wasted until last/if ever. A lot of interface and dialect fallback hook querying until then, all wasted: 38% of total execution time spent in mlir::detail::constant_op_binder::match, of that significant time in hasTrait called from there in the profile I'm looking at. I don't think there is any folding even happening in the end, just a lot of attempts made (e.g., its not expensive folders being an issue, just actually querying values to see if they are constant and a folder can be used is). 

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


More information about the Mlir-commits mailing list