[clang] [llvm] [AMDGPU] Match bitsin(typeof(x)) - popcnt(x) to s_bcnt0_i32 (PR #164847)
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 31 22:33:21 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,
----------------
arsenm wrote:
Is the COPY_TO_REGCLASS really necessary? I know we had a tablegen workaround of the same shape around, but I'm not sure it's still necessary
https://github.com/llvm/llvm-project/pull/164847
More information about the cfe-commits
mailing list