Go to the documentation of this file.
14 #ifndef LLVM_CODEGEN_INDIRECTTHUNKS_H
15 #define LLVM_CODEGEN_INDIRECTTHUNKS_H
25 Derived &getDerived() {
return *
static_cast<Derived *
>(
this); }
36 getDerived().doInitialization(
M);
42 template <
typename Derived>
45 assert(
Name.startswith(getDerived().getThunkPrefix()) &&
46 "Created a thunk with an unexpected prefix!");
57 F->setComdat(
M.getOrInsertComdat(
Name));
63 B.addAttribute(llvm::Attribute::NoUnwind);
64 B.addAttribute(llvm::Attribute::Naked);
85 template <
typename Derived>
100 if (!getDerived().mayUseThunk(MF))
103 getDerived().insertThunks(MMI);
104 InsertedThunks =
true;
109 getDerived().populateThunk(MF);
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
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
@ HiddenVisibility
The GV is hidden.
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.
void createThunkFunction(MachineModuleInfo &MMI, StringRef Name, bool Comdat=true)
LLVM Basic Block Representation.
const MachineFunctionProperties & getProperties() const
Get the function properties.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
MachineFunctionProperties & set(Property P)
This class contains meta information specific to a module.
@ InternalLinkage
Rename collisions when linking (static functions).
This is an important class for using LLVM in a threaded context.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
static Function * Create(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace, const Twine &N="", Module *M=nullptr)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A Module instance is used to store all the information related to an LLVM module.
StringRef - Represent a constant reference to a string, i.e.
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=nullptr, BasicBlock *InsertBefore=nullptr)
Creates a new BasicBlock.
MachineFunction & getOrCreateMachineFunction(Function &F)
Returns the MachineFunction constructed for the IR function F.
bool run(MachineModuleInfo &MMI, MachineFunction &MF)
static Type * getVoidTy(LLVMContext &C)
void doInitialization(Module &M)
@ LinkOnceODRLinkage
Same, but only replaced by something equivalent.
const Module * getModule() const