29#define DEBUG_TYPE "amdgpu-export-kernel-runtime-handles"
36class AMDGPUExportKernelRuntimeHandlesLegacy :
public ModulePass {
40 explicit AMDGPUExportKernelRuntimeHandlesLegacy() :
ModulePass(
ID) {}
43 bool runOnModule(
Module &M)
override;
48char AMDGPUExportKernelRuntimeHandlesLegacy::ID = 0;
51 AMDGPUExportKernelRuntimeHandlesLegacy::ID;
54 "Externalize enqueued block runtime handles",
false,
false)
57 return new AMDGPUExportKernelRuntimeHandlesLegacy();
63 const StringLiteral HandleSectionName(
".amdgpu.kernel.runtime.handle");
66 if (GV.getSection() == HandleSectionName) {
68 GV.setDSOLocal(
false);
82 const MDNode *Associated =
F.getMetadata(LLVMContext::MD_associated);
88 if (Handle && Handle->getSection() == HandleSectionName) {
97bool AMDGPUExportKernelRuntimeHandlesLegacy::runOnModule(
Module &M) {
static bool exportKernelRuntimeHandles(Module &M)
Module.h This file contains the declarations for the Module class.
ModuleAnalysisManager MAM
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM)
This templated class represents "all analyses that operate over <aparticular IR unit>" (e....
@ ProtectedVisibility
The GV is protected.
@ ExternalLinkage
Externally visible function.
const MDOperand & getOperand(unsigned I) const
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ AMDGPU_KERNEL
Used for AMDGPU code object kernels.
This is an optimization pass for GlobalISel generic memory operations.
char & AMDGPUExportKernelRuntimeHandlesLegacyID
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
ModulePass * createAMDGPUExportKernelRuntimeHandlesLegacyPass()
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.