22 "Kernel attributes are attached/belong only to OpenCL kernel functions");
26 if (
Node && ArgIdx < Node->getNumOperands())
27 return cast<MDString>(
Node->getOperand(ArgIdx));
38 unsigned MDArgIdx = ArgIdx + 1;
40 F.getParent()->getNamedMetadata(
"opencl.kernels");
48 bool FoundLoweredKernelFunction =
false;
52 dyn_cast<Function>(MaybeValue->
getValue())->getName() ==
F.getName()) {
53 FoundLoweredKernelFunction =
true;
56 if (MaybeValue && FoundLoweredKernelFunction)
59 MDNode *MaybeNode = dyn_cast<MDNode>(Operand);
60 if (FoundLoweredKernelFunction && MaybeNode &&
61 cast<MDString>(MaybeNode->
getOperand(0))->getString() ==
63 MDArgIdx < MaybeNode->getNumOperands())
64 return cast<MDString>(MaybeNode->
getOperand(MDArgIdx));
74 "Kernel attributes are attached/belong only to OpenCL kernel functions");
81 "Kernel attributes are attached/belong only to OpenCL kernel functions");
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const MDOperand & getOperand(unsigned I) const
ArrayRef< MDOperand > operands() const
Tracking metadata reference owned by Metadata.
MDNode * getOperand(unsigned i) const
unsigned getNumOperands() const
StringRef - Represent a constant reference to a string, i.e.
@ SPIR_KERNEL
Used for SPIR kernel functions.
This is an optimization pass for GlobalISel generic memory operations.
MDString * getOCLKernelArgAccessQual(const Function &F, unsigned ArgIdx)
MDString * getOCLKernelArgTypeQual(const Function &F, unsigned ArgIdx)