@@ -17086,11 +17086,6 @@ static bool isContractableFMUL(const TargetOptions &Options, SDValue N) {
1708617086 N->getFlags().hasAllowContract();
1708717087}
1708817088
17089- // Returns true if `N` can assume no infinities involved in its computation.
17090- static bool hasNoInfs(const TargetOptions &Options, SDValue N) {
17091- return Options.NoInfsFPMath || N->getFlags().hasNoInfs();
17092- }
17093-
1709417089/// Try to perform FMA combining on a given FADD node.
1709517090template <class MatchContextClass>
1709617091SDValue DAGCombiner::visitFADDForFMACombine(SDNode *N) {
@@ -17666,7 +17661,7 @@ SDValue DAGCombiner::visitFMULForFMADistributiveCombine(SDNode *N) {
1766617661 // The transforms below are incorrect when x == 0 and y == inf, because the
1766717662 // intermediate multiplication produces a nan.
1766817663 SDValue FAdd = N0.getOpcode() == ISD::FADD ? N0 : N1;
17669- if (! hasNoInfs(Options, FAdd ))
17664+ if (FAdd->getFlags(). hasNoInfs())
1767017665 return SDValue();
1767117666
1767217667 // Floating-point multiply-add without intermediate rounding.
@@ -18343,7 +18338,7 @@ template <class MatchContextClass> SDValue DAGCombiner::visitFMA(SDNode *N) {
1834318338 return matcher.getNode(ISD::FMA, DL, VT, NegN0, NegN1, N2);
1834418339 }
1834518340
18346- if (( Options.NoNaNsFPMath && Options.NoInfsFPMath) ||
18341+ if (Options.NoNaNsFPMath ||
1834718342 (N->getFlags().hasNoNaNs() && N->getFlags().hasNoInfs())) {
1834818343 if (N->getFlags().hasNoSignedZeros() ||
1834918344 (N2CFP && !N2CFP->isExactlyValue(-0.0))) {
@@ -18644,7 +18639,7 @@ SDValue DAGCombiner::visitFDIV(SDNode *N) {
1864418639 }
1864518640
1864618641 // Fold into a reciprocal estimate and multiply instead of a real divide.
18647- if (Options.NoInfsFPMath || Flags.hasNoInfs())
18642+ if (Flags.hasNoInfs())
1864818643 if (SDValue RV = BuildDivEstimate(N0, N1, Flags))
1864918644 return RV;
1865018645 }
@@ -18725,8 +18720,7 @@ SDValue DAGCombiner::visitFSQRT(SDNode *N) {
1872518720
1872618721 // Require 'ninf' flag since sqrt(+Inf) = +Inf, but the estimation goes as:
1872718722 // sqrt(+Inf) == rsqrt(+Inf) * +Inf = 0 * +Inf = NaN
18728- if (!Flags.hasApproximateFuncs() ||
18729- (!Options.NoInfsFPMath && !Flags.hasNoInfs()))
18723+ if (!Flags.hasApproximateFuncs() || !Flags.hasNoInfs())
1873018724 return SDValue();
1873118725
1873218726 SDValue N0 = N->getOperand(0);
0 commit comments