[llvm] [X86][DAG] Use nneg flag when trying to convert uitofp -> sitofp (PR #86694)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 27 11:17:40 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))
----------------
RKSimon wrote:
What targets can we test this with?
https://github.com/llvm/llvm-project/pull/86694
More information about the llvm-commits
mailing list