[llvm] [IR][DAG] Add support for `nneg` flag with `uitofp` (PR #86141)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 22 10:31:22 PDT 2024
================
@@ -54062,7 +54062,8 @@ static SDValue combineUIntToFP(SDNode *N, SelectionDAG &DAG,
// Since UINT_TO_FP is legal (it's marked custom), dag combiner won't
// optimize it to a SINT_TO_FP when the sign bit is known zero. Perform
// the optimization here.
- if (DAG.SignBitIsZero(Op0)) {
+ SDNodeFlags Flags = N->getFlags();
+ if (Flags.hasNonNeg() || DAG.SignBitIsZero(Op0)) {
----------------
goldsteinn wrote:
Done
https://github.com/llvm/llvm-project/pull/86141
More information about the llvm-commits
mailing list