Go to the documentation of this file.
29 if (Func ==
"mcount" ||
31 Func ==
"llvm.arm.gnu.eabi.mcount" ||
32 Func ==
"\01_mcount" ||
33 Func ==
"\01mcount" ||
36 Func ==
"__cyg_profile_func_enter_bare") {
39 Call->setDebugLoc(
DL);
43 if (Func ==
"__cyg_profile_func_enter" || Func ==
"__cyg_profile_func_exit") {
60 Call->setDebugLoc(
DL);
70 StringRef EntryAttr = PostInlining ?
"instrument-function-entry-inlined"
71 :
"instrument-function-entry";
73 StringRef ExitAttr = PostInlining ?
"instrument-function-exit-inlined"
74 :
"instrument-function-exit";
76 StringRef EntryFunc =
F.getFnAttribute(EntryAttr).getValueAsString();
77 StringRef ExitFunc =
F.getFnAttribute(ExitAttr).getValueAsString();
85 if (!EntryFunc.
empty()) {
87 if (
auto SP =
F.getSubprogram())
92 F.removeFnAttr(EntryAttr);
95 if (!ExitFunc.
empty()) {
98 if (!isa<ReturnInst>(
T))
102 if (
CallInst *CI =
BB.getTerminatingMustTailCall())
106 if (
DebugLoc TerminatorDL =
T->getDebugLoc())
108 else if (
auto SP =
F.getSubprogram())
114 F.removeFnAttr(ExitAttr);
134 struct PostInlineEntryExitInstrumenter :
public FunctionPass {
150 EntryExitInstrumenter,
"ee-instrument",
151 "Instrument function entry/exit with calls to e.g. mcount() (pre inlining)",
172 return new EntryExitInstrumenter();
176 return new PostInlineEntryExitInstrumenter();
A set of analyses that are preserved following a run of a transformation pass.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
const Function * getParent() const
Return the enclosing method, or null if none.
A CRTP mix-in to automatically provide informational APIs needed for passes.
static Constant * getBitCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
The instances of the Type class are immutable: once they are created, they are never changed.
should just be implemented with a CLZ instruction Since there are other e g
void initializeEntryExitInstrumenterPass(PassRegistry &)
static IntegerType * getInt32Ty(LLVMContext &C)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
LLVM Basic Block Representation.
INITIALIZE_PASS_BEGIN(EntryExitInstrumenter, "ee-instrument", "Instrument function entry/exit with calls to e.g. mcount() (pre inlining)", false, false) INITIALIZE_PASS_END(EntryExitInstrumenter
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
ee Instrument function entry exit with calls to e g mcount()(pre inlining)"
(vector float) vec_cmpeq(*A, *B) C
static CallInst * Create(FunctionType *Ty, Value *F, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Represent the analysis usage information of a pass.
Legacy analysis pass which computes a DominatorTree.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class implements an extremely fast bulk output stream that can only output to a stream.
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.
static void insertCall(Function &CurFn, StringRef Func, Instruction *InsertionPt, DebugLoc DL)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
An efficient, type-erasing, non-owning reference to a callable.
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Module * getParent()
Get the module that this global value is contained inside of...
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
This is an important class for using LLVM in a threaded context.
void setDebugLoc(DebugLoc Loc)
Set the debug location information for this instruction.
into xmm2 addss xmm2 xmm1 xmm3 addss xmm3 movaps xmm0 unpcklps xmm0 ret seems silly when it could just be one addps Expand libm rounding functions inline
FunctionPass * createPostInlineEntryExitInstrumenterPass()
print Print MemDeps of function
A Module instance is used to store all the information related to an LLVM module.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
StringRef - Represent a constant reference to a string, i.e.
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
Represents analyses that only rely on functions' control flow.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
void initializePostInlineEntryExitInstrumenterPass(PassRegistry &)
LLVMContext & getContext() const
Get the context in which this basic block lives.
static bool runOnFunction(Function &F, bool PostInlining)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static Type * getVoidTy(LLVMContext &C)
void preserveSet()
Mark an analysis set as preserved.
declare void exit(i32) noreturn nounwind This compiles into
const BasicBlock * getParent() const
Legacy wrapper pass to provide the GlobalsAAResult object.
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
amdgpu Simplify well known AMD library calls
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
FunctionPass * createEntryExitInstrumenterPass()
A container for analyses that lazily runs them and caches their results.
FunctionPass class - This class is used to implement most global optimizations.
This class represents a function call, abstracting a target machine's calling convention.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
LLVM Value Representation.
print Instructions which execute on loop entry