LLVM: lib/Transforms/IPO/MergeFunctions.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "mergefunc"
Functions
STATISTIC (NumFunctionsMerged, "Number of functions merged")
STATISTIC (NumThunksWritten, "Number of thunks generated")
STATISTIC (NumAliasesWritten, "Number of aliases generated")
STATISTIC (NumDoubleWeak, "Number of new functions created")
static bool hasDistinctMetadataIntrinsic (const Function &F)
Check whether F has an intrinsic which references distinct metadata as an operand.
static bool isEligibleForMerging (Function &F)
Check whether F is eligible for function merging.
Function * asPtr (Function *Fn)
Function * asPtr (Function &Fn)
static bool canCreateThunkFor (Function *F)
Whether this function may be replaced by a forwarding thunk.
static void copyMetadataIfPresent (Function *From, Function *To, StringRef Kind)
Copy all metadata of a specific kind from one function to another.
static bool canCreateAliasFor (Function *F)
static bool isODR (const Function *F)
Returns true if F is either weak_odr or linkonce_odr.
static bool isFuncOrderCorrect (const Function *F, const Function *G)
Variables
static cl::opt< unsigned > NumFunctionsForVerificationCheck ("mergefunc-verify", cl::desc("How many functions in a module could be used for " "MergeFunctions to pass a basic correctness check. " "'0' disables this check. Works only with '-debug' key."), cl::init(0), cl::Hidden)
static cl::opt< bool > MergeFunctionsPDI ("mergefunc-preserve-debug-info", cl::Hidden, cl::init(false), cl::desc("Preserve debug info in thunk when mergefunc " "transformations are made."))
static cl::opt< bool > MergeFunctionsAliases ("mergefunc-use-aliases", cl::Hidden, cl::init(false), cl::desc("Allow mergefunc to create aliases"))

DEBUG_TYPE

#define DEBUG_TYPE "mergefunc"

asPtr() [1/2]

asPtr() [2/2]

canCreateAliasFor()

canCreateThunkFor()

copyMetadataIfPresent()

hasDistinctMetadataIntrinsic()

isEligibleForMerging()

isFuncOrderCorrect()

isODR()

STATISTIC() [1/4]

STATISTIC ( NumAliasesWritten ,
"Number of aliases generated" )

STATISTIC() [2/4]

STATISTIC ( NumDoubleWeak ,
"Number of new functions created" )

STATISTIC() [3/4]

STATISTIC ( NumFunctionsMerged ,
"Number of functions merged" )

STATISTIC() [4/4]

STATISTIC ( NumThunksWritten ,
"Number of thunks generated" )

MergeFunctionsAliases

cl::opt< bool > MergeFunctionsAliases("mergefunc-use-aliases", cl::Hidden, cl::init(false), cl::desc("Allow mergefunc to create aliases")) ( "mergefunc-use-aliases" , cl::Hidden , cl::init(false) , cl::desc("Allow mergefunc to create aliases") ) static

MergeFunctionsPDI

cl::opt< bool > MergeFunctionsPDI("mergefunc-preserve-debug-info", cl::Hidden, cl::init(false), cl::desc("Preserve debug info in thunk when mergefunc " "transformations are made.")) ( "mergefunc-preserve-debug-info" , cl::Hidden , cl::init(false) , cl::desc("Preserve debug info in thunk when mergefunc " "transformations are made.") ) static

NumFunctionsForVerificationCheck

cl::opt< unsigned > NumFunctionsForVerificationCheck("mergefunc-verify", cl::desc("How many functions in a module could be used for " "MergeFunctions to pass a basic correctness check. " "'0' disables this check. Works only with '-debug' key."), cl::init(0), cl::Hidden) ( "mergefunc-verify" , cl::desc("How many functions in a module could be used for " "MergeFunctions to pass a basic correctness check. " "'0' disables this check. Works only with '-debug' key.") , cl::init(0) , cl::Hidden ) static