[llvm] Support STRICT_UINT_TO_FP and STRICT_SINT_TO_FP (PR #102503)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 17:25:10 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}, {N->getOperand(0), Op});
----------------
topperc wrote:

Use Op.getValue(1) instead of N->getOperand(0). We should keep the chain linear if there's already another dependency between the nodes.



https://github.com/llvm/llvm-project/pull/102503


More information about the llvm-commits mailing list