@@ -17010,8 +17010,8 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
17010
17010
return SDValue();
17011
17011
17012
17012
const SDNodeFlags Flags = N->getFlags();
17013
- bool AllowFusionGlobally = (Options.AllowFPOpFusion == FPOpFusion::Fast ||
17014
- Options.UnsafeFPMath || HasFMAD);
17013
+ bool AllowFusionGlobally =
17014
+ ( Options.AllowFPOpFusion == FPOpFusion::Fast || HasFMAD);
17015
17015
17016
17016
// If the subtraction is not contractable, do not combine.
17017
17017
if (!AllowFusionGlobally && !N->getFlags().hasAllowContract())
@@ -17167,7 +17167,7 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
17167
17167
}
17168
17168
17169
17169
auto isReassociable = [&Options](SDNode *N) {
17170
- return Options.UnsafeFPMath || N->getFlags().hasAllowReassociation();
17170
+ return N->getFlags().hasAllowReassociation();
17171
17171
};
17172
17172
17173
17173
auto isContractableAndReassociableFMUL = [&isContractableFMUL,
@@ -17181,7 +17181,7 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
17181
17181
17182
17182
// More folding opportunities when target permits.
17183
17183
if (Aggressive && isReassociable(N)) {
17184
- bool CanFuse = Options.UnsafeFPMath || N->getFlags().hasAllowContract();
17184
+ bool CanFuse = N->getFlags().hasAllowContract();
17185
17185
// fold (fsub (fma x, y, (fmul u, v)), z)
17186
17186
// -> (fma x, y (fma u, v, (fneg z)))
17187
17187
if (CanFuse && isFusedOp(N0) &&
0 commit comments