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