[llvm] [DAGCombiner] Remove all `UnsafeFPMath` references (PR #146295)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 28 02:54:30 PDT 2025
================
@@ -18923,7 +18919,7 @@ SDValue DAGCombiner::visitFP_ROUND(SDNode *N) {
// single-step fp_round we want to fold to.
// In other words, double rounding isn't the same as rounding.
// Also, this is a value preserving truncation iff both fp_round's are.
- if (DAG.getTarget().Options.UnsafeFPMath || N0IsTrunc)
+ if (N->getFlags().hasAllowContract() || N0IsTrunc)
----------------
arsenm wrote:
I don't think contract fits this. Unfortunately instcombine does not do the same fold for reference. The rounding flag is also weird, it should really be its own fast math flag instead of this special operand.
I think this is more of an approximate function
https://github.com/llvm/llvm-project/pull/146295
More information about the llvm-commits
mailing list