[llvm] [llvm] Optimize print-on-crash serialization (PR #205682)
Alexis Engelke via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 10 00:39:45 PDT 2026
aengelke wrote:
Thanks for the data. The only benchmarks where this appears to leave substantial improvements are kimwitu++ (37%), clamscan (34%) and sqlite (66%). The latter is a large module, we might still have some quadratic runtime in printing (maybe something related to function attributes?)? Maybe you could have a look on why the print-based approach is so expensive for these two benchmarks?
> This PR completely avoids serialization unless a crash occurs
Well... one could consider cloning also as some kind of serialization.
I don't particularly like the approach and would prefer to avoid this if the gains could be achieved by other means. Here are my concerns:
- I'm not 100% confident that cloning a function into a different module really does not affect any use lists etc., which may have an impact on optimizations.
- This is a debugging functionality, so it should have as little code as possible. (Maintenance cost, but also less code typically means less bugs, and bugs in debugging tools can be extremely annoying.) Cloning is much more involved than printing.
- For most benchmarks, the wins are ~20%, which I think doesn't justify additional complexity.
- (There's a very vague idea to maybe merge context and module in the distant future. Not blocking of course, but I think that we shouldn't create new modules just because we can, currently, do this easily.)
https://github.com/llvm/llvm-project/pull/205682
More information about the llvm-commits
mailing list