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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 06:12:38 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
----------------
jayfoad wrote:

Weird typo "single" for "since"?

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


More information about the llvm-commits mailing list