[llvm] Support STRICT_UINT_TO_FP and STRICT_SINT_TO_FP (PR #102503)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 6 11:39:33 PDT 2024
================
@@ -3359,6 +3349,16 @@ SDValue DAGTypeLegalizer::SoftPromoteHalfRes_XINT_TO_FP(SDNode *N) {
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), OVT);
SDLoc dl(N);
+ if (N->isStrictFPOpcode()) {
+ SDValue Op = DAG.getNode(N->getOpcode(), dl, {NVT, MVT::Other},
+ {N->getOperand(0), N->getOperand(1)});
+ Op = DAG.getNode(GetPromotionOpcodeStrict(NVT, OVT), dl,
+ {MVT::i16, MVT::Other}, {Op.getValue(1), Op});
+ ReplaceValueWith(SDValue(N, 1), Op.getValue(1));
+ DAG.ReplaceAllUsesOfValueWith(SDValue(N, 1), Op.getValue(1));
----------------
topperc wrote:
I don't understand why the DAG.ReplaceAllusesOfValue with are needed. Does the issue in the description still happen with other fixes you made?
https://github.com/llvm/llvm-project/pull/102503
More information about the llvm-commits
mailing list