@@ -16914,8 +16914,7 @@ SDValue DAGCombiner::visitFADDForFMACombine(SDNode *N) {
16914
16914
// fadd (G, (fma A, B, (fma (C, D, (fmul (E, F)))))) -->
16915
16915
// fma A, B, (fma C, D, fma (E, F, G)).
16916
16916
// This requires reassociation because it changes the order of operations.
16917
- bool CanReassociate =
16918
- Options.UnsafeFPMath || N->getFlags().hasAllowReassociation();
16917
+ bool CanReassociate = N->getFlags().hasAllowReassociation();
16919
16918
if (CanReassociate) {
16920
16919
SDValue FMA, E;
16921
16920
if (isFusedOp(N0) && N0.hasOneUse()) {
@@ -18087,8 +18086,7 @@ template <class MatchContextClass> SDValue DAGCombiner::visitFMA(SDNode *N) {
18087
18086
return matcher.getNode(ISD::FMA, DL, VT, NegN0, NegN1, N2);
18088
18087
}
18089
18088
18090
- // FIXME: use fast math flags instead of Options.UnsafeFPMath
18091
- // TODO: Finally migrate away from global TargetOptions.
18089
+ // FIXME: Finally migrate away from global TargetOptions.
18092
18090
if (Options.AllowFPOpFusion == FPOpFusion::Fast ||
18093
18091
(Options.NoNaNsFPMath && Options.NoInfsFPMath) ||
18094
18092
(N->getFlags().hasNoNaNs() && N->getFlags().hasNoInfs())) {
@@ -18112,8 +18110,7 @@ template <class MatchContextClass> SDValue DAGCombiner::visitFMA(SDNode *N) {
18112
18110
!DAG.isConstantFPBuildVectorOrConstantFP(N1))
18113
18111
return matcher.getNode(ISD::FMA, DL, VT, N1, N0, N2);
18114
18112
18115
- bool CanReassociate =
18116
- Options.UnsafeFPMath || N->getFlags().hasAllowReassociation();
18113
+ bool CanReassociate = N->getFlags().hasAllowReassociation();
18117
18114
if (CanReassociate) {
18118
18115
// (fma x, c1, (fmul x, c2)) -> (fmul x, c1+c2)
18119
18116
if (matcher.match(N2, ISD::FMUL) && N0 == N2.getOperand(0) &&
0 commit comments