@@ -9869,32 +9869,12 @@ SDValue ARMTargetLowering::LowerFSINCOS(SDValue Op, SelectionDAG &DAG) const {
98699869 assert(Subtarget->isTargetDarwin());
98709870
98719871 Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext());
9872- auto PtrVT = getPointerTy(DAG.getDataLayout());
9873-
9874- MachineFrameInfo &MFI = DAG.getMachineFunction().getFrameInfo();
98759872
98769873 // Pair of floats / doubles used to pass the result.
98779874 Type *RetTy = StructType::get(ArgTy, ArgTy);
98789875 auto &DL = DAG.getDataLayout();
98799876
98809877 ArgListTy Args;
9881- bool ShouldUseSRet = getTM().isAPCS_ABI();
9882- SDValue SRet;
9883- if (ShouldUseSRet) {
9884- // Create stack object for sret.
9885- const uint64_t ByteSize = DL.getTypeAllocSize(RetTy);
9886- const Align StackAlign = DL.getPrefTypeAlign(RetTy);
9887- int FrameIdx = MFI.CreateStackObject(ByteSize, StackAlign, false);
9888- SRet = DAG.getFrameIndex(FrameIdx, getPointerTy(DL));
9889-
9890- ArgListEntry Entry(SRet, PointerType::getUnqual(RetTy->getContext()));
9891- Entry.IsSExt = false;
9892- Entry.IsZExt = false;
9893- Entry.IsSRet = true;
9894- Args.push_back(Entry);
9895- RetTy = Type::getVoidTy(*DAG.getContext());
9896- }
9897-
98989878 Args.emplace_back(Arg, ArgTy);
98999879
99009880 StringRef LibcallName = getLibcallImplName(SincosStret);
@@ -9904,25 +9884,10 @@ SDValue ARMTargetLowering::LowerFSINCOS(SDValue Op, SelectionDAG &DAG) const {
99049884 TargetLowering::CallLoweringInfo CLI(DAG);
99059885 CLI.setDebugLoc(dl)
99069886 .setChain(DAG.getEntryNode())
9907- .setCallee(CC, RetTy, Callee, std::move(Args))
9908- .setDiscardResult(ShouldUseSRet);
9887+ .setCallee(CC, RetTy, Callee, std::move(Args));
99099888 std::pair<SDValue, SDValue> CallResult = LowerCallTo(CLI);
99109889
9911- if (!ShouldUseSRet)
9912- return CallResult.first;
9913-
9914- SDValue LoadSin =
9915- DAG.getLoad(ArgVT, dl, CallResult.second, SRet, MachinePointerInfo());
9916-
9917- // Address of cos field.
9918- SDValue Add = DAG.getNode(ISD::ADD, dl, PtrVT, SRet,
9919- DAG.getIntPtrConstant(ArgVT.getStoreSize(), dl));
9920- SDValue LoadCos =
9921- DAG.getLoad(ArgVT, dl, LoadSin.getValue(1), Add, MachinePointerInfo());
9922-
9923- SDVTList Tys = DAG.getVTList(ArgVT, ArgVT);
9924- return DAG.getNode(ISD::MERGE_VALUES, dl, Tys,
9925- LoadSin.getValue(0), LoadCos.getValue(0));
9890+ return CallResult.first;
99269891}
99279892
99289893SDValue ARMTargetLowering::LowerWindowsDIVLibCall(SDValue Op, SelectionDAG &DAG,
0 commit comments