================
@@ -21009,10 +21009,13 @@ SDValue DAGCombiner::visitUINT_TO_FP(SDNode *N) {
     return DAG.getNode(ISD::UINT_TO_FP, DL, VT, Trunc);
   }
 
-  // fold (uint_to_fp (trunc nuw x)) -> (uint_to_fp x)
+  // fold (uint_to_fp (trunc nuw x)) -> (uint_to_fp nneg x)
   if (N0.getOpcode() == ISD::TRUNCATE && N0->getFlags().hasNoUnsignedWrap() &&
-      TLI.isTypeDesirableForOp(N, N0.getOperand(0).getValueType()))
-    return DAG.getNode(ISD::UINT_TO_FP, DL, VT, N0.getOperand(0));
+      TLI.isTypeDesirableForOp(N, N0.getOperand(0).getValueType())) {
+    SDNodeFlags Flags = N->getFlags();
+    Flags.setNonNeg(true);
+    return DAG.getNode(ISD::UINT_TO_FP, DL, VT, N0.getOperand(0), Flags);
----------------
arsenm wrote:

These days you should be able to write the flag value inline without the 
SDNodeFlags + set 

https://github.com/llvm/llvm-project/pull/242916
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to