Skip to content

Commit 5813a72

Browse files
committed
Remove UnsafeFPMath in visitFP_ROUND
1 parent 1d3681c commit 5813a72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18860,7 +18860,7 @@ SDValue DAGCombiner::visitFP_ROUND(SDNode *N) {
1886018860
// single-step fp_round we want to fold to.
1886118861
// In other words, double rounding isn't the same as rounding.
1886218862
// Also, this is a value preserving truncation iff both fp_round's are.
18863-
if (DAG.getTarget().Options.UnsafeFPMath || N0IsTrunc)
18863+
if (N->getFlags().hasAllowContract() || N0IsTrunc)
1886418864
return DAG.getNode(
1886518865
ISD::FP_ROUND, DL, VT, N0.getOperand(0),
1886618866
DAG.getIntPtrConstant(NIsTrunc && N0IsTrunc, DL, /*isTarget=*/true));

0 commit comments

Comments
 (0)