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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 03:07:24 PDT 2026


================
@@ -2553,6 +2564,11 @@ def : GCNPat <
   (V_AND_B32_e32 (S_MOV_B32 (i32 0x80008000)), VGPR_32:$src1)
 >;
 
+def : GCNPat <
+  (DivergentBinFrag<fcopysign> build_vector_fpimm_pos_zero_v2<fp16vt> , (fneg fp16vt:$src1)),
----------------
jayfoad wrote:

Is there a version of this predicate that handles neg zero as well? Like:
```suggestion
  (DivergentBinFrag<fcopysign> build_vector_fpimm_zero_v2<fp16vt> , (fneg fp16vt:$src1)),
```

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


More information about the llvm-commits mailing list