llvm.org GIT mirror llvm / 7e752a3
Remove TLI from isInTailCallPosition's arguments. NFC. There is no need to pass on TLI separately to the function. As Eric pointed out the Target Machine already provides everything we need. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213108 91177308-0d34-0410-b5e6-96231b3b80d8 Juergen Ributzka 5 years ago
4 changed file(s) with 6 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
8686 /// between it and the return.
8787 ///
8888 /// This function only tests target-independent requirements.
89 bool isInTailCallPosition(ImmutableCallSite CS, const TargetMachine &TM,
90 const TargetLoweringBase &TLI);
89 bool isInTailCallPosition(ImmutableCallSite CS, const TargetMachine &TM);
9190
9291 /// Test if given that the input instruction is in the tail call position if the
9392 /// return type or any attributes of the function will inhibit tail call
474474 /// between it and the return.
475475 ///
476476 /// This function only tests target-independent requirements.
477 bool llvm::isInTailCallPosition(ImmutableCallSite CS, const TargetMachine &TM,
478 const TargetLoweringBase &TLI) {
477 bool llvm::isInTailCallPosition(ImmutableCallSite CS, const TargetMachine &TM) {
479478 const Instruction *I = CS.getInstruction();
480479 const BasicBlock *ExitBB = I->getParent();
481480 const TerminatorInst *Term = ExitBB->getTerminator();
508507 return false;
509508 }
510509
511 return returnTypeIsEligibleForTailCall(ExitBB->getParent(), I, Ret, TLI);
510 return returnTypeIsEligibleForTailCall(ExitBB->getParent(), I, Ret,
511 *TM.getTargetLowering());
512512 }
513513
514514 bool llvm::returnTypeIsEligibleForTailCall(const Function *F,
10221022 // Check if target-independent constraints permit a tail call here.
10231023 // Target-dependent constraints are checked within FastLowerCall.
10241024 bool IsTailCall = CI->isTailCall();
1025 if (IsTailCall && !isInTailCallPosition(CS, TM, TLI))
1025 if (IsTailCall && !isInTailCallPosition(CS, TM))
10261026 IsTailCall = false;
10271027
10281028 CallLoweringInfo CLI;
54895489
54905490 // Check if target-independent constraints permit a tail call here.
54915491 // Target-dependent constraints are checked within TLI->LowerCallTo.
5492 if (isTailCall && !isInTailCallPosition(CS, DAG.getTarget(), *TLI))
5492 if (isTailCall && !isInTailCallPosition(CS, DAG.getTarget()))
54935493 isTailCall = false;
54945494
54955495 TargetLowering::CallLoweringInfo CLI(DAG);