@@ -772,13 +772,16 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_FFREXP(SDNode *N) {
772
772
773
773
SDLoc DL (N);
774
774
775
+ auto PointerTy = PointerType::getUnqual (*DAG.getContext ());
775
776
TargetLowering::MakeLibCallOptions CallOptions;
776
777
SDValue Ops[2 ] = {GetSoftenedFloat (N->getOperand (0 )), StackSlot};
777
778
EVT OpsVT[2 ] = {VT0, StackSlot.getValueType ()};
779
+ Type* CallOpsTypeOverrides[2 ] = { nullptr , PointerTy };
778
780
779
781
// TODO: setTypeListBeforeSoften can't properly express multiple return types,
780
782
// 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);
782
785
783
786
auto [ReturnVal, Chain] = TLI.makeLibCall (DAG, LC, NVT0, Ops, CallOptions, DL,
784
787
/* Chain=*/ SDValue ());
@@ -811,19 +814,23 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_UnaryWithTwoFPResults(
811
814
SmallVector<EVT, 3 > OpsVT = {VT};
812
815
813
816
std::array<SDValue, 2 > StackSlots;
817
+ SmallVector<Type *, 3 > CallOpsTypeOverrides = {nullptr };
818
+ auto PointerTy = PointerType::getUnqual (*DAG.getContext ());
814
819
for (unsigned ResNum = 0 ; ResNum < N->getNumValues (); ++ResNum) {
815
820
if (ResNum == CallRetResNo)
816
821
continue ;
817
822
SDValue StackSlot = DAG.CreateStackTemporary (NVT);
818
823
Ops.push_back (StackSlot);
819
824
OpsVT.push_back (StackSlot.getValueType ());
820
825
StackSlots[ResNum] = StackSlot;
826
+ CallOpsTypeOverrides.push_back (PointerTy);
821
827
}
822
828
823
829
TargetLowering::MakeLibCallOptions CallOptions;
824
830
// TODO: setTypeListBeforeSoften can't properly express multiple return types,
825
831
// 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);
827
834
828
835
auto [ReturnVal, Chain] = TLI.makeLibCall (DAG, LC, NVT, Ops, CallOptions, DL,
829
836
/* Chain=*/ SDValue ());
0 commit comments