LLVM: lib/Target/AMDGPU/AMDGPUExportKernelRuntimeHandles.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
28
29#define DEBUG_TYPE "amdgpu-export-kernel-runtime-handles"
30
31using namespace llvm;
32
33namespace {
34
35
36class AMDGPUExportKernelRuntimeHandlesLegacy : public ModulePass {
37public:
38 static char ID;
39
40 explicit AMDGPUExportKernelRuntimeHandlesLegacy() : ModulePass(ID) {}
41
42private:
43 bool runOnModule(Module &M) override;
44};
45
46}
47
48char AMDGPUExportKernelRuntimeHandlesLegacy::ID = 0;
49
51 AMDGPUExportKernelRuntimeHandlesLegacy::ID;
52
54 "Externalize enqueued block runtime handles", false, false)
55
57 return new AMDGPUExportKernelRuntimeHandlesLegacy();
58}
59
62
63 const StringLiteral HandleSectionName(".amdgpu.kernel.runtime.handle");
64
66 if (GV.getSection() == HandleSectionName) {
68 GV.setDSOLocal(false);
70 }
71 }
72
74 return false;
75
76
77
80 continue;
81
82 const MDNode *Associated = F.getMetadata(LLVMContext::MD_associated);
83 if (!Associated)
84 continue;
85
88 if (Handle && Handle->getSection() == HandleSectionName) {
91 }
92 }
93
95}
96
97bool AMDGPUExportKernelRuntimeHandlesLegacy::runOnModule(Module &M) {
99}
100
101PreservedAnalyses
static bool exportKernelRuntimeHandles(Module &M)
Definition AMDGPUExportKernelRuntimeHandles.cpp:60
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)
Definition AMDGPUExportKernelRuntimeHandles.cpp:102
This templated class represents "all analyses that operate over " (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
Definition AMDGPUExportKernelRuntimeHandles.cpp:50
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
ModulePass * createAMDGPUExportKernelRuntimeHandlesLegacyPass()
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.