LLVM  5.0.0
Macros | Functions | Variables
SimplifyCFGPass.cpp File Reference
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/SimplifyCFG.h"
#include "llvm/Transforms/Utils/Local.h"
#include <utility>
Include dependency graph for SimplifyCFGPass.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "simplifycfg"
 

Functions

 STATISTIC (NumSimpl,"Number of blocks simplified")
 
static bool mergeEmptyReturnBlocks (Function &F)
 If we have more than one empty (other than phi node) return blocks, merge them together to promote recursive block merging. More...
 
static bool iterativelySimplifyCFG (Function &F, const TargetTransformInfo &TTI, AssumptionCache *AC, unsigned BonusInstThreshold, bool LateSimplifyCFG)
 Call SimplifyCFG on all the blocks in the function, iterating until no more changes are made. More...
 
static bool simplifyFunctionCFG (Function &F, const TargetTransformInfo &TTI, AssumptionCache *AC, int BonusInstThreshold, bool LateSimplifyCFG)
 
 INITIALIZE_PASS_BEGIN (CFGSimplifyPass,"simplifycfg","Simplify the CFG", false, false) INITIALIZE_PASS_END(CFGSimplifyPass
 
 INITIALIZE_PASS_BEGIN (LateCFGSimplifyPass,"latesimplifycfg","Simplify the CFG more aggressively", false, false) INITIALIZE_PASS_END(LateCFGSimplifyPass
 

Variables

static cl::opt< unsigned > UserBonusInstThreshold ("bonus-inst-threshold", cl::Hidden, cl::init(1), cl::desc("Control the number of bonus instructions (default = 1)"))
 
 simplifycfg
 
Simplify the CFG
 
Simplify the false
 
 latesimplifycfg
 
Simplify the CFG more aggressively
 

Macro Definition Documentation

#define DEBUG_TYPE   "simplifycfg"

Definition at line 46 of file SimplifyCFGPass.cpp.

Function Documentation

INITIALIZE_PASS_BEGIN ( CFGSimplifyPass  ,
"simplifycfg"  ,
"Simplify the CFG"  ,
false  ,
false   
)
INITIALIZE_PASS_BEGIN ( LateCFGSimplifyPass  ,
"latesimplifycfg"  ,
"Simplify the CFG more aggressively"  ,
false  ,
false   
)
static bool iterativelySimplifyCFG ( Function &  F,
const TargetTransformInfo &  TTI,
AssumptionCache *  AC,
unsigned  BonusInstThreshold,
bool  LateSimplifyCFG 
)
static

Call SimplifyCFG on all the blocks in the function, iterating until no more changes are made.

Definition at line 131 of file SimplifyCFGPass.cpp.

References llvm::Function::begin(), llvm::Function::end(), llvm::FindFunctionBackedges(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SimplifyCFG(), and llvm::SmallVectorTemplateCommon< T >::size().

Referenced by simplifyFunctionCFG().

static bool mergeEmptyReturnBlocks ( Function &  F)
static
static bool simplifyFunctionCFG ( Function &  F,
const TargetTransformInfo &  TTI,
AssumptionCache *  AC,
int  BonusInstThreshold,
bool  LateSimplifyCFG 
)
static
STATISTIC ( NumSimpl  ,
"Number of blocks simplified"   
)

Variable Documentation

Simplify the CFG more aggressively

Definition at line 272 of file SimplifyCFGPass.cpp.

Simplify the CFG

Definition at line 264 of file SimplifyCFGPass.cpp.

Simplify the CFG more false

Definition at line 264 of file SimplifyCFGPass.cpp.

latesimplifycfg

Definition at line 272 of file SimplifyCFGPass.cpp.

simplifycfg

Definition at line 264 of file SimplifyCFGPass.cpp.

cl::opt<unsigned> UserBonusInstThreshold("bonus-inst-threshold", cl::Hidden, cl::init(1), cl::desc("Control the number of bonus instructions (default = 1)"))
static