[llvm] Enable JumpTableToSwitch pass by default (PR #82546)
Alexander Shaposhnikov via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 26 20:56:47 PST 2024
alexander-shaposhnikov wrote:
@DavidSpickett - many thanks for the report,
I've looked into the provided example and have done a few experiments.
It's kind of unfortunate in several aspects:
0. The input is large (the decompressed source file is ~2.5MB) and on my MacBook it actually takes more than 3 minutes to compile.
1. The optimization with default settings triggers >11K times, there are **many** jump tables there, it looks like not all of them come from std::visit / std::variant, and they are long (90+% of them contain >= 9 functions, while the default threshold is set to 10).
2. Out of curiosity I've tried to compile the same example with -mllvm -jump-table-to-switch-size-threshold=8 and the output object file is 2.2MB vs 2.4MB (when the optimization turned off completely). The compilation time was approximately the same.
Potential options:
1. Adjust the default limit (e.g. to 8)
2. For Flang set this limit in the build system
@nikic - what do you think ?
p.s. I'll monitor the reports here, so in any case - huge thanks for the info, to the best of my knowledge this change has propagated through various CIs (not only at Google) and so far everything has been quite smooth (except this issue), but maybe it's too early to judge.
https://github.com/llvm/llvm-project/pull/82546
More information about the llvm-commits
mailing list