mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
[FastISel] Make isInTailCallPosition independent of SelectionDAG.
Break out the arguemnts required from SelectionDAG, so that this function can also be used by FastISel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212844 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -475,7 +475,8 @@ static bool nextRealType(SmallVectorImpl<CompositeType *> &SubTypes,
|
||||
/// between it and the return.
|
||||
///
|
||||
/// This function only tests target-independent requirements.
|
||||
bool llvm::isInTailCallPosition(ImmutableCallSite CS, const SelectionDAG &DAG) {
|
||||
bool llvm::isInTailCallPosition(ImmutableCallSite CS, const TargetMachine &TM,
|
||||
const TargetLoweringBase &TLI) {
|
||||
const Instruction *I = CS.getInstruction();
|
||||
const BasicBlock *ExitBB = I->getParent();
|
||||
const TerminatorInst *Term = ExitBB->getTerminator();
|
||||
@ -490,8 +491,7 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, const SelectionDAG &DAG) {
|
||||
// longjmp on x86), it can end up causing miscompilation that has not
|
||||
// been fully understood.
|
||||
if (!Ret &&
|
||||
(!DAG.getTarget().Options.GuaranteedTailCallOpt ||
|
||||
!isa<UnreachableInst>(Term)))
|
||||
(!TM.Options.GuaranteedTailCallOpt || !isa<UnreachableInst>(Term)))
|
||||
return false;
|
||||
|
||||
// If I will have a chain, make sure no other instruction that will have a
|
||||
@ -509,8 +509,7 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, const SelectionDAG &DAG) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return returnTypeIsEligibleForTailCall(ExitBB->getParent(), I, Ret,
|
||||
*DAG.getTarget().getTargetLowering());
|
||||
return returnTypeIsEligibleForTailCall(ExitBB->getParent(), I, Ret, TLI);
|
||||
}
|
||||
|
||||
bool llvm::returnTypeIsEligibleForTailCall(const Function *F,
|
||||
|
Reference in New Issue
Block a user