[llvm-branch-commits] [llvm] [DAGCombiner] Relax nsz constraint with fp->int->fp optimizations (PR #164503)

Yingwei Zheng via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Oct 24 09:50:56 PDT 2025


================
@@ -18871,6 +18871,37 @@ SDValue DAGCombiner::visitFPOW(SDNode *N) {
 
   return SDValue();
 }
+/// Check if a use of a floating-point operation doesn't care about the sign of
+/// zero. This allows us to optimize (sitofp (fptosi x)) -> ftrunc(x) even
+/// without NoSignedZerosFPMath, as long as all uses are sign-insensitive.
+static bool isSignInsensitiveUse(SDNode *Use, unsigned OperandNo,
----------------
dtcxzyw wrote:

Yeah. In ValueTracking we have `canIgnoreSignBitOfZero` and `canIgnoreSignBitOfNaN`.

https://github.com/llvm/llvm-project/pull/164503


More information about the llvm-branch-commits mailing list