17#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
20#include "llvm/ADT/STLFunctionalExtras.h"
21#include "llvm/Frontend/OpenMP/OMP.h"
22#include "llvm/Frontend/OpenMP/OMPConstants.h"
29 return mlir::failure();
34 return mlir::failure();
39static mlir::LogicalResult
41 omp::ConstructQueue::const_iterator item) {
42 mlir::LogicalResult res = mlir::success();
43 for (llvm::omp::Clause synth : item->synthesized) {
45 (llvm::Twine(
"OpenMP synthesized '") +
46 llvm::omp::getOpenMPClauseName(synth) +
47 "' clause from construct decomposition")
49 res = mlir::failure();
54static mlir::LogicalResult
58 mlir::omp::ParallelOperands &clauseOps) {
60 ce.
emitIf(clauseOps, llvm::omp::Directive::OMPD_parallel);
67 OMPPrivateClause, OMPReductionClause,
69 llvm::omp::Directive::OMPD_parallel);
72template <
typename DirectiveTy>
73static mlir::LogicalResult
76 omp::ConstructQueue::const_iterator item, mlir::Location begin,
77 mlir::Location end,
const mlir::omp::ParallelOperands &clauseOps,
78 llvm::function_ref<mlir::LogicalResult()>
emitBody) {
82 auto parallelOp = mlir::omp::ParallelOp::create(builder, begin, clauseOps);
84 parallelOp.setCombined(
true);
86 mlir::Block &block = parallelOp.getRegion().emplaceBlock();
87 mlir::OpBuilder::InsertionGuard guard(builder);
88 builder.setInsertionPointToEnd(&block);
96 cgm.
errorNYI(s.getBeginLoc(),
"OpenMP Parallel with Cancel");
97 return mlir::failure();
100 assert(!s.getTaskReductionRefExpr() &&
101 "reduction(task: ...) should already be rejected as NYI");
103 mlir::LogicalResult res =
emitBody();
104 mlir::omp::TerminatorOp::create(builder, end);
110 mlir::Location begin =
getLoc(s.getBeginLoc());
111 mlir::Location end =
getLoc(s.getEndLoc());
115 omp::ConstructQueue::const_iterator item = queue.begin();
118 return mlir::failure();
120 mlir::omp::ParallelOperands clauseOps;
122 item->clauses, clauseOps)))
123 return mlir::failure();
126 *
this, s, queue, item, begin, end, clauseOps,
127 [&]() -> mlir::LogicalResult {
138 return mlir::failure();
143 "OpenMP OMPTaskyieldDirective");
144 return mlir::failure();
148 mlir::omp::BarrierOp::create(builder,
getLoc(s.getBeginLoc()));
149 assert(s.clauses().empty() &&
"omp barrier doesn't support clauses");
150 return mlir::success();
155 return mlir::failure();
160 return mlir::failure();
165 return mlir::failure();
170 return mlir::failure();
175 return mlir::failure();
180 return mlir::failure();
185 return mlir::failure();
190 return mlir::failure();
195 return mlir::failure();
200 return mlir::failure();
205 return mlir::failure();
210 return mlir::failure();
215 return mlir::failure();
220 "OpenMP OMPParallelForDirective");
221 return mlir::failure();
226 "OpenMP OMPParallelForSimdDirective");
227 return mlir::failure();
232 "OpenMP OMPParallelMasterDirective");
233 return mlir::failure();
238 "OpenMP OMPParallelSectionsDirective");
239 return mlir::failure();
244 return mlir::failure();
249 "OpenMP OMPTaskgroupDirective");
250 return mlir::failure();
255 return mlir::failure();
260 return mlir::failure();
265 return mlir::failure();
270 "OpenMP OMPOrderedStandaloneDirective");
271 return mlir::failure();
276 "OpenMP OMPOrderedBlockAssocDirective");
277 return mlir::failure();
282 return mlir::failure();
286static mlir::LogicalResult
290 const CapturedStmt *cs = s.getCapturedStmt(llvm::omp::OMPD_target);
291 mlir::LogicalResult res = mlir::success();
292 for (
const auto &capture : cs->
captures()) {
293 if (capture.capturesThis()) {
295 "OpenMP target capture of 'this' pointer");
296 res = mlir::failure();
299 if (capture.capturesVariableByCopy()) {
301 "OpenMP target capture by copy");
302 res = mlir::failure();
305 if (capture.capturesVariableArrayType()) {
308 "OpenMP target capture of variable-length array type");
309 res = mlir::failure();
312 if (capture.capturesVariable()) {
313 const VarDecl *vd = capture.getCapturedVar();
314 if (llvm::is_contained(mapSyms, vd))
318 "OpenMP target implicit by-ref capture");
319 res = mlir::failure();
325static mlir::LogicalResult
329 mlir::omp::TargetExtOperands &clauseOps,
332 ce.
emitMap(clauseOps, &mapSyms);
340 llvm::omp::Directive::OMPD_target);
343template <
typename DirectiveTy>
344static mlir::LogicalResult
347 omp::ConstructQueue::const_iterator item, mlir::Location begin,
348 mlir::Location end, mlir::omp::TargetExtOperands &clauseOps,
350 llvm::function_ref<mlir::LogicalResult()>
emitBody) {
354 return mlir::failure();
357 clauseOps.kernelType = mlir::omp::TargetExecModeAttr::get(
360 auto targetOp = mlir::omp::TargetOp::create(builder, begin, clauseOps);
362 targetOp.setCombined(
true);
364 mlir::Block &block = targetOp.getRegion().emplaceBlock();
365 for (mlir::Value mapVar : clauseOps.mapVars)
366 block.addArgument(mapVar.getType(), begin);
368 mlir::OpBuilder::InsertionGuard guard(builder);
369 builder.setInsertionPointToEnd(&block);
374 for (
auto [idx, vd] : llvm::enumerate(mapSyms)) {
376 savedAddrs.push_back({vd, origAddr});
377 mlir::Value blockArg = block.getArgument(idx);
381 mlir::LogicalResult res =
emitBody();
382 mlir::omp::TerminatorOp::create(builder, end);
384 for (
auto &[vd, addr] : savedAddrs)
392 mlir::Location begin =
getLoc(s.getBeginLoc());
393 mlir::Location end =
getLoc(s.getEndLoc());
397 omp::ConstructQueue::const_iterator item = queue.begin();
400 return mlir::failure();
402 mlir::omp::TargetExtOperands clauseOps;
405 item->clauses, clauseOps, mapSyms)))
406 return mlir::failure();
408 return emitTargetOp(*
this, s, queue, item, begin, end, clauseOps, mapSyms,
409 [&]() -> mlir::LogicalResult {
411 s.getCapturedStmt(llvm::omp::OMPD_target);
419 return mlir::failure();
424 "OpenMP OMPCancellationPointDirective");
425 return mlir::failure();
430 return mlir::failure();
435 "OpenMP OMPTargetDataDirective");
436 return mlir::failure();
441 "OpenMP OMPTargetEnterDataDirective");
442 return mlir::failure();
447 "OpenMP OMPTargetExitDataDirective");
448 return mlir::failure();
452 mlir::Location begin =
getLoc(s.getBeginLoc());
453 mlir::Location end =
getLoc(s.getEndLoc());
457 omp::ConstructQueue::const_iterator targetItem = queue.begin();
458 assert(targetItem->id == llvm::omp::OMPD_target &&
459 "expected 'target' to be the outermost leaf");
462 return mlir::failure();
464 mlir::omp::TargetExtOperands targetOps;
467 targetItem->clauses, targetOps, mapSyms)))
468 return mlir::failure();
471 *
this, s, queue, targetItem, begin, end, targetOps, mapSyms,
472 [&]() -> mlir::LogicalResult {
473 omp::ConstructQueue::const_iterator parallelItem =
474 std::next(targetItem);
475 assert(parallelItem != queue.end() &&
476 parallelItem->id == llvm::omp::OMPD_parallel &&
477 "expected a 'parallel' leaf nested in 'target'");
480 return mlir::failure();
482 mlir::omp::ParallelOperands parallelOps;
484 begin, parallelItem->clauses,
486 return mlir::failure();
489 parallelOps, [&]() -> mlir::LogicalResult {
491 s.getCapturedStmt(llvm::omp::OMPD_parallel);
500 "OpenMP OMPTargetParallelForDirective");
501 return mlir::failure();
506 return mlir::failure();
511 "OpenMP OMPTaskLoopSimdDirective");
512 return mlir::failure();
517 "OpenMP OMPMaskedTaskLoopDirective");
518 return mlir::failure();
523 "OpenMP OMPMaskedTaskLoopSimdDirective");
524 return mlir::failure();
529 "OpenMP OMPMasterTaskLoopDirective");
530 return mlir::failure();
535 "OpenMP OMPMasterTaskLoopSimdDirective");
536 return mlir::failure();
541 "OpenMP OMPParallelGenericLoopDirective");
542 return mlir::failure();
547 "OpenMP OMPParallelMaskedDirective");
548 return mlir::failure();
553 "OpenMP OMPParallelMaskedTaskLoopDirective");
554 return mlir::failure();
559 "OpenMP OMPParallelMaskedTaskLoopSimdDirective");
560 return mlir::failure();
565 "OpenMP OMPParallelMasterTaskLoopDirective");
566 return mlir::failure();
571 "OpenMP OMPParallelMasterTaskLoopSimdDirective");
572 return mlir::failure();
577 "OpenMP OMPDistributeDirective");
578 return mlir::failure();
583 "OpenMP OMPDistributeParallelForDirective");
584 return mlir::failure();
589 "OpenMP OMPDistributeParallelForSimdDirective");
590 return mlir::failure();
595 "OpenMP OMPDistributeSimdDirective");
596 return mlir::failure();
601 "OpenMP OMPTargetParallelGenericLoopDirective");
602 return mlir::failure();
607 "OpenMP OMPTargetParallelForSimdDirective");
608 return mlir::failure();
613 "OpenMP OMPTargetSimdDirective");
614 return mlir::failure();
619 "OpenMP OMPTargetTeamsGenericLoopDirective");
620 return mlir::failure();
625 "OpenMP OMPTargetUpdateDirective");
626 return mlir::failure();
631 "OpenMP OMPTeamsDistributeDirective");
632 return mlir::failure();
637 "OpenMP OMPTeamsDistributeSimdDirective");
638 return mlir::failure();
644 s.getSourceRange(),
"OpenMP OMPTeamsDistributeParallelForSimdDirective");
645 return mlir::failure();
650 "OpenMP OMPTeamsDistributeParallelForDirective");
651 return mlir::failure();
656 "OpenMP OMPTeamsGenericLoopDirective");
657 return mlir::failure();
662 "OpenMP OMPTargetTeamsDirective");
663 return mlir::failure();
668 "OpenMP OMPTargetTeamsDistributeDirective");
669 return mlir::failure();
676 "OpenMP OMPTargetTeamsDistributeParallelForDirective");
677 return mlir::failure();
684 "OpenMP OMPTargetTeamsDistributeParallelForSimdDirective");
685 return mlir::failure();
690 "OpenMP OMPTargetTeamsDistributeSimdDirective");
691 return mlir::failure();
696 return mlir::failure();
701 return mlir::failure();
706 "OpenMP OMPGenericLoopDirective");
707 return mlir::failure();
712 return mlir::failure();
717 return mlir::failure();
722 "OpenMP OMPInterchangeDirective");
723 return mlir::failure();
728 return mlir::failure();
733 return mlir::failure();
738 return mlir::failure();
743 return mlir::failure();
static void emitBody(CodeGenFunction &CGF, const Stmt *S, const Stmt *NextLoop, int MaxLevel, int Level=0)
static mlir::LogicalResult emitOMPTargetImplicitCaptures(CIRGenFunction &cgf, const OMPExecutableDirective &s, llvm::ArrayRef< const VarDecl * > mapSyms)
Check for unsupported implicit captures in a target region.
static mlir::LogicalResult checkSynthesizedClauses(CIRGenFunction &cgf, const OMPExecutableDirective &s, omp::ConstructQueue::const_iterator item)
Report item's synthesized clauses as not-yet-implemented: having no AST node, they cannot go through ...
static mlir::LogicalResult emitTargetOp(CIRGenFunction &cgf, const DirectiveTy &s, const omp::ConstructQueue &queue, omp::ConstructQueue::const_iterator item, mlir::Location begin, mlir::Location end, mlir::omp::TargetExtOperands &clauseOps, llvm::ArrayRef< const VarDecl * > mapSyms, llvm::function_ref< mlir::LogicalResult()> emitBody)
static mlir::LogicalResult emitParallelOp(CIRGenFunction &cgf, const DirectiveTy &s, const omp::ConstructQueue &queue, omp::ConstructQueue::const_iterator item, mlir::Location begin, mlir::Location end, const mlir::omp::ParallelOperands &clauseOps, llvm::function_ref< mlir::LogicalResult()> emitBody)
static mlir::LogicalResult emitParallelClauses(CIRGenFunction &cgf, CIRGenModule &cgm, CIRGenBuilderTy &builder, mlir::Location loc, llvm::ArrayRef< const OMPClause * > clauses, mlir::omp::ParallelOperands &clauseOps)
static mlir::LogicalResult emitTargetClauses(CIRGenFunction &cgf, CIRGenModule &cgm, CIRGenBuilderTy &builder, mlir::Location loc, llvm::ArrayRef< const OMPClause * > clauses, mlir::omp::TargetExtOperands &clauseOps, llvm::SmallVectorImpl< const VarDecl * > &mapSyms)
This file defines OpenMP AST classes for clauses.
This file defines OpenMP AST classes for executable directives and clauses.
This represents 'pragma omp atomic' directive.
This represents 'pragma omp barrier' directive.
This represents 'pragma omp cancel' directive.
This represents 'pragma omp cancellation point' directive.
This represents clause 'copyin' in the 'pragma omp ...' directives.
This represents 'pragma omp critical' directive.
This represents 'defaultmap' clause in the 'pragma omp ...' directive.
This represents implicit clause 'depend' for the 'pragma omp task' directive.
This represents 'pragma omp depobj' directive.
This represents 'device' clause in the 'pragma omp ...' directive.
This represents 'pragma omp dispatch' directive.
This represents 'pragma omp distribute' directive.
This represents 'pragma omp distribute parallel for' composite directive.
This represents 'pragma omp distribute parallel for simd' composite directive.
This represents 'pragma omp distribute simd' composite directive.
This represents 'pragma omp error' directive.
Represents the 'pragma omp flatten' loop transformation directive.
This represents 'pragma omp flush' directive.
This represents 'pragma omp for' directive.
This represents 'pragma omp for simd' directive.
Represents the 'pragma omp fuse' loop transformation directive.
This represents 'pragma omp loop' directive.
This represents clause 'has_device_ptr' in the 'pragma omp ...' directives.
Represents the 'pragma omp interchange' loop transformation directive.
This represents 'pragma omp interop' directive.
This represents clause 'is_device_ptr' in the 'pragma omp ...' directives.
This represents clause 'map' in the 'pragma omp ...' directives.
This represents 'pragma omp masked' directive.
This represents 'pragma omp masked taskloop' directive.
This represents 'pragma omp masked taskloop simd' directive.
This represents 'pragma omp master' directive.
This represents 'pragma omp master taskloop' directive.
This represents 'pragma omp master taskloop simd' directive.
This represents block-associated 'pragma omp ordered' directive.
This represents standalone 'pragma omp ordered' directive.
This represents 'pragma omp parallel for' directive.
This represents 'pragma omp parallel for simd' directive.
This represents 'pragma omp parallel loop' directive.
This represents 'pragma omp parallel masked' directive.
This represents 'pragma omp parallel masked taskloop' directive.
This represents 'pragma omp parallel masked taskloop simd' directive.
This represents 'pragma omp parallel master' directive.
This represents 'pragma omp parallel master taskloop' directive.
This represents 'pragma omp parallel master taskloop simd' directive.
This represents 'pragma omp parallel sections' directive.
Represents the 'pragma omp reverse' loop transformation directive.
This represents 'pragma omp scan' directive.
This represents 'pragma omp scope' directive.
This represents 'pragma omp section' directive.
This represents 'pragma omp sections' directive.
This represents 'pragma omp simd' directive.
This represents 'pragma omp single' directive.
Represents the 'pragma omp split' loop transformation directive.
This represents the 'pragma omp stripe' loop transformation directive.
This represents 'pragma omp target data' directive.
This represents 'pragma omp target' directive.
This represents 'pragma omp target enter data' directive.
This represents 'pragma omp target exit data' directive.
This represents 'pragma omp target parallel' directive.
This represents 'pragma omp target parallel for' directive.
This represents 'pragma omp target parallel for simd' directive.
This represents 'pragma omp target parallel loop' directive.
This represents 'pragma omp target simd' directive.
This represents 'pragma omp target teams' directive.
This represents 'pragma omp target teams distribute' combined directive.
This represents 'pragma omp target teams distribute parallel for' combined directive.
This represents 'pragma omp target teams distribute parallel for simd' combined directive.
This represents 'pragma omp target teams distribute simd' combined directive.
This represents 'pragma omp target teams loop' directive.
This represents 'pragma omp target update' directive.
This represents 'pragma omp task' directive.
This represents 'pragma omp taskloop' directive.
This represents 'pragma omp taskloop simd' directive.
This represents 'pragma omp taskgroup' directive.
This represents 'pragma omp taskwait' directive.
This represents 'pragma omp taskyield' directive.
This represents 'pragma omp teams' directive.
This represents 'pragma omp teams distribute' directive.
This represents 'pragma omp teams distribute parallel for' composite directive.
This represents 'pragma omp teams distribute parallel for simd' composite directive.
This represents 'pragma omp teams distribute simd' combined directive.
This represents 'pragma omp teams loop' directive.
This represents 'thread_limit' clause in the 'pragma omp ...' directive.
This represents the 'pragma omp tile' loop transformation directive.
This represents the 'pragma omp unroll' loop transformation directive.
This represents clause 'uses_allocators' in the 'pragma omp target'-based directives.
This represents 'ompx_bare' clause in the 'pragma omp target teams ...' directive.
clang::CharUnits getAlignment() const
mlir::LogicalResult emitOMPTargetParallelForDirective(const OMPTargetParallelForDirective &s)
mlir::LogicalResult emitOMPParallelMasterTaskLoopSimdDirective(const OMPParallelMasterTaskLoopSimdDirective &s)
mlir::LogicalResult emitOMPSimdDirective(const OMPSimdDirective &s)
mlir::LogicalResult emitOMPCriticalDirective(const OMPCriticalDirective &s)
mlir::LogicalResult emitOMPParallelMasterDirective(const OMPParallelMasterDirective &s)
mlir::LogicalResult emitOMPCancellationPointDirective(const OMPCancellationPointDirective &s)
mlir::LogicalResult emitOMPParallelMaskedTaskLoopDirective(const OMPParallelMaskedTaskLoopDirective &s)
mlir::LogicalResult emitOMPReverseDirective(const OMPReverseDirective &s)
const clang::LangOptions & getLangOpts() const
mlir::LogicalResult emitOMPTileDirective(const OMPTileDirective &s)
mlir::LogicalResult emitOMPTargetTeamsDirective(const OMPTargetTeamsDirective &s)
mlir::LogicalResult emitOMPTeamsDistributeParallelForDirective(const OMPTeamsDistributeParallelForDirective &s)
mlir::LogicalResult emitOMPBarrierDirective(const OMPBarrierDirective &s)
mlir::LogicalResult emitOMPTargetParallelDirective(const OMPTargetParallelDirective &s)
void replaceAddrOfLocalVar(const clang::VarDecl *vd, Address addr)
mlir::LogicalResult emitOMPTargetDirective(const OMPTargetDirective &s)
Address getAddrOfLocalVar(const clang::VarDecl *vd)
Return the address of a local variable.
mlir::LogicalResult emitOMPScopeDirective(const OMPScopeDirective &s)
mlir::Location getLoc(clang::SourceLocation srcLoc)
Helpers to convert Clang's SourceLocation to a MLIR Location.
mlir::LogicalResult emitOMPDepobjDirective(const OMPDepobjDirective &s)
mlir::LogicalResult emitOMPDistributeParallelForSimdDirective(const OMPDistributeParallelForSimdDirective &s)
mlir::LogicalResult emitOMPUnrollDirective(const OMPUnrollDirective &s)
mlir::LogicalResult emitOMPTaskDirective(const OMPTaskDirective &s)
mlir::LogicalResult emitOMPTeamsGenericLoopDirective(const OMPTeamsGenericLoopDirective &s)
mlir::LogicalResult emitOMPCanonicalLoop(const OMPCanonicalLoop &s)
mlir::LogicalResult emitOMPTeamsDirective(const OMPTeamsDirective &s)
mlir::LogicalResult emitOMPMaskedTaskLoopDirective(const OMPMaskedTaskLoopDirective &s)
mlir::LogicalResult emitOMPFuseDirective(const OMPFuseDirective &s)
mlir::LogicalResult emitOMPSectionDirective(const OMPSectionDirective &s)
mlir::LogicalResult emitOMPFlattenDirective(const OMPFlattenDirective &s)
mlir::LogicalResult emitOMPParallelForSimdDirective(const OMPParallelForSimdDirective &s)
mlir::LogicalResult emitOMPDistributeParallelForDirective(const OMPDistributeParallelForDirective &s)
mlir::LogicalResult emitOMPOrderedStandaloneDirective(const OMPOrderedStandaloneDirective &s)
mlir::LogicalResult emitOMPMasterTaskLoopSimdDirective(const OMPMasterTaskLoopSimdDirective &s)
mlir::LogicalResult emitOMPTaskwaitDirective(const OMPTaskwaitDirective &s)
mlir::LogicalResult emitOMPFlushDirective(const OMPFlushDirective &s)
mlir::LogicalResult emitOMPGenericLoopDirective(const OMPGenericLoopDirective &s)
mlir::LogicalResult emitOMPTargetUpdateDirective(const OMPTargetUpdateDirective &s)
mlir::LogicalResult emitOMPTargetParallelForSimdDirective(const OMPTargetParallelForSimdDirective &s)
mlir::LogicalResult emitOMPInterchangeDirective(const OMPInterchangeDirective &s)
mlir::LogicalResult emitOMPDispatchDirective(const OMPDispatchDirective &s)
mlir::LogicalResult emitOMPParallelDirective(const OMPParallelDirective &s)
mlir::LogicalResult emitOMPForSimdDirective(const OMPForSimdDirective &s)
mlir::LogicalResult emitOMPTaskLoopDirective(const OMPTaskLoopDirective &s)
mlir::LogicalResult emitOMPTargetDataDirective(const OMPTargetDataDirective &s)
mlir::LogicalResult emitOMPTargetParallelGenericLoopDirective(const OMPTargetParallelGenericLoopDirective &s)
mlir::LogicalResult emitOMPParallelMaskedDirective(const OMPParallelMaskedDirective &s)
mlir::LogicalResult emitOMPMaskedTaskLoopSimdDirective(const OMPMaskedTaskLoopSimdDirective &s)
mlir::LogicalResult emitOMPAtomicDirective(const OMPAtomicDirective &s)
mlir::LogicalResult emitOMPTeamsDistributeParallelForSimdDirective(const OMPTeamsDistributeParallelForSimdDirective &s)
mlir::LogicalResult emitOMPTaskgroupDirective(const OMPTaskgroupDirective &s)
mlir::LogicalResult emitOMPParallelMaskedTaskLoopSimdDirective(const OMPParallelMaskedTaskLoopSimdDirective &s)
mlir::LogicalResult emitOMPTeamsDistributeDirective(const OMPTeamsDistributeDirective &s)
mlir::LogicalResult emitOMPInteropDirective(const OMPInteropDirective &s)
mlir::LogicalResult emitOMPErrorDirective(const OMPErrorDirective &s)
mlir::LogicalResult emitOMPSingleDirective(const OMPSingleDirective &s)
mlir::LogicalResult emitOMPTaskyieldDirective(const OMPTaskyieldDirective &s)
mlir::LogicalResult emitOMPTargetTeamsDistributeSimdDirective(const OMPTargetTeamsDistributeSimdDirective &s)
mlir::LogicalResult emitOMPScanDirective(const OMPScanDirective &s)
mlir::LogicalResult emitOMPTargetEnterDataDirective(const OMPTargetEnterDataDirective &s)
mlir::LogicalResult emitOMPMasterTaskLoopDirective(const OMPMasterTaskLoopDirective &s)
mlir::LogicalResult emitOMPForDirective(const OMPForDirective &s)
mlir::LogicalResult emitOMPMasterDirective(const OMPMasterDirective &s)
mlir::LogicalResult emitOMPMetaDirective(const OMPMetaDirective &s)
mlir::LogicalResult emitOMPDistributeSimdDirective(const OMPDistributeSimdDirective &s)
CIRGenBuilderTy & getBuilder()
mlir::LogicalResult emitOMPParallelGenericLoopDirective(const OMPParallelGenericLoopDirective &s)
mlir::LogicalResult emitOMPMaskedDirective(const OMPMaskedDirective &s)
mlir::LogicalResult emitOMPSplitDirective(const OMPSplitDirective &s)
CIRGenModule & getCIRGenModule()
mlir::MLIRContext & getMLIRContext()
mlir::LogicalResult emitOMPTargetExitDataDirective(const OMPTargetExitDataDirective &s)
mlir::LogicalResult emitOMPOrderedBlockAssocDirective(const OMPOrderedBlockAssocDirective &s)
mlir::LogicalResult emitOMPTargetTeamsDistributeParallelForDirective(const OMPTargetTeamsDistributeParallelForDirective &s)
mlir::LogicalResult emitOMPParallelForDirective(const OMPParallelForDirective &s)
mlir::LogicalResult emitOMPSectionsDirective(const OMPSectionsDirective &s)
mlir::LogicalResult emitOMPDistributeDirective(const OMPDistributeDirective &s)
mlir::LogicalResult emitOMPTargetTeamsDistributeParallelForSimdDirective(const OMPTargetTeamsDistributeParallelForSimdDirective &s)
mlir::LogicalResult emitOMPTargetTeamsGenericLoopDirective(const OMPTargetTeamsGenericLoopDirective &s)
mlir::LogicalResult emitOMPTeamsDistributeSimdDirective(const OMPTeamsDistributeSimdDirective &s)
mlir::LogicalResult emitOMPTaskLoopSimdDirective(const OMPTaskLoopSimdDirective &s)
clang::ASTContext & getContext() const
mlir::LogicalResult emitOMPParallelMasterTaskLoopDirective(const OMPParallelMasterTaskLoopDirective &s)
mlir::LogicalResult emitStmt(const clang::Stmt *s, bool useCurrentScope, llvm::ArrayRef< const Attr * > attrs={})
mlir::LogicalResult emitOMPCancelDirective(const OMPCancelDirective &s)
mlir::LogicalResult emitOMPStripeDirective(const OMPStripeDirective &s)
mlir::LogicalResult emitOMPTargetTeamsDistributeDirective(const OMPTargetTeamsDistributeDirective &s)
mlir::LogicalResult emitOMPParallelSectionsDirective(const OMPParallelSectionsDirective &s)
mlir::LogicalResult emitOMPTargetSimdDirective(const OMPTargetSimdDirective &s)
mlir::LogicalResult emitOMPAssumeDirective(const OMPAssumeDirective &s)
This class organizes the cross-function state that is used while generating CIR code.
DiagnosticBuilder errorNYI(SourceLocation, llvm::StringRef)
Helpers to emit "not yet implemented" error diagnostics.
Emits OpenMP clauses for a directive, writing results into the auto-generated ClauseOps from the OMP ...
mlir::LogicalResult emitNYI(OpenMPNYIClauseList< NYIClauses... > nyi, llvm::omp::Directive directive) const
Verify the clauses of a directive to make sure all legal cases are either implemented or give a NYI e...
bool emitMap(mlir::omp::MapClauseOps &result, llvm::SmallVectorImpl< const VarDecl * > *mapSyms=nullptr) const
Emit map clauses.
bool emitIf(mlir::omp::IfClauseOps &result, llvm::omp::Directive directiveName) const
bool emitProcBind(mlir::omp::ProcBindClauseOps &result) const
bool emitNumThreads(mlir::omp::NumThreadsClauseOps &result) const
This captures a statement into a function.
Stmt * getCapturedStmt()
Retrieve the statement being captured.
This represents clause 'allocate' in the 'pragma omp ...' directives.
This represents 'default' clause in the 'pragma omp ...' directive.
This represents 'if' clause in the 'pragma omp ...' directive.
This represents 'num_threads' clause in the 'pragma omp ...' directive.
Represents a variable declaration or definition.
bool isLastItemInQueue(ConstructQueue::const_iterator item, const ConstructQueue &queue)
llvm::SmallVector< LeafWithClauses > ConstructQueue
ConstructQueue buildConstructQueue(unsigned openmpVersion, const OMPExecutableDirective &s)
Given a potentially compound directive with a list of clauses that apply to it, break it up into indi...
Top level wrappers for InstallAPI frontend operations.
Represents a scope, including function bodies, compound statements, and the substatements of if/while...
A type-only list of OpenMP clause AST node types.