[llvm] [X86][DAG] Use nneg flag when trying to convert uitofp -> sitofp (PR #86694)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 12:18:24 PDT 2024


================
@@ -17382,8 +17382,9 @@ SDValue DAGCombiner::visitSINT_TO_FP(SDNode *N) {
   // but UINT_TO_FP is legal on this target, try to convert.
   if (!hasOperation(ISD::SINT_TO_FP, OpVT) &&
       hasOperation(ISD::UINT_TO_FP, OpVT)) {
+    SDNodeFlags Flags = N->getFlags();
     // If the sign bit is known to be zero, we can change this to UINT_TO_FP.
-    if (DAG.SignBitIsZero(N0))
+    if (Flags.hasNonNeg() || DAG.SignBitIsZero(N0))
----------------
goldsteinn wrote:

There are no failure in the test suite if I remove this code entirely...
I'm going to drop from this patch for now.

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


More information about the llvm-commits mailing list