44#define DEBUG_TYPE "amdgpu-lower-enqueued-block"
51class AMDGPUOpenCLEnqueuedBlockLowering :
public ModulePass {
55 explicit AMDGPUOpenCLEnqueuedBlockLowering() :
ModulePass(
ID) {}
63char AMDGPUOpenCLEnqueuedBlockLowering::ID = 0;
66 AMDGPUOpenCLEnqueuedBlockLowering::ID;
69 "Lower OpenCL enqueued blocks",
false,
false)
72 return new AMDGPUOpenCLEnqueuedBlockLowering();
75bool AMDGPUOpenCLEnqueuedBlockLowering::runOnModule(
Module &M) {
77 auto &
C =
M.getContext();
83 for (
auto &
F :
M.functions()) {
84 if (
F.hasFnAttribute(
"enqueued-block")) {
97 "block.runtime.handle.t");
110 F.addFnAttr(
"runtime-handle", RuntimeHandle);
This file contains the declarations for the subclasses of Constant, which represent the different fla...
This file defines the DenseSet and SmallDenseSet classes.
Module.h This file contains the declarations for the Module class.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file defines the SmallString class.
static Constant * getAddrSpaceCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
Implements a dense probed hash-table based set.
@ ExternalLinkage
Externally visible function.
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
virtual bool runOnModule(Module &M)=0
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
A Module instance is used to store all the information related to an LLVM module.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Class to represent struct types.
static StructType * create(LLVMContext &Context, StringRef Name)
This creates an identified struct.
The instances of the Type class are immutable: once they are created, they are never changed.
static IntegerType * getInt32Ty(LLVMContext &C)
@ GLOBAL_ADDRESS
Address space for global memory (RAT0, VTX0).
constexpr char RuntimeHandle[]
Key for Kernel::Attr::Metadata::mRuntimeHandle.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
ModulePass * createAMDGPUOpenCLEnqueuedBlockLoweringPass()
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
char & AMDGPUOpenCLEnqueuedBlockLoweringID