23 Fn->setDoesNotRecurse();
25 Fn->addFnAttr(llvm::Attribute::MustProgress);
28void CodeGenModule::EmitSYCLKernelCaller(
const FunctionDecl *KernelEntryPointFn,
31 "SYCL kernel caller offload entry point functions can only be emitted"
32 " during device compilation");
34 const auto *KernelEntryPointAttr =
35 KernelEntryPointFn->
getAttr<SYCLKernelEntryPointAttr>();
36 assert(KernelEntryPointAttr &&
"Missing sycl_kernel_entry_point attribute");
37 assert(!KernelEntryPointAttr->isInvalidAttr() &&
38 "sycl_kernel_entry_point attribute is invalid");
41 SYCLKernelCallStmt *KernelCallStmt =
46 const OutlinedFunctionDecl *OutlinedFnDecl =
51 const CGFunctionInfo &FnInfo =
59 auto *
Fn = llvm::Function::Create(FnTy, llvm::Function::ExternalLinkage,
63 CodeGenFunction CGF(*
this);
66 CGF.StartFunction(GlobalDecl(), Ctx.
VoidTy, Fn, FnInfo, Args,
67 SourceLocation(), SourceLocation());
68 CGF.EmitFunctionBody(OutlinedFnDecl->
getBody());
static void SetSYCLKernelAttributes(llvm::Function *Fn, CodeGenFunction &CGF)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
const LangOptions & getLangOpts() const
const SYCLKernelInfo & getSYCLKernelInfo(QualType T) const
Given a type used as a SYCL kernel name, returns a reference to the metadata generated from the corre...
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
bool checkIfFunctionMustProgress()
Returns true if a function must make progress, which means the mustprogress attribute can be added.
void setDSOLocal(llvm::GlobalValue *GV) const
llvm::Module & getModule() const
CodeGenTypes & getTypes()
void SetLLVMFunctionAttributes(GlobalDecl GD, const CGFunctionInfo &Info, llvm::Function *F, bool IsThunk)
Set the LLVM function attributes (sext, zext, etc).
void SetLLVMFunctionAttributesForDefinition(const Decl *D, llvm::Function *F)
Set the LLVM function attributes which only apply to a function definition.
llvm::FunctionType * GetFunctionType(const CGFunctionInfo &Info)
GetFunctionType - Get the LLVM function type for.
const CGFunctionInfo & arrangeDeviceKernelCallerDeclaration(QualType resultType, const FunctionArgList &args)
A device kernel caller function is an offload device entry point function with a target device depend...
Represents a function declaration or definition.
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
parameter_const_iterator param_end() const
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
parameter_const_iterator param_begin() const
OutlinedFunctionDecl * getOutlinedFunctionDecl()
Retrieve the outlined function declaration.
const std::string & GetKernelName() const
The JSON file list parser is used to communicate input to InstallAPI.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
U cast(CodeGen::Address addr)