Skip to content

Commit a3d1761

Browse files
committed
Remove UnsafeFPMath usage in visitFSUBForFMACombine
1 parent 494a748 commit a3d1761

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17010,8 +17010,7 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
1701017010
return SDValue();
1701117011

1701217012
const SDNodeFlags Flags = N->getFlags();
17013-
bool AllowFusionGlobally = (Options.AllowFPOpFusion == FPOpFusion::Fast ||
17014-
Options.UnsafeFPMath || HasFMAD);
17013+
bool AllowFusionGlobally = (Options.AllowFPOpFusion == FPOpFusion::Fast || HasFMAD);
1701517014

1701617015
// If the subtraction is not contractable, do not combine.
1701717016
if (!AllowFusionGlobally && !N->getFlags().hasAllowContract())
@@ -17167,7 +17166,7 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
1716717166
}
1716817167

1716917168
auto isReassociable = [&Options](SDNode *N) {
17170-
return Options.UnsafeFPMath || N->getFlags().hasAllowReassociation();
17169+
return N->getFlags().hasAllowReassociation();
1717117170
};
1717217171

1717317172
auto isContractableAndReassociableFMUL = [&isContractableFMUL,
@@ -17181,7 +17180,7 @@ SDValue DAGCombiner::visitFSUBForFMACombine(SDNode *N) {
1718117180

1718217181
// More folding opportunities when target permits.
1718317182
if (Aggressive && isReassociable(N)) {
17184-
bool CanFuse = Options.UnsafeFPMath || N->getFlags().hasAllowContract();
17183+
bool CanFuse = N->getFlags().hasAllowContract();
1718517184
// fold (fsub (fma x, y, (fmul u, v)), z)
1718617185
// -> (fma x, y (fma u, v, (fneg z)))
1718717186
if (CanFuse && isFusedOp(N0) &&

0 commit comments

Comments
 (0)