15 #ifndef LLVM_CLANG_LIB_CODEGEN_CGOPENMPRUNTIMENVPTX_H
16 #define LLVM_CLANG_LIB_CODEGEN_CGOPENMPRUNTIMENVPTX_H
21 #include "llvm/IR/CallSite.h"
31 struct EntryFunctionState {
32 llvm::BasicBlock *ExitBB =
nullptr;
35 class WorkerFunctionState {
37 llvm::Function *WorkerFn;
46 bool isInSpmdExecutionMode()
const;
49 void emitWorkerFunction(WorkerFunctionState &WST);
56 void emitGenericEntryHeader(
CodeGenFunction &CGF, EntryFunctionState &EST,
57 WorkerFunctionState &WST);
61 void emitGenericEntryFooter(
CodeGenFunction &CGF, EntryFunctionState &EST);
68 void emitSpmdEntryFooter(
CodeGenFunction &CGF, EntryFunctionState &EST);
76 void createOffloadEntry(llvm::Constant *
ID, llvm::Constant *Addr,
77 uint64_t Size, int32_t Flags = 0)
override;
89 llvm::Function *&OutlinedFn,
90 llvm::Constant *&OutlinedFnID,
bool IsOffloadEntry,
105 llvm::Function *&OutlinedFn,
106 llvm::Constant *&OutlinedFnID,
bool IsOffloadEntry,
119 StringRef ParentName,
120 llvm::Function *&OutlinedFn,
121 llvm::Constant *&OutlinedFnID,
161 return "__omp_outlined__";
243 const Expr *IfCond)
override;
293 #endif // LLVM_CLANG_LIB_CODEGEN_CGOPENMPRUNTIMENVPTX_H
Generic codegen to support fork-join model.
llvm::Value * emitParallelOutlinedFunction(const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) override
Emits inlined function for the specified OpenMP parallel.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
virtual void emitNumThreadsClause(CodeGenFunction &CGF, llvm::Value *NumThreads, SourceLocation Loc) override
Emits call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_threads)...
void emitNumTeamsClause(CodeGenFunction &CGF, const Expr *NumTeams, const Expr *ThreadLimit, SourceLocation Loc) override
This function ought to emit, in the general case, a call to.
Expr - This represents one expression.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
virtual void emitReduction(CodeGenFunction &CGF, SourceLocation Loc, ArrayRef< const Expr * > Privates, ArrayRef< const Expr * > LHSExprs, ArrayRef< const Expr * > RHSExprs, ArrayRef< const Expr * > ReductionOps, ReductionOptionsTy Options) override
Emit a code for reduction clause.
llvm::Value * emitTeamsOutlinedFunction(const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) override
Emits inlined function for the specified OpenMP teams.
const MatchFinder::MatchFinderOptions & Options
Encodes a location in the source.
This is a basic class for representing single OpenMP executable directive.
StringRef getOutlinedHelperName() const override
Get the function name of an outlined region.
OpenMPDirectiveKind
OpenMP directives.
void emitParallelCall(CodeGenFunction &CGF, SourceLocation Loc, llvm::Value *OutlinedFn, ArrayRef< llvm::Value * > CapturedVars, const Expr *IfCond) override
Emits code for parallel or serial call of the OutlinedFn with variables captured in a record which ad...
CGFunctionInfo - Class to encapsulate the information about a function definition.
This class organizes the cross-function state that is used while generating LLVM code.
Single Program Multiple Data.
Class provides a way to call simple version of codegen for OpenMP region, or an advanced with possibl...
llvm::Constant * createNVPTXRuntimeFunction(unsigned Function)
Returns specified OpenMP runtime function for the current OpenMP implementation.
This file defines OpenMP AST classes for executable directives and clauses.
ExecutionMode
Target codegen is specialized based on two programming models: the 'generic' fork-join model of OpenM...
Privates[]
Gets the list of initial values for linear variables.
virtual void emitProcBindClause(CodeGenFunction &CGF, OpenMPProcBindClauseKind ProcBind, SourceLocation Loc) override
Emit call to void __kmpc_push_proc_bind(ident_t *loc, kmp_int32 global_tid, int proc_bind) to generat...
void emitTeamsCall(CodeGenFunction &CGF, const OMPExecutableDirective &D, SourceLocation Loc, llvm::Value *OutlinedFn, ArrayRef< llvm::Value * > CapturedVars) override
Emits code for teams call of the OutlinedFn with variables captured in a record which address is stor...
CGOpenMPRuntimeNVPTX(CodeGenModule &CGM)