[llvm] [AMDGPU] Make fneg/fabs/copysign legal for bf16 (PR #91676)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 00:58:16 PDT 2024


================
@@ -946,14 +946,14 @@ bool AMDGPUTargetLowering::isFAbsFree(EVT VT) const {
 
   // Packed operations do not have a fabs modifier.
   return VT == MVT::f32 || VT == MVT::f64 ||
-         (Subtarget->has16BitInsts() && VT == MVT::f16);
+         (Subtarget->has16BitInsts() && (VT == MVT::f16 || VT == MVT::bf16));
 }
 
 bool AMDGPUTargetLowering::isFNegFree(EVT VT) const {
----------------
rampitec wrote:

> I've been meaning to remove the check in that case, instcombine now does that

It would be very unfortunate not to let fneg to survive until the selection.

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


More information about the llvm-commits mailing list