jayfoad wrote:

> I also applied this patch:
> 
> ```
> --- a/llvm/lib/Target/AMDGPU/SOPInstructions.td
> +++ b/llvm/lib/Target/AMDGPU/SOPInstructions.td
> @@ -1951,7 +1951,7 @@ def : GCNPat <
>  >;
>  
>  def : GCNPat <
> -   (i64 (UniformBinFrag<sub> 64, (ctpop i64:$src))),
> +   (i64 (ctpop (not i64:$src))),
>      (i64 (REG_SEQUENCE SReg_64,
>       (i32 (COPY_TO_REGCLASS (S_BCNT0_I32_B64 $src), SReg_32)), sub0,
>       (S_MOV_B32 (i32 0)), sub1))
> ```
> 
> But it resulted in worse code generation, so I didn't commit it.

Right but that's only because your .ll tests are testing non-canonical IR, 
which is not an interesting test. If you run them through `opt -O2` first then 
InstCombine will convert them to the (ctpop (not)) form.

https://github.com/llvm/llvm-project/pull/164847
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to