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();
43 if (
auto *AS = dyn_cast_or_null<AttributedStmt>(S)) {
49 if (
auto *CS = dyn_cast_or_null<CompoundStmt>(S)) {
60size_t OMPChildren::size(
unsigned NumClauses,
bool HasAssociatedStmt,
61 unsigned NumChildren) {
63 totalSizeToAlloc<OMPClause *, Stmt *>(
64 NumClauses, NumChildren + (HasAssociatedStmt ? 1 : 0)),
65 alignof(OMPChildren));
69 assert(Clauses.size() == NumClauses &&
70 "Number of clauses is not the same as the preallocated buffer");
71 llvm::copy(Clauses, getTrailingObjects<OMPClause *>());
75 return getTrailingObjects<Stmt *>(NumChildren);
80 Data->setClauses(Clauses);
85 Stmt *S,
unsigned NumChildren) {
86 auto *
Data = CreateEmpty(Mem, Clauses.size(), S, NumChildren);
87 Data->setClauses(Clauses);
89 Data->setAssociatedStmt(S);
93OMPChildren *OMPChildren::CreateEmpty(
void *Mem,
unsigned NumClauses,
94 bool HasAssociatedStmt,
95 unsigned NumChildren) {
96 return new (Mem) OMPChildren(NumClauses, NumChildren, HasAssociatedStmt);
99bool OMPExecutableDirective::isStandaloneDirective()
const {
107 return !hasAssociatedStmt();
110Stmt *OMPExecutableDirective::getStructuredBlock() {
111 assert(!isStandaloneDirective() &&
112 "Standalone Executable Directives don't have Structured Blocks.");
113 if (
auto *LD = dyn_cast<OMPLoopDirective>(
this))
114 return LD->getBody();
119OMPLoopBasedDirective::tryToFindNextInnerLoop(
Stmt *CurStmt,
120 bool TryImperfectlyNestedLoops) {
121 Stmt *OrigStmt = CurStmt;
124 if (TryImperfectlyNestedLoops) {
125 if (
auto *CS = dyn_cast<CompoundStmt>(CurStmt)) {
127 SmallVector<CompoundStmt *, 4> Statements(1, CS);
128 SmallVector<CompoundStmt *, 4> NextStatements;
129 while (!Statements.empty()) {
130 CS = Statements.pop_back_val();
133 for (Stmt *S : CS->body()) {
141 if (
auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Inner))
142 Inner = CanonLoop->getLoopStmt();
143 Inner = OMPLoopBasedDirective::ignoreIntraTileHint(Inner);
156 if (
auto *InnerCS = dyn_cast_or_null<CompoundStmt>(S))
157 NextStatements.push_back(InnerCS);
159 if (Statements.empty()) {
163 Statements.swap(NextStatements);
173bool OMPLoopBasedDirective::doForAllLoops(
174 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
175 llvm::function_ref<
bool(
unsigned,
Stmt *,
Stmt *)> Callback,
179 for (
unsigned Cnt = 0; Cnt < NumLoops; ++Cnt) {
181 auto *Dir = dyn_cast<OMPLoopTransformationDirective>(CurStmt);
187 Stmt *TransformedStmt = Dir->getTransformedStmt();
188 if (!TransformedStmt) {
189 unsigned NumGeneratedTopLevelLoops =
190 Dir->getNumGeneratedTopLevelLoops();
191 if (NumGeneratedTopLevelLoops == 0) {
196 if (NumGeneratedTopLevelLoops > 0) {
204 CurStmt = TransformedStmt;
206 if (
auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(CurStmt))
207 CurStmt = CanonLoop->getLoopStmt();
210 Stmt *LoopStmt = ignoreIntraTileHint(CurStmt);
211 Stmt *HintWrapper = LoopStmt != CurStmt ? CurStmt :
nullptr;
212 if (
Callback(Cnt, LoopStmt, HintWrapper))
219 if (
auto *For = dyn_cast<ForStmt>(LoopStmt)) {
220 CurStmt = For->getBody();
223 "Expected canonical for or range-based for loops.");
226 CurStmt = OMPLoopBasedDirective::tryToFindNextInnerLoop(
227 CurStmt, TryImperfectlyNestedLoops);
232void OMPLoopBasedDirective::doForAllLoopsBodies(
233 Stmt *CurStmt,
bool TryImperfectlyNestedLoops,
unsigned NumLoops,
234 llvm::function_ref<
void(
unsigned,
Stmt *,
Stmt *)> Callback) {
235 bool Res = OMPLoopBasedDirective::doForAllLoops(
236 CurStmt, TryImperfectlyNestedLoops, NumLoops,
238 Stmt *Body =
nullptr;
239 if (
auto *For = dyn_cast<ForStmt>(
Loop)) {
240 Body = For->getBody();
243 "Expected canonical for or range-based for loops.");
246 if (
auto *CanonLoop = dyn_cast<OMPCanonicalLoop>(Body))
247 Body = CanonLoop->getLoopStmt();
251 assert(Res &&
"Expected only loops");
257 Stmt *Body =
nullptr;
258 OMPLoopBasedDirective::doForAllLoopsBodies(
259 Data->getRawStmt(),
true,
261 [&Body](
unsigned,
Stmt *,
Stmt *BodyStmt) { Body = BodyStmt; });
266 assert(A.size() == getLoopsNumber() &&
267 "Number of loop counters is not the same as the collapsed number");
268 llvm::copy(A, getCounters().begin());
272 assert(A.size() == getLoopsNumber() &&
"Number of loop private counters "
273 "is not the same as the collapsed "
275 llvm::copy(A, getPrivateCounters().begin());
279 assert(A.size() == getLoopsNumber() &&
280 "Number of counter inits is not the same as the collapsed number");
285 assert(A.size() == getLoopsNumber() &&
286 "Number of counter updates is not the same as the collapsed number");
291 assert(A.size() == getLoopsNumber() &&
292 "Number of counter finals is not the same as the collapsed number");
298 A.size() == getLoopsNumber() &&
299 "Number of dependent counters is not the same as the collapsed number");
300 llvm::copy(A, getDependentCounters().begin());
304 assert(A.size() == getLoopsNumber() &&
305 "Number of dependent inits is not the same as the collapsed number");
306 llvm::copy(A, getDependentInits().begin());
310 assert(A.size() == getLoopsNumber() &&
311 "Number of finals conditions is not the same as the collapsed number");
312 llvm::copy(A, getFinalsConditions().begin());
319 Stmt *AssociatedStmt,
Stmt *IfStmt) {
320 auto *Dir = createDirective<OMPMetaDirective>(
321 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
322 Dir->setIfStmt(IfStmt);
329 return createEmptyDirective<OMPMetaDirective>(
C, NumClauses,
334OMPParallelDirective *OMPParallelDirective::Create(
338 auto *Dir = createDirective<OMPParallelDirective>(
339 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
340 Dir->setTaskReductionRefExpr(TaskRedRef);
341 Dir->setHasCancel(HasCancel);
345OMPParallelDirective *OMPParallelDirective::CreateEmpty(
const ASTContext &
C,
348 return createEmptyDirective<OMPParallelDirective>(
C, NumClauses,
357 const HelperExprs &Exprs) {
358 auto *Dir = createDirective<OMPSimdDirective>(
360 StartLoc, EndLoc, CollapsedNum);
361 Dir->setIterationVariable(Exprs.IterationVarRef);
362 Dir->setLastIteration(Exprs.LastIteration);
363 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
364 Dir->setPreCond(Exprs.PreCond);
365 Dir->setCond(Exprs.Cond);
366 Dir->setInit(Exprs.Init);
367 Dir->setInc(Exprs.Inc);
368 Dir->setCounters(Exprs.Counters);
369 Dir->setPrivateCounters(Exprs.PrivateCounters);
370 Dir->setInits(Exprs.Inits);
371 Dir->setUpdates(Exprs.Updates);
372 Dir->setFinals(Exprs.Finals);
373 Dir->setDependentCounters(Exprs.DependentCounters);
374 Dir->setDependentInits(Exprs.DependentInits);
375 Dir->setFinalsConditions(Exprs.FinalsConditions);
376 Dir->setPreInits(Exprs.PreInits);
382 unsigned CollapsedNum,
384 return createEmptyDirective<OMPSimdDirective>(
392 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
393 auto *Dir = createDirective<OMPForDirective>(
395 StartLoc, EndLoc, CollapsedNum);
396 Dir->setIterationVariable(Exprs.IterationVarRef);
397 Dir->setLastIteration(Exprs.LastIteration);
398 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
399 Dir->setPreCond(Exprs.PreCond);
400 Dir->setCond(Exprs.Cond);
401 Dir->setInit(Exprs.Init);
402 Dir->setInc(Exprs.Inc);
403 Dir->setIsLastIterVariable(Exprs.IL);
404 Dir->setLowerBoundVariable(Exprs.LB);
405 Dir->setUpperBoundVariable(Exprs.UB);
406 Dir->setStrideVariable(Exprs.ST);
407 Dir->setEnsureUpperBound(Exprs.EUB);
408 Dir->setNextLowerBound(Exprs.NLB);
409 Dir->setNextUpperBound(Exprs.NUB);
410 Dir->setNumIterations(Exprs.NumIterations);
411 Dir->setCounters(Exprs.Counters);
412 Dir->setPrivateCounters(Exprs.PrivateCounters);
413 Dir->setInits(Exprs.Inits);
414 Dir->setUpdates(Exprs.Updates);
415 Dir->setFinals(Exprs.Finals);
416 Dir->setDependentCounters(Exprs.DependentCounters);
417 Dir->setDependentInits(Exprs.DependentInits);
418 Dir->setFinalsConditions(Exprs.FinalsConditions);
419 Dir->setPreInits(Exprs.PreInits);
420 Dir->setTaskReductionRefExpr(TaskRedRef);
421 Dir->setHasCancel(HasCancel);
426 if (
auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
427 return D->getTransformedStmt();
428 if (
auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
429 return D->getTransformedStmt();
430 llvm_unreachable(
"unexpected object type");
434 if (
auto *D = dyn_cast<OMPCanonicalLoopNestTransformationDirective>(S))
435 return D->getPreInits();
436 if (
auto *D = dyn_cast<OMPCanonicalLoopSequenceTransformationDirective>(S))
437 return D->getPreInits();
438 llvm_unreachable(
"unexpected object type");
442 switch (getStmtClass()) {
443#define STMT(CLASS, PARENT)
444#define ABSTRACT_STMT(CLASS)
445#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
446 case Stmt::CLASS##Class: \
447 return static_cast<const CLASS *>(this)->getTransformedStmt();
448#include "clang/AST/StmtNodes.inc"
450 llvm_unreachable(
"Not a loop transformation for canonical loop nests");
455 switch (getStmtClass()) {
456#define STMT(CLASS, PARENT)
457#define ABSTRACT_STMT(CLASS)
458#define OMPCANONICALLOOPNESTTRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
459 case Stmt::CLASS##Class: \
460 return static_cast<const CLASS *>(this)->getPreInits();
461#include "clang/AST/StmtNodes.inc"
463 llvm_unreachable(
"Not a loop transformation for canonical loop nests");
469 switch (getStmtClass()) {
470#define STMT(CLASS, PARENT)
471#define ABSTRACT_STMT(CLASS)
472#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
473 case Stmt::CLASS##Class: \
474 return static_cast<const CLASS *>(this)->getTransformedStmt();
475#include "clang/AST/StmtNodes.inc"
477 llvm_unreachable(
"Not a loop transformation for canonical loop sequences");
482 switch (getStmtClass()) {
483#define STMT(CLASS, PARENT)
484#define ABSTRACT_STMT(CLASS)
485#define OMPCANONICALLOOPSEQUENCETRANSFORMATIONDIRECTIVE(CLASS, PARENT) \
486 case Stmt::CLASS##Class: \
487 return static_cast<const CLASS *>(this)->getPreInits();
488#include "clang/AST/StmtNodes.inc"
490 llvm_unreachable(
"Not a loop transformation for canonical loop sequences");
496 unsigned CollapsedNum,
498 return createEmptyDirective<OMPForDirective>(
506 unsigned NumLoops,
Stmt *AssociatedStmt,
507 Stmt *TransformedStmt,
Stmt *PreInits) {
508 OMPTileDirective *Dir = createDirective<OMPTileDirective>(
509 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
511 Dir->setTransformedStmt(TransformedStmt);
512 Dir->setPreInits(PreInits);
519 return createEmptyDirective<OMPTileDirective>(
520 C, NumClauses,
true, TransformedStmtOffset + 1,
527 unsigned NumLoops,
Stmt *AssociatedStmt,
528 Stmt *TransformedStmt,
Stmt *PreInits) {
529 OMPStripeDirective *Dir = createDirective<OMPStripeDirective>(
530 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
532 Dir->setTransformedStmt(TransformedStmt);
533 Dir->setPreInits(PreInits);
540 return createEmptyDirective<OMPStripeDirective>(
541 C, NumClauses,
true, TransformedStmtOffset + 1,
548 unsigned NumGeneratedTopLevelLoops,
Stmt *TransformedStmt,
Stmt *PreInits) {
549 assert(NumGeneratedTopLevelLoops <= 1 &&
550 "Unrolling generates at most one loop");
552 auto *Dir = createDirective<OMPUnrollDirective>(
553 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);
554 Dir->setNumGeneratedTopLevelLoops(NumGeneratedTopLevelLoops);
555 Dir->setTransformedStmt(TransformedStmt);
556 Dir->setPreInits(PreInits);
561 unsigned NumClauses) {
562 return createEmptyDirective<OMPUnrollDirective>(
563 C, NumClauses,
true, TransformedStmtOffset + 1,
570 unsigned NumLoops,
Stmt *TransformedStmt,
572 OMPReverseDirective *Dir = createDirective<OMPReverseDirective>(
573 C, {}, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
575 Dir->setTransformedStmt(TransformedStmt);
576 Dir->setPreInits(PreInits);
582 return createEmptyDirective<OMPReverseDirective>(
590 Stmt *TransformedStmt,
Stmt *PreInits) {
591 OMPInterchangeDirective *Dir = createDirective<OMPInterchangeDirective>(
592 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
594 Dir->setTransformedStmt(TransformedStmt);
595 Dir->setPreInits(PreInits);
602 return createEmptyDirective<OMPInterchangeDirective>(
603 C, NumClauses,
true, TransformedStmtOffset + 1,
611 OMPFlattenDirective *Dir = createDirective<OMPFlattenDirective>(
612 C, Clauses, AssociatedStmt, FinalsOffset + 1, StartLoc, EndLoc, NumLoops);
613 Dir->setTransformedStmt(TransformedStmt);
614 Dir->setPreInits(PreInits);
615 Dir->setFinals(Finals);
622 return createEmptyDirective<OMPFlattenDirective>(
623 C, NumClauses,
true, FinalsOffset + 1,
630 unsigned NumLoops,
Stmt *AssociatedStmt,
631 Stmt *TransformedStmt,
Stmt *PreInits) {
632 OMPSplitDirective *Dir = createDirective<OMPSplitDirective>(
633 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
635 Dir->setTransformedStmt(TransformedStmt);
636 Dir->setPreInits(PreInits);
643 return createEmptyDirective<OMPSplitDirective>(
644 C, NumClauses,
true, TransformedStmtOffset + 1,
651 Stmt *AssociatedStmt,
Stmt *TransformedStmt,
Stmt *PreInits) {
653 OMPFuseDirective *Dir = createDirective<OMPFuseDirective>(
654 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);
655 Dir->setTransformedStmt(TransformedStmt);
656 Dir->setPreInits(PreInits);
662 unsigned NumClauses) {
663 OMPFuseDirective *Dir = createEmptyDirective<OMPFuseDirective>(
664 C, NumClauses,
true, TransformedStmtOffset + 1,
673 const HelperExprs &Exprs) {
674 auto *Dir = createDirective<OMPForSimdDirective>(
676 StartLoc, EndLoc, CollapsedNum);
677 Dir->setIterationVariable(Exprs.IterationVarRef);
678 Dir->setLastIteration(Exprs.LastIteration);
679 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
680 Dir->setPreCond(Exprs.PreCond);
681 Dir->setCond(Exprs.Cond);
682 Dir->setInit(Exprs.Init);
683 Dir->setInc(Exprs.Inc);
684 Dir->setIsLastIterVariable(Exprs.IL);
685 Dir->setLowerBoundVariable(Exprs.LB);
686 Dir->setUpperBoundVariable(Exprs.UB);
687 Dir->setStrideVariable(Exprs.ST);
688 Dir->setEnsureUpperBound(Exprs.EUB);
689 Dir->setNextLowerBound(Exprs.NLB);
690 Dir->setNextUpperBound(Exprs.NUB);
691 Dir->setNumIterations(Exprs.NumIterations);
692 Dir->setCounters(Exprs.Counters);
693 Dir->setPrivateCounters(Exprs.PrivateCounters);
694 Dir->setInits(Exprs.Inits);
695 Dir->setUpdates(Exprs.Updates);
696 Dir->setFinals(Exprs.Finals);
697 Dir->setDependentCounters(Exprs.DependentCounters);
698 Dir->setDependentInits(Exprs.DependentInits);
699 Dir->setFinalsConditions(Exprs.FinalsConditions);
700 Dir->setPreInits(Exprs.PreInits);
706 unsigned CollapsedNum,
708 return createEmptyDirective<OMPForSimdDirective>(
717 auto *Dir = createDirective<OMPSectionsDirective>(
C, Clauses, AssociatedStmt,
720 Dir->setTaskReductionRefExpr(TaskRedRef);
721 Dir->setHasCancel(HasCancel);
728 return createEmptyDirective<OMPSectionsDirective>(
C, NumClauses,
736 Stmt *AssociatedStmt,
739 createDirective<OMPSectionDirective>(
C, {}, AssociatedStmt,
740 0, StartLoc, EndLoc);
747 return createEmptyDirective<OMPSectionDirective>(
C, 0,
755 Stmt *AssociatedStmt) {
756 return createDirective<OMPScopeDirective>(
C, Clauses, AssociatedStmt,
764 return createEmptyDirective<OMPScopeDirective>(
C, NumClauses,
772 Stmt *AssociatedStmt) {
773 return createDirective<OMPSingleDirective>(
C, Clauses, AssociatedStmt,
781 return createEmptyDirective<OMPSingleDirective>(
C, NumClauses,
788 Stmt *AssociatedStmt) {
789 return createDirective<OMPMasterDirective>(
C, {}, AssociatedStmt,
796 return createEmptyDirective<OMPMasterDirective>(
C, 0,
804 return createDirective<OMPCriticalDirective>(
C, Clauses, AssociatedStmt,
812 return createEmptyDirective<OMPCriticalDirective>(
C, NumClauses,
819 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
820 auto *Dir = createDirective<OMPParallelForDirective>(
821 C, Clauses, AssociatedStmt,
822 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,
824 Dir->setIterationVariable(Exprs.IterationVarRef);
825 Dir->setLastIteration(Exprs.LastIteration);
826 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
827 Dir->setPreCond(Exprs.PreCond);
828 Dir->setCond(Exprs.Cond);
829 Dir->setInit(Exprs.Init);
830 Dir->setInc(Exprs.Inc);
831 Dir->setIsLastIterVariable(Exprs.IL);
832 Dir->setLowerBoundVariable(Exprs.LB);
833 Dir->setUpperBoundVariable(Exprs.UB);
834 Dir->setStrideVariable(Exprs.ST);
835 Dir->setEnsureUpperBound(Exprs.EUB);
836 Dir->setNextLowerBound(Exprs.NLB);
837 Dir->setNextUpperBound(Exprs.NUB);
838 Dir->setNumIterations(Exprs.NumIterations);
839 Dir->setCounters(Exprs.Counters);
840 Dir->setPrivateCounters(Exprs.PrivateCounters);
841 Dir->setInits(Exprs.Inits);
842 Dir->setUpdates(Exprs.Updates);
843 Dir->setFinals(Exprs.Finals);
844 Dir->setDependentCounters(Exprs.DependentCounters);
845 Dir->setDependentInits(Exprs.DependentInits);
846 Dir->setFinalsConditions(Exprs.FinalsConditions);
847 Dir->setPreInits(Exprs.PreInits);
848 Dir->setTaskReductionRefExpr(TaskRedRef);
849 Dir->setHasCancel(HasCancel);
855 unsigned CollapsedNum, EmptyShell) {
856 return createEmptyDirective<OMPParallelForDirective>(
864 const HelperExprs &Exprs) {
865 auto *Dir = createDirective<OMPParallelForSimdDirective>(
866 C, Clauses, AssociatedStmt,
867 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,
869 Dir->setIterationVariable(Exprs.IterationVarRef);
870 Dir->setLastIteration(Exprs.LastIteration);
871 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
872 Dir->setPreCond(Exprs.PreCond);
873 Dir->setCond(Exprs.Cond);
874 Dir->setInit(Exprs.Init);
875 Dir->setInc(Exprs.Inc);
876 Dir->setIsLastIterVariable(Exprs.IL);
877 Dir->setLowerBoundVariable(Exprs.LB);
878 Dir->setUpperBoundVariable(Exprs.UB);
879 Dir->setStrideVariable(Exprs.ST);
880 Dir->setEnsureUpperBound(Exprs.EUB);
881 Dir->setNextLowerBound(Exprs.NLB);
882 Dir->setNextUpperBound(Exprs.NUB);
883 Dir->setNumIterations(Exprs.NumIterations);
884 Dir->setCounters(Exprs.Counters);
885 Dir->setPrivateCounters(Exprs.PrivateCounters);
886 Dir->setInits(Exprs.Inits);
887 Dir->setUpdates(Exprs.Updates);
888 Dir->setFinals(Exprs.Finals);
889 Dir->setDependentCounters(Exprs.DependentCounters);
890 Dir->setDependentInits(Exprs.DependentInits);
891 Dir->setFinalsConditions(Exprs.FinalsConditions);
892 Dir->setPreInits(Exprs.PreInits);
899 unsigned CollapsedNum, EmptyShell) {
900 return createEmptyDirective<OMPParallelForSimdDirective>(
908 auto *Dir = createDirective<OMPParallelMasterDirective>(
909 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
910 Dir->setTaskReductionRefExpr(TaskRedRef);
916 unsigned NumClauses, EmptyShell) {
917 return createEmptyDirective<OMPParallelMasterDirective>(
918 C, NumClauses,
true, 1);
924 auto *Dir = createDirective<OMPParallelMaskedDirective>(
925 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
926 Dir->setTaskReductionRefExpr(TaskRedRef);
932 unsigned NumClauses, EmptyShell) {
933 return createEmptyDirective<OMPParallelMaskedDirective>(
934 C, NumClauses,
true, 1);
941 auto *Dir = createDirective<OMPParallelSectionsDirective>(
942 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
943 Dir->setTaskReductionRefExpr(TaskRedRef);
944 Dir->setHasCancel(HasCancel);
950 unsigned NumClauses, EmptyShell) {
951 return createEmptyDirective<OMPParallelSectionsDirective>(
952 C, NumClauses,
true, 1);
958 Stmt *AssociatedStmt,
bool HasCancel) {
959 auto *Dir = createDirective<OMPTaskDirective>(
960 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
961 Dir->setHasCancel(HasCancel);
968 return createEmptyDirective<OMPTaskDirective>(
C, NumClauses,
975 return new (
C) OMPTaskyieldDirective(StartLoc, EndLoc);
980 return new (
C) OMPTaskyieldDirective();
988 return createDirective<OMPAssumeDirective>(
C, Clauses, AStmt,
996 return createEmptyDirective<OMPAssumeDirective>(
C, NumClauses,
1004 return createDirective<OMPErrorDirective>(
1005 C, Clauses,
nullptr, 0, StartLoc,
1010 unsigned NumClauses,
1012 return createEmptyDirective<OMPErrorDirective>(
C, NumClauses);
1018 return new (
C) OMPBarrierDirective(StartLoc, EndLoc);
1023 return new (
C) OMPBarrierDirective();
1030 return createDirective<OMPTaskwaitDirective>(
1031 C, Clauses,
nullptr, 0, StartLoc,
1036 unsigned NumClauses,
1038 return createEmptyDirective<OMPTaskwaitDirective>(
C, NumClauses);
1044 auto *Dir = createDirective<OMPTaskgroupDirective>(
1045 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
1046 Dir->setReductionRef(ReductionRef);
1051 unsigned NumClauses,
1053 return createEmptyDirective<OMPTaskgroupDirective>(
1054 C, NumClauses,
true, 1);
1060 auto *Dir =
new (
C) OMPCancellationPointDirective(StartLoc, EndLoc);
1061 Dir->setCancelRegion(CancelRegion);
1067 return new (
C) OMPCancellationPointDirective();
1074 auto *Dir = createDirective<OMPCancelDirective>(
1075 C, Clauses,
nullptr, 0, StartLoc,
1077 Dir->setCancelRegion(CancelRegion);
1082 unsigned NumClauses,
1084 return createEmptyDirective<OMPCancelDirective>(
C, NumClauses);
1091 return createDirective<OMPFlushDirective>(
1092 C, Clauses,
nullptr, 0, StartLoc,
1097 unsigned NumClauses,
1099 return createEmptyDirective<OMPFlushDirective>(
C, NumClauses);
1106 return createDirective<OMPDepobjDirective>(
1107 C, Clauses,
nullptr,
1108 0, StartLoc, EndLoc);
1112 unsigned NumClauses,
1114 return createEmptyDirective<OMPDepobjDirective>(
C, NumClauses);
1121 return createDirective<OMPScanDirective>(
C, Clauses,
1123 0, StartLoc, EndLoc);
1127 unsigned NumClauses,
1129 return createEmptyDirective<OMPScanDirective>(
C, NumClauses);
1135 return createDirective<OMPOrderedStandaloneDirective>(
1136 C, Clauses,
nullptr, 0, StartLoc,
1142 unsigned NumClauses, EmptyShell) {
1143 return createEmptyDirective<OMPOrderedStandaloneDirective>(
C, NumClauses);
1149 return createDirective<OMPOrderedBlockAssocDirective>(
1156 unsigned NumClauses, EmptyShell) {
1157 return createEmptyDirective<OMPOrderedBlockAssocDirective>(
1158 C, NumClauses,
true);
1165 auto *Dir = createDirective<OMPAtomicDirective>(
1166 C, Clauses, AssociatedStmt, 7, StartLoc, EndLoc);
1170 Dir->setExpr(Exprs.
E);
1171 Dir->setUpdateExpr(Exprs.
UE);
1173 Dir->setCond(Exprs.
Cond);
1176 Dir->Flags.IsFailOnly = Exprs.
IsFailOnly ? 1 : 0;
1181 unsigned NumClauses,
1183 return createEmptyDirective<OMPAtomicDirective>(
1184 C, NumClauses,
true, 7);
1191 Stmt *AssociatedStmt) {
1192 return createDirective<OMPTargetDirective>(
1193 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1197 unsigned NumClauses,
1199 return createEmptyDirective<OMPTargetDirective>(
C, NumClauses,
1207 auto *Dir = createDirective<OMPTargetParallelDirective>(
1208 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
1209 Dir->setTaskReductionRefExpr(TaskRedRef);
1210 Dir->setHasCancel(HasCancel);
1216 unsigned NumClauses, EmptyShell) {
1217 return createEmptyDirective<OMPTargetParallelDirective>(
1218 C, NumClauses,
true, 1);
1224 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
1225 auto *Dir = createDirective<OMPTargetParallelForDirective>(
1226 C, Clauses, AssociatedStmt,
1227 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
1228 EndLoc, CollapsedNum);
1229 Dir->setIterationVariable(Exprs.IterationVarRef);
1230 Dir->setLastIteration(Exprs.LastIteration);
1231 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1232 Dir->setPreCond(Exprs.PreCond);
1233 Dir->setCond(Exprs.Cond);
1234 Dir->setInit(Exprs.Init);
1235 Dir->setInc(Exprs.Inc);
1236 Dir->setIsLastIterVariable(Exprs.IL);
1237 Dir->setLowerBoundVariable(Exprs.LB);
1238 Dir->setUpperBoundVariable(Exprs.UB);
1239 Dir->setStrideVariable(Exprs.ST);
1240 Dir->setEnsureUpperBound(Exprs.EUB);
1241 Dir->setNextLowerBound(Exprs.NLB);
1242 Dir->setNextUpperBound(Exprs.NUB);
1243 Dir->setNumIterations(Exprs.NumIterations);
1244 Dir->setCounters(Exprs.Counters);
1245 Dir->setPrivateCounters(Exprs.PrivateCounters);
1246 Dir->setInits(Exprs.Inits);
1247 Dir->setUpdates(Exprs.Updates);
1248 Dir->setFinals(Exprs.Finals);
1249 Dir->setDependentCounters(Exprs.DependentCounters);
1250 Dir->setDependentInits(Exprs.DependentInits);
1251 Dir->setFinalsConditions(Exprs.FinalsConditions);
1252 Dir->setPreInits(Exprs.PreInits);
1253 Dir->setTaskReductionRefExpr(TaskRedRef);
1254 Dir->setHasCancel(HasCancel);
1260 unsigned NumClauses,
1261 unsigned CollapsedNum, EmptyShell) {
1262 return createEmptyDirective<OMPTargetParallelForDirective>(
1263 C, NumClauses,
true,
1271 return createDirective<OMPTargetDataDirective>(
1272 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1278 return createEmptyDirective<OMPTargetDataDirective>(
1285 return createDirective<OMPTargetEnterDataDirective>(
1286 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1292 return createEmptyDirective<OMPTargetEnterDataDirective>(
1299 return createDirective<OMPTargetExitDataDirective>(
1300 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1306 return createEmptyDirective<OMPTargetExitDataDirective>(
1314 Stmt *AssociatedStmt) {
1315 return createDirective<OMPTeamsDirective>(
1316 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1320 unsigned NumClauses,
1322 return createEmptyDirective<OMPTeamsDirective>(
C, NumClauses,
1329 const HelperExprs &Exprs,
bool HasCancel) {
1330 auto *Dir = createDirective<OMPTaskLoopDirective>(
1332 StartLoc, EndLoc, CollapsedNum);
1333 Dir->setIterationVariable(Exprs.IterationVarRef);
1334 Dir->setLastIteration(Exprs.LastIteration);
1335 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1336 Dir->setPreCond(Exprs.PreCond);
1337 Dir->setCond(Exprs.Cond);
1338 Dir->setInit(Exprs.Init);
1339 Dir->setInc(Exprs.Inc);
1340 Dir->setIsLastIterVariable(Exprs.IL);
1341 Dir->setLowerBoundVariable(Exprs.LB);
1342 Dir->setUpperBoundVariable(Exprs.UB);
1343 Dir->setStrideVariable(Exprs.ST);
1344 Dir->setEnsureUpperBound(Exprs.EUB);
1345 Dir->setNextLowerBound(Exprs.NLB);
1346 Dir->setNextUpperBound(Exprs.NUB);
1347 Dir->setNumIterations(Exprs.NumIterations);
1348 Dir->setCounters(Exprs.Counters);
1349 Dir->setPrivateCounters(Exprs.PrivateCounters);
1350 Dir->setInits(Exprs.Inits);
1351 Dir->setUpdates(Exprs.Updates);
1352 Dir->setFinals(Exprs.Finals);
1353 Dir->setDependentCounters(Exprs.DependentCounters);
1354 Dir->setDependentInits(Exprs.DependentInits);
1355 Dir->setFinalsConditions(Exprs.FinalsConditions);
1356 Dir->setPreInits(Exprs.PreInits);
1357 Dir->setHasCancel(HasCancel);
1362 unsigned NumClauses,
1363 unsigned CollapsedNum,
1365 return createEmptyDirective<OMPTaskLoopDirective>(
1366 C, NumClauses,
true,
1373 const HelperExprs &Exprs) {
1374 auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1375 C, Clauses, AssociatedStmt,
1378 Dir->setIterationVariable(Exprs.IterationVarRef);
1379 Dir->setLastIteration(Exprs.LastIteration);
1380 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1381 Dir->setPreCond(Exprs.PreCond);
1382 Dir->setCond(Exprs.Cond);
1383 Dir->setInit(Exprs.Init);
1384 Dir->setInc(Exprs.Inc);
1385 Dir->setIsLastIterVariable(Exprs.IL);
1386 Dir->setLowerBoundVariable(Exprs.LB);
1387 Dir->setUpperBoundVariable(Exprs.UB);
1388 Dir->setStrideVariable(Exprs.ST);
1389 Dir->setEnsureUpperBound(Exprs.EUB);
1390 Dir->setNextLowerBound(Exprs.NLB);
1391 Dir->setNextUpperBound(Exprs.NUB);
1392 Dir->setNumIterations(Exprs.NumIterations);
1393 Dir->setCounters(Exprs.Counters);
1394 Dir->setPrivateCounters(Exprs.PrivateCounters);
1395 Dir->setInits(Exprs.Inits);
1396 Dir->setUpdates(Exprs.Updates);
1397 Dir->setFinals(Exprs.Finals);
1398 Dir->setDependentCounters(Exprs.DependentCounters);
1399 Dir->setDependentInits(Exprs.DependentInits);
1400 Dir->setFinalsConditions(Exprs.FinalsConditions);
1401 Dir->setPreInits(Exprs.PreInits);
1407 unsigned CollapsedNum, EmptyShell) {
1408 return createEmptyDirective<OMPTaskLoopSimdDirective>(
1409 C, NumClauses,
true,
1416 const HelperExprs &Exprs,
bool HasCancel) {
1417 auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1418 C, Clauses, AssociatedStmt,
1419 numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1421 Dir->setIterationVariable(Exprs.IterationVarRef);
1422 Dir->setLastIteration(Exprs.LastIteration);
1423 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1424 Dir->setPreCond(Exprs.PreCond);
1425 Dir->setCond(Exprs.Cond);
1426 Dir->setInit(Exprs.Init);
1427 Dir->setInc(Exprs.Inc);
1428 Dir->setIsLastIterVariable(Exprs.IL);
1429 Dir->setLowerBoundVariable(Exprs.LB);
1430 Dir->setUpperBoundVariable(Exprs.UB);
1431 Dir->setStrideVariable(Exprs.ST);
1432 Dir->setEnsureUpperBound(Exprs.EUB);
1433 Dir->setNextLowerBound(Exprs.NLB);
1434 Dir->setNextUpperBound(Exprs.NUB);
1435 Dir->setNumIterations(Exprs.NumIterations);
1436 Dir->setCounters(Exprs.Counters);
1437 Dir->setPrivateCounters(Exprs.PrivateCounters);
1438 Dir->setInits(Exprs.Inits);
1439 Dir->setUpdates(Exprs.Updates);
1440 Dir->setFinals(Exprs.Finals);
1441 Dir->setDependentCounters(Exprs.DependentCounters);
1442 Dir->setDependentInits(Exprs.DependentInits);
1443 Dir->setFinalsConditions(Exprs.FinalsConditions);
1444 Dir->setPreInits(Exprs.PreInits);
1445 Dir->setHasCancel(HasCancel);
1451 unsigned NumClauses,
1452 unsigned CollapsedNum, EmptyShell) {
1453 return createEmptyDirective<OMPMasterTaskLoopDirective>(
1454 C, NumClauses,
true,
1461 const HelperExprs &Exprs,
bool HasCancel) {
1462 auto *Dir = createDirective<OMPMaskedTaskLoopDirective>(
1463 C, Clauses, AssociatedStmt,
1464 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,
1466 Dir->setIterationVariable(Exprs.IterationVarRef);
1467 Dir->setLastIteration(Exprs.LastIteration);
1468 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1469 Dir->setPreCond(Exprs.PreCond);
1470 Dir->setCond(Exprs.Cond);
1471 Dir->setInit(Exprs.Init);
1472 Dir->setInc(Exprs.Inc);
1473 Dir->setIsLastIterVariable(Exprs.IL);
1474 Dir->setLowerBoundVariable(Exprs.LB);
1475 Dir->setUpperBoundVariable(Exprs.UB);
1476 Dir->setStrideVariable(Exprs.ST);
1477 Dir->setEnsureUpperBound(Exprs.EUB);
1478 Dir->setNextLowerBound(Exprs.NLB);
1479 Dir->setNextUpperBound(Exprs.NUB);
1480 Dir->setNumIterations(Exprs.NumIterations);
1481 Dir->setCounters(Exprs.Counters);
1482 Dir->setPrivateCounters(Exprs.PrivateCounters);
1483 Dir->setInits(Exprs.Inits);
1484 Dir->setUpdates(Exprs.Updates);
1485 Dir->setFinals(Exprs.Finals);
1486 Dir->setDependentCounters(Exprs.DependentCounters);
1487 Dir->setDependentInits(Exprs.DependentInits);
1488 Dir->setFinalsConditions(Exprs.FinalsConditions);
1489 Dir->setPreInits(Exprs.PreInits);
1490 Dir->setHasCancel(HasCancel);
1496 unsigned NumClauses,
1497 unsigned CollapsedNum, EmptyShell) {
1498 return createEmptyDirective<OMPMaskedTaskLoopDirective>(
1499 C, NumClauses,
true,
1506 const HelperExprs &Exprs) {
1507 auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1508 C, Clauses, AssociatedStmt,
1510 EndLoc, CollapsedNum);
1511 Dir->setIterationVariable(Exprs.IterationVarRef);
1512 Dir->setLastIteration(Exprs.LastIteration);
1513 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1514 Dir->setPreCond(Exprs.PreCond);
1515 Dir->setCond(Exprs.Cond);
1516 Dir->setInit(Exprs.Init);
1517 Dir->setInc(Exprs.Inc);
1518 Dir->setIsLastIterVariable(Exprs.IL);
1519 Dir->setLowerBoundVariable(Exprs.LB);
1520 Dir->setUpperBoundVariable(Exprs.UB);
1521 Dir->setStrideVariable(Exprs.ST);
1522 Dir->setEnsureUpperBound(Exprs.EUB);
1523 Dir->setNextLowerBound(Exprs.NLB);
1524 Dir->setNextUpperBound(Exprs.NUB);
1525 Dir->setNumIterations(Exprs.NumIterations);
1526 Dir->setCounters(Exprs.Counters);
1527 Dir->setPrivateCounters(Exprs.PrivateCounters);
1528 Dir->setInits(Exprs.Inits);
1529 Dir->setUpdates(Exprs.Updates);
1530 Dir->setFinals(Exprs.Finals);
1531 Dir->setDependentCounters(Exprs.DependentCounters);
1532 Dir->setDependentInits(Exprs.DependentInits);
1533 Dir->setFinalsConditions(Exprs.FinalsConditions);
1534 Dir->setPreInits(Exprs.PreInits);
1540 unsigned NumClauses,
1541 unsigned CollapsedNum, EmptyShell) {
1542 return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1543 C, NumClauses,
true,
1544 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1550 const HelperExprs &Exprs) {
1551 auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>(
1552 C, Clauses, AssociatedStmt,
1554 EndLoc, CollapsedNum);
1555 Dir->setIterationVariable(Exprs.IterationVarRef);
1556 Dir->setLastIteration(Exprs.LastIteration);
1557 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1558 Dir->setPreCond(Exprs.PreCond);
1559 Dir->setCond(Exprs.Cond);
1560 Dir->setInit(Exprs.Init);
1561 Dir->setInc(Exprs.Inc);
1562 Dir->setIsLastIterVariable(Exprs.IL);
1563 Dir->setLowerBoundVariable(Exprs.LB);
1564 Dir->setUpperBoundVariable(Exprs.UB);
1565 Dir->setStrideVariable(Exprs.ST);
1566 Dir->setEnsureUpperBound(Exprs.EUB);
1567 Dir->setNextLowerBound(Exprs.NLB);
1568 Dir->setNextUpperBound(Exprs.NUB);
1569 Dir->setNumIterations(Exprs.NumIterations);
1570 Dir->setCounters(Exprs.Counters);
1571 Dir->setPrivateCounters(Exprs.PrivateCounters);
1572 Dir->setInits(Exprs.Inits);
1573 Dir->setUpdates(Exprs.Updates);
1574 Dir->setFinals(Exprs.Finals);
1575 Dir->setDependentCounters(Exprs.DependentCounters);
1576 Dir->setDependentInits(Exprs.DependentInits);
1577 Dir->setFinalsConditions(Exprs.FinalsConditions);
1578 Dir->setPreInits(Exprs.PreInits);
1584 unsigned NumClauses,
1585 unsigned CollapsedNum, EmptyShell) {
1586 return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>(
1587 C, NumClauses,
true,
1588 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);
1594 const HelperExprs &Exprs,
bool HasCancel) {
1595 auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1596 C, Clauses, AssociatedStmt,
1597 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1598 EndLoc, CollapsedNum);
1599 Dir->setIterationVariable(Exprs.IterationVarRef);
1600 Dir->setLastIteration(Exprs.LastIteration);
1601 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1602 Dir->setPreCond(Exprs.PreCond);
1603 Dir->setCond(Exprs.Cond);
1604 Dir->setInit(Exprs.Init);
1605 Dir->setInc(Exprs.Inc);
1606 Dir->setIsLastIterVariable(Exprs.IL);
1607 Dir->setLowerBoundVariable(Exprs.LB);
1608 Dir->setUpperBoundVariable(Exprs.UB);
1609 Dir->setStrideVariable(Exprs.ST);
1610 Dir->setEnsureUpperBound(Exprs.EUB);
1611 Dir->setNextLowerBound(Exprs.NLB);
1612 Dir->setNextUpperBound(Exprs.NUB);
1613 Dir->setNumIterations(Exprs.NumIterations);
1614 Dir->setCounters(Exprs.Counters);
1615 Dir->setPrivateCounters(Exprs.PrivateCounters);
1616 Dir->setInits(Exprs.Inits);
1617 Dir->setUpdates(Exprs.Updates);
1618 Dir->setFinals(Exprs.Finals);
1619 Dir->setDependentCounters(Exprs.DependentCounters);
1620 Dir->setDependentInits(Exprs.DependentInits);
1621 Dir->setFinalsConditions(Exprs.FinalsConditions);
1622 Dir->setPreInits(Exprs.PreInits);
1623 Dir->setHasCancel(HasCancel);
1629 unsigned NumClauses,
1630 unsigned CollapsedNum,
1632 return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1633 C, NumClauses,
true,
1641 const HelperExprs &Exprs,
bool HasCancel) {
1642 auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>(
1643 C, Clauses, AssociatedStmt,
1644 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,
1645 EndLoc, CollapsedNum);
1646 Dir->setIterationVariable(Exprs.IterationVarRef);
1647 Dir->setLastIteration(Exprs.LastIteration);
1648 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1649 Dir->setPreCond(Exprs.PreCond);
1650 Dir->setCond(Exprs.Cond);
1651 Dir->setInit(Exprs.Init);
1652 Dir->setInc(Exprs.Inc);
1653 Dir->setIsLastIterVariable(Exprs.IL);
1654 Dir->setLowerBoundVariable(Exprs.LB);
1655 Dir->setUpperBoundVariable(Exprs.UB);
1656 Dir->setStrideVariable(Exprs.ST);
1657 Dir->setEnsureUpperBound(Exprs.EUB);
1658 Dir->setNextLowerBound(Exprs.NLB);
1659 Dir->setNextUpperBound(Exprs.NUB);
1660 Dir->setNumIterations(Exprs.NumIterations);
1661 Dir->setCounters(Exprs.Counters);
1662 Dir->setPrivateCounters(Exprs.PrivateCounters);
1663 Dir->setInits(Exprs.Inits);
1664 Dir->setUpdates(Exprs.Updates);
1665 Dir->setFinals(Exprs.Finals);
1666 Dir->setDependentCounters(Exprs.DependentCounters);
1667 Dir->setDependentInits(Exprs.DependentInits);
1668 Dir->setFinalsConditions(Exprs.FinalsConditions);
1669 Dir->setPreInits(Exprs.PreInits);
1670 Dir->setHasCancel(HasCancel);
1676 unsigned NumClauses,
1677 unsigned CollapsedNum,
1679 return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>(
1680 C, NumClauses,
true,
1689 const HelperExprs &Exprs) {
1690 auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1691 C, Clauses, AssociatedStmt,
1693 StartLoc, EndLoc, CollapsedNum);
1694 Dir->setIterationVariable(Exprs.IterationVarRef);
1695 Dir->setLastIteration(Exprs.LastIteration);
1696 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1697 Dir->setPreCond(Exprs.PreCond);
1698 Dir->setCond(Exprs.Cond);
1699 Dir->setInit(Exprs.Init);
1700 Dir->setInc(Exprs.Inc);
1701 Dir->setIsLastIterVariable(Exprs.IL);
1702 Dir->setLowerBoundVariable(Exprs.LB);
1703 Dir->setUpperBoundVariable(Exprs.UB);
1704 Dir->setStrideVariable(Exprs.ST);
1705 Dir->setEnsureUpperBound(Exprs.EUB);
1706 Dir->setNextLowerBound(Exprs.NLB);
1707 Dir->setNextUpperBound(Exprs.NUB);
1708 Dir->setNumIterations(Exprs.NumIterations);
1709 Dir->setCounters(Exprs.Counters);
1710 Dir->setPrivateCounters(Exprs.PrivateCounters);
1711 Dir->setInits(Exprs.Inits);
1712 Dir->setUpdates(Exprs.Updates);
1713 Dir->setFinals(Exprs.Finals);
1714 Dir->setDependentCounters(Exprs.DependentCounters);
1715 Dir->setDependentInits(Exprs.DependentInits);
1716 Dir->setFinalsConditions(Exprs.FinalsConditions);
1717 Dir->setPreInits(Exprs.PreInits);
1723 unsigned NumClauses,
1724 unsigned CollapsedNum,
1726 return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1727 C, NumClauses,
true,
1736 const HelperExprs &Exprs) {
1737 auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1738 C, Clauses, AssociatedStmt,
1740 StartLoc, EndLoc, CollapsedNum);
1741 Dir->setIterationVariable(Exprs.IterationVarRef);
1742 Dir->setLastIteration(Exprs.LastIteration);
1743 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1744 Dir->setPreCond(Exprs.PreCond);
1745 Dir->setCond(Exprs.Cond);
1746 Dir->setInit(Exprs.Init);
1747 Dir->setInc(Exprs.Inc);
1748 Dir->setIsLastIterVariable(Exprs.IL);
1749 Dir->setLowerBoundVariable(Exprs.LB);
1750 Dir->setUpperBoundVariable(Exprs.UB);
1751 Dir->setStrideVariable(Exprs.ST);
1752 Dir->setEnsureUpperBound(Exprs.EUB);
1753 Dir->setNextLowerBound(Exprs.NLB);
1754 Dir->setNextUpperBound(Exprs.NUB);
1755 Dir->setNumIterations(Exprs.NumIterations);
1756 Dir->setCounters(Exprs.Counters);
1757 Dir->setPrivateCounters(Exprs.PrivateCounters);
1758 Dir->setInits(Exprs.Inits);
1759 Dir->setUpdates(Exprs.Updates);
1760 Dir->setFinals(Exprs.Finals);
1761 Dir->setDependentCounters(Exprs.DependentCounters);
1762 Dir->setDependentInits(Exprs.DependentInits);
1763 Dir->setFinalsConditions(Exprs.FinalsConditions);
1764 Dir->setPreInits(Exprs.PreInits);
1770 unsigned NumClauses,
1771 unsigned CollapsedNum,
1773 return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1774 C, NumClauses,
true,
1783 Stmt *AssociatedStmt,
const HelperExprs &Exprs) {
1784 auto *Dir = createDirective<OMPDistributeDirective>(
1785 C, Clauses, AssociatedStmt,
1788 Dir->setIterationVariable(Exprs.IterationVarRef);
1789 Dir->setLastIteration(Exprs.LastIteration);
1790 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1791 Dir->setPreCond(Exprs.PreCond);
1792 Dir->setCond(Exprs.Cond);
1793 Dir->setInit(Exprs.Init);
1794 Dir->setInc(Exprs.Inc);
1795 Dir->setIsLastIterVariable(Exprs.IL);
1796 Dir->setLowerBoundVariable(Exprs.LB);
1797 Dir->setUpperBoundVariable(Exprs.UB);
1798 Dir->setStrideVariable(Exprs.ST);
1799 Dir->setEnsureUpperBound(Exprs.EUB);
1800 Dir->setNextLowerBound(Exprs.NLB);
1801 Dir->setNextUpperBound(Exprs.NUB);
1802 Dir->setNumIterations(Exprs.NumIterations);
1803 Dir->setCounters(Exprs.Counters);
1804 Dir->setPrivateCounters(Exprs.PrivateCounters);
1805 Dir->setInits(Exprs.Inits);
1806 Dir->setUpdates(Exprs.Updates);
1807 Dir->setFinals(Exprs.Finals);
1808 Dir->setDependentCounters(Exprs.DependentCounters);
1809 Dir->setDependentInits(Exprs.DependentInits);
1810 Dir->setFinalsConditions(Exprs.FinalsConditions);
1811 Dir->setPreInits(Exprs.PreInits);
1817 unsigned CollapsedNum, EmptyShell) {
1818 return createEmptyDirective<OMPDistributeDirective>(
1819 C, NumClauses,
true,
1826 return createDirective<OMPTargetUpdateDirective>(
C, Clauses, AssociatedStmt,
1834 return createEmptyDirective<OMPTargetUpdateDirective>(
1835 C, NumClauses,
true);
1841 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
1842 auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1843 C, Clauses, AssociatedStmt,
1844 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1845 EndLoc, CollapsedNum);
1846 Dir->setIterationVariable(Exprs.IterationVarRef);
1847 Dir->setLastIteration(Exprs.LastIteration);
1848 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1849 Dir->setPreCond(Exprs.PreCond);
1850 Dir->setCond(Exprs.Cond);
1851 Dir->setInit(Exprs.Init);
1852 Dir->setInc(Exprs.Inc);
1853 Dir->setIsLastIterVariable(Exprs.IL);
1854 Dir->setLowerBoundVariable(Exprs.LB);
1855 Dir->setUpperBoundVariable(Exprs.UB);
1856 Dir->setStrideVariable(Exprs.ST);
1857 Dir->setEnsureUpperBound(Exprs.EUB);
1858 Dir->setNextLowerBound(Exprs.NLB);
1859 Dir->setNextUpperBound(Exprs.NUB);
1860 Dir->setNumIterations(Exprs.NumIterations);
1861 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1862 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1863 Dir->setDistInc(Exprs.DistInc);
1864 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1865 Dir->setCounters(Exprs.Counters);
1866 Dir->setPrivateCounters(Exprs.PrivateCounters);
1867 Dir->setInits(Exprs.Inits);
1868 Dir->setUpdates(Exprs.Updates);
1869 Dir->setFinals(Exprs.Finals);
1870 Dir->setDependentCounters(Exprs.DependentCounters);
1871 Dir->setDependentInits(Exprs.DependentInits);
1872 Dir->setFinalsConditions(Exprs.FinalsConditions);
1873 Dir->setPreInits(Exprs.PreInits);
1874 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1875 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1876 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1877 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1878 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1879 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1880 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1881 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1882 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1883 Dir->setTaskReductionRefExpr(TaskRedRef);
1884 Dir->HasCancel = HasCancel;
1890 unsigned NumClauses,
1891 unsigned CollapsedNum,
1893 return createEmptyDirective<OMPDistributeParallelForDirective>(
1894 C, NumClauses,
true,
1903 const HelperExprs &Exprs) {
1904 auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1905 C, Clauses, AssociatedStmt,
1907 StartLoc, EndLoc, CollapsedNum);
1908 Dir->setIterationVariable(Exprs.IterationVarRef);
1909 Dir->setLastIteration(Exprs.LastIteration);
1910 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1911 Dir->setPreCond(Exprs.PreCond);
1912 Dir->setCond(Exprs.Cond);
1913 Dir->setInit(Exprs.Init);
1914 Dir->setInc(Exprs.Inc);
1915 Dir->setIsLastIterVariable(Exprs.IL);
1916 Dir->setLowerBoundVariable(Exprs.LB);
1917 Dir->setUpperBoundVariable(Exprs.UB);
1918 Dir->setStrideVariable(Exprs.ST);
1919 Dir->setEnsureUpperBound(Exprs.EUB);
1920 Dir->setNextLowerBound(Exprs.NLB);
1921 Dir->setNextUpperBound(Exprs.NUB);
1922 Dir->setNumIterations(Exprs.NumIterations);
1923 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1924 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1925 Dir->setDistInc(Exprs.DistInc);
1926 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1927 Dir->setCounters(Exprs.Counters);
1928 Dir->setPrivateCounters(Exprs.PrivateCounters);
1929 Dir->setInits(Exprs.Inits);
1930 Dir->setUpdates(Exprs.Updates);
1931 Dir->setFinals(Exprs.Finals);
1932 Dir->setDependentCounters(Exprs.DependentCounters);
1933 Dir->setDependentInits(Exprs.DependentInits);
1934 Dir->setFinalsConditions(Exprs.FinalsConditions);
1935 Dir->setPreInits(Exprs.PreInits);
1936 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1937 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1938 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1939 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1940 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1941 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1942 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1943 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1944 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1950 unsigned NumClauses,
1951 unsigned CollapsedNum,
1953 return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1954 C, NumClauses,
true,
1962 const HelperExprs &Exprs) {
1963 auto *Dir = createDirective<OMPDistributeSimdDirective>(
1964 C, Clauses, AssociatedStmt,
1965 numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1967 Dir->setIterationVariable(Exprs.IterationVarRef);
1968 Dir->setLastIteration(Exprs.LastIteration);
1969 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1970 Dir->setPreCond(Exprs.PreCond);
1971 Dir->setCond(Exprs.Cond);
1972 Dir->setInit(Exprs.Init);
1973 Dir->setInc(Exprs.Inc);
1974 Dir->setIsLastIterVariable(Exprs.IL);
1975 Dir->setLowerBoundVariable(Exprs.LB);
1976 Dir->setUpperBoundVariable(Exprs.UB);
1977 Dir->setStrideVariable(Exprs.ST);
1978 Dir->setEnsureUpperBound(Exprs.EUB);
1979 Dir->setNextLowerBound(Exprs.NLB);
1980 Dir->setNextUpperBound(Exprs.NUB);
1981 Dir->setNumIterations(Exprs.NumIterations);
1982 Dir->setCounters(Exprs.Counters);
1983 Dir->setPrivateCounters(Exprs.PrivateCounters);
1984 Dir->setInits(Exprs.Inits);
1985 Dir->setUpdates(Exprs.Updates);
1986 Dir->setFinals(Exprs.Finals);
1987 Dir->setDependentCounters(Exprs.DependentCounters);
1988 Dir->setDependentInits(Exprs.DependentInits);
1989 Dir->setFinalsConditions(Exprs.FinalsConditions);
1990 Dir->setPreInits(Exprs.PreInits);
1996 unsigned NumClauses,
1997 unsigned CollapsedNum, EmptyShell) {
1998 return createEmptyDirective<OMPDistributeSimdDirective>(
1999 C, NumClauses,
true,
2006 const HelperExprs &Exprs) {
2007 auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
2008 C, Clauses, AssociatedStmt,
2009 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
2010 EndLoc, CollapsedNum);
2011 Dir->setIterationVariable(Exprs.IterationVarRef);
2012 Dir->setLastIteration(Exprs.LastIteration);
2013 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2014 Dir->setPreCond(Exprs.PreCond);
2015 Dir->setCond(Exprs.Cond);
2016 Dir->setInit(Exprs.Init);
2017 Dir->setInc(Exprs.Inc);
2018 Dir->setIsLastIterVariable(Exprs.IL);
2019 Dir->setLowerBoundVariable(Exprs.LB);
2020 Dir->setUpperBoundVariable(Exprs.UB);
2021 Dir->setStrideVariable(Exprs.ST);
2022 Dir->setEnsureUpperBound(Exprs.EUB);
2023 Dir->setNextLowerBound(Exprs.NLB);
2024 Dir->setNextUpperBound(Exprs.NUB);
2025 Dir->setNumIterations(Exprs.NumIterations);
2026 Dir->setCounters(Exprs.Counters);
2027 Dir->setPrivateCounters(Exprs.PrivateCounters);
2028 Dir->setInits(Exprs.Inits);
2029 Dir->setUpdates(Exprs.Updates);
2030 Dir->setFinals(Exprs.Finals);
2031 Dir->setDependentCounters(Exprs.DependentCounters);
2032 Dir->setDependentInits(Exprs.DependentInits);
2033 Dir->setFinalsConditions(Exprs.FinalsConditions);
2034 Dir->setPreInits(Exprs.PreInits);
2040 unsigned NumClauses,
2041 unsigned CollapsedNum,
2043 return createEmptyDirective<OMPTargetParallelForSimdDirective>(
2044 C, NumClauses,
true,
2053 Stmt *AssociatedStmt,
const HelperExprs &Exprs) {
2054 auto *Dir = createDirective<OMPTargetSimdDirective>(
2055 C, Clauses, AssociatedStmt,
2058 Dir->setIterationVariable(Exprs.IterationVarRef);
2059 Dir->setLastIteration(Exprs.LastIteration);
2060 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2061 Dir->setPreCond(Exprs.PreCond);
2062 Dir->setCond(Exprs.Cond);
2063 Dir->setInit(Exprs.Init);
2064 Dir->setInc(Exprs.Inc);
2065 Dir->setCounters(Exprs.Counters);
2066 Dir->setPrivateCounters(Exprs.PrivateCounters);
2067 Dir->setInits(Exprs.Inits);
2068 Dir->setUpdates(Exprs.Updates);
2069 Dir->setFinals(Exprs.Finals);
2070 Dir->setDependentCounters(Exprs.DependentCounters);
2071 Dir->setDependentInits(Exprs.DependentInits);
2072 Dir->setFinalsConditions(Exprs.FinalsConditions);
2073 Dir->setPreInits(Exprs.PreInits);
2079 unsigned CollapsedNum, EmptyShell) {
2080 return createEmptyDirective<OMPTargetSimdDirective>(
2081 C, NumClauses,
true,
2088 const HelperExprs &Exprs) {
2089 auto *Dir = createDirective<OMPTeamsDistributeDirective>(
2090 C, Clauses, AssociatedStmt,
2091 numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
2093 Dir->setIterationVariable(Exprs.IterationVarRef);
2094 Dir->setLastIteration(Exprs.LastIteration);
2095 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2096 Dir->setPreCond(Exprs.PreCond);
2097 Dir->setCond(Exprs.Cond);
2098 Dir->setInit(Exprs.Init);
2099 Dir->setInc(Exprs.Inc);
2100 Dir->setIsLastIterVariable(Exprs.IL);
2101 Dir->setLowerBoundVariable(Exprs.LB);
2102 Dir->setUpperBoundVariable(Exprs.UB);
2103 Dir->setStrideVariable(Exprs.ST);
2104 Dir->setEnsureUpperBound(Exprs.EUB);
2105 Dir->setNextLowerBound(Exprs.NLB);
2106 Dir->setNextUpperBound(Exprs.NUB);
2107 Dir->setNumIterations(Exprs.NumIterations);
2108 Dir->setCounters(Exprs.Counters);
2109 Dir->setPrivateCounters(Exprs.PrivateCounters);
2110 Dir->setInits(Exprs.Inits);
2111 Dir->setUpdates(Exprs.Updates);
2112 Dir->setFinals(Exprs.Finals);
2113 Dir->setDependentCounters(Exprs.DependentCounters);
2114 Dir->setDependentInits(Exprs.DependentInits);
2115 Dir->setFinalsConditions(Exprs.FinalsConditions);
2116 Dir->setPreInits(Exprs.PreInits);
2122 unsigned NumClauses,
2123 unsigned CollapsedNum, EmptyShell) {
2124 return createEmptyDirective<OMPTeamsDistributeDirective>(
2125 C, NumClauses,
true,
2132 const HelperExprs &Exprs) {
2133 auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
2134 C, Clauses, AssociatedStmt,
2136 EndLoc, CollapsedNum);
2137 Dir->setIterationVariable(Exprs.IterationVarRef);
2138 Dir->setLastIteration(Exprs.LastIteration);
2139 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2140 Dir->setPreCond(Exprs.PreCond);
2141 Dir->setCond(Exprs.Cond);
2142 Dir->setInit(Exprs.Init);
2143 Dir->setInc(Exprs.Inc);
2144 Dir->setIsLastIterVariable(Exprs.IL);
2145 Dir->setLowerBoundVariable(Exprs.LB);
2146 Dir->setUpperBoundVariable(Exprs.UB);
2147 Dir->setStrideVariable(Exprs.ST);
2148 Dir->setEnsureUpperBound(Exprs.EUB);
2149 Dir->setNextLowerBound(Exprs.NLB);
2150 Dir->setNextUpperBound(Exprs.NUB);
2151 Dir->setNumIterations(Exprs.NumIterations);
2152 Dir->setCounters(Exprs.Counters);
2153 Dir->setPrivateCounters(Exprs.PrivateCounters);
2154 Dir->setInits(Exprs.Inits);
2155 Dir->setUpdates(Exprs.Updates);
2156 Dir->setFinals(Exprs.Finals);
2157 Dir->setDependentCounters(Exprs.DependentCounters);
2158 Dir->setDependentInits(Exprs.DependentInits);
2159 Dir->setFinalsConditions(Exprs.FinalsConditions);
2160 Dir->setPreInits(Exprs.PreInits);
2165 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
2167 return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
2168 C, NumClauses,
true,
2169 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
2176 const HelperExprs &Exprs) {
2177 auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
2178 C, Clauses, AssociatedStmt,
2179 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
2180 StartLoc, EndLoc, CollapsedNum);
2181 Dir->setIterationVariable(Exprs.IterationVarRef);
2182 Dir->setLastIteration(Exprs.LastIteration);
2183 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2184 Dir->setPreCond(Exprs.PreCond);
2185 Dir->setCond(Exprs.Cond);
2186 Dir->setInit(Exprs.Init);
2187 Dir->setInc(Exprs.Inc);
2188 Dir->setIsLastIterVariable(Exprs.IL);
2189 Dir->setLowerBoundVariable(Exprs.LB);
2190 Dir->setUpperBoundVariable(Exprs.UB);
2191 Dir->setStrideVariable(Exprs.ST);
2192 Dir->setEnsureUpperBound(Exprs.EUB);
2193 Dir->setNextLowerBound(Exprs.NLB);
2194 Dir->setNextUpperBound(Exprs.NUB);
2195 Dir->setNumIterations(Exprs.NumIterations);
2196 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2197 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2198 Dir->setDistInc(Exprs.DistInc);
2199 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2200 Dir->setCounters(Exprs.Counters);
2201 Dir->setPrivateCounters(Exprs.PrivateCounters);
2202 Dir->setInits(Exprs.Inits);
2203 Dir->setUpdates(Exprs.Updates);
2204 Dir->setFinals(Exprs.Finals);
2205 Dir->setDependentCounters(Exprs.DependentCounters);
2206 Dir->setDependentInits(Exprs.DependentInits);
2207 Dir->setFinalsConditions(Exprs.FinalsConditions);
2208 Dir->setPreInits(Exprs.PreInits);
2209 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2210 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2211 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2212 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2213 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2214 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2215 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2216 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2217 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2223 unsigned NumClauses,
2224 unsigned CollapsedNum,
2226 return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
2227 C, NumClauses,
true,
2228 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
2236 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
2237 auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
2238 C, Clauses, AssociatedStmt,
2239 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2240 StartLoc, EndLoc, CollapsedNum);
2241 Dir->setIterationVariable(Exprs.IterationVarRef);
2242 Dir->setLastIteration(Exprs.LastIteration);
2243 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2244 Dir->setPreCond(Exprs.PreCond);
2245 Dir->setCond(Exprs.Cond);
2246 Dir->setInit(Exprs.Init);
2247 Dir->setInc(Exprs.Inc);
2248 Dir->setIsLastIterVariable(Exprs.IL);
2249 Dir->setLowerBoundVariable(Exprs.LB);
2250 Dir->setUpperBoundVariable(Exprs.UB);
2251 Dir->setStrideVariable(Exprs.ST);
2252 Dir->setEnsureUpperBound(Exprs.EUB);
2253 Dir->setNextLowerBound(Exprs.NLB);
2254 Dir->setNextUpperBound(Exprs.NUB);
2255 Dir->setNumIterations(Exprs.NumIterations);
2256 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2257 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2258 Dir->setDistInc(Exprs.DistInc);
2259 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2260 Dir->setCounters(Exprs.Counters);
2261 Dir->setPrivateCounters(Exprs.PrivateCounters);
2262 Dir->setInits(Exprs.Inits);
2263 Dir->setUpdates(Exprs.Updates);
2264 Dir->setFinals(Exprs.Finals);
2265 Dir->setDependentCounters(Exprs.DependentCounters);
2266 Dir->setDependentInits(Exprs.DependentInits);
2267 Dir->setFinalsConditions(Exprs.FinalsConditions);
2268 Dir->setPreInits(Exprs.PreInits);
2269 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2270 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2271 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2272 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2273 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2274 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2275 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2276 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2277 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2278 Dir->setTaskReductionRefExpr(TaskRedRef);
2279 Dir->HasCancel = HasCancel;
2285 unsigned NumClauses,
2286 unsigned CollapsedNum,
2288 return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
2289 C, NumClauses,
true,
2290 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2297 return createDirective<OMPTargetTeamsDirective>(
C, Clauses, AssociatedStmt,
2305 return createEmptyDirective<OMPTargetTeamsDirective>(
2306 C, NumClauses,
true);
2312 const HelperExprs &Exprs) {
2313 auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
2314 C, Clauses, AssociatedStmt,
2315 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
2316 EndLoc, CollapsedNum);
2317 Dir->setIterationVariable(Exprs.IterationVarRef);
2318 Dir->setLastIteration(Exprs.LastIteration);
2319 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2320 Dir->setPreCond(Exprs.PreCond);
2321 Dir->setCond(Exprs.Cond);
2322 Dir->setInit(Exprs.Init);
2323 Dir->setInc(Exprs.Inc);
2324 Dir->setIsLastIterVariable(Exprs.IL);
2325 Dir->setLowerBoundVariable(Exprs.LB);
2326 Dir->setUpperBoundVariable(Exprs.UB);
2327 Dir->setStrideVariable(Exprs.ST);
2328 Dir->setEnsureUpperBound(Exprs.EUB);
2329 Dir->setNextLowerBound(Exprs.NLB);
2330 Dir->setNextUpperBound(Exprs.NUB);
2331 Dir->setNumIterations(Exprs.NumIterations);
2332 Dir->setCounters(Exprs.Counters);
2333 Dir->setPrivateCounters(Exprs.PrivateCounters);
2334 Dir->setInits(Exprs.Inits);
2335 Dir->setUpdates(Exprs.Updates);
2336 Dir->setFinals(Exprs.Finals);
2337 Dir->setDependentCounters(Exprs.DependentCounters);
2338 Dir->setDependentInits(Exprs.DependentInits);
2339 Dir->setFinalsConditions(Exprs.FinalsConditions);
2340 Dir->setPreInits(Exprs.PreInits);
2346 unsigned NumClauses,
2347 unsigned CollapsedNum,
2349 return createEmptyDirective<OMPTargetTeamsDistributeDirective>(
2350 C, NumClauses,
true,
2359 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
2360 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
2361 C, Clauses, AssociatedStmt,
2362 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2364 StartLoc, EndLoc, CollapsedNum);
2365 Dir->setIterationVariable(Exprs.IterationVarRef);
2366 Dir->setLastIteration(Exprs.LastIteration);
2367 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2368 Dir->setPreCond(Exprs.PreCond);
2369 Dir->setCond(Exprs.Cond);
2370 Dir->setInit(Exprs.Init);
2371 Dir->setInc(Exprs.Inc);
2372 Dir->setIsLastIterVariable(Exprs.IL);
2373 Dir->setLowerBoundVariable(Exprs.LB);
2374 Dir->setUpperBoundVariable(Exprs.UB);
2375 Dir->setStrideVariable(Exprs.ST);
2376 Dir->setEnsureUpperBound(Exprs.EUB);
2377 Dir->setNextLowerBound(Exprs.NLB);
2378 Dir->setNextUpperBound(Exprs.NUB);
2379 Dir->setNumIterations(Exprs.NumIterations);
2380 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2381 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2382 Dir->setDistInc(Exprs.DistInc);
2383 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2384 Dir->setCounters(Exprs.Counters);
2385 Dir->setPrivateCounters(Exprs.PrivateCounters);
2386 Dir->setInits(Exprs.Inits);
2387 Dir->setUpdates(Exprs.Updates);
2388 Dir->setFinals(Exprs.Finals);
2389 Dir->setDependentCounters(Exprs.DependentCounters);
2390 Dir->setDependentInits(Exprs.DependentInits);
2391 Dir->setFinalsConditions(Exprs.FinalsConditions);
2392 Dir->setPreInits(Exprs.PreInits);
2393 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2394 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2395 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2396 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2397 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2398 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2399 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2400 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2401 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2402 Dir->setTaskReductionRefExpr(TaskRedRef);
2403 Dir->HasCancel = HasCancel;
2409 unsigned NumClauses,
2410 unsigned CollapsedNum,
2412 return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
2413 C, NumClauses,
true,
2414 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2423 const HelperExprs &Exprs) {
2424 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2425 C, Clauses, AssociatedStmt,
2427 OMPD_target_teams_distribute_parallel_for_simd),
2428 StartLoc, EndLoc, CollapsedNum);
2429 Dir->setIterationVariable(Exprs.IterationVarRef);
2430 Dir->setLastIteration(Exprs.LastIteration);
2431 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2432 Dir->setPreCond(Exprs.PreCond);
2433 Dir->setCond(Exprs.Cond);
2434 Dir->setInit(Exprs.Init);
2435 Dir->setInc(Exprs.Inc);
2436 Dir->setIsLastIterVariable(Exprs.IL);
2437 Dir->setLowerBoundVariable(Exprs.LB);
2438 Dir->setUpperBoundVariable(Exprs.UB);
2439 Dir->setStrideVariable(Exprs.ST);
2440 Dir->setEnsureUpperBound(Exprs.EUB);
2441 Dir->setNextLowerBound(Exprs.NLB);
2442 Dir->setNextUpperBound(Exprs.NUB);
2443 Dir->setNumIterations(Exprs.NumIterations);
2444 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2445 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2446 Dir->setDistInc(Exprs.DistInc);
2447 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2448 Dir->setCounters(Exprs.Counters);
2449 Dir->setPrivateCounters(Exprs.PrivateCounters);
2450 Dir->setInits(Exprs.Inits);
2451 Dir->setUpdates(Exprs.Updates);
2452 Dir->setFinals(Exprs.Finals);
2453 Dir->setDependentCounters(Exprs.DependentCounters);
2454 Dir->setDependentInits(Exprs.DependentInits);
2455 Dir->setFinalsConditions(Exprs.FinalsConditions);
2456 Dir->setPreInits(Exprs.PreInits);
2457 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2458 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2459 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2460 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2461 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2462 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2463 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2464 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2465 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2471 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
2473 return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2474 C, NumClauses,
true,
2476 OMPD_target_teams_distribute_parallel_for_simd),
2484 const HelperExprs &Exprs) {
2485 auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
2486 C, Clauses, AssociatedStmt,
2488 StartLoc, EndLoc, CollapsedNum);
2489 Dir->setIterationVariable(Exprs.IterationVarRef);
2490 Dir->setLastIteration(Exprs.LastIteration);
2491 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2492 Dir->setPreCond(Exprs.PreCond);
2493 Dir->setCond(Exprs.Cond);
2494 Dir->setInit(Exprs.Init);
2495 Dir->setInc(Exprs.Inc);
2496 Dir->setIsLastIterVariable(Exprs.IL);
2497 Dir->setLowerBoundVariable(Exprs.LB);
2498 Dir->setUpperBoundVariable(Exprs.UB);
2499 Dir->setStrideVariable(Exprs.ST);
2500 Dir->setEnsureUpperBound(Exprs.EUB);
2501 Dir->setNextLowerBound(Exprs.NLB);
2502 Dir->setNextUpperBound(Exprs.NUB);
2503 Dir->setNumIterations(Exprs.NumIterations);
2504 Dir->setCounters(Exprs.Counters);
2505 Dir->setPrivateCounters(Exprs.PrivateCounters);
2506 Dir->setInits(Exprs.Inits);
2507 Dir->setUpdates(Exprs.Updates);
2508 Dir->setFinals(Exprs.Finals);
2509 Dir->setDependentCounters(Exprs.DependentCounters);
2510 Dir->setDependentInits(Exprs.DependentInits);
2511 Dir->setFinalsConditions(Exprs.FinalsConditions);
2512 Dir->setPreInits(Exprs.PreInits);
2518 unsigned NumClauses,
2519 unsigned CollapsedNum,
2521 return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
2522 C, NumClauses,
true,
2531 return createDirective<OMPInteropDirective>(
2532 C, Clauses,
nullptr, 0, StartLoc,
2537 unsigned NumClauses,
2539 return createEmptyDirective<OMPInteropDirective>(
C, NumClauses);
2546 auto *Dir = createDirective<OMPDispatchDirective>(
2547 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
2548 Dir->setTargetCallLoc(TargetCallLoc);
2553 unsigned NumClauses,
2555 return createEmptyDirective<OMPDispatchDirective>(
C, NumClauses,
2564 Stmt *AssociatedStmt) {
2565 return createDirective<OMPMaskedDirective>(
C, Clauses, AssociatedStmt,
2571 unsigned NumClauses,
2573 return createEmptyDirective<OMPMaskedDirective>(
C, NumClauses,
2580 const HelperExprs &Exprs) {
2581 auto *Dir = createDirective<OMPGenericLoopDirective>(
2583 StartLoc, EndLoc, CollapsedNum);
2584 Dir->setIterationVariable(Exprs.IterationVarRef);
2585 Dir->setLastIteration(Exprs.LastIteration);
2586 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2587 Dir->setPreCond(Exprs.PreCond);
2588 Dir->setCond(Exprs.Cond);
2589 Dir->setInit(Exprs.Init);
2590 Dir->setInc(Exprs.Inc);
2591 Dir->setIsLastIterVariable(Exprs.IL);
2592 Dir->setLowerBoundVariable(Exprs.LB);
2593 Dir->setUpperBoundVariable(Exprs.UB);
2594 Dir->setStrideVariable(Exprs.ST);
2595 Dir->setEnsureUpperBound(Exprs.EUB);
2596 Dir->setNextLowerBound(Exprs.NLB);
2597 Dir->setNextUpperBound(Exprs.NUB);
2598 Dir->setNumIterations(Exprs.NumIterations);
2599 Dir->setCounters(Exprs.Counters);
2600 Dir->setPrivateCounters(Exprs.PrivateCounters);
2601 Dir->setInits(Exprs.Inits);
2602 Dir->setUpdates(Exprs.Updates);
2603 Dir->setFinals(Exprs.Finals);
2604 Dir->setDependentCounters(Exprs.DependentCounters);
2605 Dir->setDependentInits(Exprs.DependentInits);
2606 Dir->setFinalsConditions(Exprs.FinalsConditions);
2607 Dir->setPreInits(Exprs.PreInits);
2613 unsigned CollapsedNum, EmptyShell) {
2614 return createEmptyDirective<OMPGenericLoopDirective>(
2615 C, NumClauses,
true,
2622 const HelperExprs &Exprs) {
2623 auto *Dir = createDirective<OMPTeamsGenericLoopDirective>(
2624 C, Clauses, AssociatedStmt,
2627 Dir->setIterationVariable(Exprs.IterationVarRef);
2628 Dir->setLastIteration(Exprs.LastIteration);
2629 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2630 Dir->setPreCond(Exprs.PreCond);
2631 Dir->setCond(Exprs.Cond);
2632 Dir->setInit(Exprs.Init);
2633 Dir->setInc(Exprs.Inc);
2634 Dir->setIsLastIterVariable(Exprs.IL);
2635 Dir->setLowerBoundVariable(Exprs.LB);
2636 Dir->setUpperBoundVariable(Exprs.UB);
2637 Dir->setStrideVariable(Exprs.ST);
2638 Dir->setEnsureUpperBound(Exprs.EUB);
2639 Dir->setNextLowerBound(Exprs.NLB);
2640 Dir->setNextUpperBound(Exprs.NUB);
2641 Dir->setNumIterations(Exprs.NumIterations);
2642 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2643 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2644 Dir->setDistInc(Exprs.DistInc);
2645 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2646 Dir->setCounters(Exprs.Counters);
2647 Dir->setPrivateCounters(Exprs.PrivateCounters);
2648 Dir->setInits(Exprs.Inits);
2649 Dir->setUpdates(Exprs.Updates);
2650 Dir->setFinals(Exprs.Finals);
2651 Dir->setDependentCounters(Exprs.DependentCounters);
2652 Dir->setDependentInits(Exprs.DependentInits);
2653 Dir->setFinalsConditions(Exprs.FinalsConditions);
2654 Dir->setPreInits(Exprs.PreInits);
2655 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2656 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2657 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2658 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2659 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2660 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2661 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2662 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2663 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2669 unsigned NumClauses,
2670 unsigned CollapsedNum, EmptyShell) {
2671 return createEmptyDirective<OMPTeamsGenericLoopDirective>(
2672 C, NumClauses,
true,
2679 const HelperExprs &Exprs,
bool CanBeParallelFor) {
2680 auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>(
2681 C, Clauses, AssociatedStmt,
2682 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,
2684 Dir->setIterationVariable(Exprs.IterationVarRef);
2685 Dir->setLastIteration(Exprs.LastIteration);
2686 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2687 Dir->setPreCond(Exprs.PreCond);
2688 Dir->setCond(Exprs.Cond);
2689 Dir->setInit(Exprs.Init);
2690 Dir->setInc(Exprs.Inc);
2691 Dir->setIsLastIterVariable(Exprs.IL);
2692 Dir->setLowerBoundVariable(Exprs.LB);
2693 Dir->setUpperBoundVariable(Exprs.UB);
2694 Dir->setStrideVariable(Exprs.ST);
2695 Dir->setEnsureUpperBound(Exprs.EUB);
2696 Dir->setNextLowerBound(Exprs.NLB);
2697 Dir->setNextUpperBound(Exprs.NUB);
2698 Dir->setNumIterations(Exprs.NumIterations);
2699 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2700 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2701 Dir->setDistInc(Exprs.DistInc);
2702 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2703 Dir->setCounters(Exprs.Counters);
2704 Dir->setPrivateCounters(Exprs.PrivateCounters);
2705 Dir->setInits(Exprs.Inits);
2706 Dir->setUpdates(Exprs.Updates);
2707 Dir->setFinals(Exprs.Finals);
2708 Dir->setDependentCounters(Exprs.DependentCounters);
2709 Dir->setDependentInits(Exprs.DependentInits);
2710 Dir->setFinalsConditions(Exprs.FinalsConditions);
2711 Dir->setPreInits(Exprs.PreInits);
2712 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2713 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2714 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2715 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2716 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2717 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2718 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2719 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2720 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2721 Dir->setCanBeParallelFor(CanBeParallelFor);
2727 unsigned NumClauses,
2728 unsigned CollapsedNum,
2730 return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>(
2731 C, NumClauses,
true,
2738 const HelperExprs &Exprs) {
2739 auto *Dir = createDirective<OMPParallelGenericLoopDirective>(
2740 C, Clauses, AssociatedStmt,
2743 Dir->setIterationVariable(Exprs.IterationVarRef);
2744 Dir->setLastIteration(Exprs.LastIteration);
2745 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2746 Dir->setPreCond(Exprs.PreCond);
2747 Dir->setCond(Exprs.Cond);
2748 Dir->setInit(Exprs.Init);
2749 Dir->setInc(Exprs.Inc);
2750 Dir->setIsLastIterVariable(Exprs.IL);
2751 Dir->setLowerBoundVariable(Exprs.LB);
2752 Dir->setUpperBoundVariable(Exprs.UB);
2753 Dir->setStrideVariable(Exprs.ST);
2754 Dir->setEnsureUpperBound(Exprs.EUB);
2755 Dir->setNextLowerBound(Exprs.NLB);
2756 Dir->setNextUpperBound(Exprs.NUB);
2757 Dir->setNumIterations(Exprs.NumIterations);
2758 Dir->setCounters(Exprs.Counters);
2759 Dir->setPrivateCounters(Exprs.PrivateCounters);
2760 Dir->setInits(Exprs.Inits);
2761 Dir->setUpdates(Exprs.Updates);
2762 Dir->setFinals(Exprs.Finals);
2763 Dir->setDependentCounters(Exprs.DependentCounters);
2764 Dir->setDependentInits(Exprs.DependentInits);
2765 Dir->setFinalsConditions(Exprs.FinalsConditions);
2766 Dir->setPreInits(Exprs.PreInits);
2771 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
2773 return createEmptyDirective<OMPParallelGenericLoopDirective>(
2774 C, NumClauses,
true,
2782 const HelperExprs &Exprs) {
2783 auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>(
2784 C, Clauses, AssociatedStmt,
2786 EndLoc, CollapsedNum);
2787 Dir->setIterationVariable(Exprs.IterationVarRef);
2788 Dir->setLastIteration(Exprs.LastIteration);
2789 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2790 Dir->setPreCond(Exprs.PreCond);
2791 Dir->setCond(Exprs.Cond);
2792 Dir->setInit(Exprs.Init);
2793 Dir->setInc(Exprs.Inc);
2794 Dir->setIsLastIterVariable(Exprs.IL);
2795 Dir->setLowerBoundVariable(Exprs.LB);
2796 Dir->setUpperBoundVariable(Exprs.UB);
2797 Dir->setStrideVariable(Exprs.ST);
2798 Dir->setEnsureUpperBound(Exprs.EUB);
2799 Dir->setNextLowerBound(Exprs.NLB);
2800 Dir->setNextUpperBound(Exprs.NUB);
2801 Dir->setNumIterations(Exprs.NumIterations);
2802 Dir->setCounters(Exprs.Counters);
2803 Dir->setPrivateCounters(Exprs.PrivateCounters);
2804 Dir->setInits(Exprs.Inits);
2805 Dir->setUpdates(Exprs.Updates);
2806 Dir->setFinals(Exprs.Finals);
2807 Dir->setDependentCounters(Exprs.DependentCounters);
2808 Dir->setDependentInits(Exprs.DependentInits);
2809 Dir->setFinalsConditions(Exprs.FinalsConditions);
2810 Dir->setPreInits(Exprs.PreInits);
2816 unsigned NumClauses,
2817 unsigned CollapsedNum,
2819 return createEmptyDirective<OMPTargetParallelGenericLoopDirective>(
2820 C, NumClauses,
true,
2821 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.
Stmt * IgnoreContainers(bool IgnoreCaptured=false)
Skip no-op (attributed, compound) container stmts and skip captured stmt at the top,...
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
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...