[clang] [llvm] Match bitsin(typeof(x)) - popcnt(x) to s_bcnt0_i32 on AMDGPU (PR #164847)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 25 04:12:03 PDT 2025


https://github.com/arsenm requested changes to this pull request.

This should not introduce a new intrinsic and only needs a tablegen pattern. The one benefit you get out doing this fold in the IR would be sinking a popcnt out of block, but you can do that just by handling this case in isProfitableToSinkOperands, and that avoids teaching all of the known bits / sign bits / simplify demanded bits about this 

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


More information about the llvm-commits mailing list