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

Jay Foad via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 18 07:48:51 PDT 2026


jayfoad wrote:

That;s just demonstrating that the InstCombine optimization "C - ctpop(X) => ctpop(~X) if C is bitwidth" has a oneuse restriction but your isel pattern does not. It's not clear to me which is better in this case. Generally oneuse restrictions lead to codegen with longer overall latency but lower register pressure, so it's a tradeoff.

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


More information about the cfe-commits mailing list