[llvm] [IR][DAG] Add support for `nneg` flag with `uitofp` (PR #86141)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 22 10:24:42 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)) {
----------------
RKSimon wrote:
Please can you add some test coverage (maybe to uint_to_fp.ll?)
https://github.com/llvm/llvm-project/pull/86141
More information about the llvm-commits
mailing list