19using namespace llvm::omp;
22const OMPInvariantPredicateBoundAttr *
23OMPLoopBasedDirective::getIntraTileHint(
const Stmt *S) {
24 if (
const auto *AS = dyn_cast_or_null<AttributedStmt>(S))
30Stmt *OMPLoopBasedDirective::ignoreIntraTileHint(
Stmt *S) {
31 if (
auto *AS = dyn_cast_or_null<AttributedStmt>(S))
33 return AS->getSubStmt();
38 auto *CS = dyn_cast_or_null<CompoundStmt>(Body);
39 if (!CS || CS->size() < 2)
41 return ArrayRef(CS->body_begin(), CS->size() - 1);
50 if (
auto *AS = dyn_cast_or_null<AttributedStmt>(S)) {
56 if (
auto *CS = dyn_cast_or_null<CompoundStmt>(S)) {
67size_t OMPChildren::size(
unsigned NumClauses,
bool HasAssociatedStmt,
68 unsigned NumChildren) {
70 totalSizeToAlloc<OMPClause *, Stmt *>(
71 NumClauses, NumChildren + (HasAssociatedStmt ? 1 : 0)),
72 alignof(OMPChildren));
76 assert(Clauses.size() == NumClauses &&
77 "Number of clauses is not the same as the preallocated buffer");
78 llvm::copy(Clauses, getTrailingObjects<OMPClause *>());
82 return getTrailingObjects<Stmt *>(NumChildren);
87 Data->setClauses(Clauses);
92 Stmt *S,
unsigned NumChildren) {
93 auto *
Data = CreateEmpty(Mem, Clauses.size(), S, NumChildren);
94 Data->setClauses(Clauses);
96 Data->setAssociatedStmt(S);
100OMPChildren *OMPChildren::CreateEmpty(
void *Mem,
unsigned NumClauses,
101 bool HasAssociatedStmt,
102 unsigned NumChildren) {
103 return new (Mem) OMPChildren(NumClauses, NumChildren, HasAssociatedStmt);
106bool OMPExecutableDirective::isStandaloneDirective()
const {
114 return !hasAssociatedStmt();
117Stmt *OMPExecutableDirective::getStructuredBlock() {
118 assert(!isStandaloneDirective() &&
119 "Standalone Executable Directives don't have Structured Blocks.");
120 if (
auto *LD = dyn_cast<OMPLoopDirective>(
this))
121 return LD->getBody();
126OMPLoopBasedDirective::tryToFindNextInnerLoop(
Stmt *CurStmt,
127 bool TryImperfectlyNestedLoops) {
128 Stmt *OrigStmt = CurStmt;
131 if (TryImperfectlyNestedLoops) {
132 if (
auto *CS = dyn_cast<CompoundStmt>(CurStmt)) {
134 SmallVector<CompoundStmt *, 4> Statements(1, CS);
135 SmallVector<CompoundStmt *, 4> NextStatements;
136 while (!Statements.empty()) {
137 CS = Statements.pop_back_val();
140 for (Stmt *S : CS->body()) {
150 if (
auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Inner))
151 Inner = CanonLoop->getLoopStmt();
152 Inner = OMPLoopBasedDirective::ignoreIntraTileHint(Inner);
164 S = OMPLoopBasedDirective::ignoreIntraTileHint(S);
165 if (
auto *InnerCS = dyn_cast_or_null<CompoundStmt>(S))
166 NextStatements.push_back(InnerCS);
168 if (Statements.empty()) {
172 Statements.swap(NextStatements);
182bool OMPLoopBasedDirective::doForAllLoops(
183 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
184 llvm::function_ref<
bool(
unsigned,
Stmt *,
Stmt *)> Callback,
189 for (
unsigned Cnt = 0; Cnt < NumLoops; ++Cnt) {
194 bool PeeledTransformation =
false;
196 auto *Dir = dyn_cast<OMPLoopTransformationDirective>(CurStmt);
202 Stmt *TransformedStmt = Dir->getTransformedStmt();
203 if (!TransformedStmt) {
204 unsigned NumGeneratedTopLevelLoops =
205 Dir->getNumGeneratedTopLevelLoops();
206 if (NumGeneratedTopLevelLoops == 0) {
211 if (NumGeneratedTopLevelLoops > 0) {
219 CurStmt = TransformedStmt;
220 PeeledTransformation =
true;
222 if (
auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(CurStmt))
223 CurStmt = CanonLoop->getLoopStmt();
226 Stmt *LoopStmt = ignoreIntraTileHint(CurStmt);
227 Stmt *HintWrapper = LoopStmt != CurStmt ? CurStmt :
nullptr;
228 if (
Callback(Cnt, LoopStmt, HintWrapper))
235 if (
auto *For = dyn_cast<ForStmt>(LoopStmt)) {
236 CurStmt = For->getBody();
239 "Expected canonical for or range-based for loops.");
243 !getStmtsBeforeNestedLoop(CurStmt).empty())
245 CurStmt = OMPLoopBasedDirective::tryToFindNextInnerLoop(
246 CurStmt, TryImperfectlyNestedLoops);
251void OMPLoopBasedDirective::doForAllLoopsBodies(
252 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
253 llvm::function_ref<
void(
unsigned,
Stmt *,
Stmt *)> Callback) {
254 bool Res = OMPLoopBasedDirective::doForAllLoops(
255 CurStmt, TryImperfectlyNestedLoops, NumLoops,
257 Stmt *Body =
nullptr;
258 if (
auto *For = dyn_cast<ForStmt>(
Loop)) {
259 Body = For->getBody();
262 "Expected canonical for or range-based for loops.");
265 if (
auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Body))
266 Body = CanonLoop->getLoopStmt();
270 assert(Res &&
"Expected only loops");
276 Stmt *Body =
nullptr;
277 OMPLoopBasedDirective::doForAllLoopsBodies(
278 Data->getRawStmt(),
true,
280 [&Body](
unsigned,
Stmt *,
Stmt *BodyStmt) { Body = BodyStmt; });
285 assert(A.size() == getLoopsNumber() &&
286 "Number of loop counters is not the same as the collapsed number");
287 llvm::copy(A, getCounters().begin());
291 assert(A.size() == getLoopsNumber() &&
"Number of loop private counters "
292 "is not the same as the collapsed "
294 llvm::copy(A, getPrivateCounters().begin());
298 assert(A.size() == getLoopsNumber() &&
299 "Number of counter inits is not the same as the collapsed number");
304 assert(A.size() == getLoopsNumber() &&
305 "Number of counter updates is not the same as the collapsed number");
310 assert(A.size() == getLoopsNumber() &&
311 "Number of counter finals is not the same as the collapsed number");
317 A.size() == getLoopsNumber() &&
318 "Number of dependent counters is not the same as the collapsed number");
319 llvm::copy(A, getDependentCounters().begin());
323 assert(A.size() == getLoopsNumber() &&
324 "Number of dependent inits is not the same as the collapsed number");
325 llvm::copy(A, getDependentInits().begin());
329 assert(A.size() == getLoopsNumber() &&
330 "Number of finals conditions is not the same as the collapsed number");
331 llvm::copy(A, getFinalsConditions().begin());
338 Stmt *AssociatedStmt,
Stmt *IfStmt) {
339 auto *Dir = createDirective<OMPMetaDirective>(
340 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
341 Dir->setIfStmt(IfStmt);
348 return createEmptyDirective<OMPMetaDirective>(
C, NumClauses,
353OMPParallelDirective *OMPParallelDirective::Create(
357 auto *Dir = createDirective<OMPParallelDirective>(
358 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
359 Dir->setTaskReductionRefExpr(TaskRedRef);
360 Dir->setHasCancel(HasCancel);
364OMPParallelDirective *OMPParallelDirective::CreateEmpty(
const ASTContext &
C,
367 return createEmptyDirective<OMPParallelDirective>(
C, NumClauses,
376 const HelperExprs &Exprs) {
377 auto *Dir = createDirective<OMPSimdDirective>(
379 StartLoc, EndLoc, CollapsedNum);
380 Dir->setIterationVariable(Exprs.IterationVarRef);
381 Dir->setLastIteration(Exprs.LastIteration);
382 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
383 Dir->setPreCond(Exprs.PreCond);
384 Dir->setCond(Exprs.Cond);
385 Dir->setInit(Exprs.Init);
386 Dir->setInc(Exprs.Inc);
387 Dir->setCounters(Exprs.Counters);
388 Dir->setPrivateCounters(Exprs.PrivateCounters);
389 Dir->setInits(Exprs.Inits);
390 Dir->setUpdates(Exprs.Updates);
391 Dir->setFinals(Exprs.Finals);
392 Dir->setDependentCounters(Exprs.DependentCounters);
393 Dir->setDependentInits(Exprs.DependentInits);
394 Dir->setFinalsConditions(Exprs.FinalsConditions);
395 Dir->setPreInits(Exprs.PreInits);
401 unsigned CollapsedNum,
403 return createEmptyDirective<OMPSimdDirective>(
411 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
412 auto *Dir = createDirective<OMPForDirective>(
414 StartLoc, EndLoc, CollapsedNum);
415 Dir->setIterationVariable(Exprs.IterationVarRef);
416 Dir->setLastIteration(Exprs.LastIteration);
417 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
418 Dir->setPreCond(Exprs.PreCond);
419 Dir->setCond(Exprs.Cond);
420 Dir->setInit(Exprs.Init);
421 Dir->setInc(Exprs.Inc);
422 Dir->setIsLastIterVariable(Exprs.IL);
423 Dir->setLowerBoundVariable(Exprs.LB);
424 Dir->setUpperBoundVariable(Exprs.UB);
425 Dir->setStrideVariable(Exprs.ST);
426 Dir->setEnsureUpperBound(Exprs.EUB);
427 Dir->setNextLowerBound(Exprs.NLB);
428 Dir->setNextUpperBound(Exprs.NUB);
429 Dir->setNumIterations(Exprs.NumIterations);
430 Dir->setCounters(Exprs.Counters);
431 Dir->setPrivateCounters(Exprs.PrivateCounters);
432 Dir->setInits(Exprs.Inits);
433 Dir->setUpdates(Exprs.Updates);
434 Dir->setFinals(Exprs.Finals);
435 Dir->setDependentCounters(Exprs.DependentCounters);
436 Dir->setDependentInits(Exprs.DependentInits);
437 Dir->setFinalsConditions(Exprs.FinalsConditions);
438 Dir->setPreInits(Exprs.PreInits);
439 Dir->setTaskReductionRefExpr(TaskRedRef);
440 Dir->setHasCancel(HasCancel);
445 if (
auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
446 return D->getTransformedStmt();
447 if (
auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
448 return D->getTransformedStmt();
449 llvm_unreachable(
"unexpected object type");
453 if (
auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
454 return D->getPreInits();
455 if (
auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
456 return D->getPreInits();
457 llvm_unreachable(
"unexpected object type");
461 switch (getStmtClass()) {
462#define STMT(CLASS, PARENT)
463#define ABSTRACT_STMT(CLASS)
464#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
465 case Stmt::CLASS##Class: \
466 return static_cast<const CLASS *>(this)->getTransformedStmt();
467#include "clang/AST/StmtNodes.inc"
469 llvm_unreachable(
"Not a loop transformation for canonical loop nests");
474 switch (getStmtClass()) {
475#define STMT(CLASS, PARENT)
476#define ABSTRACT_STMT(CLASS)
477#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
478 case Stmt::CLASS##Class: \
479 return static_cast<const CLASS *>(this)->getPreInits();
480#include "clang/AST/StmtNodes.inc"
482 llvm_unreachable(
"Not a loop transformation for canonical loop nests");
488 switch (getStmtClass()) {
489#define STMT(CLASS, PARENT)
490#define ABSTRACT_STMT(CLASS)
491#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
492 case Stmt::CLASS##Class: \
493 return static_cast<const CLASS *>(this)->getTransformedStmt();
494#include "clang/AST/StmtNodes.inc"
496 llvm_unreachable(
"Not a loop transformation for canonical loop sequences");
501 switch (getStmtClass()) {
502#define STMT(CLASS, PARENT)
503#define ABSTRACT_STMT(CLASS)
504#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
505 case Stmt::CLASS##Class: \
506 return static_cast<const CLASS *>(this)->getPreInits();
507#include "clang/AST/StmtNodes.inc"
509 llvm_unreachable(
"Not a loop transformation for canonical loop sequences");
515 unsigned CollapsedNum,
517 return createEmptyDirective<OMPForDirective>(
525 unsigned NumLoops,
Stmt *AssociatedStmt,
526 Stmt *TransformedStmt,
Stmt *PreInits) {
527 OMPTileDirective *Dir = createDirective<OMPTileDirective>(
528 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
530 Dir->setTransformedStmt(TransformedStmt);
531 Dir->setPreInits(PreInits);
538 return createEmptyDirective<OMPTileDirective>(
539 C, NumClauses,
true, TransformedStmtOffset + 1,
546 unsigned NumLoops,
Stmt *AssociatedStmt,
547 Stmt *TransformedStmt,
Stmt *PreInits) {
548 OMPStripeDirective *Dir = createDirective<OMPStripeDirective>(
549 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
551 Dir->setTransformedStmt(TransformedStmt);
552 Dir->setPreInits(PreInits);
559 return createEmptyDirective<OMPStripeDirective>(
560 C, NumClauses,
true, TransformedStmtOffset + 1,
567 unsigned NumGeneratedTopLevelLoops,
Stmt *TransformedStmt,
Stmt *PreInits) {
568 assert(NumGeneratedTopLevelLoops <= 1 &&
569 "Unrolling generates at most one loop");
571 auto *Dir = createDirective<OMPUnrollDirective>(
572 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);
573 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);
574 Dir->setTransformedStmt(TransformedStmt);
575 Dir->setPreInits(PreInits);
580 unsigned NumClauses) {
581 return createEmptyDirective<OMPUnrollDirective>(
582 C, NumClauses,
true, TransformedStmtOffset + 1,
589 unsigned NumLoops,
Stmt *TransformedStmt,
591 OMPReverseDirective *Dir = createDirective<OMPReverseDirective>(
592 C, {}, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
594 Dir->setTransformedStmt(TransformedStmt);
595 Dir->setPreInits(PreInits);
601 return createEmptyDirective<OMPReverseDirective>(
609 Stmt *TransformedStmt,
Stmt *PreInits) {
610 OMPInterchangeDirective *Dir = createDirective<OMPInterchangeDirective>(
611 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
613 Dir->setTransformedStmt(TransformedStmt);
614 Dir->setPreInits(PreInits);
621 return createEmptyDirective<OMPInterchangeDirective>(
622 C, NumClauses,
true, TransformedStmtOffset + 1,
630 OMPFlattenDirective *Dir = createDirective<OMPFlattenDirective>(
631 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
632 Dir->setTransformedStmt(TransformedStmt);
633 Dir->setPreInits(PreInits);
634 Dir->setFinals(Finals);
641 return createEmptyDirective<OMPFlattenDirective>(
642 C, NumClauses,
true, FinalsOffset + 1,
649 unsigned NumLoops,
Stmt *AssociatedStmt,
650 Stmt *TransformedStmt,
Stmt *PreInits) {
651 OMPSplitDirective *Dir = createDirective<OMPSplitDirective>(
652 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
654 Dir->setTransformedStmt(TransformedStmt);
655 Dir->setPreInits(PreInits);
662 return createEmptyDirective<OMPSplitDirective>(
663 C, NumClauses,
true, TransformedStmtOffset + 1,
670 Stmt *AssociatedStmt,
Stmt *TransformedStmt,
Stmt *PreInits) {
672 OMPFuseDirective *Dir = createDirective<OMPFuseDirective>(
673 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);
674 Dir->setTransformedStmt(TransformedStmt);
675 Dir->setPreInits(PreInits);
681 unsigned NumClauses) {
682 OMPFuseDirective *Dir = createEmptyDirective<OMPFuseDirective>(
683 C, NumClauses,
true, TransformedStmtOffset + 1,
692 const HelperExprs &Exprs) {
693 auto *Dir = createDirective<OMPForSimdDirective>(
695 StartLoc, EndLoc, CollapsedNum);
696 Dir->setIterationVariable(Exprs.IterationVarRef);
697 Dir->setLastIteration(Exprs.LastIteration);
698 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
699 Dir->setPreCond(Exprs.PreCond);
700 Dir->setCond(Exprs.Cond);
701 Dir->setInit(Exprs.Init);
702 Dir->setInc(Exprs.Inc);
703 Dir->setIsLastIterVariable(Exprs.IL);
704 Dir->setLowerBoundVariable(Exprs.LB);
705 Dir->setUpperBoundVariable(Exprs.UB);
706 Dir->setStrideVariable(Exprs.ST);
707 Dir->setEnsureUpperBound(Exprs.EUB);
708 Dir->setNextLowerBound(Exprs.NLB);
709 Dir->setNextUpperBound(Exprs.NUB);
710 Dir->setNumIterations(Exprs.NumIterations);
711 Dir->setCounters(Exprs.Counters);
712 Dir->setPrivateCounters(Exprs.PrivateCounters);
713 Dir->setInits(Exprs.Inits);
714 Dir->setUpdates(Exprs.Updates);
715 Dir->setFinals(Exprs.Finals);
716 Dir->setDependentCounters(Exprs.DependentCounters);
717 Dir->setDependentInits(Exprs.DependentInits);
718 Dir->setFinalsConditions(Exprs.FinalsConditions);
719 Dir->setPreInits(Exprs.PreInits);
725 unsigned CollapsedNum,
727 return createEmptyDirective<OMPForSimdDirective>(
736 auto *Dir = createDirective<OMPSectionsDirective>(
C, Clauses, AssociatedStmt,
739 Dir->setTaskReductionRefExpr(TaskRedRef);
740 Dir->setHasCancel(HasCancel);
747 return createEmptyDirective<OMPSectionsDirective>(
C, NumClauses,
755 Stmt *AssociatedStmt,
758 createDirective<OMPSectionDirective>(
C, {}, AssociatedStmt,
759 0, StartLoc, EndLoc);
766 return createEmptyDirective<OMPSectionDirective>(
C, 0,
774 Stmt *AssociatedStmt) {
775 return createDirective<OMPScopeDirective>(
C, Clauses, AssociatedStmt,
783 return createEmptyDirective<OMPScopeDirective>(
C, NumClauses,
791 Stmt *AssociatedStmt) {
792 return createDirective<OMPSingleDirective>(
C, Clauses, AssociatedStmt,
800 return createEmptyDirective<OMPSingleDirective>(
C, NumClauses,
807 Stmt *AssociatedStmt) {
808 return createDirective<OMPMasterDirective>(
C, {}, AssociatedStmt,
815 return createEmptyDirective<OMPMasterDirective>(
C, 0,
823 return createDirective<OMPCriticalDirective>(
C, Clauses, AssociatedStmt,
831 return createEmptyDirective<OMPCriticalDirective>(
C, NumClauses,
838 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
839 auto *Dir = createDirective<OMPParallelForDirective>(
840 C, Clauses, AssociatedStmt,
841 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,
843 Dir->setIterationVariable(Exprs.IterationVarRef);
844 Dir->setLastIteration(Exprs.LastIteration);
845 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
846 Dir->setPreCond(Exprs.PreCond);
847 Dir->setCond(Exprs.Cond);
848 Dir->setInit(Exprs.Init);
849 Dir->setInc(Exprs.Inc);
850 Dir->setIsLastIterVariable(Exprs.IL);
851 Dir->setLowerBoundVariable(Exprs.LB);
852 Dir->setUpperBoundVariable(Exprs.UB);
853 Dir->setStrideVariable(Exprs.ST);
854 Dir->setEnsureUpperBound(Exprs.EUB);
855 Dir->setNextLowerBound(Exprs.NLB);
856 Dir->setNextUpperBound(Exprs.NUB);
857 Dir->setNumIterations(Exprs.NumIterations);
858 Dir->setCounters(Exprs.Counters);
859 Dir->setPrivateCounters(Exprs.PrivateCounters);
860 Dir->setInits(Exprs.Inits);
861 Dir->setUpdates(Exprs.Updates);
862 Dir->setFinals(Exprs.Finals);
863 Dir->setDependentCounters(Exprs.DependentCounters);
864 Dir->setDependentInits(Exprs.DependentInits);
865 Dir->setFinalsConditions(Exprs.FinalsConditions);
866 Dir->setPreInits(Exprs.PreInits);
867 Dir->setTaskReductionRefExpr(TaskRedRef);
868 Dir->setHasCancel(HasCancel);
874 unsigned CollapsedNum, EmptyShell) {
875 return createEmptyDirective<OMPParallelForDirective>(
883 const HelperExprs &Exprs) {
884 auto *Dir = createDirective<OMPParallelForSimdDirective>(
885 C, Clauses, AssociatedStmt,
886 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,
888 Dir->setIterationVariable(Exprs.IterationVarRef);
889 Dir->setLastIteration(Exprs.LastIteration);
890 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
891 Dir->setPreCond(Exprs.PreCond);
892 Dir->setCond(Exprs.Cond);
893 Dir->setInit(Exprs.Init);
894 Dir->setInc(Exprs.Inc);
895 Dir->setIsLastIterVariable(Exprs.IL);
896 Dir->setLowerBoundVariable(Exprs.LB);
897 Dir->setUpperBoundVariable(Exprs.UB);
898 Dir->setStrideVariable(Exprs.ST);
899 Dir->setEnsureUpperBound(Exprs.EUB);
900 Dir->setNextLowerBound(Exprs.NLB);
901 Dir->setNextUpperBound(Exprs.NUB);
902 Dir->setNumIterations(Exprs.NumIterations);
903 Dir->setCounters(Exprs.Counters);
904 Dir->setPrivateCounters(Exprs.PrivateCounters);
905 Dir->setInits(Exprs.Inits);
906 Dir->setUpdates(Exprs.Updates);
907 Dir->setFinals(Exprs.Finals);
908 Dir->setDependentCounters(Exprs.DependentCounters);
909 Dir->setDependentInits(Exprs.DependentInits);
910 Dir->setFinalsConditions(Exprs.FinalsConditions);
911 Dir->setPreInits(Exprs.PreInits);
918 unsigned CollapsedNum, EmptyShell) {
919 return createEmptyDirective<OMPParallelForSimdDirective>(
927 auto *Dir = createDirective<OMPParallelMasterDirective>(
928 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
929 Dir->setTaskReductionRefExpr(TaskRedRef);
935 unsigned NumClauses, EmptyShell) {
936 return createEmptyDirective<OMPParallelMasterDirective>(
937 C, NumClauses,
true, 1);
943 auto *Dir = createDirective<OMPParallelMaskedDirective>(
944 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
945 Dir->setTaskReductionRefExpr(TaskRedRef);
951 unsigned NumClauses, EmptyShell) {
952 return createEmptyDirective<OMPParallelMaskedDirective>(
953 C, NumClauses,
true, 1);
960 auto *Dir = createDirective<OMPParallelSectionsDirective>(
961 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
962 Dir->setTaskReductionRefExpr(TaskRedRef);
963 Dir->setHasCancel(HasCancel);
969 unsigned NumClauses, EmptyShell) {
970 return createEmptyDirective<OMPParallelSectionsDirective>(
971 C, NumClauses,
true, 1);
977 Stmt *AssociatedStmt,
bool HasCancel) {
978 auto *Dir = createDirective<OMPTaskDirective>(
979 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
980 Dir->setHasCancel(HasCancel);
987 return createEmptyDirective<OMPTaskDirective>(
C, NumClauses,
994 return new (
C) OMPTaskyieldDirective(StartLoc, EndLoc);
999 return new (
C) OMPTaskyieldDirective();
1007 return createDirective<OMPAssumeDirective>(
C, Clauses, AStmt,
1013 unsigned NumClauses,
1015 return createEmptyDirective<OMPAssumeDirective>(
C, NumClauses,
1023 return createDirective<OMPErrorDirective>(
1024 C, Clauses,
nullptr, 0, StartLoc,
1029 unsigned NumClauses,
1031 return createEmptyDirective<OMPErrorDirective>(
C, NumClauses);
1037 return new (
C) OMPBarrierDirective(StartLoc, EndLoc);
1042 return new (
C) OMPBarrierDirective();
1049 return createDirective<OMPTaskwaitDirective>(
1050 C, Clauses,
nullptr, 0, StartLoc,
1055 unsigned NumClauses,
1057 return createEmptyDirective<OMPTaskwaitDirective>(
C, NumClauses);
1063 auto *Dir = createDirective<OMPTaskgroupDirective>(
1064 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
1065 Dir->setReductionRef(ReductionRef);
1070 unsigned NumClauses,
1072 return createEmptyDirective<OMPTaskgroupDirective>(
1073 C, NumClauses,
true, 1);
1079 auto *Dir =
new (
C) OMPCancellationPointDirective(StartLoc, EndLoc);
1080 Dir->setCancelRegion(CancelRegion);
1086 return new (
C) OMPCancellationPointDirective();
1093 auto *Dir = createDirective<OMPCancelDirective>(
1094 C, Clauses,
nullptr, 0, StartLoc,
1096 Dir->setCancelRegion(CancelRegion);
1101 unsigned NumClauses,
1103 return createEmptyDirective<OMPCancelDirective>(
C, NumClauses);
1110 return createDirective<OMPFlushDirective>(
1111 C, Clauses,
nullptr, 0, StartLoc,
1116 unsigned NumClauses,
1118 return createEmptyDirective<OMPFlushDirective>(
C, NumClauses);
1125 return createDirective<OMPDepobjDirective>(
1126 C, Clauses,
nullptr,
1127 0, StartLoc, EndLoc);
1131 unsigned NumClauses,
1133 return createEmptyDirective<OMPDepobjDirective>(
C, NumClauses);
1140 return createDirective<OMPScanDirective>(
C, Clauses,
1142 0, StartLoc, EndLoc);
1146 unsigned NumClauses,
1148 return createEmptyDirective<OMPScanDirective>(
C, NumClauses);
1154 return createDirective<OMPOrderedStandaloneDirective>(
1155 C, Clauses,
nullptr, 0, StartLoc,
1161 unsigned NumClauses, EmptyShell) {
1162 return createEmptyDirective<OMPOrderedStandaloneDirective>(
C, NumClauses);
1168 return createDirective<OMPOrderedBlockAssocDirective>(
1175 unsigned NumClauses, EmptyShell) {
1176 return createEmptyDirective<OMPOrderedBlockAssocDirective>(
1177 C, NumClauses,
true);
1184 auto *Dir = createDirective<OMPAtomicDirective>(
1185 C, Clauses, AssociatedStmt, 7, StartLoc, EndLoc);
1189 Dir->setExpr(Exprs.
E);
1190 Dir->setUpdateExpr(Exprs.
UE);
1192 Dir->setCond(Exprs.
Cond);
1195 Dir->Flags.IsFailOnly = Exprs.
IsFailOnly ? 1 : 0;
1200 unsigned NumClauses,
1202 return createEmptyDirective<OMPAtomicDirective>(
1203 C, NumClauses,
true, 7);
1210 Stmt *AssociatedStmt) {
1211 return createDirective<OMPTargetDirective>(
1212 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1216 unsigned NumClauses,
1218 return createEmptyDirective<OMPTargetDirective>(
C, NumClauses,
1226 auto *Dir = createDirective<OMPTargetParallelDirective>(
1227 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
1228 Dir->setTaskReductionRefExpr(TaskRedRef);
1229 Dir->setHasCancel(HasCancel);
1235 unsigned NumClauses, EmptyShell) {
1236 return createEmptyDirective<OMPTargetParallelDirective>(
1237 C, NumClauses,
true, 1);
1243 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
1244 auto *Dir = createDirective<OMPTargetParallelForDirective>(
1245 C, Clauses, AssociatedStmt,
1246 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
1247 EndLoc, CollapsedNum);
1248 Dir->setIterationVariable(Exprs.IterationVarRef);
1249 Dir->setLastIteration(Exprs.LastIteration);
1250 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1251 Dir->setPreCond(Exprs.PreCond);
1252 Dir->setCond(Exprs.Cond);
1253 Dir->setInit(Exprs.Init);
1254 Dir->setInc(Exprs.Inc);
1255 Dir->setIsLastIterVariable(Exprs.IL);
1256 Dir->setLowerBoundVariable(Exprs.LB);
1257 Dir->setUpperBoundVariable(Exprs.UB);
1258 Dir->setStrideVariable(Exprs.ST);
1259 Dir->setEnsureUpperBound(Exprs.EUB);
1260 Dir->setNextLowerBound(Exprs.NLB);
1261 Dir->setNextUpperBound(Exprs.NUB);
1262 Dir->setNumIterations(Exprs.NumIterations);
1263 Dir->setCounters(Exprs.Counters);
1264 Dir->setPrivateCounters(Exprs.PrivateCounters);
1265 Dir->setInits(Exprs.Inits);
1266 Dir->setUpdates(Exprs.Updates);
1267 Dir->setFinals(Exprs.Finals);
1268 Dir->setDependentCounters(Exprs.DependentCounters);
1269 Dir->setDependentInits(Exprs.DependentInits);
1270 Dir->setFinalsConditions(Exprs.FinalsConditions);
1271 Dir->setPreInits(Exprs.PreInits);
1272 Dir->setTaskReductionRefExpr(TaskRedRef);
1273 Dir->setHasCancel(HasCancel);
1279 unsigned NumClauses,
1280 unsigned CollapsedNum, EmptyShell) {
1281 return createEmptyDirective<OMPTargetParallelForDirective>(
1282 C, NumClauses,
true,
1290 return createDirective<OMPTargetDataDirective>(
1291 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1297 return createEmptyDirective<OMPTargetDataDirective>(
1304 return createDirective<OMPTargetEnterDataDirective>(
1305 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1311 return createEmptyDirective<OMPTargetEnterDataDirective>(
1318 return createDirective<OMPTargetExitDataDirective>(
1319 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1325 return createEmptyDirective<OMPTargetExitDataDirective>(
1333 Stmt *AssociatedStmt) {
1334 return createDirective<OMPTeamsDirective>(
1335 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1339 unsigned NumClauses,
1341 return createEmptyDirective<OMPTeamsDirective>(
C, NumClauses,
1348 const HelperExprs &Exprs,
bool HasCancel) {
1349 auto *Dir = createDirective<OMPTaskLoopDirective>(
1351 StartLoc, EndLoc, CollapsedNum);
1352 Dir->setIterationVariable(Exprs.IterationVarRef);
1353 Dir->setLastIteration(Exprs.LastIteration);
1354 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1355 Dir->setPreCond(Exprs.PreCond);
1356 Dir->setCond(Exprs.Cond);
1357 Dir->setInit(Exprs.Init);
1358 Dir->setInc(Exprs.Inc);
1359 Dir->setIsLastIterVariable(Exprs.IL);
1360 Dir->setLowerBoundVariable(Exprs.LB);
1361 Dir->setUpperBoundVariable(Exprs.UB);
1362 Dir->setStrideVariable(Exprs.ST);
1363 Dir->setEnsureUpperBound(Exprs.EUB);
1364 Dir->setNextLowerBound(Exprs.NLB);
1365 Dir->setNextUpperBound(Exprs.NUB);
1366 Dir->setNumIterations(Exprs.NumIterations);
1367 Dir->setCounters(Exprs.Counters);
1368 Dir->setPrivateCounters(Exprs.PrivateCounters);
1369 Dir->setInits(Exprs.Inits);
1370 Dir->setUpdates(Exprs.Updates);
1371 Dir->setFinals(Exprs.Finals);
1372 Dir->setDependentCounters(Exprs.DependentCounters);
1373 Dir->setDependentInits(Exprs.DependentInits);
1374 Dir->setFinalsConditions(Exprs.FinalsConditions);
1375 Dir->setPreInits(Exprs.PreInits);
1376 Dir->setHasCancel(HasCancel);
1381 unsigned NumClauses,
1382 unsigned CollapsedNum,
1384 return createEmptyDirective<OMPTaskLoopDirective>(
1385 C, NumClauses,
true,
1392 const HelperExprs &Exprs) {
1393 auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1394 C, Clauses, AssociatedStmt,
1397 Dir->setIterationVariable(Exprs.IterationVarRef);
1398 Dir->setLastIteration(Exprs.LastIteration);
1399 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1400 Dir->setPreCond(Exprs.PreCond);
1401 Dir->setCond(Exprs.Cond);
1402 Dir->setInit(Exprs.Init);
1403 Dir->setInc(Exprs.Inc);
1404 Dir->setIsLastIterVariable(Exprs.IL);
1405 Dir->setLowerBoundVariable(Exprs.LB);
1406 Dir->setUpperBoundVariable(Exprs.UB);
1407 Dir->setStrideVariable(Exprs.ST);
1408 Dir->setEnsureUpperBound(Exprs.EUB);
1409 Dir->setNextLowerBound(Exprs.NLB);
1410 Dir->setNextUpperBound(Exprs.NUB);
1411 Dir->setNumIterations(Exprs.NumIterations);
1412 Dir->setCounters(Exprs.Counters);
1413 Dir->setPrivateCounters(Exprs.PrivateCounters);
1414 Dir->setInits(Exprs.Inits);
1415 Dir->setUpdates(Exprs.Updates);
1416 Dir->setFinals(Exprs.Finals);
1417 Dir->setDependentCounters(Exprs.DependentCounters);
1418 Dir->setDependentInits(Exprs.DependentInits);
1419 Dir->setFinalsConditions(Exprs.FinalsConditions);
1420 Dir->setPreInits(Exprs.PreInits);
1426 unsigned CollapsedNum, EmptyShell) {
1427 return createEmptyDirective<OMPTaskLoopSimdDirective>(
1428 C, NumClauses,
true,
1435 const HelperExprs &Exprs,
bool HasCancel) {
1436 auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1437 C, Clauses, AssociatedStmt,
1438 numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1440 Dir->setIterationVariable(Exprs.IterationVarRef);
1441 Dir->setLastIteration(Exprs.LastIteration);
1442 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1443 Dir->setPreCond(Exprs.PreCond);
1444 Dir->setCond(Exprs.Cond);
1445 Dir->setInit(Exprs.Init);
1446 Dir->setInc(Exprs.Inc);
1447 Dir->setIsLastIterVariable(Exprs.IL);
1448 Dir->setLowerBoundVariable(Exprs.LB);
1449 Dir->setUpperBoundVariable(Exprs.UB);
1450 Dir->setStrideVariable(Exprs.ST);
1451 Dir->setEnsureUpperBound(Exprs.EUB);
1452 Dir->setNextLowerBound(Exprs.NLB);
1453 Dir->setNextUpperBound(Exprs.NUB);
1454 Dir->setNumIterations(Exprs.NumIterations);
1455 Dir->setCounters(Exprs.Counters);
1456 Dir->setPrivateCounters(Exprs.PrivateCounters);
1457 Dir->setInits(Exprs.Inits);
1458 Dir->setUpdates(Exprs.Updates);
1459 Dir->setFinals(Exprs.Finals);
1460 Dir->setDependentCounters(Exprs.DependentCounters);
1461 Dir->setDependentInits(Exprs.DependentInits);
1462 Dir->setFinalsConditions(Exprs.FinalsConditions);
1463 Dir->setPreInits(Exprs.PreInits);
1464 Dir->setHasCancel(HasCancel);
1470 unsigned NumClauses,
1471 unsigned CollapsedNum, EmptyShell) {
1472 return createEmptyDirective<OMPMasterTaskLoopDirective>(
1473 C, NumClauses,
true,
1480 const HelperExprs &Exprs,
bool HasCancel) {
1481 auto *Dir = createDirective<OMPMaskedTaskLoopDirective>(
1482 C, Clauses, AssociatedStmt,
1483 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,
1485 Dir->setIterationVariable(Exprs.IterationVarRef);
1486 Dir->setLastIteration(Exprs.LastIteration);
1487 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1488 Dir->setPreCond(Exprs.PreCond);
1489 Dir->setCond(Exprs.Cond);
1490 Dir->setInit(Exprs.Init);
1491 Dir->setInc(Exprs.Inc);
1492 Dir->setIsLastIterVariable(Exprs.IL);
1493 Dir->setLowerBoundVariable(Exprs.LB);
1494 Dir->setUpperBoundVariable(Exprs.UB);
1495 Dir->setStrideVariable(Exprs.ST);
1496 Dir->setEnsureUpperBound(Exprs.EUB);
1497 Dir->setNextLowerBound(Exprs.NLB);
1498 Dir->setNextUpperBound(Exprs.NUB);
1499 Dir->setNumIterations(Exprs.NumIterations);
1500 Dir->setCounters(Exprs.Counters);
1501 Dir->setPrivateCounters(Exprs.PrivateCounters);
1502 Dir->setInits(Exprs.Inits);
1503 Dir->setUpdates(Exprs.Updates);
1504 Dir->setFinals(Exprs.Finals);
1505 Dir->setDependentCounters(Exprs.DependentCounters);
1506 Dir->setDependentInits(Exprs.DependentInits);
1507 Dir->setFinalsConditions(Exprs.FinalsConditions);
1508 Dir->setPreInits(Exprs.PreInits);
1509 Dir->setHasCancel(HasCancel);
1515 unsigned NumClauses,
1516 unsigned CollapsedNum, EmptyShell) {
1517 return createEmptyDirective<OMPMaskedTaskLoopDirective>(
1518 C, NumClauses,
true,
1525 const HelperExprs &Exprs) {
1526 auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1527 C, Clauses, AssociatedStmt,
1529 EndLoc, CollapsedNum);
1530 Dir->setIterationVariable(Exprs.IterationVarRef);
1531 Dir->setLastIteration(Exprs.LastIteration);
1532 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1533 Dir->setPreCond(Exprs.PreCond);
1534 Dir->setCond(Exprs.Cond);
1535 Dir->setInit(Exprs.Init);
1536 Dir->setInc(Exprs.Inc);
1537 Dir->setIsLastIterVariable(Exprs.IL);
1538 Dir->setLowerBoundVariable(Exprs.LB);
1539 Dir->setUpperBoundVariable(Exprs.UB);
1540 Dir->setStrideVariable(Exprs.ST);
1541 Dir->setEnsureUpperBound(Exprs.EUB);
1542 Dir->setNextLowerBound(Exprs.NLB);
1543 Dir->setNextUpperBound(Exprs.NUB);
1544 Dir->setNumIterations(Exprs.NumIterations);
1545 Dir->setCounters(Exprs.Counters);
1546 Dir->setPrivateCounters(Exprs.PrivateCounters);
1547 Dir->setInits(Exprs.Inits);
1548 Dir->setUpdates(Exprs.Updates);
1549 Dir->setFinals(Exprs.Finals);
1550 Dir->setDependentCounters(Exprs.DependentCounters);
1551 Dir->setDependentInits(Exprs.DependentInits);
1552 Dir->setFinalsConditions(Exprs.FinalsConditions);
1553 Dir->setPreInits(Exprs.PreInits);
1559 unsigned NumClauses,
1560 unsigned CollapsedNum, EmptyShell) {
1561 return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1562 C, NumClauses,
true,
1563 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1569 const HelperExprs &Exprs) {
1570 auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>(
1571 C, Clauses, AssociatedStmt,
1573 EndLoc, CollapsedNum);
1574 Dir->setIterationVariable(Exprs.IterationVarRef);
1575 Dir->setLastIteration(Exprs.LastIteration);
1576 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1577 Dir->setPreCond(Exprs.PreCond);
1578 Dir->setCond(Exprs.Cond);
1579 Dir->setInit(Exprs.Init);
1580 Dir->setInc(Exprs.Inc);
1581 Dir->setIsLastIterVariable(Exprs.IL);
1582 Dir->setLowerBoundVariable(Exprs.LB);
1583 Dir->setUpperBoundVariable(Exprs.UB);
1584 Dir->setStrideVariable(Exprs.ST);
1585 Dir->setEnsureUpperBound(Exprs.EUB);
1586 Dir->setNextLowerBound(Exprs.NLB);
1587 Dir->setNextUpperBound(Exprs.NUB);
1588 Dir->setNumIterations(Exprs.NumIterations);
1589 Dir->setCounters(Exprs.Counters);
1590 Dir->setPrivateCounters(Exprs.PrivateCounters);
1591 Dir->setInits(Exprs.Inits);
1592 Dir->setUpdates(Exprs.Updates);
1593 Dir->setFinals(Exprs.Finals);
1594 Dir->setDependentCounters(Exprs.DependentCounters);
1595 Dir->setDependentInits(Exprs.DependentInits);
1596 Dir->setFinalsConditions(Exprs.FinalsConditions);
1597 Dir->setPreInits(Exprs.PreInits);
1603 unsigned NumClauses,
1604 unsigned CollapsedNum, EmptyShell) {
1605 return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>(
1606 C, NumClauses,
true,
1607 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);
1613 const HelperExprs &Exprs,
bool HasCancel) {
1614 auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1615 C, Clauses, AssociatedStmt,
1616 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1617 EndLoc, CollapsedNum);
1618 Dir->setIterationVariable(Exprs.IterationVarRef);
1619 Dir->setLastIteration(Exprs.LastIteration);
1620 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1621 Dir->setPreCond(Exprs.PreCond);
1622 Dir->setCond(Exprs.Cond);
1623 Dir->setInit(Exprs.Init);
1624 Dir->setInc(Exprs.Inc);
1625 Dir->setIsLastIterVariable(Exprs.IL);
1626 Dir->setLowerBoundVariable(Exprs.LB);
1627 Dir->setUpperBoundVariable(Exprs.UB);
1628 Dir->setStrideVariable(Exprs.ST);
1629 Dir->setEnsureUpperBound(Exprs.EUB);
1630 Dir->setNextLowerBound(Exprs.NLB);
1631 Dir->setNextUpperBound(Exprs.NUB);
1632 Dir->setNumIterations(Exprs.NumIterations);
1633 Dir->setCounters(Exprs.Counters);
1634 Dir->setPrivateCounters(Exprs.PrivateCounters);
1635 Dir->setInits(Exprs.Inits);
1636 Dir->setUpdates(Exprs.Updates);
1637 Dir->setFinals(Exprs.Finals);
1638 Dir->setDependentCounters(Exprs.DependentCounters);
1639 Dir->setDependentInits(Exprs.DependentInits);
1640 Dir->setFinalsConditions(Exprs.FinalsConditions);
1641 Dir->setPreInits(Exprs.PreInits);
1642 Dir->setHasCancel(HasCancel);
1648 unsigned NumClauses,
1649 unsigned CollapsedNum,
1651 return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1652 C, NumClauses,
true,
1660 const HelperExprs &Exprs,
bool HasCancel) {
1661 auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>(
1662 C, Clauses, AssociatedStmt,
1663 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,
1664 EndLoc, CollapsedNum);
1665 Dir->setIterationVariable(Exprs.IterationVarRef);
1666 Dir->setLastIteration(Exprs.LastIteration);
1667 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1668 Dir->setPreCond(Exprs.PreCond);
1669 Dir->setCond(Exprs.Cond);
1670 Dir->setInit(Exprs.Init);
1671 Dir->setInc(Exprs.Inc);
1672 Dir->setIsLastIterVariable(Exprs.IL);
1673 Dir->setLowerBoundVariable(Exprs.LB);
1674 Dir->setUpperBoundVariable(Exprs.UB);
1675 Dir->setStrideVariable(Exprs.ST);
1676 Dir->setEnsureUpperBound(Exprs.EUB);
1677 Dir->setNextLowerBound(Exprs.NLB);
1678 Dir->setNextUpperBound(Exprs.NUB);
1679 Dir->setNumIterations(Exprs.NumIterations);
1680 Dir->setCounters(Exprs.Counters);
1681 Dir->setPrivateCounters(Exprs.PrivateCounters);
1682 Dir->setInits(Exprs.Inits);
1683 Dir->setUpdates(Exprs.Updates);
1684 Dir->setFinals(Exprs.Finals);
1685 Dir->setDependentCounters(Exprs.DependentCounters);
1686 Dir->setDependentInits(Exprs.DependentInits);
1687 Dir->setFinalsConditions(Exprs.FinalsConditions);
1688 Dir->setPreInits(Exprs.PreInits);
1689 Dir->setHasCancel(HasCancel);
1695 unsigned NumClauses,
1696 unsigned CollapsedNum,
1698 return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>(
1699 C, NumClauses,
true,
1708 const HelperExprs &Exprs) {
1709 auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1710 C, Clauses, AssociatedStmt,
1712 StartLoc, EndLoc, CollapsedNum);
1713 Dir->setIterationVariable(Exprs.IterationVarRef);
1714 Dir->setLastIteration(Exprs.LastIteration);
1715 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1716 Dir->setPreCond(Exprs.PreCond);
1717 Dir->setCond(Exprs.Cond);
1718 Dir->setInit(Exprs.Init);
1719 Dir->setInc(Exprs.Inc);
1720 Dir->setIsLastIterVariable(Exprs.IL);
1721 Dir->setLowerBoundVariable(Exprs.LB);
1722 Dir->setUpperBoundVariable(Exprs.UB);
1723 Dir->setStrideVariable(Exprs.ST);
1724 Dir->setEnsureUpperBound(Exprs.EUB);
1725 Dir->setNextLowerBound(Exprs.NLB);
1726 Dir->setNextUpperBound(Exprs.NUB);
1727 Dir->setNumIterations(Exprs.NumIterations);
1728 Dir->setCounters(Exprs.Counters);
1729 Dir->setPrivateCounters(Exprs.PrivateCounters);
1730 Dir->setInits(Exprs.Inits);
1731 Dir->setUpdates(Exprs.Updates);
1732 Dir->setFinals(Exprs.Finals);
1733 Dir->setDependentCounters(Exprs.DependentCounters);
1734 Dir->setDependentInits(Exprs.DependentInits);
1735 Dir->setFinalsConditions(Exprs.FinalsConditions);
1736 Dir->setPreInits(Exprs.PreInits);
1742 unsigned NumClauses,
1743 unsigned CollapsedNum,
1745 return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1746 C, NumClauses,
true,
1755 const HelperExprs &Exprs) {
1756 auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1757 C, Clauses, AssociatedStmt,
1759 StartLoc, EndLoc, CollapsedNum);
1760 Dir->setIterationVariable(Exprs.IterationVarRef);
1761 Dir->setLastIteration(Exprs.LastIteration);
1762 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1763 Dir->setPreCond(Exprs.PreCond);
1764 Dir->setCond(Exprs.Cond);
1765 Dir->setInit(Exprs.Init);
1766 Dir->setInc(Exprs.Inc);
1767 Dir->setIsLastIterVariable(Exprs.IL);
1768 Dir->setLowerBoundVariable(Exprs.LB);
1769 Dir->setUpperBoundVariable(Exprs.UB);
1770 Dir->setStrideVariable(Exprs.ST);
1771 Dir->setEnsureUpperBound(Exprs.EUB);
1772 Dir->setNextLowerBound(Exprs.NLB);
1773 Dir->setNextUpperBound(Exprs.NUB);
1774 Dir->setNumIterations(Exprs.NumIterations);
1775 Dir->setCounters(Exprs.Counters);
1776 Dir->setPrivateCounters(Exprs.PrivateCounters);
1777 Dir->setInits(Exprs.Inits);
1778 Dir->setUpdates(Exprs.Updates);
1779 Dir->setFinals(Exprs.Finals);
1780 Dir->setDependentCounters(Exprs.DependentCounters);
1781 Dir->setDependentInits(Exprs.DependentInits);
1782 Dir->setFinalsConditions(Exprs.FinalsConditions);
1783 Dir->setPreInits(Exprs.PreInits);
1789 unsigned NumClauses,
1790 unsigned CollapsedNum,
1792 return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1793 C, NumClauses,
true,
1802 Stmt *AssociatedStmt,
const HelperExprs &Exprs) {
1803 auto *Dir = createDirective<OMPDistributeDirective>(
1804 C, Clauses, AssociatedStmt,
1807 Dir->setIterationVariable(Exprs.IterationVarRef);
1808 Dir->setLastIteration(Exprs.LastIteration);
1809 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1810 Dir->setPreCond(Exprs.PreCond);
1811 Dir->setCond(Exprs.Cond);
1812 Dir->setInit(Exprs.Init);
1813 Dir->setInc(Exprs.Inc);
1814 Dir->setIsLastIterVariable(Exprs.IL);
1815 Dir->setLowerBoundVariable(Exprs.LB);
1816 Dir->setUpperBoundVariable(Exprs.UB);
1817 Dir->setStrideVariable(Exprs.ST);
1818 Dir->setEnsureUpperBound(Exprs.EUB);
1819 Dir->setNextLowerBound(Exprs.NLB);
1820 Dir->setNextUpperBound(Exprs.NUB);
1821 Dir->setNumIterations(Exprs.NumIterations);
1822 Dir->setCounters(Exprs.Counters);
1823 Dir->setPrivateCounters(Exprs.PrivateCounters);
1824 Dir->setInits(Exprs.Inits);
1825 Dir->setUpdates(Exprs.Updates);
1826 Dir->setFinals(Exprs.Finals);
1827 Dir->setDependentCounters(Exprs.DependentCounters);
1828 Dir->setDependentInits(Exprs.DependentInits);
1829 Dir->setFinalsConditions(Exprs.FinalsConditions);
1830 Dir->setPreInits(Exprs.PreInits);
1836 unsigned CollapsedNum, EmptyShell) {
1837 return createEmptyDirective<OMPDistributeDirective>(
1838 C, NumClauses,
true,
1845 return createDirective<OMPTargetUpdateDirective>(
C, Clauses, AssociatedStmt,
1853 return createEmptyDirective<OMPTargetUpdateDirective>(
1854 C, NumClauses,
true);
1860 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
1861 auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1862 C, Clauses, AssociatedStmt,
1863 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1864 EndLoc, CollapsedNum);
1865 Dir->setIterationVariable(Exprs.IterationVarRef);
1866 Dir->setLastIteration(Exprs.LastIteration);
1867 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1868 Dir->setPreCond(Exprs.PreCond);
1869 Dir->setCond(Exprs.Cond);
1870 Dir->setInit(Exprs.Init);
1871 Dir->setInc(Exprs.Inc);
1872 Dir->setIsLastIterVariable(Exprs.IL);
1873 Dir->setLowerBoundVariable(Exprs.LB);
1874 Dir->setUpperBoundVariable(Exprs.UB);
1875 Dir->setStrideVariable(Exprs.ST);
1876 Dir->setEnsureUpperBound(Exprs.EUB);
1877 Dir->setNextLowerBound(Exprs.NLB);
1878 Dir->setNextUpperBound(Exprs.NUB);
1879 Dir->setNumIterations(Exprs.NumIterations);
1880 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1881 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1882 Dir->setDistInc(Exprs.DistInc);
1883 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1884 Dir->setCounters(Exprs.Counters);
1885 Dir->setPrivateCounters(Exprs.PrivateCounters);
1886 Dir->setInits(Exprs.Inits);
1887 Dir->setUpdates(Exprs.Updates);
1888 Dir->setFinals(Exprs.Finals);
1889 Dir->setDependentCounters(Exprs.DependentCounters);
1890 Dir->setDependentInits(Exprs.DependentInits);
1891 Dir->setFinalsConditions(Exprs.FinalsConditions);
1892 Dir->setPreInits(Exprs.PreInits);
1893 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1894 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1895 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1896 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1897 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1898 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1899 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1900 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1901 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1902 Dir->setTaskReductionRefExpr(TaskRedRef);
1903 Dir->HasCancel = HasCancel;
1909 unsigned NumClauses,
1910 unsigned CollapsedNum,
1912 return createEmptyDirective<OMPDistributeParallelForDirective>(
1913 C, NumClauses,
true,
1922 const HelperExprs &Exprs) {
1923 auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1924 C, Clauses, AssociatedStmt,
1926 StartLoc, EndLoc, CollapsedNum);
1927 Dir->setIterationVariable(Exprs.IterationVarRef);
1928 Dir->setLastIteration(Exprs.LastIteration);
1929 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1930 Dir->setPreCond(Exprs.PreCond);
1931 Dir->setCond(Exprs.Cond);
1932 Dir->setInit(Exprs.Init);
1933 Dir->setInc(Exprs.Inc);
1934 Dir->setIsLastIterVariable(Exprs.IL);
1935 Dir->setLowerBoundVariable(Exprs.LB);
1936 Dir->setUpperBoundVariable(Exprs.UB);
1937 Dir->setStrideVariable(Exprs.ST);
1938 Dir->setEnsureUpperBound(Exprs.EUB);
1939 Dir->setNextLowerBound(Exprs.NLB);
1940 Dir->setNextUpperBound(Exprs.NUB);
1941 Dir->setNumIterations(Exprs.NumIterations);
1942 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1943 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1944 Dir->setDistInc(Exprs.DistInc);
1945 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1946 Dir->setCounters(Exprs.Counters);
1947 Dir->setPrivateCounters(Exprs.PrivateCounters);
1948 Dir->setInits(Exprs.Inits);
1949 Dir->setUpdates(Exprs.Updates);
1950 Dir->setFinals(Exprs.Finals);
1951 Dir->setDependentCounters(Exprs.DependentCounters);
1952 Dir->setDependentInits(Exprs.DependentInits);
1953 Dir->setFinalsConditions(Exprs.FinalsConditions);
1954 Dir->setPreInits(Exprs.PreInits);
1955 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1956 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1957 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1958 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1959 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1960 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1961 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1962 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1963 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1969 unsigned NumClauses,
1970 unsigned CollapsedNum,
1972 return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1973 C, NumClauses,
true,
1981 const HelperExprs &Exprs) {
1982 auto *Dir = createDirective<OMPDistributeSimdDirective>(
1983 C, Clauses, AssociatedStmt,
1984 numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1986 Dir->setIterationVariable(Exprs.IterationVarRef);
1987 Dir->setLastIteration(Exprs.LastIteration);
1988 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1989 Dir->setPreCond(Exprs.PreCond);
1990 Dir->setCond(Exprs.Cond);
1991 Dir->setInit(Exprs.Init);
1992 Dir->setInc(Exprs.Inc);
1993 Dir->setIsLastIterVariable(Exprs.IL);
1994 Dir->setLowerBoundVariable(Exprs.LB);
1995 Dir->setUpperBoundVariable(Exprs.UB);
1996 Dir->setStrideVariable(Exprs.ST);
1997 Dir->setEnsureUpperBound(Exprs.EUB);
1998 Dir->setNextLowerBound(Exprs.NLB);
1999 Dir->setNextUpperBound(Exprs.NUB);
2000 Dir->setNumIterations(Exprs.NumIterations);
2001 Dir->setCounters(Exprs.Counters);
2002 Dir->setPrivateCounters(Exprs.PrivateCounters);
2003 Dir->setInits(Exprs.Inits);
2004 Dir->setUpdates(Exprs.Updates);
2005 Dir->setFinals(Exprs.Finals);
2006 Dir->setDependentCounters(Exprs.DependentCounters);
2007 Dir->setDependentInits(Exprs.DependentInits);
2008 Dir->setFinalsConditions(Exprs.FinalsConditions);
2009 Dir->setPreInits(Exprs.PreInits);
2015 unsigned NumClauses,
2016 unsigned CollapsedNum, EmptyShell) {
2017 return createEmptyDirective<OMPDistributeSimdDirective>(
2018 C, NumClauses,
true,
2025 const HelperExprs &Exprs) {
2026 auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
2027 C, Clauses, AssociatedStmt,
2028 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
2029 EndLoc, CollapsedNum);
2030 Dir->setIterationVariable(Exprs.IterationVarRef);
2031 Dir->setLastIteration(Exprs.LastIteration);
2032 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2033 Dir->setPreCond(Exprs.PreCond);
2034 Dir->setCond(Exprs.Cond);
2035 Dir->setInit(Exprs.Init);
2036 Dir->setInc(Exprs.Inc);
2037 Dir->setIsLastIterVariable(Exprs.IL);
2038 Dir->setLowerBoundVariable(Exprs.LB);
2039 Dir->setUpperBoundVariable(Exprs.UB);
2040 Dir->setStrideVariable(Exprs.ST);
2041 Dir->setEnsureUpperBound(Exprs.EUB);
2042 Dir->setNextLowerBound(Exprs.NLB);
2043 Dir->setNextUpperBound(Exprs.NUB);
2044 Dir->setNumIterations(Exprs.NumIterations);
2045 Dir->setCounters(Exprs.Counters);
2046 Dir->setPrivateCounters(Exprs.PrivateCounters);
2047 Dir->setInits(Exprs.Inits);
2048 Dir->setUpdates(Exprs.Updates);
2049 Dir->setFinals(Exprs.Finals);
2050 Dir->setDependentCounters(Exprs.DependentCounters);
2051 Dir->setDependentInits(Exprs.DependentInits);
2052 Dir->setFinalsConditions(Exprs.FinalsConditions);
2053 Dir->setPreInits(Exprs.PreInits);
2059 unsigned NumClauses,
2060 unsigned CollapsedNum,
2062 return createEmptyDirective<OMPTargetParallelForSimdDirective>(
2063 C, NumClauses,
true,
2072 Stmt *AssociatedStmt,
const HelperExprs &Exprs) {
2073 auto *Dir = createDirective<OMPTargetSimdDirective>(
2074 C, Clauses, AssociatedStmt,
2077 Dir->setIterationVariable(Exprs.IterationVarRef);
2078 Dir->setLastIteration(Exprs.LastIteration);
2079 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2080 Dir->setPreCond(Exprs.PreCond);
2081 Dir->setCond(Exprs.Cond);
2082 Dir->setInit(Exprs.Init);
2083 Dir->setInc(Exprs.Inc);
2084 Dir->setCounters(Exprs.Counters);
2085 Dir->setPrivateCounters(Exprs.PrivateCounters);
2086 Dir->setInits(Exprs.Inits);
2087 Dir->setUpdates(Exprs.Updates);
2088 Dir->setFinals(Exprs.Finals);
2089 Dir->setDependentCounters(Exprs.DependentCounters);
2090 Dir->setDependentInits(Exprs.DependentInits);
2091 Dir->setFinalsConditions(Exprs.FinalsConditions);
2092 Dir->setPreInits(Exprs.PreInits);
2098 unsigned CollapsedNum, EmptyShell) {
2099 return createEmptyDirective<OMPTargetSimdDirective>(
2100 C, NumClauses,
true,
2107 const HelperExprs &Exprs) {
2108 auto *Dir = createDirective<OMPTeamsDistributeDirective>(
2109 C, Clauses, AssociatedStmt,
2110 numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
2112 Dir->setIterationVariable(Exprs.IterationVarRef);
2113 Dir->setLastIteration(Exprs.LastIteration);
2114 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2115 Dir->setPreCond(Exprs.PreCond);
2116 Dir->setCond(Exprs.Cond);
2117 Dir->setInit(Exprs.Init);
2118 Dir->setInc(Exprs.Inc);
2119 Dir->setIsLastIterVariable(Exprs.IL);
2120 Dir->setLowerBoundVariable(Exprs.LB);
2121 Dir->setUpperBoundVariable(Exprs.UB);
2122 Dir->setStrideVariable(Exprs.ST);
2123 Dir->setEnsureUpperBound(Exprs.EUB);
2124 Dir->setNextLowerBound(Exprs.NLB);
2125 Dir->setNextUpperBound(Exprs.NUB);
2126 Dir->setNumIterations(Exprs.NumIterations);
2127 Dir->setCounters(Exprs.Counters);
2128 Dir->setPrivateCounters(Exprs.PrivateCounters);
2129 Dir->setInits(Exprs.Inits);
2130 Dir->setUpdates(Exprs.Updates);
2131 Dir->setFinals(Exprs.Finals);
2132 Dir->setDependentCounters(Exprs.DependentCounters);
2133 Dir->setDependentInits(Exprs.DependentInits);
2134 Dir->setFinalsConditions(Exprs.FinalsConditions);
2135 Dir->setPreInits(Exprs.PreInits);
2141 unsigned NumClauses,
2142 unsigned CollapsedNum, EmptyShell) {
2143 return createEmptyDirective<OMPTeamsDistributeDirective>(
2144 C, NumClauses,
true,
2151 const HelperExprs &Exprs) {
2152 auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
2153 C, Clauses, AssociatedStmt,
2155 EndLoc, CollapsedNum);
2156 Dir->setIterationVariable(Exprs.IterationVarRef);
2157 Dir->setLastIteration(Exprs.LastIteration);
2158 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2159 Dir->setPreCond(Exprs.PreCond);
2160 Dir->setCond(Exprs.Cond);
2161 Dir->setInit(Exprs.Init);
2162 Dir->setInc(Exprs.Inc);
2163 Dir->setIsLastIterVariable(Exprs.IL);
2164 Dir->setLowerBoundVariable(Exprs.LB);
2165 Dir->setUpperBoundVariable(Exprs.UB);
2166 Dir->setStrideVariable(Exprs.ST);
2167 Dir->setEnsureUpperBound(Exprs.EUB);
2168 Dir->setNextLowerBound(Exprs.NLB);
2169 Dir->setNextUpperBound(Exprs.NUB);
2170 Dir->setNumIterations(Exprs.NumIterations);
2171 Dir->setCounters(Exprs.Counters);
2172 Dir->setPrivateCounters(Exprs.PrivateCounters);
2173 Dir->setInits(Exprs.Inits);
2174 Dir->setUpdates(Exprs.Updates);
2175 Dir->setFinals(Exprs.Finals);
2176 Dir->setDependentCounters(Exprs.DependentCounters);
2177 Dir->setDependentInits(Exprs.DependentInits);
2178 Dir->setFinalsConditions(Exprs.FinalsConditions);
2179 Dir->setPreInits(Exprs.PreInits);
2184 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
2186 return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
2187 C, NumClauses,
true,
2188 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
2195 const HelperExprs &Exprs) {
2196 auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
2197 C, Clauses, AssociatedStmt,
2198 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
2199 StartLoc, EndLoc, CollapsedNum);
2200 Dir->setIterationVariable(Exprs.IterationVarRef);
2201 Dir->setLastIteration(Exprs.LastIteration);
2202 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2203 Dir->setPreCond(Exprs.PreCond);
2204 Dir->setCond(Exprs.Cond);
2205 Dir->setInit(Exprs.Init);
2206 Dir->setInc(Exprs.Inc);
2207 Dir->setIsLastIterVariable(Exprs.IL);
2208 Dir->setLowerBoundVariable(Exprs.LB);
2209 Dir->setUpperBoundVariable(Exprs.UB);
2210 Dir->setStrideVariable(Exprs.ST);
2211 Dir->setEnsureUpperBound(Exprs.EUB);
2212 Dir->setNextLowerBound(Exprs.NLB);
2213 Dir->setNextUpperBound(Exprs.NUB);
2214 Dir->setNumIterations(Exprs.NumIterations);
2215 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2216 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2217 Dir->setDistInc(Exprs.DistInc);
2218 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2219 Dir->setCounters(Exprs.Counters);
2220 Dir->setPrivateCounters(Exprs.PrivateCounters);
2221 Dir->setInits(Exprs.Inits);
2222 Dir->setUpdates(Exprs.Updates);
2223 Dir->setFinals(Exprs.Finals);
2224 Dir->setDependentCounters(Exprs.DependentCounters);
2225 Dir->setDependentInits(Exprs.DependentInits);
2226 Dir->setFinalsConditions(Exprs.FinalsConditions);
2227 Dir->setPreInits(Exprs.PreInits);
2228 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2229 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2230 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2231 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2232 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2233 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2234 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2235 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2236 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2242 unsigned NumClauses,
2243 unsigned CollapsedNum,
2245 return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
2246 C, NumClauses,
true,
2247 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
2255 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
2256 auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
2257 C, Clauses, AssociatedStmt,
2258 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2259 StartLoc, EndLoc, CollapsedNum);
2260 Dir->setIterationVariable(Exprs.IterationVarRef);
2261 Dir->setLastIteration(Exprs.LastIteration);
2262 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2263 Dir->setPreCond(Exprs.PreCond);
2264 Dir->setCond(Exprs.Cond);
2265 Dir->setInit(Exprs.Init);
2266 Dir->setInc(Exprs.Inc);
2267 Dir->setIsLastIterVariable(Exprs.IL);
2268 Dir->setLowerBoundVariable(Exprs.LB);
2269 Dir->setUpperBoundVariable(Exprs.UB);
2270 Dir->setStrideVariable(Exprs.ST);
2271 Dir->setEnsureUpperBound(Exprs.EUB);
2272 Dir->setNextLowerBound(Exprs.NLB);
2273 Dir->setNextUpperBound(Exprs.NUB);
2274 Dir->setNumIterations(Exprs.NumIterations);
2275 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2276 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2277 Dir->setDistInc(Exprs.DistInc);
2278 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2279 Dir->setCounters(Exprs.Counters);
2280 Dir->setPrivateCounters(Exprs.PrivateCounters);
2281 Dir->setInits(Exprs.Inits);
2282 Dir->setUpdates(Exprs.Updates);
2283 Dir->setFinals(Exprs.Finals);
2284 Dir->setDependentCounters(Exprs.DependentCounters);
2285 Dir->setDependentInits(Exprs.DependentInits);
2286 Dir->setFinalsConditions(Exprs.FinalsConditions);
2287 Dir->setPreInits(Exprs.PreInits);
2288 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2289 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2290 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2291 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2292 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2293 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2294 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2295 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2296 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2297 Dir->setTaskReductionRefExpr(TaskRedRef);
2298 Dir->HasCancel = HasCancel;
2304 unsigned NumClauses,
2305 unsigned CollapsedNum,
2307 return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
2308 C, NumClauses,
true,
2309 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2316 return createDirective<OMPTargetTeamsDirective>(
C, Clauses, AssociatedStmt,
2324 return createEmptyDirective<OMPTargetTeamsDirective>(
2325 C, NumClauses,
true);
2331 const HelperExprs &Exprs) {
2332 auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
2333 C, Clauses, AssociatedStmt,
2334 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
2335 EndLoc, CollapsedNum);
2336 Dir->setIterationVariable(Exprs.IterationVarRef);
2337 Dir->setLastIteration(Exprs.LastIteration);
2338 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2339 Dir->setPreCond(Exprs.PreCond);
2340 Dir->setCond(Exprs.Cond);
2341 Dir->setInit(Exprs.Init);
2342 Dir->setInc(Exprs.Inc);
2343 Dir->setIsLastIterVariable(Exprs.IL);
2344 Dir->setLowerBoundVariable(Exprs.LB);
2345 Dir->setUpperBoundVariable(Exprs.UB);
2346 Dir->setStrideVariable(Exprs.ST);
2347 Dir->setEnsureUpperBound(Exprs.EUB);
2348 Dir->setNextLowerBound(Exprs.NLB);
2349 Dir->setNextUpperBound(Exprs.NUB);
2350 Dir->setNumIterations(Exprs.NumIterations);
2351 Dir->setCounters(Exprs.Counters);
2352 Dir->setPrivateCounters(Exprs.PrivateCounters);
2353 Dir->setInits(Exprs.Inits);
2354 Dir->setUpdates(Exprs.Updates);
2355 Dir->setFinals(Exprs.Finals);
2356 Dir->setDependentCounters(Exprs.DependentCounters);
2357 Dir->setDependentInits(Exprs.DependentInits);
2358 Dir->setFinalsConditions(Exprs.FinalsConditions);
2359 Dir->setPreInits(Exprs.PreInits);
2365 unsigned NumClauses,
2366 unsigned CollapsedNum,
2368 return createEmptyDirective<OMPTargetTeamsDistributeDirective>(
2369 C, NumClauses,
true,
2378 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
2379 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
2380 C, Clauses, AssociatedStmt,
2381 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2383 StartLoc, EndLoc, CollapsedNum);
2384 Dir->setIterationVariable(Exprs.IterationVarRef);
2385 Dir->setLastIteration(Exprs.LastIteration);
2386 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2387 Dir->setPreCond(Exprs.PreCond);
2388 Dir->setCond(Exprs.Cond);
2389 Dir->setInit(Exprs.Init);
2390 Dir->setInc(Exprs.Inc);
2391 Dir->setIsLastIterVariable(Exprs.IL);
2392 Dir->setLowerBoundVariable(Exprs.LB);
2393 Dir->setUpperBoundVariable(Exprs.UB);
2394 Dir->setStrideVariable(Exprs.ST);
2395 Dir->setEnsureUpperBound(Exprs.EUB);
2396 Dir->setNextLowerBound(Exprs.NLB);
2397 Dir->setNextUpperBound(Exprs.NUB);
2398 Dir->setNumIterations(Exprs.NumIterations);
2399 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2400 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2401 Dir->setDistInc(Exprs.DistInc);
2402 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2403 Dir->setCounters(Exprs.Counters);
2404 Dir->setPrivateCounters(Exprs.PrivateCounters);
2405 Dir->setInits(Exprs.Inits);
2406 Dir->setUpdates(Exprs.Updates);
2407 Dir->setFinals(Exprs.Finals);
2408 Dir->setDependentCounters(Exprs.DependentCounters);
2409 Dir->setDependentInits(Exprs.DependentInits);
2410 Dir->setFinalsConditions(Exprs.FinalsConditions);
2411 Dir->setPreInits(Exprs.PreInits);
2412 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2413 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2414 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2415 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2416 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2417 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2418 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2419 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2420 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2421 Dir->setTaskReductionRefExpr(TaskRedRef);
2422 Dir->HasCancel = HasCancel;
2428 unsigned NumClauses,
2429 unsigned CollapsedNum,
2431 return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
2432 C, NumClauses,
true,
2433 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2442 const HelperExprs &Exprs) {
2443 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2444 C, Clauses, AssociatedStmt,
2446 OMPD_target_teams_distribute_parallel_for_simd),
2447 StartLoc, EndLoc, CollapsedNum);
2448 Dir->setIterationVariable(Exprs.IterationVarRef);
2449 Dir->setLastIteration(Exprs.LastIteration);
2450 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2451 Dir->setPreCond(Exprs.PreCond);
2452 Dir->setCond(Exprs.Cond);
2453 Dir->setInit(Exprs.Init);
2454 Dir->setInc(Exprs.Inc);
2455 Dir->setIsLastIterVariable(Exprs.IL);
2456 Dir->setLowerBoundVariable(Exprs.LB);
2457 Dir->setUpperBoundVariable(Exprs.UB);
2458 Dir->setStrideVariable(Exprs.ST);
2459 Dir->setEnsureUpperBound(Exprs.EUB);
2460 Dir->setNextLowerBound(Exprs.NLB);
2461 Dir->setNextUpperBound(Exprs.NUB);
2462 Dir->setNumIterations(Exprs.NumIterations);
2463 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2464 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2465 Dir->setDistInc(Exprs.DistInc);
2466 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2467 Dir->setCounters(Exprs.Counters);
2468 Dir->setPrivateCounters(Exprs.PrivateCounters);
2469 Dir->setInits(Exprs.Inits);
2470 Dir->setUpdates(Exprs.Updates);
2471 Dir->setFinals(Exprs.Finals);
2472 Dir->setDependentCounters(Exprs.DependentCounters);
2473 Dir->setDependentInits(Exprs.DependentInits);
2474 Dir->setFinalsConditions(Exprs.FinalsConditions);
2475 Dir->setPreInits(Exprs.PreInits);
2476 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2477 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2478 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2479 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2480 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2481 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2482 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2483 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2484 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2490 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
2492 return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2493 C, NumClauses,
true,
2495 OMPD_target_teams_distribute_parallel_for_simd),
2503 const HelperExprs &Exprs) {
2504 auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
2505 C, Clauses, AssociatedStmt,
2507 StartLoc, EndLoc, CollapsedNum);
2508 Dir->setIterationVariable(Exprs.IterationVarRef);
2509 Dir->setLastIteration(Exprs.LastIteration);
2510 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2511 Dir->setPreCond(Exprs.PreCond);
2512 Dir->setCond(Exprs.Cond);
2513 Dir->setInit(Exprs.Init);
2514 Dir->setInc(Exprs.Inc);
2515 Dir->setIsLastIterVariable(Exprs.IL);
2516 Dir->setLowerBoundVariable(Exprs.LB);
2517 Dir->setUpperBoundVariable(Exprs.UB);
2518 Dir->setStrideVariable(Exprs.ST);
2519 Dir->setEnsureUpperBound(Exprs.EUB);
2520 Dir->setNextLowerBound(Exprs.NLB);
2521 Dir->setNextUpperBound(Exprs.NUB);
2522 Dir->setNumIterations(Exprs.NumIterations);
2523 Dir->setCounters(Exprs.Counters);
2524 Dir->setPrivateCounters(Exprs.PrivateCounters);
2525 Dir->setInits(Exprs.Inits);
2526 Dir->setUpdates(Exprs.Updates);
2527 Dir->setFinals(Exprs.Finals);
2528 Dir->setDependentCounters(Exprs.DependentCounters);
2529 Dir->setDependentInits(Exprs.DependentInits);
2530 Dir->setFinalsConditions(Exprs.FinalsConditions);
2531 Dir->setPreInits(Exprs.PreInits);
2537 unsigned NumClauses,
2538 unsigned CollapsedNum,
2540 return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
2541 C, NumClauses,
true,
2550 return createDirective<OMPInteropDirective>(
2551 C, Clauses,
nullptr, 0, StartLoc,
2556 unsigned NumClauses,
2558 return createEmptyDirective<OMPInteropDirective>(
C, NumClauses);
2565 auto *Dir = createDirective<OMPDispatchDirective>(
2566 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
2567 Dir->setTargetCallLoc(TargetCallLoc);
2572 unsigned NumClauses,
2574 return createEmptyDirective<OMPDispatchDirective>(
C, NumClauses,
2583 Stmt *AssociatedStmt) {
2584 return createDirective<OMPMaskedDirective>(
C, Clauses, AssociatedStmt,
2590 unsigned NumClauses,
2592 return createEmptyDirective<OMPMaskedDirective>(
C, NumClauses,
2599 const HelperExprs &Exprs) {
2600 auto *Dir = createDirective<OMPGenericLoopDirective>(
2602 StartLoc, EndLoc, CollapsedNum);
2603 Dir->setIterationVariable(Exprs.IterationVarRef);
2604 Dir->setLastIteration(Exprs.LastIteration);
2605 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2606 Dir->setPreCond(Exprs.PreCond);
2607 Dir->setCond(Exprs.Cond);
2608 Dir->setInit(Exprs.Init);
2609 Dir->setInc(Exprs.Inc);
2610 Dir->setIsLastIterVariable(Exprs.IL);
2611 Dir->setLowerBoundVariable(Exprs.LB);
2612 Dir->setUpperBoundVariable(Exprs.UB);
2613 Dir->setStrideVariable(Exprs.ST);
2614 Dir->setEnsureUpperBound(Exprs.EUB);
2615 Dir->setNextLowerBound(Exprs.NLB);
2616 Dir->setNextUpperBound(Exprs.NUB);
2617 Dir->setNumIterations(Exprs.NumIterations);
2618 Dir->setCounters(Exprs.Counters);
2619 Dir->setPrivateCounters(Exprs.PrivateCounters);
2620 Dir->setInits(Exprs.Inits);
2621 Dir->setUpdates(Exprs.Updates);
2622 Dir->setFinals(Exprs.Finals);
2623 Dir->setDependentCounters(Exprs.DependentCounters);
2624 Dir->setDependentInits(Exprs.DependentInits);
2625 Dir->setFinalsConditions(Exprs.FinalsConditions);
2626 Dir->setPreInits(Exprs.PreInits);
2632 unsigned CollapsedNum, EmptyShell) {
2633 return createEmptyDirective<OMPGenericLoopDirective>(
2634 C, NumClauses,
true,
2641 const HelperExprs &Exprs) {
2642 auto *Dir = createDirective<OMPTeamsGenericLoopDirective>(
2643 C, Clauses, AssociatedStmt,
2646 Dir->setIterationVariable(Exprs.IterationVarRef);
2647 Dir->setLastIteration(Exprs.LastIteration);
2648 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2649 Dir->setPreCond(Exprs.PreCond);
2650 Dir->setCond(Exprs.Cond);
2651 Dir->setInit(Exprs.Init);
2652 Dir->setInc(Exprs.Inc);
2653 Dir->setIsLastIterVariable(Exprs.IL);
2654 Dir->setLowerBoundVariable(Exprs.LB);
2655 Dir->setUpperBoundVariable(Exprs.UB);
2656 Dir->setStrideVariable(Exprs.ST);
2657 Dir->setEnsureUpperBound(Exprs.EUB);
2658 Dir->setNextLowerBound(Exprs.NLB);
2659 Dir->setNextUpperBound(Exprs.NUB);
2660 Dir->setNumIterations(Exprs.NumIterations);
2661 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2662 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2663 Dir->setDistInc(Exprs.DistInc);
2664 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2665 Dir->setCounters(Exprs.Counters);
2666 Dir->setPrivateCounters(Exprs.PrivateCounters);
2667 Dir->setInits(Exprs.Inits);
2668 Dir->setUpdates(Exprs.Updates);
2669 Dir->setFinals(Exprs.Finals);
2670 Dir->setDependentCounters(Exprs.DependentCounters);
2671 Dir->setDependentInits(Exprs.DependentInits);
2672 Dir->setFinalsConditions(Exprs.FinalsConditions);
2673 Dir->setPreInits(Exprs.PreInits);
2674 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2675 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2676 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2677 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2678 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2679 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2680 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2681 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2682 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2688 unsigned NumClauses,
2689 unsigned CollapsedNum, EmptyShell) {
2690 return createEmptyDirective<OMPTeamsGenericLoopDirective>(
2691 C, NumClauses,
true,
2698 const HelperExprs &Exprs,
bool CanBeParallelFor) {
2699 auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>(
2700 C, Clauses, AssociatedStmt,
2701 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,
2703 Dir->setIterationVariable(Exprs.IterationVarRef);
2704 Dir->setLastIteration(Exprs.LastIteration);
2705 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2706 Dir->setPreCond(Exprs.PreCond);
2707 Dir->setCond(Exprs.Cond);
2708 Dir->setInit(Exprs.Init);
2709 Dir->setInc(Exprs.Inc);
2710 Dir->setIsLastIterVariable(Exprs.IL);
2711 Dir->setLowerBoundVariable(Exprs.LB);
2712 Dir->setUpperBoundVariable(Exprs.UB);
2713 Dir->setStrideVariable(Exprs.ST);
2714 Dir->setEnsureUpperBound(Exprs.EUB);
2715 Dir->setNextLowerBound(Exprs.NLB);
2716 Dir->setNextUpperBound(Exprs.NUB);
2717 Dir->setNumIterations(Exprs.NumIterations);
2718 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2719 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2720 Dir->setDistInc(Exprs.DistInc);
2721 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2722 Dir->setCounters(Exprs.Counters);
2723 Dir->setPrivateCounters(Exprs.PrivateCounters);
2724 Dir->setInits(Exprs.Inits);
2725 Dir->setUpdates(Exprs.Updates);
2726 Dir->setFinals(Exprs.Finals);
2727 Dir->setDependentCounters(Exprs.DependentCounters);
2728 Dir->setDependentInits(Exprs.DependentInits);
2729 Dir->setFinalsConditions(Exprs.FinalsConditions);
2730 Dir->setPreInits(Exprs.PreInits);
2731 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2732 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2733 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2734 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2735 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2736 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2737 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2738 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2739 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2740 Dir->setCanBeParallelFor(CanBeParallelFor);
2746 unsigned NumClauses,
2747 unsigned CollapsedNum,
2749 return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>(
2750 C, NumClauses,
true,
2757 const HelperExprs &Exprs) {
2758 auto *Dir = createDirective<OMPParallelGenericLoopDirective>(
2759 C, Clauses, AssociatedStmt,
2762 Dir->setIterationVariable(Exprs.IterationVarRef);
2763 Dir->setLastIteration(Exprs.LastIteration);
2764 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2765 Dir->setPreCond(Exprs.PreCond);
2766 Dir->setCond(Exprs.Cond);
2767 Dir->setInit(Exprs.Init);
2768 Dir->setInc(Exprs.Inc);
2769 Dir->setIsLastIterVariable(Exprs.IL);
2770 Dir->setLowerBoundVariable(Exprs.LB);
2771 Dir->setUpperBoundVariable(Exprs.UB);
2772 Dir->setStrideVariable(Exprs.ST);
2773 Dir->setEnsureUpperBound(Exprs.EUB);
2774 Dir->setNextLowerBound(Exprs.NLB);
2775 Dir->setNextUpperBound(Exprs.NUB);
2776 Dir->setNumIterations(Exprs.NumIterations);
2777 Dir->setCounters(Exprs.Counters);
2778 Dir->setPrivateCounters(Exprs.PrivateCounters);
2779 Dir->setInits(Exprs.Inits);
2780 Dir->setUpdates(Exprs.Updates);
2781 Dir->setFinals(Exprs.Finals);
2782 Dir->setDependentCounters(Exprs.DependentCounters);
2783 Dir->setDependentInits(Exprs.DependentInits);
2784 Dir->setFinalsConditions(Exprs.FinalsConditions);
2785 Dir->setPreInits(Exprs.PreInits);
2790 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
2792 return createEmptyDirective<OMPParallelGenericLoopDirective>(
2793 C, NumClauses,
true,
2801 const HelperExprs &Exprs) {
2802 auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>(
2803 C, Clauses, AssociatedStmt,
2805 EndLoc, CollapsedNum);
2806 Dir->setIterationVariable(Exprs.IterationVarRef);
2807 Dir->setLastIteration(Exprs.LastIteration);
2808 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2809 Dir->setPreCond(Exprs.PreCond);
2810 Dir->setCond(Exprs.Cond);
2811 Dir->setInit(Exprs.Init);
2812 Dir->setInc(Exprs.Inc);
2813 Dir->setIsLastIterVariable(Exprs.IL);
2814 Dir->setLowerBoundVariable(Exprs.LB);
2815 Dir->setUpperBoundVariable(Exprs.UB);
2816 Dir->setStrideVariable(Exprs.ST);
2817 Dir->setEnsureUpperBound(Exprs.EUB);
2818 Dir->setNextLowerBound(Exprs.NLB);
2819 Dir->setNextUpperBound(Exprs.NUB);
2820 Dir->setNumIterations(Exprs.NumIterations);
2821 Dir->setCounters(Exprs.Counters);
2822 Dir->setPrivateCounters(Exprs.PrivateCounters);
2823 Dir->setInits(Exprs.Inits);
2824 Dir->setUpdates(Exprs.Updates);
2825 Dir->setFinals(Exprs.Finals);
2826 Dir->setDependentCounters(Exprs.DependentCounters);
2827 Dir->setDependentInits(Exprs.DependentInits);
2828 Dir->setFinalsConditions(Exprs.FinalsConditions);
2829 Dir->setPreInits(Exprs.PreInits);
2835 unsigned NumClauses,
2836 unsigned CollapsedNum,
2838 return createEmptyDirective<OMPTargetParallelGenericLoopDirective>(
2839 C, NumClauses,
true,
2840 numLoopChildren(CollapsedNum, OMPD_target_parallel_loop), CollapsedNum);
Defines the clang::ASTContext interface.
static Stmt * ignoreContainersKeepingIntraTileHint(Stmt *S)
Like Stmt::IgnoreContainers, but stops at (and preserves) an intra-tile hint wrapper so that the encl...
This file defines OpenMP AST classes for executable directives and clauses.
static OMPAssumeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
static OMPAssumeDirective * Create(const ASTContext &Ctx, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AStmt)
This represents 'pragma omp atomic' directive.
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expressions Exprs)
Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see S...
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This represents 'pragma omp cancel' directive.
static OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents 'pragma omp cancellation point' directive.
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
Contains data for OpenMP directives: clauses, children expressions/statements (helpers for codegen) a...
void setClauses(ArrayRef< OMPClause * > Clauses)
Sets the list of variables for this clause.
MutableArrayRef< Stmt * > getChildren()
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
static OMPDepobjDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDepobjDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
static OMPDispatchDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, SourceLocation TargetCallLoc)
Creates directive with a list of Clauses.
static OMPDispatchDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp distribute' directive.
static OMPDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp distribute parallel for' composite directive.
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents 'pragma omp distribute parallel for simd' composite directive.
static OMPDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp distribute simd' composite directive.
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPErrorDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
static OMPErrorDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPFlattenDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
Create a new AST node representation for 'pragma omp flatten'.
static OMPFlattenDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp flatten' AST node for deserialization.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
static OMPForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp for simd' directive.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPFuseDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumGeneratedTopLevelLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for pragma omp fuse'.
static OMPFuseDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty 'pragma omp fuse' AST node for deserialization.
This represents 'pragma omp loop' directive.
static OMPGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with a place for NumClauses clauses.
static OMPGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
Represents the 'pragma omp interchange' loop transformation directive.
static OMPInterchangeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp interchange' AST node for deserialization.
static OMPInterchangeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for 'pragma omp interchange'.
This represents 'pragma omp interop' directive.
static OMPInteropDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPInteropDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
void setFinals(ArrayRef< Expr * > A)
static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind)
Children number.
void setDependentCounters(ArrayRef< Expr * > A)
void setFinalsConditions(ArrayRef< Expr * > A)
void setInits(ArrayRef< Expr * > A)
void setCounters(ArrayRef< Expr * > A)
void setDependentInits(ArrayRef< Expr * > A)
void setUpdates(ArrayRef< Expr * > A)
void setPrivateCounters(ArrayRef< Expr * > A)
static OMPMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
This represents 'pragma omp masked taskloop' directive.
static OMPMaskedTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp masked taskloop simd' directive.
static OMPMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMaskedTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This represents 'pragma omp master taskloop' directive.
static OMPMasterTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp master taskloop simd' directive.
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMasterTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents block-associated 'pragma omp ordered' directive.
static OMPOrderedBlockAssocDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
static OMPOrderedBlockAssocDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents standalone 'pragma omp ordered' directive.
static OMPOrderedStandaloneDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPOrderedStandaloneDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
This represents 'pragma omp parallel for' directive.
static OMPParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
static OMPParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel for simd' directive.
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents 'pragma omp parallel masked' directive.
static OMPParallelMaskedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPParallelMaskedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef)
Creates directive with a list of Clauses.
This represents 'pragma omp parallel masked taskloop' directive.
static OMPParallelMaskedTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPParallelMaskedTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel masked taskloop simd' directive.
static OMPParallelMaskedTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPParallelMaskedTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel master' directive.
static OMPParallelMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef)
Creates directive with a list of Clauses.
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel master taskloop' directive.
static OMPParallelMasterTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPParallelMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel master taskloop simd' directive.
static OMPParallelMasterTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPParallelMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp parallel sections' directive.
static OMPParallelSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents the 'pragma omp reverse' loop transformation directive.
static OMPReverseDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, unsigned NumLoops, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for 'pragma omp reverse'.
static OMPReverseDirective * CreateEmpty(const ASTContext &C, unsigned NumLoops)
Build an empty 'pragma omp reverse' AST node for deserialization.
static OMPScanDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPScanDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive with a list of Clauses.
static OMPScopeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive.
static OMPScopeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
void setHasCancel(bool Has)
Set cancel state.
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
static OMPSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp simd' directive.
static OMPSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPSingleDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Represents the 'pragma omp split' loop transformation directive.
static OMPSplitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp split' AST node for deserialization.
static OMPSplitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for 'pragma omp split'.
This represents the 'pragma omp stripe' loop transformation directive.
static OMPStripeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for 'pragma omp stripe'.
static OMPStripeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp stripe' AST node for deserialization.
static OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTargetDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target enter data' directive.
static OMPTargetEnterDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents 'pragma omp target exit data' directive.
static OMPTargetExitDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents 'pragma omp target parallel' directive.
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents 'pragma omp target parallel for' directive.
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents 'pragma omp target parallel for simd' directive.
static OMPTargetParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target parallel loop' directive.
static OMPTargetParallelGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetParallelGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents 'pragma omp target simd' directive.
static OMPTargetSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target teams' directive.
static OMPTargetTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target teams distribute' combined directive.
static OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents 'pragma omp target teams distribute parallel for' combined directive.
static OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetTeamsDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
This represents 'pragma omp target teams distribute parallel for simd' combined directive.
static OMPTargetTeamsDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target teams distribute simd' combined directive.
static OMPTargetTeamsDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target teams loop' directive.
static OMPTargetTeamsGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool CanBeParallelFor)
Creates directive with a list of Clauses.
static OMPTargetTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp target update' directive.
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetUpdateDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents 'pragma omp task' directive.
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
static OMPTaskLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel)
Creates directive with a list of Clauses.
static OMPTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp taskloop simd' directive.
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTaskLoopSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expr *ReductionRef)
Creates directive.
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents 'pragma omp taskwait' directive.
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses)
Creates directive.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents 'pragma omp teams distribute' directive.
static OMPTeamsDistributeDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp teams distribute parallel for' composite directive.
static OMPTeamsDistributeParallelForDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel)
Creates directive with a list of Clauses.
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp teams distribute parallel for simd' composite directive.
static OMPTeamsDistributeParallelForSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTeamsDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeSimdDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents 'pragma omp teams loop' directive.
static OMPTeamsGenericLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsGenericLoopDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, const HelperExprs &Exprs)
Creates directive with a list of Clauses.
This represents the 'pragma omp tile' loop transformation directive.
static OMPTileDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops)
Build an empty 'pragma omp tile' AST node for deserialization.
static OMPTileDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, unsigned NumLoops, Stmt *AssociatedStmt, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for 'pragma omp tile'.
static OMPUnrollDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt, Stmt *PreInits)
Create a new AST node representation for 'pragma omp unroll'.
static OMPUnrollDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses)
Build an empty 'pragma omp unroll' AST node for deserialization.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
This represents one expression.
Encodes a location in the source.
Stmt - This represents one statement.
Top level wrappers for InstallAPI frontend operations.
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
bool isa(CodeGen::Address addr)
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
Stmt Stmt llvm::function_ref< void(OMPLoopTransformationDirective *)> OnTransformationCallback
Stmt Stmt llvm::function_ref< void(OMPLoopTransformationDirective *)> bool RelaxNestForPeeledTransformation
bool hasSpecificAttr(const Container &container)
auto * getSpecificAttr(const Container &container)
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
MutableArrayRef< Expr * > getInits()
U cast(CodeGen::Address addr)
Expr * Cond
Conditional expression in atomic compare construct. */.
Expr * X
'x' part of the associated expression/statement.
bool IsXLHSInRHSPart
True if UE has the first form and false if the second.
Expr * E
'expr' part of the associated expression/statement.
Expr * D
'd' part of the associated expression/statement.
Expr * V
'v' part of the associated expression/statement.
bool IsFailOnly
True if 'v' is updated only when the condition is false (compare capture only).
Expr * UE
UE Helper expression of the form: 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or 'OpaqueValueExp...
bool IsPostfixUpdate
True if original value of 'x' must be stored in 'v', not an updated one.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...