[llvm] [AMDGPU] Improve codegen for copysign(x, fneg(y)) (PR #207178)

Madhur Kumar via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 03:17:50 PDT 2026


================
@@ -2420,6 +2420,11 @@ def : GCNPat <
   (S_AND_B32 (S_MOV_B32 (i32 0x00008000)), SReg_32:$src1)
 >;
 
+def : GCNPat <
+  (DivergentBinFrag<fcopysign> (fp16vt fpimm_zero), (fneg fp16vt:$src1)),
+  (V_BFI_B32_e64 VGPR_32:$src1, (i32 0), (S_MOV_B32 (i32 0x00008000)))
----------------
MadhurKumar004 wrote:

I will make the changes if that's the preference.

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


More information about the llvm-commits mailing list