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

River Riddle llvmlistbot at llvm.org
Wed Aug 28 13:41:23 PDT 2024


River707 wrote:

> To make it more concrete:
> 
> All passes/pipelines combined 140s applyPatternsAndFoldGreedily 105s
> 
> * fold 93s
>   
>   * constant matching 63s (there are some additional constant matching outside folding, < 0.5s)
>     
>     * hasTrait related to 57s
> 
> So ~50% of time is spent just checking if an operation is a constant (don't have all the line info to see time spent in repopulating constant hash map etc). The only ways to reduce overhead at the moment is to combine into larger patternsets (only sometimes possible) or not using the rewrite driver (which means you either lose the worklist management & nicer debug/tracing facilities or just create duplication).

Is the hasTrait purely the ConstantLike trait check? or cumulative checking for the various operands/etc.? Feels like there is a lot of low hanging fruit here for optimization, even outside of decoupling folding.

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


More information about the Mlir-commits mailing list