26 if (Func ==
"mcount" ||
28 Func ==
"\01__gnu_mcount_nc" ||
29 Func ==
"\01_mcount" ||
30 Func ==
"\01mcount" ||
33 Func ==
"__cyg_profile_func_enter_bare") {
40 if (Func ==
"__cyg_profile_func_enter" || Func ==
"__cyg_profile_func_exit") {
67 StringRef EntryAttr = PostInlining ?
"instrument-function-entry-inlined" 68 :
"instrument-function-entry";
70 StringRef ExitAttr = PostInlining ?
"instrument-function-exit-inlined" 71 :
"instrument-function-exit";
82 if (!EntryFunc.
empty()) {
92 if (!ExitFunc.
empty()) {
95 if (!isa<ReturnInst>(T))
100 if (
BitCastInst *BCI = dyn_cast_or_null<BitCastInst>(Prev))
102 if (
CallInst *CI = dyn_cast_or_null<CallInst>(Prev)) {
103 if (CI->isMustTailCall())
110 else if (
auto SP = F.getSubprogram())
135 struct PostInlineEntryExitInstrumenter :
public FunctionPass {
150 EntryExitInstrumenter,
"ee-instrument",
151 "Instrument function entry/exit with calls to e.g. mcount() (pre inlining)",
159 return new EntryExitInstrumenter();
163 return new PostInlineEntryExitInstrumenter();
Legacy wrapper pass to provide the GlobalsAAResult object.
void initializeEntryExitInstrumenterPass(PassRegistry &)
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
DILocation * get() const
Get the underlying DILocation.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
post inline ee instrument
This is the interface for a simple mod/ref and alias analysis over globals.
Constant * getOrInsertFunction(StringRef Name, FunctionType *T, AttributeList AttributeList)
Look up the specified function in the module symbol table.
A Module instance is used to store all the information related to an LLVM module. ...
static CallInst * Create(FunctionType *Ty, Value *F, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
This class represents a function call, abstracting a target machine's calling convention.
static void insertCall(Function &CurFn, StringRef Func, Instruction *InsertionPt, DebugLoc DL)
post inline ee Instrument function entry exit with calls to e g mcount() " "(post inlining)"
LLVMContext & getContext() const
Get the context in which this basic block lives.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
This class represents a no-op cast from one type to another.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Function * getDeclaration(Module *M, ID id, ArrayRef< Type *> Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
static Constant * getBitCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static bool runOnFunction(Function &F, bool PostInlining)
A set of analyses that are preserved following a run of a transformation pass.
void setDebugLoc(DebugLoc Loc)
Set the debug location information for this instruction.
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
DISubprogram * getSubprogram() const
Get the attached subprogram.
This is an important base class in LLVM.
void removeAttribute(unsigned i, Attribute::AttrKind Kind)
removes the attribute from the list of attributes.
Represent the analysis usage information of a pass.
static Type * getVoidTy(LLVMContext &C)
FunctionPass class - This class is used to implement most global optimizations.
static FunctionType * get(Type *Result, ArrayRef< Type *> Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Module.h This file contains the declarations for the Module class.
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
FunctionPass * createPostInlineEntryExitInstrumenterPass()
Represents analyses that only rely on functions' control flow.
INITIALIZE_PASS(EntryExitInstrumenter, "ee-instrument", "Instrument function entry/exit with calls to e.g. mcount() (pre inlining)", false, false) INITIALIZE_PASS(PostInlineEntryExitInstrumenter
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.
static IntegerType * getInt32Ty(LLVMContext &C)
StringRef getValueAsString() const
Return the attribute's value as a string.
void preserveSet()
Mark an analysis set as preserved.
const Function * getParent() const
Return the enclosing method, or null if none.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
amdgpu Simplify well known AMD library calls
Attribute getFnAttribute(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind.
print Print MemDeps of function
print Instructions which execute on loop entry
StringRef - Represent a constant reference to a string, i.e.
A container for analyses that lazily runs them and caches their results.
FunctionPass * createEntryExitInstrumenterPass()
void initializePostInlineEntryExitInstrumenterPass(PassRegistry &)
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
const BasicBlock * getParent() const