[llvm] [SimplifyCFG] Relax `cttz` cost check in `simplifySwitchOfPowersOfTwo` (PR #145159)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 22 00:23:28 PDT 2025
https://github.com/nikic approved this pull request.
LGTM
One thing this regressions is a power of two identity mapping (1 => 1, 2 => 2, 4 => 4, 8 => 8), which previously would just simplify to the input and now instead becomes cttz + table lookup. See https://github.com/dtcxzyw/llvm-opt-benchmark/pull/2486/files/7b32e72e21d0f2d7df01d737f7a43222df4b1b60#diff-469c9a904297396b18fb7e4fd311b56e92874a0c79a13d5f960f01304ec305de.
It probably make sense to not perform this transform in the early SimplifyCFG runs.
https://github.com/llvm/llvm-project/pull/145159
More information about the llvm-commits
mailing list