29 bool runOnModule(
Module &M)
override;
30 const char *getPassName()
const override {
return "AMDGPU Always Inline Pass"; }
37 bool AMDGPUAlwaysInline::runOnModule(
Module &M) {
38 std::vector<Function *> FuncsToClone;
41 if (!
F.hasLocalLinkage() && !
F.isDeclaration() && !
F.use_empty() &&
43 FuncsToClone.push_back(&
F);
50 M.getFunctionList().push_back(NewFunc);
51 F->replaceAllUsesWith(NewFunc);
63 return new AMDGPUAlwaysInline();
A Module instance is used to store all the information related to an LLVM module. ...
ModulePass * createAMDGPUAlwaysInlinePass()
Module.h This file contains the declarations for the Module class.
void setLinkage(LinkageTypes LT)
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Rename collisions when linking (static functions).
Function * CloneFunction(const Function *F, ValueToValueMapTy &VMap, bool ModuleLevelChanges, ClonedCodeInfo *CodeInfo=nullptr)
CloneFunction - Return a copy of the specified function, but without embedding the function into anot...