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

Patrick Simmons via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 31 22:39:40 PDT 2025


================
@@ -1884,6 +1886,13 @@ def : GCNPat <
      (S_MOV_B32 (i32 0)), sub1))
 >;
 
+def : GCNPat <
+   (i64 (UniformBinFrag<sub> 64, (ctpop i64:$src))),
+    (i64 (REG_SEQUENCE SReg_64,
+     (i32 (COPY_TO_REGCLASS (S_BCNT0_I32_B64 $src), SReg_32)), sub0,
----------------
linuxrocks123 wrote:

@arsenm I have no clue.  I put it there because I was aping similar code in that file that seemed to use it when copying from 32-bit to 64-bit.  I can remove it and see if it still works?

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


More information about the cfe-commits mailing list