LLVM API Documentation

Defines | Functions | Variables
TailRecursionElimination.cpp File Reference
#include "llvm/Transforms/Scalar.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/CaptureTracking.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/InlineCost.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/Loads.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ValueHandle.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
Include dependency graph for TailRecursionElimination.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "tailcallelim"

Functions

 STATISTIC (NumEliminated,"Number of tail calls removed")
 STATISTIC (NumRetDuped,"Number of return duplicated")
 STATISTIC (NumAccumAdded,"Number of accumulators introduced")
 INITIALIZE_PASS_BEGIN (TailCallElim,"tailcallelim","Tail Call Elimination", false, false) INITIALIZE_PASS_END(TailCallElim
static bool CanTRE (Function &F)
 Scan the specified function for alloca instructions. If it contains any dynamic allocas, returns false.
static bool isDynamicConstant (Value *V, CallInst *CI, ReturnInst *RI)
static ValuegetCommonReturnValue (ReturnInst *IgnoreRI, CallInst *CI)
static InstructionFirstNonDbg (BasicBlock::iterator I)

Variables

 tailcallelim
Tail Call Elimination
Tail Call false

Define Documentation

#define DEBUG_TYPE   "tailcallelim"

Definition at line 80 of file TailRecursionElimination.cpp.


Function Documentation

static bool CanTRE ( Function F) [static]

Scan the specified function for alloca instructions. If it contains any dynamic allocas, returns false.

Definition at line 142 of file TailRecursionElimination.cpp.

References I.

static Instruction* FirstNonDbg ( BasicBlock::iterator  I) [static]

Definition at line 559 of file TailRecursionElimination.cpp.

References I.

static Value* getCommonReturnValue ( ReturnInst IgnoreRI,
CallInst CI 
) [static]
INITIALIZE_PASS_BEGIN ( TailCallElim  ,
"tailcallelim"  ,
"Tail Call Elimination ,
false  ,
false   
)
static bool isDynamicConstant ( Value V,
CallInst CI,
ReturnInst RI 
) [static]
STATISTIC ( NumEliminated  ,
"Number of tail calls removed"   
)
STATISTIC ( NumRetDuped  ,
"Number of return duplicated"   
)
STATISTIC ( NumAccumAdded  ,
"Number of accumulators introduced"   
)

Variable Documentation

Tail Call Elimination

Definition at line 128 of file TailRecursionElimination.cpp.

Tail Call false

Definition at line 128 of file TailRecursionElimination.cpp.

Definition at line 128 of file TailRecursionElimination.cpp.