@@ -772,13 +772,16 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FFREXP(SDNode *N) {
772772
773773 SDLoc DL (N);
774774
775+ auto PointerTy = PointerType::getUnqual (*DAG.getContext ());
775776 TargetLowering::MakeLibCallOptions CallOptions;
776777 SDValue Ops[2 ] = {GetSoftenedFloat (N->getOperand (0 )), StackSlot};
777778 EVT OpsVT[2 ] = {VT0, StackSlot.getValueType ()};
779+ Type *CallOpsTypeOverrides[2 ] = {nullptr , PointerTy};
778780
779781 // TODO: setTypeListBeforeSoften can't properly express multiple return types,
780782 // but we only really need to handle the 0th one for softening anyway.
781- CallOptions.setTypeListBeforeSoften ({OpsVT}, VT0, true );
783+ CallOptions.setTypeListBeforeSoften ({OpsVT}, VT0, true )
784+ .setOpsTypeOverrides (CallOpsTypeOverrides);
782785
783786 auto [ReturnVal, Chain] = TLI.makeLibCall (DAG, LC, NVT0, Ops, CallOptions, DL,
784787 /* Chain=*/ SDValue ());
@@ -811,19 +814,23 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_UnaryWithTwoFPResults(
811814 SmallVector<EVT, 3 > OpsVT = {VT};
812815
813816 std::array<SDValue, 2 > StackSlots;
817+ SmallVector<Type *, 3 > CallOpsTypeOverrides = {nullptr };
818+ auto PointerTy = PointerType::getUnqual (*DAG.getContext ());
814819 for (unsigned ResNum = 0 ; ResNum < N->getNumValues (); ++ResNum) {
815820 if (ResNum == CallRetResNo)
816821 continue ;
817822 SDValue StackSlot = DAG.CreateStackTemporary (NVT);
818823 Ops.push_back (StackSlot);
819824 OpsVT.push_back (StackSlot.getValueType ());
820825 StackSlots[ResNum] = StackSlot;
826+ CallOpsTypeOverrides.push_back (PointerTy);
821827 }
822828
823829 TargetLowering::MakeLibCallOptions CallOptions;
824830 // TODO: setTypeListBeforeSoften can't properly express multiple return types,
825831 // but since both returns have the same type it should be okay.
826- CallOptions.setTypeListBeforeSoften ({OpsVT}, VT, true );
832+ CallOptions.setTypeListBeforeSoften ({OpsVT}, VT, true )
833+ .setOpsTypeOverrides (CallOpsTypeOverrides);
827834
828835 auto [ReturnVal, Chain] = TLI.makeLibCall (DAG, LC, NVT, Ops, CallOptions, DL,
829836 /* Chain=*/ SDValue ());
0 commit comments