Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 5,645 Lines • ▼ Show 20 Lines | SDValue PPCTargetLowering::FinishCall( | ||||
Chain = DAG.getCALLSEQ_END(Chain, NumBytes, BytesCalleePops, Glue, dl); | Chain = DAG.getCALLSEQ_END(Chain, NumBytes, BytesCalleePops, Glue, dl); | ||||
Glue = Chain.getValue(1); | Glue = Chain.getValue(1); | ||||
return LowerCallResult(Chain, Glue, CFlags.CallConv, CFlags.IsVarArg, Ins, dl, | return LowerCallResult(Chain, Glue, CFlags.CallConv, CFlags.IsVarArg, Ins, dl, | ||||
DAG, InVals); | DAG, InVals); | ||||
} | } | ||||
bool PPCTargetLowering::supportsTailCallFor(const CallBase *CB) const { | |||||
CallingConv::ID CalleeCC = CB->getCallingConv(); | |||||
const Function *CallerFunc = CB->getCaller(); | |||||
CallingConv::ID CallerCC = CallerFunc->getCallingConv(); | |||||
const Function *CalleeFunc = CB->getCalledFunction(); | |||||
if (!CalleeFunc) | |||||
return false; | |||||
const GlobalValue *CalleeGV = dyn_cast<GlobalValue>(CalleeFunc); | |||||
SmallVector<ISD::OutputArg, 2> Outs; | |||||
SmallVector<ISD::InputArg, 2> Ins; | |||||
GetReturnInfo(CalleeCC, CalleeFunc->getReturnType(), | |||||
CalleeFunc->getAttributes(), Outs, *this, | |||||
CalleeFunc->getParent()->getDataLayout()); | |||||
return isEligibleForTCO( | |||||
CalleeGV, CalleeCC, CallerCC, CB, CalleeFunc->isVarArg(), Outs, Ins, | |||||
false /*IsByValArg*/, CallerFunc, false /*isCalleeExternalSymbol*/); | |||||
shchenz: we may need a NFC patch to remove the `IsByValArg` for `isEligibleForTCO` as all callers pass… | |||||
Sure, will do. Thank you! tingwang: Sure, will do. Thank you! | |||||
} | |||||
bool PPCTargetLowering::isEligibleForTCO( | bool PPCTargetLowering::isEligibleForTCO( | ||||
Not Done ReplyInline ActionsShould this be on PPC target only or it should be a target independent check? shouldBeMustTail checks some target independent conditions. shchenz: Should this be on PPC target only or it should be a target independent check? | |||||
Yeah, these checks are already covered by shouldBeMustTail, and could be redundant. I removed the check and updated the patch. Thank you! tingwang: Yeah, these checks are already covered by `shouldBeMustTail`, and could be redundant. I removed… | |||||
const GlobalValue *CalleeGV, CallingConv::ID CalleeCC, | const GlobalValue *CalleeGV, CallingConv::ID CalleeCC, | ||||
CallingConv::ID CallerCC, const CallBase *CB, bool isVarArg, | CallingConv::ID CallerCC, const CallBase *CB, bool isVarArg, | ||||
const SmallVectorImpl<ISD::OutputArg> &Outs, | const SmallVectorImpl<ISD::OutputArg> &Outs, | ||||
const SmallVectorImpl<ISD::InputArg> &Ins, bool isByValArg, | const SmallVectorImpl<ISD::InputArg> &Ins, bool isByValArg, | ||||
const Function *CallerFunc, bool isCalleeExternalSymbol) const { | const Function *CallerFunc, bool isCalleeExternalSymbol) const { | ||||
if (Subtarget.useLongCalls() && !(CB && CB->isMustTailCall())) | if (Subtarget.useLongCalls() && !(CB && CB->isMustTailCall())) | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 12,736 Lines • Show Last 20 Lines |
we may need a NFC patch to remove the IsByValArg for isEligibleForTCO as all callers pass false to it, we should be able to check the byval parameter inside isEligibleForTCO.