[llvm] [LLVM][DecoderEmitter] Add option to use lambdas in decodeToMCInst (PR #144814)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 20 21:37:20 PDT 2025


jurahul wrote:

I did not look into why exactly the compile time is large with switch case, but I am guessing it's just that there is a single function with a large IR and making lambdas (which won't get inlined) avoid that case. As expected, it probably comes with some perf cost, both due to the indirect function call as well as any cross-switch-case optimizations that may be happening in the switch version. See my note about further refinement that includes a comment about setting up a benchmark to measure. For our use case, a 3x reduction in compile time might be good to adopt it in some builds (for example, pre-commit CI can use this, and post-commit builds can still use switch case). 

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


More information about the llvm-commits mailing list