[llvm] [LLVM][DecoderEmitter] Add option to use lambdas in decodeToMCInst (PR #144814)
Min-Yih Hsu via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 20 09:16:18 PDT 2025
https://github.com/mshockwave commented:
> Using a table of lambdas instead improves the compile time significantly (~3x speedup in compiling the code in a downstream target)
Do you know why? My guess is that it'll spend lots of time on control flow related optimizations, while the lambda / function approach scales better in terms of compilation time. Aside from that, I think the question now becomes whether the LLVM you built runs slower. Because instead of plain switch cases you start to pay the price of function calls, and inlining might not always kick in (even in a -O3 build) given the sheer number of callees to be inlined. Have you done any related measurements regarding this?
https://github.com/llvm/llvm-project/pull/144814
More information about the llvm-commits
mailing list