LLVM API Documentation
#include "llvm/Transforms/Scalar.h"#include "llvm/Constants.h"#include "llvm/DerivedTypes.h"#include "llvm/Function.h"#include "llvm/Instructions.h"#include "llvm/Pass.h"#include "llvm/Support/CFG.h"#include "llvm/ADT/Statistic.h"#include "llvm/Support/Compiler.h"

Go to the source code of this file.
Defines | |
| #define | DEBUG_TYPE "tailcallelim" |
Functions | |
| STATISTIC (NumEliminated,"Number of tail calls removed") | |
| STATISTIC (NumAccumAdded,"Number of accumulators introduced") | |
| FunctionPass * | llvm::createTailCallEliminationPass () |
| static bool | AllocaMightEscapeToCalls (AllocaInst *AI) |
| static bool | CheckForEscapingAllocas (BasicBlock *BB, bool &CannotTCETailMarkedCall) |
| static bool | isDynamicConstant (Value *V, CallInst *CI) |
| static Value * | getCommonReturnValue (ReturnInst *TheRI, CallInst *CI) |
Variables | |
| static RegisterPass< TailCallElim > | X ("tailcallelim","Tail Call Elimination") |
| #define DEBUG_TYPE "tailcallelim" |
Definition at line 53 of file TailRecursionElimination.cpp.
| static bool AllocaMightEscapeToCalls | ( | AllocaInst * | AI | ) | [static] |
AllocaMightEscapeToCalls - Return true if this alloca may be accessed by callees of this function. We only do very simple analysis right now, this could be expanded in the future to use mod/ref information for particular call sites if desired.
Definition at line 98 of file TailRecursionElimination.cpp.
Referenced by CheckForEscapingAllocas().
| static bool CheckForEscapingAllocas | ( | BasicBlock * | BB, | |
| bool & | CannotTCETailMarkedCall | |||
| ) | [static] |
FunctionContainsAllocas - Scan the specified basic block for alloca instructions. If it contains any that might be accessed by calls, return true.
Definition at line 106 of file TailRecursionElimination.cpp.
References AI, AllocaMightEscapeToCalls(), llvm::BasicBlock::begin(), E, llvm::BasicBlock::end(), llvm::AllocationInst::getArraySize(), llvm::Function::getEntryBlock(), llvm::BasicBlock::getParent(), and I.
| static Value* getCommonReturnValue | ( | ReturnInst * | TheRI, | |
| CallInst * | CI | |||
| ) | [static] |
Definition at line 251 of file TailRecursionElimination.cpp.
References BBI, llvm::Function::begin(), E, llvm::Function::end(), llvm::Constant::getOperand(), llvm::BasicBlock::getParent(), llvm::Instruction::getParent(), llvm::Function::getReturnType(), and isDynamicConstant().
Definition at line 225 of file TailRecursionElimination.cpp.
References AI, Arg, llvm::Function::arg_begin(), llvm::User::getOperand(), llvm::BasicBlock::getParent(), and llvm::Instruction::getParent().
Referenced by getCommonReturnValue().
| STATISTIC | ( | NumAccumAdded | , | |
| "Number of accumulators introduced" | ||||
| ) |
| STATISTIC | ( | NumEliminated | , | |
| "Number of tail calls removed" | ||||
| ) |
char ID [static] |
Definition at line 70 of file TailRecursionElimination.cpp.
RegisterPass<TailCallElim> X("tailcallelim","Tail Call Elimination") [static] |
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.