Go to the source code of this file.
|
| STATISTIC (NumEliminated, "Number of tail calls removed") |
|
| STATISTIC (NumRetDuped, "Number of return duplicated") |
|
| STATISTIC (NumAccumAdded, "Number of accumulators introduced") |
|
static bool | canTRE (Function &F) |
| Scan the specified function for alloca instructions.
|
|
static bool | markTails (Function &F, OptimizationRemarkEmitter *ORE) |
|
static bool | canMoveAboveCall (Instruction *I, CallInst *CI, AliasAnalysis *AA) |
| Return true if it is safe to move the specified instruction from after the call to before the call, assuming that all instructions between the call and this instruction are movable.
|
|
static bool | canTransformAccumulatorRecursion (Instruction *I, CallInst *CI) |
|
static Instruction * | firstNonDbg (BasicBlock::iterator I) |
|
| INITIALIZE_PASS_BEGIN (TailCallElim, "tailcallelim", "Tail Call Elimination", false, false) INITIALIZE_PASS_END(TailCallElim |
|
◆ DEBUG_TYPE
#define DEBUG_TYPE "tailcallelim" |
◆ canMoveAboveCall()
Return true if it is safe to move the specified instruction from after the call to before the call, assuming that all instructions between the call and this instruction are movable.
Definition at line 337 of file TailRecursionElimination.cpp.
References DL, llvm::findAllocaForValue(), llvm::MemoryLocation::get(), llvm::AAResults::getModRefInfo(), I, II, llvm::is_contained(), llvm::isModSet(), llvm::isSafeToLoadUnconditionally(), and llvm::Instruction::mayHaveSideEffects().
◆ canTransformAccumulatorRecursion()
◆ canTRE()
◆ firstNonDbg()
◆ INITIALIZE_PASS_BEGIN()
INITIALIZE_PASS_BEGIN |
( |
TailCallElim |
, |
|
|
"tailcallelim" |
, |
|
|
"Tail Call Elimination" |
, |
|
|
false |
, |
|
|
false |
|
|
) |
| |
◆ markTails()
Definition at line 189 of file TailRecursionElimination.cpp.
References A, llvm::CallBase::args(), llvm::dbgs(), DEBUG_TYPE, llvm::CallBase::doesNotAccessMemory(), llvm::OptimizationRemarkEmitter::emit(), llvm::SmallVectorBase< Size_T >::empty(), F, llvm::CallBase::hasOperandBundlesOtherThan(), I, II, llvm::CallInst::isNoTailCall(), llvm::CallInst::isTailCall(), LLVM_DEBUG, Modified, llvm::LLVMContext::OB_clang_arc_attachedcall, llvm::LLVMContext::OB_kcfi, llvm::LLVMContext::OB_ptrauth, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::CallInst::setTailCall(), and llvm::successors().
◆ STATISTIC() [1/3]
STATISTIC |
( |
NumAccumAdded |
, |
|
|
"Number of accumulators introduced" |
|
|
) |
| |
◆ STATISTIC() [2/3]
STATISTIC |
( |
NumEliminated |
, |
|
|
"Number of tail calls removed" |
|
|
) |
| |
◆ STATISTIC() [3/3]
STATISTIC |
( |
NumRetDuped |
, |
|
|
"Number of return duplicated" |
|
|
) |
| |
◆ Elimination
◆ false
◆ tailcallelim