clang 22.0.0git
CGOpenMPRuntimeGPU.h
Go to the documentation of this file.
1//===------ CGOpenMPRuntimeGPU.h - Interface to OpenMP GPU Runtimes ------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This provides a generalized class for OpenMP runtime code generation
10// specialized by GPU targets NVPTX and AMDGCN.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_LIB_CODEGEN_CGOPENMPRUNTIMEGPU_H
15#define LLVM_CLANG_LIB_CODEGEN_CGOPENMPRUNTIMEGPU_H
16
17#include "CGOpenMPRuntime.h"
18#include "CodeGenFunction.h"
20
21namespace clang {
22namespace CodeGen {
23
25public:
26 /// Defines the execution mode.
28 /// SPMD execution mode (all threads are worker threads).
30 /// Non-SPMD execution mode (1 master thread, others are workers).
32 /// Unknown execution mode (orphaned directive).
34 };
35
36 /// Target codegen is specialized based on two data-sharing modes: CUDA, in
37 /// which the local variables are actually global threadlocal, and Generic, in
38 /// which the local variables are placed in global memory if they may escape
39 /// their declaration context.
41 /// CUDA data sharing mode.
43 /// Generic data-sharing mode.
45 };
46
47private:
48 /// Parallel outlined function work for workers to execute.
50
51 struct EntryFunctionState {
53 };
54
55 ExecutionMode getExecutionMode() const;
56
57 DataSharingMode getDataSharingMode() const;
58
59 /// Get barrier to synchronize all threads in a block.
60 void syncCTAThreads(CodeGenFunction &CGF);
61
62 /// Helper for target directive initialization.
63 void emitKernelInit(const OMPExecutableDirective &D, CodeGenFunction &CGF,
64 EntryFunctionState &EST, bool IsSPMD);
65
66 /// Helper for target directive finalization.
67 void emitKernelDeinit(CodeGenFunction &CGF, EntryFunctionState &EST,
68 bool IsSPMD);
69
70 /// Helper for generic variables globalization prolog.
71 void emitGenericVarsProlog(CodeGenFunction &CGF, SourceLocation Loc);
72
73 /// Helper for generic variables globalization epilog.
74 void emitGenericVarsEpilog(CodeGenFunction &CGF);
75
76 //
77 // Base class overrides.
78 //
79
80 /// Emit outlined function specialized for the Fork-Join
81 /// programming model for applicable target directives on the NVPTX device.
82 /// \param D Directive to emit.
83 /// \param ParentName Name of the function that encloses the target region.
84 /// \param OutlinedFn Outlined function value to be defined by this call.
85 /// \param OutlinedFnID Outlined function ID value to be defined by this call.
86 /// \param IsOffloadEntry True if the outlined function is an offload entry.
87 /// An outlined function may not be an entry if, e.g. the if clause always
88 /// evaluates to false.
89 void emitNonSPMDKernel(const OMPExecutableDirective &D, StringRef ParentName,
90 llvm::Function *&OutlinedFn,
91 llvm::Constant *&OutlinedFnID, bool IsOffloadEntry,
92 const RegionCodeGenTy &CodeGen);
93
94 /// Emit outlined function specialized for the Single Program
95 /// Multiple Data programming model for applicable target directives on the
96 /// NVPTX device.
97 /// \param D Directive to emit.
98 /// \param ParentName Name of the function that encloses the target region.
99 /// \param OutlinedFn Outlined function value to be defined by this call.
100 /// \param OutlinedFnID Outlined function ID value to be defined by this call.
101 /// \param IsOffloadEntry True if the outlined function is an offload entry.
102 /// \param CodeGen Object containing the target statements.
103 /// An outlined function may not be an entry if, e.g. the if clause always
104 /// evaluates to false.
105 void emitSPMDKernel(const OMPExecutableDirective &D, StringRef ParentName,
106 llvm::Function *&OutlinedFn,
107 llvm::Constant *&OutlinedFnID, bool IsOffloadEntry,
108 const RegionCodeGenTy &CodeGen);
109
110 /// Emit outlined function for 'target' directive on the NVPTX
111 /// device.
112 /// \param D Directive to emit.
113 /// \param ParentName Name of the function that encloses the target region.
114 /// \param OutlinedFn Outlined function value to be defined by this call.
115 /// \param OutlinedFnID Outlined function ID value to be defined by this call.
116 /// \param IsOffloadEntry True if the outlined function is an offload entry.
117 /// An outlined function may not be an entry if, e.g. the if clause always
118 /// evaluates to false.
119 void emitTargetOutlinedFunction(const OMPExecutableDirective &D,
120 StringRef ParentName,
121 llvm::Function *&OutlinedFn,
122 llvm::Constant *&OutlinedFnID,
123 bool IsOffloadEntry,
124 const RegionCodeGenTy &CodeGen) override;
125
126protected:
127 /// Check if the default location must be constant.
128 /// Constant for NVPTX for better optimization.
129 bool isDefaultLocationConstant() const override { return true; }
130
131public:
133
134 bool isGPU() const override { return true; };
135
136 /// Declare generalized virtual functions which need to be defined
137 /// by all specializations of OpenMPGPURuntime Targets like AMDGCN
138 /// and NVPTX.
139
140 /// Check if the variable length declaration is delayed:
142 const VarDecl *VD) const override;
143
144 /// Get call to __kmpc_alloc_shared
145 std::pair<llvm::Value *, llvm::Value *>
146 getKmpcAllocShared(CodeGenFunction &CGF, const VarDecl *VD) override;
147
148 /// Get call to __kmpc_free_shared
150 CodeGenFunction &CGF,
151 const std::pair<llvm::Value *, llvm::Value *> &AddrSizePair) override;
152
153 /// Get the id of the current thread on the GPU.
154 llvm::Value *getGPUThreadID(CodeGenFunction &CGF);
155
156 /// Get the maximum number of threads in a block of the GPU.
157 llvm::Value *getGPUNumThreads(CodeGenFunction &CGF);
158
159 /// Emit call to void __kmpc_push_proc_bind(ident_t *loc, kmp_int32
160 /// global_tid, int proc_bind) to generate code for 'proc_bind' clause.
162 llvm::omp::ProcBindKind ProcBind,
163 SourceLocation Loc) override;
164
165 /// Emits call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32
166 /// global_tid, kmp_int32 num_threads) to generate code for 'num_threads'
167 /// clause.
168 /// If the modifier 'strict' is given:
169 /// Emits call to void __kmpc_push_num_threads_strict(ident_t *loc, kmp_int32
170 /// global_tid, kmp_int32 num_threads, int severity, const char *message) to
171 /// generate code for 'num_threads' clause with 'strict' modifier.
172 /// \param NumThreads An integer value of threads.
174 CodeGenFunction &CGF, llvm::Value *NumThreads, SourceLocation Loc,
176 OpenMPSeverityClauseKind Severity = OMPC_SEVERITY_fatal,
177 const Expr *Message = nullptr) override;
178
179 /// This function ought to emit, in the general case, a call to
180 // the openmp runtime kmpc_push_num_teams. In NVPTX backend it is not needed
181 // as these numbers are obtained through the PTX grid and block configuration.
182 /// \param NumTeams An integer expression of teams.
183 /// \param ThreadLimit An integer expression of threads.
184 void emitNumTeamsClause(CodeGenFunction &CGF, const Expr *NumTeams,
185 const Expr *ThreadLimit, SourceLocation Loc) override;
186
187 /// Emits inlined function for the specified OpenMP parallel
188 // directive.
189 /// \a D. This outlined function has type void(*)(kmp_int32 *ThreadID,
190 /// kmp_int32 BoundID, struct context_vars*).
191 /// \param CGF Reference to current CodeGenFunction.
192 /// \param D OpenMP directive.
193 /// \param ThreadIDVar Variable for thread id in the current OpenMP region.
194 /// \param InnermostKind Kind of innermost directive (for simple directives it
195 /// is a directive itself, for combined - its innermost directive).
196 /// \param CodeGen Code generation sequence for the \a D directive.
197 llvm::Function *emitParallelOutlinedFunction(
199 const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind,
200 const RegionCodeGenTy &CodeGen) override;
201
202 /// Emits inlined function for the specified OpenMP teams
203 // directive.
204 /// \a D. This outlined function has type void(*)(kmp_int32 *ThreadID,
205 /// kmp_int32 BoundID, struct context_vars*).
206 /// \param CGF Reference to current CodeGenFunction.
207 /// \param D OpenMP directive.
208 /// \param ThreadIDVar Variable for thread id in the current OpenMP region.
209 /// \param InnermostKind Kind of innermost directive (for simple directives it
210 /// is a directive itself, for combined - its innermost directive).
211 /// \param CodeGen Code generation sequence for the \a D directive.
212 llvm::Function *emitTeamsOutlinedFunction(
214 const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind,
215 const RegionCodeGenTy &CodeGen) override;
216
217 /// Emits code for teams call of the \a OutlinedFn with
218 /// variables captured in a record which address is stored in \a
219 /// CapturedStruct.
220 /// \param OutlinedFn Outlined function to be run by team masters. Type of
221 /// this function is void(*)(kmp_int32 *, kmp_int32, struct context_vars*).
222 /// \param CapturedVars A pointer to the record with the references to
223 /// variables used in \a OutlinedFn function.
224 ///
226 SourceLocation Loc, llvm::Function *OutlinedFn,
227 ArrayRef<llvm::Value *> CapturedVars) override;
228
229 /// Emits code for parallel or serial call of the \a OutlinedFn with
230 /// variables captured in a record which address is stored in \a
231 /// CapturedStruct.
232 /// \param OutlinedFn Outlined function to be run in parallel threads. Type of
233 /// this function is void(*)(kmp_int32 *, kmp_int32, struct context_vars*).
234 /// \param CapturedVars A pointer to the record with the references to
235 /// variables used in \a OutlinedFn function.
236 /// \param IfCond Condition in the associated 'if' clause, if it was
237 /// specified, nullptr otherwise.
238 /// \param NumThreads The value corresponding to the num_threads clause, if
239 /// any, or nullptr.
240 /// \param NumThreadsModifier The modifier of the num_threads clause, if
241 /// any, ignored otherwise.
242 /// \param Severity The severity corresponding to the num_threads clause, if
243 /// any, ignored otherwise.
244 /// \param Message The message string corresponding to the num_threads clause,
245 /// if any, or nullptr.
247 llvm::Function *OutlinedFn,
248 ArrayRef<llvm::Value *> CapturedVars,
249 const Expr *IfCond, llvm::Value *NumThreads,
250 OpenMPNumThreadsClauseModifier NumThreadsModifier =
252 OpenMPSeverityClauseKind Severity = OMPC_SEVERITY_fatal,
253 const Expr *Message = nullptr) override;
254
255 /// Emit an implicit/explicit barrier for OpenMP threads.
256 /// \param Kind Directive for which this implicit barrier call must be
257 /// generated. Must be OMPD_barrier for explicit barrier generation.
258 /// \param EmitChecks true if need to emit checks for cancellation barriers.
259 /// \param ForceSimpleCall true simple barrier call must be emitted, false if
260 /// runtime class decides which one to emit (simple or with cancellation
261 /// checks).
262 ///
264 OpenMPDirectiveKind Kind, bool EmitChecks = true,
265 bool ForceSimpleCall = false) override;
266
267 /// Emits a critical region.
268 /// \param CriticalName Name of the critical region.
269 /// \param CriticalOpGen Generator for the statement associated with the given
270 /// critical region.
271 /// \param Hint Value of the 'hint' clause (optional).
272 void emitCriticalRegion(CodeGenFunction &CGF, StringRef CriticalName,
273 const RegionCodeGenTy &CriticalOpGen,
275 const Expr *Hint = nullptr) override;
276
277 /// Emit a code for reduction clause.
278 ///
279 /// \param Privates List of private copies for original reduction arguments.
280 /// \param LHSExprs List of LHS in \a ReductionOps reduction operations.
281 /// \param RHSExprs List of RHS in \a ReductionOps reduction operations.
282 /// \param ReductionOps List of reduction operations in form 'LHS binop RHS'
283 /// or 'operator binop(LHS, RHS)'.
284 /// \param Options List of options for reduction codegen:
285 /// WithNowait true if parent directive has also nowait clause, false
286 /// otherwise.
287 /// SimpleReduction Emit reduction operation only. Used for omp simd
288 /// directive on the host.
289 /// ReductionKind The kind of reduction to perform.
291 ArrayRef<const Expr *> Privates,
292 ArrayRef<const Expr *> LHSExprs,
293 ArrayRef<const Expr *> RHSExprs,
294 ArrayRef<const Expr *> ReductionOps,
295 ReductionOptionsTy Options) override;
296
297 /// Translates the native parameter of outlined function if this is required
298 /// for target.
299 /// \param FD Field decl from captured record for the parameter.
300 /// \param NativeParam Parameter itself.
301 const VarDecl *translateParameter(const FieldDecl *FD,
302 const VarDecl *NativeParam) const override;
303
304 /// Gets the address of the native argument basing on the address of the
305 /// target-specific parameter.
306 /// \param NativeParam Parameter itself.
307 /// \param TargetParam Corresponding target-specific parameter.
308 Address getParameterAddress(CodeGenFunction &CGF, const VarDecl *NativeParam,
309 const VarDecl *TargetParam) const override;
310
311 /// Emits call of the outlined function with the provided arguments,
312 /// translating these arguments to correct target-specific arguments.
313 void
315 llvm::FunctionCallee OutlinedFn,
316 ArrayRef<llvm::Value *> Args = {}) const override;
317
318 /// Emits OpenMP-specific function prolog.
319 /// Required for device constructs.
320 void emitFunctionProlog(CodeGenFunction &CGF, const Decl *D) override;
321
322 /// Gets the OpenMP-specific address of the local variable.
323 Address getAddressOfLocalVariable(CodeGenFunction &CGF,
324 const VarDecl *VD) override;
325
326 /// Cleans up references to the objects in finished function.
327 ///
328 void functionFinished(CodeGenFunction &CGF) override;
329
330 /// Choose a default value for the dist_schedule clause.
331 void getDefaultDistScheduleAndChunk(CodeGenFunction &CGF,
332 const OMPLoopDirective &S, OpenMPDistScheduleClauseKind &ScheduleKind,
333 llvm::Value *&Chunk) const override;
334
335 /// Choose a default value for the schedule clause.
336 void getDefaultScheduleAndChunk(CodeGenFunction &CGF,
337 const OMPLoopDirective &S, OpenMPScheduleClauseKind &ScheduleKind,
338 const Expr *&ChunkExpr) const override;
339
340 /// Adjust some parameters for the target-based directives, like addresses of
341 /// the variables captured by reference in lambdas.
343 CodeGenFunction &CGF, const OMPExecutableDirective &D) const override;
344
345 /// Perform check on requires decl to ensure that target architecture
346 /// supports unified addressing
347 void processRequiresDirective(const OMPRequiresDecl *D) override;
348
349 /// Checks if the variable has associated OMPAllocateDeclAttr attribute with
350 /// the predefined allocator and translates it into the corresponding address
351 /// space.
352 bool hasAllocateAttributeForGlobalVar(const VarDecl *VD, LangAS &AS) override;
353
354private:
355 /// Track the execution mode when codegening directives within a target
356 /// region. The appropriate mode (SPMD/NON-SPMD) is set on entry to the
357 /// target region and used by containing directives such as 'parallel'
358 /// to emit optimized code.
359 ExecutionMode CurrentExecutionMode = EM_Unknown;
360
361 /// Track the data sharing mode when codegening directives within a target
362 /// region.
363 DataSharingMode CurrentDataSharingMode = DataSharingMode::DS_Generic;
364
365 /// true if currently emitting code for target/teams/distribute region, false
366 /// - otherwise.
367 bool IsInTTDRegion = false;
368
369 /// Map between an outlined function and its wrapper.
370 llvm::DenseMap<llvm::Function *, llvm::Function *> WrapperFunctionsMap;
371
372 /// Emit function which wraps the outline parallel region
373 /// and controls the parameters which are passed to this function.
374 /// The wrapper ensures that the outlined function is called
375 /// with the correct arguments when data is shared.
376 llvm::Function *createParallelDataSharingWrapper(
377 llvm::Function *OutlinedParallelFn, const OMPExecutableDirective &D);
378
379 /// The data for the single globalized variable.
380 struct MappedVarData {
381 /// Corresponding field in the global record.
382 llvm::Value *GlobalizedVal = nullptr;
383 /// Corresponding address.
384 Address PrivateAddr = Address::invalid();
385 };
386 /// The map of local variables to their addresses in the global memory.
387 using DeclToAddrMapTy = llvm::MapVector<const Decl *, MappedVarData>;
388 /// Set of the parameters passed by value escaping OpenMP context.
389 using EscapedParamsTy = llvm::SmallPtrSet<const Decl *, 4>;
390 struct FunctionData {
391 DeclToAddrMapTy LocalVarData;
392 EscapedParamsTy EscapedParameters;
393 llvm::SmallVector<const ValueDecl*, 4> EscapedVariableLengthDecls;
394 llvm::SmallVector<const ValueDecl *, 4> DelayedVariableLengthDecls;
396 EscapedVariableLengthDeclsAddrs;
397 std::unique_ptr<CodeGenFunction::OMPMapVars> MappedParams;
398 };
399 /// Maps the function to the list of the globalized variables with their
400 /// addresses.
401 llvm::SmallDenseMap<llvm::Function *, FunctionData> FunctionGlobalizedDecls;
402 /// List of the records with the list of fields for the reductions across the
403 /// teams. Used to build the intermediate buffer for the fast teams
404 /// reductions.
405 /// All the records are gathered into a union `union.type` is created.
407 /// Pair of the Non-SPMD team and all reductions variables in this team
408 /// region.
409 std::pair<const Decl *, llvm::SmallVector<const ValueDecl *, 4>>
410 TeamAndReductions;
411};
412
413} // CodeGen namespace.
414} // clang namespace.
415
416#endif // LLVM_CLANG_LIB_CODEGEN_CGOPENMPRUNTIMEGPU_H
const Decl * D
enum clang::sema::@1840::IndirectLocalPathEntry::EntryKind Kind
SourceLocation Loc
Definition: SemaObjC.cpp:754
This file defines OpenMP AST classes for executable directives and clauses.
Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...
Definition: Address.h:128
static Address invalid()
Definition: Address.h:176
llvm::Function * emitTeamsOutlinedFunction(CodeGenFunction &CGF, const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) override
Emits inlined function for the specified OpenMP teams.
void emitProcBindClause(CodeGenFunction &CGF, llvm::omp::ProcBindKind 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 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.
DataSharingMode
Target codegen is specialized based on two data-sharing modes: CUDA, in which the local variables are...
@ DS_CUDA
CUDA data sharing mode.
@ DS_Generic
Generic data-sharing mode.
void getDefaultDistScheduleAndChunk(CodeGenFunction &CGF, const OMPLoopDirective &S, OpenMPDistScheduleClauseKind &ScheduleKind, llvm::Value *&Chunk) const override
Choose a default value for the dist_schedule clause.
Address getAddressOfLocalVariable(CodeGenFunction &CGF, const VarDecl *VD) override
Gets the OpenMP-specific address of the local variable.
void emitFunctionProlog(CodeGenFunction &CGF, const Decl *D) override
Emits OpenMP-specific function prolog.
bool isDefaultLocationConstant() const override
Check if the default location must be constant.
void getDefaultScheduleAndChunk(CodeGenFunction &CGF, const OMPLoopDirective &S, OpenMPScheduleClauseKind &ScheduleKind, const Expr *&ChunkExpr) const override
Choose a default value for the schedule clause.
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.
void emitCriticalRegion(CodeGenFunction &CGF, StringRef CriticalName, const RegionCodeGenTy &CriticalOpGen, SourceLocation Loc, const Expr *Hint=nullptr) override
Emits a critical region.
void emitTeamsCall(CodeGenFunction &CGF, const OMPExecutableDirective &D, SourceLocation Loc, llvm::Function *OutlinedFn, ArrayRef< llvm::Value * > CapturedVars) override
Emits code for teams call of the OutlinedFn with variables captured in a record which address is stor...
bool hasAllocateAttributeForGlobalVar(const VarDecl *VD, LangAS &AS) override
Checks if the variable has associated OMPAllocateDeclAttr attribute with the predefined allocator and...
void getKmpcFreeShared(CodeGenFunction &CGF, const std::pair< llvm::Value *, llvm::Value * > &AddrSizePair) override
Get call to __kmpc_free_shared.
llvm::Function * emitParallelOutlinedFunction(CodeGenFunction &CGF, const OMPExecutableDirective &D, const VarDecl *ThreadIDVar, OpenMPDirectiveKind InnermostKind, const RegionCodeGenTy &CodeGen) override
Emits inlined function for the specified OpenMP parallel.
void functionFinished(CodeGenFunction &CGF) override
Cleans up references to the objects in finished function.
llvm::Value * getGPUThreadID(CodeGenFunction &CGF)
Get the id of the current thread on the GPU.
void emitNumThreadsClause(CodeGenFunction &CGF, llvm::Value *NumThreads, SourceLocation Loc, OpenMPNumThreadsClauseModifier Modifier=OMPC_NUMTHREADS_unknown, OpenMPSeverityClauseKind Severity=OMPC_SEVERITY_fatal, const Expr *Message=nullptr) override
Emits call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_threads)...
void processRequiresDirective(const OMPRequiresDecl *D) override
Perform check on requires decl to ensure that target architecture supports unified addressing.
bool isDelayedVariableLengthDecl(CodeGenFunction &CGF, const VarDecl *VD) const override
Declare generalized virtual functions which need to be defined by all specializations of OpenMPGPURun...
void emitOutlinedFunctionCall(CodeGenFunction &CGF, SourceLocation Loc, llvm::FunctionCallee OutlinedFn, ArrayRef< llvm::Value * > Args={}) const override
Emits call of the outlined function with the provided arguments, translating these arguments to corre...
Address getParameterAddress(CodeGenFunction &CGF, const VarDecl *NativeParam, const VarDecl *TargetParam) const override
Gets the address of the native argument basing on the address of the target-specific parameter.
ExecutionMode
Defines the execution mode.
@ EM_NonSPMD
Non-SPMD execution mode (1 master thread, others are workers).
@ EM_Unknown
Unknown execution mode (orphaned directive).
@ EM_SPMD
SPMD execution mode (all threads are worker threads).
void emitBarrierCall(CodeGenFunction &CGF, SourceLocation Loc, OpenMPDirectiveKind Kind, bool EmitChecks=true, bool ForceSimpleCall=false) override
Emit an implicit/explicit barrier for OpenMP threads.
llvm::Value * getGPUNumThreads(CodeGenFunction &CGF)
Get the maximum number of threads in a block of the GPU.
const VarDecl * translateParameter(const FieldDecl *FD, const VarDecl *NativeParam) const override
Translates the native parameter of outlined function if this is required for target.
std::pair< llvm::Value *, llvm::Value * > getKmpcAllocShared(CodeGenFunction &CGF, const VarDecl *VD) override
Get call to __kmpc_alloc_shared.
bool isGPU() const override
Returns true if the current target is a GPU.
void emitParallelCall(CodeGenFunction &CGF, SourceLocation Loc, llvm::Function *OutlinedFn, ArrayRef< llvm::Value * > CapturedVars, const Expr *IfCond, llvm::Value *NumThreads, OpenMPNumThreadsClauseModifier NumThreadsModifier=OMPC_NUMTHREADS_unknown, OpenMPSeverityClauseKind Severity=OMPC_SEVERITY_fatal, const Expr *Message=nullptr) override
Emits code for parallel or serial call of the OutlinedFn with variables captured in a record which ad...
void adjustTargetSpecificDataForLambdas(CodeGenFunction &CGF, const OMPExecutableDirective &D) const override
Adjust some parameters for the target-based directives, like addresses of the variables captured by r...
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
This class organizes the cross-function state that is used while generating LLVM code.
Class provides a way to call simple version of codegen for OpenMP region, or an advanced with possibl...
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
This represents one expression.
Definition: Expr.h:112
Represents a member of a struct/union/class.
Definition: Decl.h:3157
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:266
This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc....
Definition: StmtOpenMP.h:1004
This represents '#pragma omp requires...' directive.
Definition: DeclOpenMP.h:417
Encodes a location in the source.
Represents a variable declaration or definition.
Definition: Decl.h:925
The JSON file list parser is used to communicate input to InstallAPI.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Definition: OpenMPKinds.h:25
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
Definition: OpenMPKinds.h:104
OpenMPSeverityClauseKind
OpenMP attributes for 'severity' clause.
Definition: OpenMPKinds.h:143
LangAS
Defines the address space values used by the address space qualifier of QualType.
Definition: AddressSpaces.h:25
OpenMPNumThreadsClauseModifier
Definition: OpenMPKinds.h:226
@ OMPC_NUMTHREADS_unknown
Definition: OpenMPKinds.h:229
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
Definition: OpenMPKinds.h:31