10#include "TargetInfo.h"
32void TCETargetCodeGenInfo::setTargetAttributes(
34 if (GV->isDeclaration())
39 llvm::Function *F = cast<llvm::Function>(GV);
42 if (FD->
hasAttr<OpenCLKernelAttr>()) {
44 F->addFnAttr(llvm::Attribute::NoInline);
45 const ReqdWorkGroupSizeAttr *
Attr = FD->
getAttr<ReqdWorkGroupSizeAttr>();
48 llvm::LLVMContext &Context = F->getContext();
49 llvm::NamedMDNode *OpenCLMetadata =
51 "opencl.kernel_wg_size_info");
54 Operands.push_back(llvm::ConstantAsMetadata::get(F));
57 llvm::ConstantAsMetadata::get(llvm::Constant::getIntegerValue(
60 llvm::ConstantAsMetadata::get(llvm::Constant::getIntegerValue(
63 llvm::ConstantAsMetadata::get(llvm::Constant::getIntegerValue(
70 llvm::ConstantAsMetadata::get(llvm::ConstantInt::getTrue(Context)));
71 OpenCLMetadata->addOperand(llvm::MDNode::get(Context, Operands));
79std::unique_ptr<TargetCodeGenInfo>
81 return std::make_unique<TCETargetCodeGenInfo>(CGM.
getTypes());
Attr - This represents one attribute.
This class organizes the cross-function state that is used while generating LLVM code.
llvm::Module & getModule() const
const LangOptions & getLangOpts() const
CodeGenTypes & getTypes()
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
DefaultABIInfo - The default implementation for ABI specific details.
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
virtual void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV, CodeGen::CodeGenModule &M) const
setTargetAttributes - Provides a convenient hook to handle extra target-specific attributes for the g...
Decl - This represents one declaration (or definition), e.g.
Represents a function declaration or definition.
std::unique_ptr< TargetCodeGenInfo > createTCETargetCodeGenInfo(CodeGenModule &CGM)
The JSON file list parser is used to communicate input to InstallAPI.
llvm::IntegerType * Int32Ty