[llvm] [X86, SimplifyCFG] Allow more PHIs when sinking common code on target supports CMOV (PR #110420)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 29 07:28:29 PDT 2024
https://github.com/nikic requested changes to this pull request.
This change doesn't make sense to me, on multiple levels:
* The limit you are adjusting here is a limit on the number of phi nodes **per sunk instruction**, not the total number of phis. You are saying here that on targets with cmov, you consider it profitable to create 6 phi nodes to sink one instruction. Surely that is not what you intend.
* Whether the target has cmov only becomes relevant if *all* instructions in a block can be sunk, the branch eliminated and all phi nodes converted to select instructions. For "normal" sinking, presence of cmov is not relevant at all, as the phi nodes will be lowered as movs in the incoming basic blocks.
Based on past experience, I can tell you that it's very easy to cause regressions by allowing more sinking in SimplifyCFG. You need to tread carefully when adjusting these heuristics.
https://github.com/llvm/llvm-project/pull/110420
More information about the llvm-commits
mailing list