[llvm] [AggressiveInstCombine] Fold split-width i32 cttz/ctlz patterns into wide i64 intrinsics (PR #192296)

Usha Gupta via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 06:56:09 PDT 2026


usha1830 wrote:

> Does something prevent the phi forms from being turned into the select form?

SimplifyCFG's `FoldTwoEntryPHINode ` does not convert this pattern because the speculation cost exceeds its budget. The default `two-entry-phi-node-folding-threshold` is 4, but for this pattern it is 6-7 instructions. 
Bumping the threshold to 7 causes if-conversion, but the result is a nested select (there is a select in the if.then block)


https://github.com/llvm/llvm-project/pull/192296


More information about the llvm-commits mailing list