[llvm] [DAG] Prefer 0.0 over -0.0 as neutral value for FADD w/NoSignedZero (PR #106616)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 08:05:29 PDT 2024


================
@@ -13267,7 +13267,9 @@ SDValue SelectionDAG::getNeutralElement(unsigned Opcode, const SDLoc &DL,
   case ISD::SMIN:
     return getConstant(APInt::getSignedMaxValue(VT.getSizeInBits()), DL, VT);
   case ISD::FADD:
-    return getConstantFP(-0.0, DL, VT);
+    // If flags allow, prefer positive zero single it's generally cheaper
----------------
preames wrote:

Fixed in e1bde1c5b203224b0fa68ee141ec2c7a079f5eac

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


More information about the llvm-commits mailing list