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,
610 unsigned NumLoops,
Stmt *AssociatedStmt,
611 Stmt *TransformedStmt,
Stmt *PreInits) {
612 OMPSplitDirective *Dir = createDirective<OMPSplitDirective>(
613 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc,
615 Dir->setTransformedStmt(TransformedStmt);
616 Dir->setPreInits(PreInits);
623 return createEmptyDirective<OMPSplitDirective>(
624 C, NumClauses,
true, TransformedStmtOffset + 1,
631 Stmt *AssociatedStmt,
Stmt *TransformedStmt,
Stmt *PreInits) {
633 OMPFuseDirective *Dir = createDirective<OMPFuseDirective>(
634 C, Clauses, AssociatedStmt, TransformedStmtOffset + 1, StartLoc, EndLoc);
635 Dir->setTransformedStmt(TransformedStmt);
636 Dir->setPreInits(PreInits);
642 unsigned NumClauses) {
643 OMPFuseDirective *Dir = createEmptyDirective<OMPFuseDirective>(
644 C, NumClauses,
true, TransformedStmtOffset + 1,
653 const HelperExprs &Exprs) {
654 auto *Dir = createDirective<OMPForSimdDirective>(
656 StartLoc, EndLoc, CollapsedNum);
657 Dir->setIterationVariable(Exprs.IterationVarRef);
658 Dir->setLastIteration(Exprs.LastIteration);
659 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
660 Dir->setPreCond(Exprs.PreCond);
661 Dir->setCond(Exprs.Cond);
662 Dir->setInit(Exprs.Init);
663 Dir->setInc(Exprs.Inc);
664 Dir->setIsLastIterVariable(Exprs.IL);
665 Dir->setLowerBoundVariable(Exprs.LB);
666 Dir->setUpperBoundVariable(Exprs.UB);
667 Dir->setStrideVariable(Exprs.ST);
668 Dir->setEnsureUpperBound(Exprs.EUB);
669 Dir->setNextLowerBound(Exprs.NLB);
670 Dir->setNextUpperBound(Exprs.NUB);
671 Dir->setNumIterations(Exprs.NumIterations);
672 Dir->setCounters(Exprs.Counters);
673 Dir->setPrivateCounters(Exprs.PrivateCounters);
674 Dir->setInits(Exprs.Inits);
675 Dir->setUpdates(Exprs.Updates);
676 Dir->setFinals(Exprs.Finals);
677 Dir->setDependentCounters(Exprs.DependentCounters);
678 Dir->setDependentInits(Exprs.DependentInits);
679 Dir->setFinalsConditions(Exprs.FinalsConditions);
680 Dir->setPreInits(Exprs.PreInits);
686 unsigned CollapsedNum,
688 return createEmptyDirective<OMPForSimdDirective>(
697 auto *Dir = createDirective<OMPSectionsDirective>(
C, Clauses, AssociatedStmt,
700 Dir->setTaskReductionRefExpr(TaskRedRef);
701 Dir->setHasCancel(HasCancel);
708 return createEmptyDirective<OMPSectionsDirective>(
C, NumClauses,
716 Stmt *AssociatedStmt,
719 createDirective<OMPSectionDirective>(
C, {}, AssociatedStmt,
720 0, StartLoc, EndLoc);
727 return createEmptyDirective<OMPSectionDirective>(
C, 0,
735 Stmt *AssociatedStmt) {
736 return createDirective<OMPScopeDirective>(
C, Clauses, AssociatedStmt,
744 return createEmptyDirective<OMPScopeDirective>(
C, NumClauses,
752 Stmt *AssociatedStmt) {
753 return createDirective<OMPSingleDirective>(
C, Clauses, AssociatedStmt,
761 return createEmptyDirective<OMPSingleDirective>(
C, NumClauses,
768 Stmt *AssociatedStmt) {
769 return createDirective<OMPMasterDirective>(
C, {}, AssociatedStmt,
776 return createEmptyDirective<OMPMasterDirective>(
C, 0,
784 return createDirective<OMPCriticalDirective>(
C, Clauses, AssociatedStmt,
792 return createEmptyDirective<OMPCriticalDirective>(
C, NumClauses,
799 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
800 auto *Dir = createDirective<OMPParallelForDirective>(
801 C, Clauses, AssociatedStmt,
802 numLoopChildren(CollapsedNum, OMPD_parallel_for) + 1, StartLoc, EndLoc,
804 Dir->setIterationVariable(Exprs.IterationVarRef);
805 Dir->setLastIteration(Exprs.LastIteration);
806 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
807 Dir->setPreCond(Exprs.PreCond);
808 Dir->setCond(Exprs.Cond);
809 Dir->setInit(Exprs.Init);
810 Dir->setInc(Exprs.Inc);
811 Dir->setIsLastIterVariable(Exprs.IL);
812 Dir->setLowerBoundVariable(Exprs.LB);
813 Dir->setUpperBoundVariable(Exprs.UB);
814 Dir->setStrideVariable(Exprs.ST);
815 Dir->setEnsureUpperBound(Exprs.EUB);
816 Dir->setNextLowerBound(Exprs.NLB);
817 Dir->setNextUpperBound(Exprs.NUB);
818 Dir->setNumIterations(Exprs.NumIterations);
819 Dir->setCounters(Exprs.Counters);
820 Dir->setPrivateCounters(Exprs.PrivateCounters);
821 Dir->setInits(Exprs.Inits);
822 Dir->setUpdates(Exprs.Updates);
823 Dir->setFinals(Exprs.Finals);
824 Dir->setDependentCounters(Exprs.DependentCounters);
825 Dir->setDependentInits(Exprs.DependentInits);
826 Dir->setFinalsConditions(Exprs.FinalsConditions);
827 Dir->setPreInits(Exprs.PreInits);
828 Dir->setTaskReductionRefExpr(TaskRedRef);
829 Dir->setHasCancel(HasCancel);
835 unsigned CollapsedNum, EmptyShell) {
836 return createEmptyDirective<OMPParallelForDirective>(
844 const HelperExprs &Exprs) {
845 auto *Dir = createDirective<OMPParallelForSimdDirective>(
846 C, Clauses, AssociatedStmt,
847 numLoopChildren(CollapsedNum, OMPD_parallel_for_simd), StartLoc, EndLoc,
849 Dir->setIterationVariable(Exprs.IterationVarRef);
850 Dir->setLastIteration(Exprs.LastIteration);
851 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
852 Dir->setPreCond(Exprs.PreCond);
853 Dir->setCond(Exprs.Cond);
854 Dir->setInit(Exprs.Init);
855 Dir->setInc(Exprs.Inc);
856 Dir->setIsLastIterVariable(Exprs.IL);
857 Dir->setLowerBoundVariable(Exprs.LB);
858 Dir->setUpperBoundVariable(Exprs.UB);
859 Dir->setStrideVariable(Exprs.ST);
860 Dir->setEnsureUpperBound(Exprs.EUB);
861 Dir->setNextLowerBound(Exprs.NLB);
862 Dir->setNextUpperBound(Exprs.NUB);
863 Dir->setNumIterations(Exprs.NumIterations);
864 Dir->setCounters(Exprs.Counters);
865 Dir->setPrivateCounters(Exprs.PrivateCounters);
866 Dir->setInits(Exprs.Inits);
867 Dir->setUpdates(Exprs.Updates);
868 Dir->setFinals(Exprs.Finals);
869 Dir->setDependentCounters(Exprs.DependentCounters);
870 Dir->setDependentInits(Exprs.DependentInits);
871 Dir->setFinalsConditions(Exprs.FinalsConditions);
872 Dir->setPreInits(Exprs.PreInits);
879 unsigned CollapsedNum, EmptyShell) {
880 return createEmptyDirective<OMPParallelForSimdDirective>(
888 auto *Dir = createDirective<OMPParallelMasterDirective>(
889 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
890 Dir->setTaskReductionRefExpr(TaskRedRef);
896 unsigned NumClauses, EmptyShell) {
897 return createEmptyDirective<OMPParallelMasterDirective>(
898 C, NumClauses,
true, 1);
904 auto *Dir = createDirective<OMPParallelMaskedDirective>(
905 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
906 Dir->setTaskReductionRefExpr(TaskRedRef);
912 unsigned NumClauses, EmptyShell) {
913 return createEmptyDirective<OMPParallelMaskedDirective>(
914 C, NumClauses,
true, 1);
921 auto *Dir = createDirective<OMPParallelSectionsDirective>(
922 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
923 Dir->setTaskReductionRefExpr(TaskRedRef);
924 Dir->setHasCancel(HasCancel);
930 unsigned NumClauses, EmptyShell) {
931 return createEmptyDirective<OMPParallelSectionsDirective>(
932 C, NumClauses,
true, 1);
938 Stmt *AssociatedStmt,
bool HasCancel) {
939 auto *Dir = createDirective<OMPTaskDirective>(
940 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
941 Dir->setHasCancel(HasCancel);
948 return createEmptyDirective<OMPTaskDirective>(
C, NumClauses,
955 return new (
C) OMPTaskyieldDirective(StartLoc, EndLoc);
960 return new (
C) OMPTaskyieldDirective();
968 return createDirective<OMPAssumeDirective>(
C, Clauses, AStmt,
976 return createEmptyDirective<OMPAssumeDirective>(
C, NumClauses,
984 return createDirective<OMPErrorDirective>(
985 C, Clauses,
nullptr, 0, StartLoc,
992 return createEmptyDirective<OMPErrorDirective>(
C, NumClauses);
998 return new (
C) OMPBarrierDirective(StartLoc, EndLoc);
1003 return new (
C) OMPBarrierDirective();
1010 return createDirective<OMPTaskwaitDirective>(
1011 C, Clauses,
nullptr, 0, StartLoc,
1016 unsigned NumClauses,
1018 return createEmptyDirective<OMPTaskwaitDirective>(
C, NumClauses);
1024 auto *Dir = createDirective<OMPTaskgroupDirective>(
1025 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
1026 Dir->setReductionRef(ReductionRef);
1031 unsigned NumClauses,
1033 return createEmptyDirective<OMPTaskgroupDirective>(
1034 C, NumClauses,
true, 1);
1040 auto *Dir =
new (
C) OMPCancellationPointDirective(StartLoc, EndLoc);
1041 Dir->setCancelRegion(CancelRegion);
1047 return new (
C) OMPCancellationPointDirective();
1054 auto *Dir = createDirective<OMPCancelDirective>(
1055 C, Clauses,
nullptr, 0, StartLoc,
1057 Dir->setCancelRegion(CancelRegion);
1062 unsigned NumClauses,
1064 return createEmptyDirective<OMPCancelDirective>(
C, NumClauses);
1071 return createDirective<OMPFlushDirective>(
1072 C, Clauses,
nullptr, 0, StartLoc,
1077 unsigned NumClauses,
1079 return createEmptyDirective<OMPFlushDirective>(
C, NumClauses);
1086 return createDirective<OMPDepobjDirective>(
1087 C, Clauses,
nullptr,
1088 0, StartLoc, EndLoc);
1092 unsigned NumClauses,
1094 return createEmptyDirective<OMPDepobjDirective>(
C, NumClauses);
1101 return createDirective<OMPScanDirective>(
C, Clauses,
1103 0, StartLoc, EndLoc);
1107 unsigned NumClauses,
1109 return createEmptyDirective<OMPScanDirective>(
C, NumClauses);
1115 return createDirective<OMPOrderedStandaloneDirective>(
1116 C, Clauses,
nullptr, 0, StartLoc,
1122 unsigned NumClauses, EmptyShell) {
1123 return createEmptyDirective<OMPOrderedStandaloneDirective>(
C, NumClauses);
1129 return createDirective<OMPOrderedBlockAssocDirective>(
1136 unsigned NumClauses, EmptyShell) {
1137 return createEmptyDirective<OMPOrderedBlockAssocDirective>(
1138 C, NumClauses,
true);
1145 auto *Dir = createDirective<OMPAtomicDirective>(
1146 C, Clauses, AssociatedStmt, 7, StartLoc, EndLoc);
1150 Dir->setExpr(Exprs.
E);
1151 Dir->setUpdateExpr(Exprs.
UE);
1153 Dir->setCond(Exprs.
Cond);
1156 Dir->Flags.IsFailOnly = Exprs.
IsFailOnly ? 1 : 0;
1161 unsigned NumClauses,
1163 return createEmptyDirective<OMPAtomicDirective>(
1164 C, NumClauses,
true, 7);
1171 Stmt *AssociatedStmt) {
1172 return createDirective<OMPTargetDirective>(
1173 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1177 unsigned NumClauses,
1179 return createEmptyDirective<OMPTargetDirective>(
C, NumClauses,
1187 auto *Dir = createDirective<OMPTargetParallelDirective>(
1188 C, Clauses, AssociatedStmt, 1, StartLoc, EndLoc);
1189 Dir->setTaskReductionRefExpr(TaskRedRef);
1190 Dir->setHasCancel(HasCancel);
1196 unsigned NumClauses, EmptyShell) {
1197 return createEmptyDirective<OMPTargetParallelDirective>(
1198 C, NumClauses,
true, 1);
1204 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
1205 auto *Dir = createDirective<OMPTargetParallelForDirective>(
1206 C, Clauses, AssociatedStmt,
1207 numLoopChildren(CollapsedNum, OMPD_target_parallel_for) + 1, StartLoc,
1208 EndLoc, CollapsedNum);
1209 Dir->setIterationVariable(Exprs.IterationVarRef);
1210 Dir->setLastIteration(Exprs.LastIteration);
1211 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1212 Dir->setPreCond(Exprs.PreCond);
1213 Dir->setCond(Exprs.Cond);
1214 Dir->setInit(Exprs.Init);
1215 Dir->setInc(Exprs.Inc);
1216 Dir->setIsLastIterVariable(Exprs.IL);
1217 Dir->setLowerBoundVariable(Exprs.LB);
1218 Dir->setUpperBoundVariable(Exprs.UB);
1219 Dir->setStrideVariable(Exprs.ST);
1220 Dir->setEnsureUpperBound(Exprs.EUB);
1221 Dir->setNextLowerBound(Exprs.NLB);
1222 Dir->setNextUpperBound(Exprs.NUB);
1223 Dir->setNumIterations(Exprs.NumIterations);
1224 Dir->setCounters(Exprs.Counters);
1225 Dir->setPrivateCounters(Exprs.PrivateCounters);
1226 Dir->setInits(Exprs.Inits);
1227 Dir->setUpdates(Exprs.Updates);
1228 Dir->setFinals(Exprs.Finals);
1229 Dir->setDependentCounters(Exprs.DependentCounters);
1230 Dir->setDependentInits(Exprs.DependentInits);
1231 Dir->setFinalsConditions(Exprs.FinalsConditions);
1232 Dir->setPreInits(Exprs.PreInits);
1233 Dir->setTaskReductionRefExpr(TaskRedRef);
1234 Dir->setHasCancel(HasCancel);
1240 unsigned NumClauses,
1241 unsigned CollapsedNum, EmptyShell) {
1242 return createEmptyDirective<OMPTargetParallelForDirective>(
1243 C, NumClauses,
true,
1251 return createDirective<OMPTargetDataDirective>(
1252 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1258 return createEmptyDirective<OMPTargetDataDirective>(
1265 return createDirective<OMPTargetEnterDataDirective>(
1266 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1272 return createEmptyDirective<OMPTargetEnterDataDirective>(
1279 return createDirective<OMPTargetExitDataDirective>(
1280 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1286 return createEmptyDirective<OMPTargetExitDataDirective>(
1294 Stmt *AssociatedStmt) {
1295 return createDirective<OMPTeamsDirective>(
1296 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
1300 unsigned NumClauses,
1302 return createEmptyDirective<OMPTeamsDirective>(
C, NumClauses,
1309 const HelperExprs &Exprs,
bool HasCancel) {
1310 auto *Dir = createDirective<OMPTaskLoopDirective>(
1312 StartLoc, EndLoc, CollapsedNum);
1313 Dir->setIterationVariable(Exprs.IterationVarRef);
1314 Dir->setLastIteration(Exprs.LastIteration);
1315 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1316 Dir->setPreCond(Exprs.PreCond);
1317 Dir->setCond(Exprs.Cond);
1318 Dir->setInit(Exprs.Init);
1319 Dir->setInc(Exprs.Inc);
1320 Dir->setIsLastIterVariable(Exprs.IL);
1321 Dir->setLowerBoundVariable(Exprs.LB);
1322 Dir->setUpperBoundVariable(Exprs.UB);
1323 Dir->setStrideVariable(Exprs.ST);
1324 Dir->setEnsureUpperBound(Exprs.EUB);
1325 Dir->setNextLowerBound(Exprs.NLB);
1326 Dir->setNextUpperBound(Exprs.NUB);
1327 Dir->setNumIterations(Exprs.NumIterations);
1328 Dir->setCounters(Exprs.Counters);
1329 Dir->setPrivateCounters(Exprs.PrivateCounters);
1330 Dir->setInits(Exprs.Inits);
1331 Dir->setUpdates(Exprs.Updates);
1332 Dir->setFinals(Exprs.Finals);
1333 Dir->setDependentCounters(Exprs.DependentCounters);
1334 Dir->setDependentInits(Exprs.DependentInits);
1335 Dir->setFinalsConditions(Exprs.FinalsConditions);
1336 Dir->setPreInits(Exprs.PreInits);
1337 Dir->setHasCancel(HasCancel);
1342 unsigned NumClauses,
1343 unsigned CollapsedNum,
1345 return createEmptyDirective<OMPTaskLoopDirective>(
1346 C, NumClauses,
true,
1353 const HelperExprs &Exprs) {
1354 auto *Dir = createDirective<OMPTaskLoopSimdDirective>(
1355 C, Clauses, AssociatedStmt,
1358 Dir->setIterationVariable(Exprs.IterationVarRef);
1359 Dir->setLastIteration(Exprs.LastIteration);
1360 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1361 Dir->setPreCond(Exprs.PreCond);
1362 Dir->setCond(Exprs.Cond);
1363 Dir->setInit(Exprs.Init);
1364 Dir->setInc(Exprs.Inc);
1365 Dir->setIsLastIterVariable(Exprs.IL);
1366 Dir->setLowerBoundVariable(Exprs.LB);
1367 Dir->setUpperBoundVariable(Exprs.UB);
1368 Dir->setStrideVariable(Exprs.ST);
1369 Dir->setEnsureUpperBound(Exprs.EUB);
1370 Dir->setNextLowerBound(Exprs.NLB);
1371 Dir->setNextUpperBound(Exprs.NUB);
1372 Dir->setNumIterations(Exprs.NumIterations);
1373 Dir->setCounters(Exprs.Counters);
1374 Dir->setPrivateCounters(Exprs.PrivateCounters);
1375 Dir->setInits(Exprs.Inits);
1376 Dir->setUpdates(Exprs.Updates);
1377 Dir->setFinals(Exprs.Finals);
1378 Dir->setDependentCounters(Exprs.DependentCounters);
1379 Dir->setDependentInits(Exprs.DependentInits);
1380 Dir->setFinalsConditions(Exprs.FinalsConditions);
1381 Dir->setPreInits(Exprs.PreInits);
1387 unsigned CollapsedNum, EmptyShell) {
1388 return createEmptyDirective<OMPTaskLoopSimdDirective>(
1389 C, NumClauses,
true,
1396 const HelperExprs &Exprs,
bool HasCancel) {
1397 auto *Dir = createDirective<OMPMasterTaskLoopDirective>(
1398 C, Clauses, AssociatedStmt,
1399 numLoopChildren(CollapsedNum, OMPD_master_taskloop), StartLoc, EndLoc,
1401 Dir->setIterationVariable(Exprs.IterationVarRef);
1402 Dir->setLastIteration(Exprs.LastIteration);
1403 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1404 Dir->setPreCond(Exprs.PreCond);
1405 Dir->setCond(Exprs.Cond);
1406 Dir->setInit(Exprs.Init);
1407 Dir->setInc(Exprs.Inc);
1408 Dir->setIsLastIterVariable(Exprs.IL);
1409 Dir->setLowerBoundVariable(Exprs.LB);
1410 Dir->setUpperBoundVariable(Exprs.UB);
1411 Dir->setStrideVariable(Exprs.ST);
1412 Dir->setEnsureUpperBound(Exprs.EUB);
1413 Dir->setNextLowerBound(Exprs.NLB);
1414 Dir->setNextUpperBound(Exprs.NUB);
1415 Dir->setNumIterations(Exprs.NumIterations);
1416 Dir->setCounters(Exprs.Counters);
1417 Dir->setPrivateCounters(Exprs.PrivateCounters);
1418 Dir->setInits(Exprs.Inits);
1419 Dir->setUpdates(Exprs.Updates);
1420 Dir->setFinals(Exprs.Finals);
1421 Dir->setDependentCounters(Exprs.DependentCounters);
1422 Dir->setDependentInits(Exprs.DependentInits);
1423 Dir->setFinalsConditions(Exprs.FinalsConditions);
1424 Dir->setPreInits(Exprs.PreInits);
1425 Dir->setHasCancel(HasCancel);
1431 unsigned NumClauses,
1432 unsigned CollapsedNum, EmptyShell) {
1433 return createEmptyDirective<OMPMasterTaskLoopDirective>(
1434 C, NumClauses,
true,
1441 const HelperExprs &Exprs,
bool HasCancel) {
1442 auto *Dir = createDirective<OMPMaskedTaskLoopDirective>(
1443 C, Clauses, AssociatedStmt,
1444 numLoopChildren(CollapsedNum, OMPD_masked_taskloop), StartLoc, EndLoc,
1446 Dir->setIterationVariable(Exprs.IterationVarRef);
1447 Dir->setLastIteration(Exprs.LastIteration);
1448 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1449 Dir->setPreCond(Exprs.PreCond);
1450 Dir->setCond(Exprs.Cond);
1451 Dir->setInit(Exprs.Init);
1452 Dir->setInc(Exprs.Inc);
1453 Dir->setIsLastIterVariable(Exprs.IL);
1454 Dir->setLowerBoundVariable(Exprs.LB);
1455 Dir->setUpperBoundVariable(Exprs.UB);
1456 Dir->setStrideVariable(Exprs.ST);
1457 Dir->setEnsureUpperBound(Exprs.EUB);
1458 Dir->setNextLowerBound(Exprs.NLB);
1459 Dir->setNextUpperBound(Exprs.NUB);
1460 Dir->setNumIterations(Exprs.NumIterations);
1461 Dir->setCounters(Exprs.Counters);
1462 Dir->setPrivateCounters(Exprs.PrivateCounters);
1463 Dir->setInits(Exprs.Inits);
1464 Dir->setUpdates(Exprs.Updates);
1465 Dir->setFinals(Exprs.Finals);
1466 Dir->setDependentCounters(Exprs.DependentCounters);
1467 Dir->setDependentInits(Exprs.DependentInits);
1468 Dir->setFinalsConditions(Exprs.FinalsConditions);
1469 Dir->setPreInits(Exprs.PreInits);
1470 Dir->setHasCancel(HasCancel);
1476 unsigned NumClauses,
1477 unsigned CollapsedNum, EmptyShell) {
1478 return createEmptyDirective<OMPMaskedTaskLoopDirective>(
1479 C, NumClauses,
true,
1486 const HelperExprs &Exprs) {
1487 auto *Dir = createDirective<OMPMasterTaskLoopSimdDirective>(
1488 C, Clauses, AssociatedStmt,
1490 EndLoc, CollapsedNum);
1491 Dir->setIterationVariable(Exprs.IterationVarRef);
1492 Dir->setLastIteration(Exprs.LastIteration);
1493 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1494 Dir->setPreCond(Exprs.PreCond);
1495 Dir->setCond(Exprs.Cond);
1496 Dir->setInit(Exprs.Init);
1497 Dir->setInc(Exprs.Inc);
1498 Dir->setIsLastIterVariable(Exprs.IL);
1499 Dir->setLowerBoundVariable(Exprs.LB);
1500 Dir->setUpperBoundVariable(Exprs.UB);
1501 Dir->setStrideVariable(Exprs.ST);
1502 Dir->setEnsureUpperBound(Exprs.EUB);
1503 Dir->setNextLowerBound(Exprs.NLB);
1504 Dir->setNextUpperBound(Exprs.NUB);
1505 Dir->setNumIterations(Exprs.NumIterations);
1506 Dir->setCounters(Exprs.Counters);
1507 Dir->setPrivateCounters(Exprs.PrivateCounters);
1508 Dir->setInits(Exprs.Inits);
1509 Dir->setUpdates(Exprs.Updates);
1510 Dir->setFinals(Exprs.Finals);
1511 Dir->setDependentCounters(Exprs.DependentCounters);
1512 Dir->setDependentInits(Exprs.DependentInits);
1513 Dir->setFinalsConditions(Exprs.FinalsConditions);
1514 Dir->setPreInits(Exprs.PreInits);
1520 unsigned NumClauses,
1521 unsigned CollapsedNum, EmptyShell) {
1522 return createEmptyDirective<OMPMasterTaskLoopSimdDirective>(
1523 C, NumClauses,
true,
1524 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd), CollapsedNum);
1530 const HelperExprs &Exprs) {
1531 auto *Dir = createDirective<OMPMaskedTaskLoopSimdDirective>(
1532 C, Clauses, AssociatedStmt,
1534 EndLoc, CollapsedNum);
1535 Dir->setIterationVariable(Exprs.IterationVarRef);
1536 Dir->setLastIteration(Exprs.LastIteration);
1537 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1538 Dir->setPreCond(Exprs.PreCond);
1539 Dir->setCond(Exprs.Cond);
1540 Dir->setInit(Exprs.Init);
1541 Dir->setInc(Exprs.Inc);
1542 Dir->setIsLastIterVariable(Exprs.IL);
1543 Dir->setLowerBoundVariable(Exprs.LB);
1544 Dir->setUpperBoundVariable(Exprs.UB);
1545 Dir->setStrideVariable(Exprs.ST);
1546 Dir->setEnsureUpperBound(Exprs.EUB);
1547 Dir->setNextLowerBound(Exprs.NLB);
1548 Dir->setNextUpperBound(Exprs.NUB);
1549 Dir->setNumIterations(Exprs.NumIterations);
1550 Dir->setCounters(Exprs.Counters);
1551 Dir->setPrivateCounters(Exprs.PrivateCounters);
1552 Dir->setInits(Exprs.Inits);
1553 Dir->setUpdates(Exprs.Updates);
1554 Dir->setFinals(Exprs.Finals);
1555 Dir->setDependentCounters(Exprs.DependentCounters);
1556 Dir->setDependentInits(Exprs.DependentInits);
1557 Dir->setFinalsConditions(Exprs.FinalsConditions);
1558 Dir->setPreInits(Exprs.PreInits);
1564 unsigned NumClauses,
1565 unsigned CollapsedNum, EmptyShell) {
1566 return createEmptyDirective<OMPMaskedTaskLoopSimdDirective>(
1567 C, NumClauses,
true,
1568 numLoopChildren(CollapsedNum, OMPD_masked_taskloop_simd), CollapsedNum);
1574 const HelperExprs &Exprs,
bool HasCancel) {
1575 auto *Dir = createDirective<OMPParallelMasterTaskLoopDirective>(
1576 C, Clauses, AssociatedStmt,
1577 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop), StartLoc,
1578 EndLoc, CollapsedNum);
1579 Dir->setIterationVariable(Exprs.IterationVarRef);
1580 Dir->setLastIteration(Exprs.LastIteration);
1581 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1582 Dir->setPreCond(Exprs.PreCond);
1583 Dir->setCond(Exprs.Cond);
1584 Dir->setInit(Exprs.Init);
1585 Dir->setInc(Exprs.Inc);
1586 Dir->setIsLastIterVariable(Exprs.IL);
1587 Dir->setLowerBoundVariable(Exprs.LB);
1588 Dir->setUpperBoundVariable(Exprs.UB);
1589 Dir->setStrideVariable(Exprs.ST);
1590 Dir->setEnsureUpperBound(Exprs.EUB);
1591 Dir->setNextLowerBound(Exprs.NLB);
1592 Dir->setNextUpperBound(Exprs.NUB);
1593 Dir->setNumIterations(Exprs.NumIterations);
1594 Dir->setCounters(Exprs.Counters);
1595 Dir->setPrivateCounters(Exprs.PrivateCounters);
1596 Dir->setInits(Exprs.Inits);
1597 Dir->setUpdates(Exprs.Updates);
1598 Dir->setFinals(Exprs.Finals);
1599 Dir->setDependentCounters(Exprs.DependentCounters);
1600 Dir->setDependentInits(Exprs.DependentInits);
1601 Dir->setFinalsConditions(Exprs.FinalsConditions);
1602 Dir->setPreInits(Exprs.PreInits);
1603 Dir->setHasCancel(HasCancel);
1609 unsigned NumClauses,
1610 unsigned CollapsedNum,
1612 return createEmptyDirective<OMPParallelMasterTaskLoopDirective>(
1613 C, NumClauses,
true,
1621 const HelperExprs &Exprs,
bool HasCancel) {
1622 auto *Dir = createDirective<OMPParallelMaskedTaskLoopDirective>(
1623 C, Clauses, AssociatedStmt,
1624 numLoopChildren(CollapsedNum, OMPD_parallel_masked_taskloop), StartLoc,
1625 EndLoc, CollapsedNum);
1626 Dir->setIterationVariable(Exprs.IterationVarRef);
1627 Dir->setLastIteration(Exprs.LastIteration);
1628 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1629 Dir->setPreCond(Exprs.PreCond);
1630 Dir->setCond(Exprs.Cond);
1631 Dir->setInit(Exprs.Init);
1632 Dir->setInc(Exprs.Inc);
1633 Dir->setIsLastIterVariable(Exprs.IL);
1634 Dir->setLowerBoundVariable(Exprs.LB);
1635 Dir->setUpperBoundVariable(Exprs.UB);
1636 Dir->setStrideVariable(Exprs.ST);
1637 Dir->setEnsureUpperBound(Exprs.EUB);
1638 Dir->setNextLowerBound(Exprs.NLB);
1639 Dir->setNextUpperBound(Exprs.NUB);
1640 Dir->setNumIterations(Exprs.NumIterations);
1641 Dir->setCounters(Exprs.Counters);
1642 Dir->setPrivateCounters(Exprs.PrivateCounters);
1643 Dir->setInits(Exprs.Inits);
1644 Dir->setUpdates(Exprs.Updates);
1645 Dir->setFinals(Exprs.Finals);
1646 Dir->setDependentCounters(Exprs.DependentCounters);
1647 Dir->setDependentInits(Exprs.DependentInits);
1648 Dir->setFinalsConditions(Exprs.FinalsConditions);
1649 Dir->setPreInits(Exprs.PreInits);
1650 Dir->setHasCancel(HasCancel);
1656 unsigned NumClauses,
1657 unsigned CollapsedNum,
1659 return createEmptyDirective<OMPParallelMaskedTaskLoopDirective>(
1660 C, NumClauses,
true,
1669 const HelperExprs &Exprs) {
1670 auto *Dir = createDirective<OMPParallelMasterTaskLoopSimdDirective>(
1671 C, Clauses, AssociatedStmt,
1673 StartLoc, EndLoc, CollapsedNum);
1674 Dir->setIterationVariable(Exprs.IterationVarRef);
1675 Dir->setLastIteration(Exprs.LastIteration);
1676 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1677 Dir->setPreCond(Exprs.PreCond);
1678 Dir->setCond(Exprs.Cond);
1679 Dir->setInit(Exprs.Init);
1680 Dir->setInc(Exprs.Inc);
1681 Dir->setIsLastIterVariable(Exprs.IL);
1682 Dir->setLowerBoundVariable(Exprs.LB);
1683 Dir->setUpperBoundVariable(Exprs.UB);
1684 Dir->setStrideVariable(Exprs.ST);
1685 Dir->setEnsureUpperBound(Exprs.EUB);
1686 Dir->setNextLowerBound(Exprs.NLB);
1687 Dir->setNextUpperBound(Exprs.NUB);
1688 Dir->setNumIterations(Exprs.NumIterations);
1689 Dir->setCounters(Exprs.Counters);
1690 Dir->setPrivateCounters(Exprs.PrivateCounters);
1691 Dir->setInits(Exprs.Inits);
1692 Dir->setUpdates(Exprs.Updates);
1693 Dir->setFinals(Exprs.Finals);
1694 Dir->setDependentCounters(Exprs.DependentCounters);
1695 Dir->setDependentInits(Exprs.DependentInits);
1696 Dir->setFinalsConditions(Exprs.FinalsConditions);
1697 Dir->setPreInits(Exprs.PreInits);
1703 unsigned NumClauses,
1704 unsigned CollapsedNum,
1706 return createEmptyDirective<OMPParallelMasterTaskLoopSimdDirective>(
1707 C, NumClauses,
true,
1716 const HelperExprs &Exprs) {
1717 auto *Dir = createDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1718 C, Clauses, AssociatedStmt,
1720 StartLoc, EndLoc, CollapsedNum);
1721 Dir->setIterationVariable(Exprs.IterationVarRef);
1722 Dir->setLastIteration(Exprs.LastIteration);
1723 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1724 Dir->setPreCond(Exprs.PreCond);
1725 Dir->setCond(Exprs.Cond);
1726 Dir->setInit(Exprs.Init);
1727 Dir->setInc(Exprs.Inc);
1728 Dir->setIsLastIterVariable(Exprs.IL);
1729 Dir->setLowerBoundVariable(Exprs.LB);
1730 Dir->setUpperBoundVariable(Exprs.UB);
1731 Dir->setStrideVariable(Exprs.ST);
1732 Dir->setEnsureUpperBound(Exprs.EUB);
1733 Dir->setNextLowerBound(Exprs.NLB);
1734 Dir->setNextUpperBound(Exprs.NUB);
1735 Dir->setNumIterations(Exprs.NumIterations);
1736 Dir->setCounters(Exprs.Counters);
1737 Dir->setPrivateCounters(Exprs.PrivateCounters);
1738 Dir->setInits(Exprs.Inits);
1739 Dir->setUpdates(Exprs.Updates);
1740 Dir->setFinals(Exprs.Finals);
1741 Dir->setDependentCounters(Exprs.DependentCounters);
1742 Dir->setDependentInits(Exprs.DependentInits);
1743 Dir->setFinalsConditions(Exprs.FinalsConditions);
1744 Dir->setPreInits(Exprs.PreInits);
1750 unsigned NumClauses,
1751 unsigned CollapsedNum,
1753 return createEmptyDirective<OMPParallelMaskedTaskLoopSimdDirective>(
1754 C, NumClauses,
true,
1763 Stmt *AssociatedStmt,
const HelperExprs &Exprs) {
1764 auto *Dir = createDirective<OMPDistributeDirective>(
1765 C, Clauses, AssociatedStmt,
1768 Dir->setIterationVariable(Exprs.IterationVarRef);
1769 Dir->setLastIteration(Exprs.LastIteration);
1770 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1771 Dir->setPreCond(Exprs.PreCond);
1772 Dir->setCond(Exprs.Cond);
1773 Dir->setInit(Exprs.Init);
1774 Dir->setInc(Exprs.Inc);
1775 Dir->setIsLastIterVariable(Exprs.IL);
1776 Dir->setLowerBoundVariable(Exprs.LB);
1777 Dir->setUpperBoundVariable(Exprs.UB);
1778 Dir->setStrideVariable(Exprs.ST);
1779 Dir->setEnsureUpperBound(Exprs.EUB);
1780 Dir->setNextLowerBound(Exprs.NLB);
1781 Dir->setNextUpperBound(Exprs.NUB);
1782 Dir->setNumIterations(Exprs.NumIterations);
1783 Dir->setCounters(Exprs.Counters);
1784 Dir->setPrivateCounters(Exprs.PrivateCounters);
1785 Dir->setInits(Exprs.Inits);
1786 Dir->setUpdates(Exprs.Updates);
1787 Dir->setFinals(Exprs.Finals);
1788 Dir->setDependentCounters(Exprs.DependentCounters);
1789 Dir->setDependentInits(Exprs.DependentInits);
1790 Dir->setFinalsConditions(Exprs.FinalsConditions);
1791 Dir->setPreInits(Exprs.PreInits);
1797 unsigned CollapsedNum, EmptyShell) {
1798 return createEmptyDirective<OMPDistributeDirective>(
1799 C, NumClauses,
true,
1806 return createDirective<OMPTargetUpdateDirective>(
C, Clauses, AssociatedStmt,
1814 return createEmptyDirective<OMPTargetUpdateDirective>(
1815 C, NumClauses,
true);
1821 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
1822 auto *Dir = createDirective<OMPDistributeParallelForDirective>(
1823 C, Clauses, AssociatedStmt,
1824 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for) + 1, StartLoc,
1825 EndLoc, CollapsedNum);
1826 Dir->setIterationVariable(Exprs.IterationVarRef);
1827 Dir->setLastIteration(Exprs.LastIteration);
1828 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1829 Dir->setPreCond(Exprs.PreCond);
1830 Dir->setCond(Exprs.Cond);
1831 Dir->setInit(Exprs.Init);
1832 Dir->setInc(Exprs.Inc);
1833 Dir->setIsLastIterVariable(Exprs.IL);
1834 Dir->setLowerBoundVariable(Exprs.LB);
1835 Dir->setUpperBoundVariable(Exprs.UB);
1836 Dir->setStrideVariable(Exprs.ST);
1837 Dir->setEnsureUpperBound(Exprs.EUB);
1838 Dir->setNextLowerBound(Exprs.NLB);
1839 Dir->setNextUpperBound(Exprs.NUB);
1840 Dir->setNumIterations(Exprs.NumIterations);
1841 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1842 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1843 Dir->setDistInc(Exprs.DistInc);
1844 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1845 Dir->setCounters(Exprs.Counters);
1846 Dir->setPrivateCounters(Exprs.PrivateCounters);
1847 Dir->setInits(Exprs.Inits);
1848 Dir->setUpdates(Exprs.Updates);
1849 Dir->setFinals(Exprs.Finals);
1850 Dir->setDependentCounters(Exprs.DependentCounters);
1851 Dir->setDependentInits(Exprs.DependentInits);
1852 Dir->setFinalsConditions(Exprs.FinalsConditions);
1853 Dir->setPreInits(Exprs.PreInits);
1854 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1855 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1856 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1857 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1858 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1859 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1860 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1861 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1862 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1863 Dir->setTaskReductionRefExpr(TaskRedRef);
1864 Dir->HasCancel = HasCancel;
1870 unsigned NumClauses,
1871 unsigned CollapsedNum,
1873 return createEmptyDirective<OMPDistributeParallelForDirective>(
1874 C, NumClauses,
true,
1883 const HelperExprs &Exprs) {
1884 auto *Dir = createDirective<OMPDistributeParallelForSimdDirective>(
1885 C, Clauses, AssociatedStmt,
1887 StartLoc, EndLoc, CollapsedNum);
1888 Dir->setIterationVariable(Exprs.IterationVarRef);
1889 Dir->setLastIteration(Exprs.LastIteration);
1890 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1891 Dir->setPreCond(Exprs.PreCond);
1892 Dir->setCond(Exprs.Cond);
1893 Dir->setInit(Exprs.Init);
1894 Dir->setInc(Exprs.Inc);
1895 Dir->setIsLastIterVariable(Exprs.IL);
1896 Dir->setLowerBoundVariable(Exprs.LB);
1897 Dir->setUpperBoundVariable(Exprs.UB);
1898 Dir->setStrideVariable(Exprs.ST);
1899 Dir->setEnsureUpperBound(Exprs.EUB);
1900 Dir->setNextLowerBound(Exprs.NLB);
1901 Dir->setNextUpperBound(Exprs.NUB);
1902 Dir->setNumIterations(Exprs.NumIterations);
1903 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
1904 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
1905 Dir->setDistInc(Exprs.DistInc);
1906 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
1907 Dir->setCounters(Exprs.Counters);
1908 Dir->setPrivateCounters(Exprs.PrivateCounters);
1909 Dir->setInits(Exprs.Inits);
1910 Dir->setUpdates(Exprs.Updates);
1911 Dir->setFinals(Exprs.Finals);
1912 Dir->setDependentCounters(Exprs.DependentCounters);
1913 Dir->setDependentInits(Exprs.DependentInits);
1914 Dir->setFinalsConditions(Exprs.FinalsConditions);
1915 Dir->setPreInits(Exprs.PreInits);
1916 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
1917 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
1918 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
1919 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
1920 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
1921 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
1922 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
1923 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
1924 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
1930 unsigned NumClauses,
1931 unsigned CollapsedNum,
1933 return createEmptyDirective<OMPDistributeParallelForSimdDirective>(
1934 C, NumClauses,
true,
1942 const HelperExprs &Exprs) {
1943 auto *Dir = createDirective<OMPDistributeSimdDirective>(
1944 C, Clauses, AssociatedStmt,
1945 numLoopChildren(CollapsedNum, OMPD_distribute_simd), StartLoc, EndLoc,
1947 Dir->setIterationVariable(Exprs.IterationVarRef);
1948 Dir->setLastIteration(Exprs.LastIteration);
1949 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1950 Dir->setPreCond(Exprs.PreCond);
1951 Dir->setCond(Exprs.Cond);
1952 Dir->setInit(Exprs.Init);
1953 Dir->setInc(Exprs.Inc);
1954 Dir->setIsLastIterVariable(Exprs.IL);
1955 Dir->setLowerBoundVariable(Exprs.LB);
1956 Dir->setUpperBoundVariable(Exprs.UB);
1957 Dir->setStrideVariable(Exprs.ST);
1958 Dir->setEnsureUpperBound(Exprs.EUB);
1959 Dir->setNextLowerBound(Exprs.NLB);
1960 Dir->setNextUpperBound(Exprs.NUB);
1961 Dir->setNumIterations(Exprs.NumIterations);
1962 Dir->setCounters(Exprs.Counters);
1963 Dir->setPrivateCounters(Exprs.PrivateCounters);
1964 Dir->setInits(Exprs.Inits);
1965 Dir->setUpdates(Exprs.Updates);
1966 Dir->setFinals(Exprs.Finals);
1967 Dir->setDependentCounters(Exprs.DependentCounters);
1968 Dir->setDependentInits(Exprs.DependentInits);
1969 Dir->setFinalsConditions(Exprs.FinalsConditions);
1970 Dir->setPreInits(Exprs.PreInits);
1976 unsigned NumClauses,
1977 unsigned CollapsedNum, EmptyShell) {
1978 return createEmptyDirective<OMPDistributeSimdDirective>(
1979 C, NumClauses,
true,
1986 const HelperExprs &Exprs) {
1987 auto *Dir = createDirective<OMPTargetParallelForSimdDirective>(
1988 C, Clauses, AssociatedStmt,
1989 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd), StartLoc,
1990 EndLoc, CollapsedNum);
1991 Dir->setIterationVariable(Exprs.IterationVarRef);
1992 Dir->setLastIteration(Exprs.LastIteration);
1993 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
1994 Dir->setPreCond(Exprs.PreCond);
1995 Dir->setCond(Exprs.Cond);
1996 Dir->setInit(Exprs.Init);
1997 Dir->setInc(Exprs.Inc);
1998 Dir->setIsLastIterVariable(Exprs.IL);
1999 Dir->setLowerBoundVariable(Exprs.LB);
2000 Dir->setUpperBoundVariable(Exprs.UB);
2001 Dir->setStrideVariable(Exprs.ST);
2002 Dir->setEnsureUpperBound(Exprs.EUB);
2003 Dir->setNextLowerBound(Exprs.NLB);
2004 Dir->setNextUpperBound(Exprs.NUB);
2005 Dir->setNumIterations(Exprs.NumIterations);
2006 Dir->setCounters(Exprs.Counters);
2007 Dir->setPrivateCounters(Exprs.PrivateCounters);
2008 Dir->setInits(Exprs.Inits);
2009 Dir->setUpdates(Exprs.Updates);
2010 Dir->setFinals(Exprs.Finals);
2011 Dir->setDependentCounters(Exprs.DependentCounters);
2012 Dir->setDependentInits(Exprs.DependentInits);
2013 Dir->setFinalsConditions(Exprs.FinalsConditions);
2014 Dir->setPreInits(Exprs.PreInits);
2020 unsigned NumClauses,
2021 unsigned CollapsedNum,
2023 return createEmptyDirective<OMPTargetParallelForSimdDirective>(
2024 C, NumClauses,
true,
2033 Stmt *AssociatedStmt,
const HelperExprs &Exprs) {
2034 auto *Dir = createDirective<OMPTargetSimdDirective>(
2035 C, Clauses, AssociatedStmt,
2038 Dir->setIterationVariable(Exprs.IterationVarRef);
2039 Dir->setLastIteration(Exprs.LastIteration);
2040 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2041 Dir->setPreCond(Exprs.PreCond);
2042 Dir->setCond(Exprs.Cond);
2043 Dir->setInit(Exprs.Init);
2044 Dir->setInc(Exprs.Inc);
2045 Dir->setCounters(Exprs.Counters);
2046 Dir->setPrivateCounters(Exprs.PrivateCounters);
2047 Dir->setInits(Exprs.Inits);
2048 Dir->setUpdates(Exprs.Updates);
2049 Dir->setFinals(Exprs.Finals);
2050 Dir->setDependentCounters(Exprs.DependentCounters);
2051 Dir->setDependentInits(Exprs.DependentInits);
2052 Dir->setFinalsConditions(Exprs.FinalsConditions);
2053 Dir->setPreInits(Exprs.PreInits);
2059 unsigned CollapsedNum, EmptyShell) {
2060 return createEmptyDirective<OMPTargetSimdDirective>(
2061 C, NumClauses,
true,
2068 const HelperExprs &Exprs) {
2069 auto *Dir = createDirective<OMPTeamsDistributeDirective>(
2070 C, Clauses, AssociatedStmt,
2071 numLoopChildren(CollapsedNum, OMPD_teams_distribute), StartLoc, EndLoc,
2073 Dir->setIterationVariable(Exprs.IterationVarRef);
2074 Dir->setLastIteration(Exprs.LastIteration);
2075 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2076 Dir->setPreCond(Exprs.PreCond);
2077 Dir->setCond(Exprs.Cond);
2078 Dir->setInit(Exprs.Init);
2079 Dir->setInc(Exprs.Inc);
2080 Dir->setIsLastIterVariable(Exprs.IL);
2081 Dir->setLowerBoundVariable(Exprs.LB);
2082 Dir->setUpperBoundVariable(Exprs.UB);
2083 Dir->setStrideVariable(Exprs.ST);
2084 Dir->setEnsureUpperBound(Exprs.EUB);
2085 Dir->setNextLowerBound(Exprs.NLB);
2086 Dir->setNextUpperBound(Exprs.NUB);
2087 Dir->setNumIterations(Exprs.NumIterations);
2088 Dir->setCounters(Exprs.Counters);
2089 Dir->setPrivateCounters(Exprs.PrivateCounters);
2090 Dir->setInits(Exprs.Inits);
2091 Dir->setUpdates(Exprs.Updates);
2092 Dir->setFinals(Exprs.Finals);
2093 Dir->setDependentCounters(Exprs.DependentCounters);
2094 Dir->setDependentInits(Exprs.DependentInits);
2095 Dir->setFinalsConditions(Exprs.FinalsConditions);
2096 Dir->setPreInits(Exprs.PreInits);
2102 unsigned NumClauses,
2103 unsigned CollapsedNum, EmptyShell) {
2104 return createEmptyDirective<OMPTeamsDistributeDirective>(
2105 C, NumClauses,
true,
2112 const HelperExprs &Exprs) {
2113 auto *Dir = createDirective<OMPTeamsDistributeSimdDirective>(
2114 C, Clauses, AssociatedStmt,
2116 EndLoc, CollapsedNum);
2117 Dir->setIterationVariable(Exprs.IterationVarRef);
2118 Dir->setLastIteration(Exprs.LastIteration);
2119 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2120 Dir->setPreCond(Exprs.PreCond);
2121 Dir->setCond(Exprs.Cond);
2122 Dir->setInit(Exprs.Init);
2123 Dir->setInc(Exprs.Inc);
2124 Dir->setIsLastIterVariable(Exprs.IL);
2125 Dir->setLowerBoundVariable(Exprs.LB);
2126 Dir->setUpperBoundVariable(Exprs.UB);
2127 Dir->setStrideVariable(Exprs.ST);
2128 Dir->setEnsureUpperBound(Exprs.EUB);
2129 Dir->setNextLowerBound(Exprs.NLB);
2130 Dir->setNextUpperBound(Exprs.NUB);
2131 Dir->setNumIterations(Exprs.NumIterations);
2132 Dir->setCounters(Exprs.Counters);
2133 Dir->setPrivateCounters(Exprs.PrivateCounters);
2134 Dir->setInits(Exprs.Inits);
2135 Dir->setUpdates(Exprs.Updates);
2136 Dir->setFinals(Exprs.Finals);
2137 Dir->setDependentCounters(Exprs.DependentCounters);
2138 Dir->setDependentInits(Exprs.DependentInits);
2139 Dir->setFinalsConditions(Exprs.FinalsConditions);
2140 Dir->setPreInits(Exprs.PreInits);
2145 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
2147 return createEmptyDirective<OMPTeamsDistributeSimdDirective>(
2148 C, NumClauses,
true,
2149 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd), CollapsedNum);
2156 const HelperExprs &Exprs) {
2157 auto *Dir = createDirective<OMPTeamsDistributeParallelForSimdDirective>(
2158 C, Clauses, AssociatedStmt,
2159 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
2160 StartLoc, EndLoc, CollapsedNum);
2161 Dir->setIterationVariable(Exprs.IterationVarRef);
2162 Dir->setLastIteration(Exprs.LastIteration);
2163 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2164 Dir->setPreCond(Exprs.PreCond);
2165 Dir->setCond(Exprs.Cond);
2166 Dir->setInit(Exprs.Init);
2167 Dir->setInc(Exprs.Inc);
2168 Dir->setIsLastIterVariable(Exprs.IL);
2169 Dir->setLowerBoundVariable(Exprs.LB);
2170 Dir->setUpperBoundVariable(Exprs.UB);
2171 Dir->setStrideVariable(Exprs.ST);
2172 Dir->setEnsureUpperBound(Exprs.EUB);
2173 Dir->setNextLowerBound(Exprs.NLB);
2174 Dir->setNextUpperBound(Exprs.NUB);
2175 Dir->setNumIterations(Exprs.NumIterations);
2176 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2177 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2178 Dir->setDistInc(Exprs.DistInc);
2179 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2180 Dir->setCounters(Exprs.Counters);
2181 Dir->setPrivateCounters(Exprs.PrivateCounters);
2182 Dir->setInits(Exprs.Inits);
2183 Dir->setUpdates(Exprs.Updates);
2184 Dir->setFinals(Exprs.Finals);
2185 Dir->setDependentCounters(Exprs.DependentCounters);
2186 Dir->setDependentInits(Exprs.DependentInits);
2187 Dir->setFinalsConditions(Exprs.FinalsConditions);
2188 Dir->setPreInits(Exprs.PreInits);
2189 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2190 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2191 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2192 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2193 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2194 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2195 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2196 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2197 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2203 unsigned NumClauses,
2204 unsigned CollapsedNum,
2206 return createEmptyDirective<OMPTeamsDistributeParallelForSimdDirective>(
2207 C, NumClauses,
true,
2208 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for_simd),
2216 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
2217 auto *Dir = createDirective<OMPTeamsDistributeParallelForDirective>(
2218 C, Clauses, AssociatedStmt,
2219 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2220 StartLoc, EndLoc, CollapsedNum);
2221 Dir->setIterationVariable(Exprs.IterationVarRef);
2222 Dir->setLastIteration(Exprs.LastIteration);
2223 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2224 Dir->setPreCond(Exprs.PreCond);
2225 Dir->setCond(Exprs.Cond);
2226 Dir->setInit(Exprs.Init);
2227 Dir->setInc(Exprs.Inc);
2228 Dir->setIsLastIterVariable(Exprs.IL);
2229 Dir->setLowerBoundVariable(Exprs.LB);
2230 Dir->setUpperBoundVariable(Exprs.UB);
2231 Dir->setStrideVariable(Exprs.ST);
2232 Dir->setEnsureUpperBound(Exprs.EUB);
2233 Dir->setNextLowerBound(Exprs.NLB);
2234 Dir->setNextUpperBound(Exprs.NUB);
2235 Dir->setNumIterations(Exprs.NumIterations);
2236 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2237 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2238 Dir->setDistInc(Exprs.DistInc);
2239 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2240 Dir->setCounters(Exprs.Counters);
2241 Dir->setPrivateCounters(Exprs.PrivateCounters);
2242 Dir->setInits(Exprs.Inits);
2243 Dir->setUpdates(Exprs.Updates);
2244 Dir->setFinals(Exprs.Finals);
2245 Dir->setDependentCounters(Exprs.DependentCounters);
2246 Dir->setDependentInits(Exprs.DependentInits);
2247 Dir->setFinalsConditions(Exprs.FinalsConditions);
2248 Dir->setPreInits(Exprs.PreInits);
2249 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2250 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2251 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2252 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2253 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2254 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2255 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2256 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2257 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2258 Dir->setTaskReductionRefExpr(TaskRedRef);
2259 Dir->HasCancel = HasCancel;
2265 unsigned NumClauses,
2266 unsigned CollapsedNum,
2268 return createEmptyDirective<OMPTeamsDistributeParallelForDirective>(
2269 C, NumClauses,
true,
2270 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for) + 1,
2277 return createDirective<OMPTargetTeamsDirective>(
C, Clauses, AssociatedStmt,
2285 return createEmptyDirective<OMPTargetTeamsDirective>(
2286 C, NumClauses,
true);
2292 const HelperExprs &Exprs) {
2293 auto *Dir = createDirective<OMPTargetTeamsDistributeDirective>(
2294 C, Clauses, AssociatedStmt,
2295 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute), StartLoc,
2296 EndLoc, CollapsedNum);
2297 Dir->setIterationVariable(Exprs.IterationVarRef);
2298 Dir->setLastIteration(Exprs.LastIteration);
2299 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2300 Dir->setPreCond(Exprs.PreCond);
2301 Dir->setCond(Exprs.Cond);
2302 Dir->setInit(Exprs.Init);
2303 Dir->setInc(Exprs.Inc);
2304 Dir->setIsLastIterVariable(Exprs.IL);
2305 Dir->setLowerBoundVariable(Exprs.LB);
2306 Dir->setUpperBoundVariable(Exprs.UB);
2307 Dir->setStrideVariable(Exprs.ST);
2308 Dir->setEnsureUpperBound(Exprs.EUB);
2309 Dir->setNextLowerBound(Exprs.NLB);
2310 Dir->setNextUpperBound(Exprs.NUB);
2311 Dir->setNumIterations(Exprs.NumIterations);
2312 Dir->setCounters(Exprs.Counters);
2313 Dir->setPrivateCounters(Exprs.PrivateCounters);
2314 Dir->setInits(Exprs.Inits);
2315 Dir->setUpdates(Exprs.Updates);
2316 Dir->setFinals(Exprs.Finals);
2317 Dir->setDependentCounters(Exprs.DependentCounters);
2318 Dir->setDependentInits(Exprs.DependentInits);
2319 Dir->setFinalsConditions(Exprs.FinalsConditions);
2320 Dir->setPreInits(Exprs.PreInits);
2326 unsigned NumClauses,
2327 unsigned CollapsedNum,
2329 return createEmptyDirective<OMPTargetTeamsDistributeDirective>(
2330 C, NumClauses,
true,
2339 const HelperExprs &Exprs,
Expr *TaskRedRef,
bool HasCancel) {
2340 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForDirective>(
2341 C, Clauses, AssociatedStmt,
2342 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2344 StartLoc, EndLoc, CollapsedNum);
2345 Dir->setIterationVariable(Exprs.IterationVarRef);
2346 Dir->setLastIteration(Exprs.LastIteration);
2347 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2348 Dir->setPreCond(Exprs.PreCond);
2349 Dir->setCond(Exprs.Cond);
2350 Dir->setInit(Exprs.Init);
2351 Dir->setInc(Exprs.Inc);
2352 Dir->setIsLastIterVariable(Exprs.IL);
2353 Dir->setLowerBoundVariable(Exprs.LB);
2354 Dir->setUpperBoundVariable(Exprs.UB);
2355 Dir->setStrideVariable(Exprs.ST);
2356 Dir->setEnsureUpperBound(Exprs.EUB);
2357 Dir->setNextLowerBound(Exprs.NLB);
2358 Dir->setNextUpperBound(Exprs.NUB);
2359 Dir->setNumIterations(Exprs.NumIterations);
2360 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2361 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2362 Dir->setDistInc(Exprs.DistInc);
2363 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2364 Dir->setCounters(Exprs.Counters);
2365 Dir->setPrivateCounters(Exprs.PrivateCounters);
2366 Dir->setInits(Exprs.Inits);
2367 Dir->setUpdates(Exprs.Updates);
2368 Dir->setFinals(Exprs.Finals);
2369 Dir->setDependentCounters(Exprs.DependentCounters);
2370 Dir->setDependentInits(Exprs.DependentInits);
2371 Dir->setFinalsConditions(Exprs.FinalsConditions);
2372 Dir->setPreInits(Exprs.PreInits);
2373 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2374 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2375 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2376 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2377 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2378 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2379 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2380 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2381 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2382 Dir->setTaskReductionRefExpr(TaskRedRef);
2383 Dir->HasCancel = HasCancel;
2389 unsigned NumClauses,
2390 unsigned CollapsedNum,
2392 return createEmptyDirective<OMPTargetTeamsDistributeParallelForDirective>(
2393 C, NumClauses,
true,
2394 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_parallel_for) +
2403 const HelperExprs &Exprs) {
2404 auto *Dir = createDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2405 C, Clauses, AssociatedStmt,
2407 OMPD_target_teams_distribute_parallel_for_simd),
2408 StartLoc, EndLoc, CollapsedNum);
2409 Dir->setIterationVariable(Exprs.IterationVarRef);
2410 Dir->setLastIteration(Exprs.LastIteration);
2411 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2412 Dir->setPreCond(Exprs.PreCond);
2413 Dir->setCond(Exprs.Cond);
2414 Dir->setInit(Exprs.Init);
2415 Dir->setInc(Exprs.Inc);
2416 Dir->setIsLastIterVariable(Exprs.IL);
2417 Dir->setLowerBoundVariable(Exprs.LB);
2418 Dir->setUpperBoundVariable(Exprs.UB);
2419 Dir->setStrideVariable(Exprs.ST);
2420 Dir->setEnsureUpperBound(Exprs.EUB);
2421 Dir->setNextLowerBound(Exprs.NLB);
2422 Dir->setNextUpperBound(Exprs.NUB);
2423 Dir->setNumIterations(Exprs.NumIterations);
2424 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2425 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2426 Dir->setDistInc(Exprs.DistInc);
2427 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2428 Dir->setCounters(Exprs.Counters);
2429 Dir->setPrivateCounters(Exprs.PrivateCounters);
2430 Dir->setInits(Exprs.Inits);
2431 Dir->setUpdates(Exprs.Updates);
2432 Dir->setFinals(Exprs.Finals);
2433 Dir->setDependentCounters(Exprs.DependentCounters);
2434 Dir->setDependentInits(Exprs.DependentInits);
2435 Dir->setFinalsConditions(Exprs.FinalsConditions);
2436 Dir->setPreInits(Exprs.PreInits);
2437 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2438 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2439 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2440 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2441 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2442 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2443 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2444 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2445 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2451 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
2453 return createEmptyDirective<OMPTargetTeamsDistributeParallelForSimdDirective>(
2454 C, NumClauses,
true,
2456 OMPD_target_teams_distribute_parallel_for_simd),
2464 const HelperExprs &Exprs) {
2465 auto *Dir = createDirective<OMPTargetTeamsDistributeSimdDirective>(
2466 C, Clauses, AssociatedStmt,
2468 StartLoc, EndLoc, CollapsedNum);
2469 Dir->setIterationVariable(Exprs.IterationVarRef);
2470 Dir->setLastIteration(Exprs.LastIteration);
2471 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2472 Dir->setPreCond(Exprs.PreCond);
2473 Dir->setCond(Exprs.Cond);
2474 Dir->setInit(Exprs.Init);
2475 Dir->setInc(Exprs.Inc);
2476 Dir->setIsLastIterVariable(Exprs.IL);
2477 Dir->setLowerBoundVariable(Exprs.LB);
2478 Dir->setUpperBoundVariable(Exprs.UB);
2479 Dir->setStrideVariable(Exprs.ST);
2480 Dir->setEnsureUpperBound(Exprs.EUB);
2481 Dir->setNextLowerBound(Exprs.NLB);
2482 Dir->setNextUpperBound(Exprs.NUB);
2483 Dir->setNumIterations(Exprs.NumIterations);
2484 Dir->setCounters(Exprs.Counters);
2485 Dir->setPrivateCounters(Exprs.PrivateCounters);
2486 Dir->setInits(Exprs.Inits);
2487 Dir->setUpdates(Exprs.Updates);
2488 Dir->setFinals(Exprs.Finals);
2489 Dir->setDependentCounters(Exprs.DependentCounters);
2490 Dir->setDependentInits(Exprs.DependentInits);
2491 Dir->setFinalsConditions(Exprs.FinalsConditions);
2492 Dir->setPreInits(Exprs.PreInits);
2498 unsigned NumClauses,
2499 unsigned CollapsedNum,
2501 return createEmptyDirective<OMPTargetTeamsDistributeSimdDirective>(
2502 C, NumClauses,
true,
2511 return createDirective<OMPInteropDirective>(
2512 C, Clauses,
nullptr, 0, StartLoc,
2517 unsigned NumClauses,
2519 return createEmptyDirective<OMPInteropDirective>(
C, NumClauses);
2526 auto *Dir = createDirective<OMPDispatchDirective>(
2527 C, Clauses, AssociatedStmt, 0, StartLoc, EndLoc);
2528 Dir->setTargetCallLoc(TargetCallLoc);
2533 unsigned NumClauses,
2535 return createEmptyDirective<OMPDispatchDirective>(
C, NumClauses,
2544 Stmt *AssociatedStmt) {
2545 return createDirective<OMPMaskedDirective>(
C, Clauses, AssociatedStmt,
2551 unsigned NumClauses,
2553 return createEmptyDirective<OMPMaskedDirective>(
C, NumClauses,
2560 const HelperExprs &Exprs) {
2561 auto *Dir = createDirective<OMPGenericLoopDirective>(
2563 StartLoc, EndLoc, CollapsedNum);
2564 Dir->setIterationVariable(Exprs.IterationVarRef);
2565 Dir->setLastIteration(Exprs.LastIteration);
2566 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2567 Dir->setPreCond(Exprs.PreCond);
2568 Dir->setCond(Exprs.Cond);
2569 Dir->setInit(Exprs.Init);
2570 Dir->setInc(Exprs.Inc);
2571 Dir->setIsLastIterVariable(Exprs.IL);
2572 Dir->setLowerBoundVariable(Exprs.LB);
2573 Dir->setUpperBoundVariable(Exprs.UB);
2574 Dir->setStrideVariable(Exprs.ST);
2575 Dir->setEnsureUpperBound(Exprs.EUB);
2576 Dir->setNextLowerBound(Exprs.NLB);
2577 Dir->setNextUpperBound(Exprs.NUB);
2578 Dir->setNumIterations(Exprs.NumIterations);
2579 Dir->setCounters(Exprs.Counters);
2580 Dir->setPrivateCounters(Exprs.PrivateCounters);
2581 Dir->setInits(Exprs.Inits);
2582 Dir->setUpdates(Exprs.Updates);
2583 Dir->setFinals(Exprs.Finals);
2584 Dir->setDependentCounters(Exprs.DependentCounters);
2585 Dir->setDependentInits(Exprs.DependentInits);
2586 Dir->setFinalsConditions(Exprs.FinalsConditions);
2587 Dir->setPreInits(Exprs.PreInits);
2593 unsigned CollapsedNum, EmptyShell) {
2594 return createEmptyDirective<OMPGenericLoopDirective>(
2595 C, NumClauses,
true,
2602 const HelperExprs &Exprs) {
2603 auto *Dir = createDirective<OMPTeamsGenericLoopDirective>(
2604 C, Clauses, AssociatedStmt,
2607 Dir->setIterationVariable(Exprs.IterationVarRef);
2608 Dir->setLastIteration(Exprs.LastIteration);
2609 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2610 Dir->setPreCond(Exprs.PreCond);
2611 Dir->setCond(Exprs.Cond);
2612 Dir->setInit(Exprs.Init);
2613 Dir->setInc(Exprs.Inc);
2614 Dir->setIsLastIterVariable(Exprs.IL);
2615 Dir->setLowerBoundVariable(Exprs.LB);
2616 Dir->setUpperBoundVariable(Exprs.UB);
2617 Dir->setStrideVariable(Exprs.ST);
2618 Dir->setEnsureUpperBound(Exprs.EUB);
2619 Dir->setNextLowerBound(Exprs.NLB);
2620 Dir->setNextUpperBound(Exprs.NUB);
2621 Dir->setNumIterations(Exprs.NumIterations);
2622 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2623 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2624 Dir->setDistInc(Exprs.DistInc);
2625 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2626 Dir->setCounters(Exprs.Counters);
2627 Dir->setPrivateCounters(Exprs.PrivateCounters);
2628 Dir->setInits(Exprs.Inits);
2629 Dir->setUpdates(Exprs.Updates);
2630 Dir->setFinals(Exprs.Finals);
2631 Dir->setDependentCounters(Exprs.DependentCounters);
2632 Dir->setDependentInits(Exprs.DependentInits);
2633 Dir->setFinalsConditions(Exprs.FinalsConditions);
2634 Dir->setPreInits(Exprs.PreInits);
2635 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2636 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2637 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2638 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2639 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2640 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2641 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2642 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2643 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2649 unsigned NumClauses,
2650 unsigned CollapsedNum, EmptyShell) {
2651 return createEmptyDirective<OMPTeamsGenericLoopDirective>(
2652 C, NumClauses,
true,
2659 const HelperExprs &Exprs,
bool CanBeParallelFor) {
2660 auto *Dir = createDirective<OMPTargetTeamsGenericLoopDirective>(
2661 C, Clauses, AssociatedStmt,
2662 numLoopChildren(CollapsedNum, OMPD_target_teams_loop), StartLoc, EndLoc,
2664 Dir->setIterationVariable(Exprs.IterationVarRef);
2665 Dir->setLastIteration(Exprs.LastIteration);
2666 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2667 Dir->setPreCond(Exprs.PreCond);
2668 Dir->setCond(Exprs.Cond);
2669 Dir->setInit(Exprs.Init);
2670 Dir->setInc(Exprs.Inc);
2671 Dir->setIsLastIterVariable(Exprs.IL);
2672 Dir->setLowerBoundVariable(Exprs.LB);
2673 Dir->setUpperBoundVariable(Exprs.UB);
2674 Dir->setStrideVariable(Exprs.ST);
2675 Dir->setEnsureUpperBound(Exprs.EUB);
2676 Dir->setNextLowerBound(Exprs.NLB);
2677 Dir->setNextUpperBound(Exprs.NUB);
2678 Dir->setNumIterations(Exprs.NumIterations);
2679 Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
2680 Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
2681 Dir->setDistInc(Exprs.DistInc);
2682 Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
2683 Dir->setCounters(Exprs.Counters);
2684 Dir->setPrivateCounters(Exprs.PrivateCounters);
2685 Dir->setInits(Exprs.Inits);
2686 Dir->setUpdates(Exprs.Updates);
2687 Dir->setFinals(Exprs.Finals);
2688 Dir->setDependentCounters(Exprs.DependentCounters);
2689 Dir->setDependentInits(Exprs.DependentInits);
2690 Dir->setFinalsConditions(Exprs.FinalsConditions);
2691 Dir->setPreInits(Exprs.PreInits);
2692 Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
2693 Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
2694 Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
2695 Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
2696 Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
2697 Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
2698 Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
2699 Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
2700 Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
2701 Dir->setCanBeParallelFor(CanBeParallelFor);
2707 unsigned NumClauses,
2708 unsigned CollapsedNum,
2710 return createEmptyDirective<OMPTargetTeamsGenericLoopDirective>(
2711 C, NumClauses,
true,
2718 const HelperExprs &Exprs) {
2719 auto *Dir = createDirective<OMPParallelGenericLoopDirective>(
2720 C, Clauses, AssociatedStmt,
2723 Dir->setIterationVariable(Exprs.IterationVarRef);
2724 Dir->setLastIteration(Exprs.LastIteration);
2725 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2726 Dir->setPreCond(Exprs.PreCond);
2727 Dir->setCond(Exprs.Cond);
2728 Dir->setInit(Exprs.Init);
2729 Dir->setInc(Exprs.Inc);
2730 Dir->setIsLastIterVariable(Exprs.IL);
2731 Dir->setLowerBoundVariable(Exprs.LB);
2732 Dir->setUpperBoundVariable(Exprs.UB);
2733 Dir->setStrideVariable(Exprs.ST);
2734 Dir->setEnsureUpperBound(Exprs.EUB);
2735 Dir->setNextLowerBound(Exprs.NLB);
2736 Dir->setNextUpperBound(Exprs.NUB);
2737 Dir->setNumIterations(Exprs.NumIterations);
2738 Dir->setCounters(Exprs.Counters);
2739 Dir->setPrivateCounters(Exprs.PrivateCounters);
2740 Dir->setInits(Exprs.Inits);
2741 Dir->setUpdates(Exprs.Updates);
2742 Dir->setFinals(Exprs.Finals);
2743 Dir->setDependentCounters(Exprs.DependentCounters);
2744 Dir->setDependentInits(Exprs.DependentInits);
2745 Dir->setFinalsConditions(Exprs.FinalsConditions);
2746 Dir->setPreInits(Exprs.PreInits);
2751 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
2753 return createEmptyDirective<OMPParallelGenericLoopDirective>(
2754 C, NumClauses,
true,
2762 const HelperExprs &Exprs) {
2763 auto *Dir = createDirective<OMPTargetParallelGenericLoopDirective>(
2764 C, Clauses, AssociatedStmt,
2766 EndLoc, CollapsedNum);
2767 Dir->setIterationVariable(Exprs.IterationVarRef);
2768 Dir->setLastIteration(Exprs.LastIteration);
2769 Dir->setCalcLastIteration(Exprs.CalcLastIteration);
2770 Dir->setPreCond(Exprs.PreCond);
2771 Dir->setCond(Exprs.Cond);
2772 Dir->setInit(Exprs.Init);
2773 Dir->setInc(Exprs.Inc);
2774 Dir->setIsLastIterVariable(Exprs.IL);
2775 Dir->setLowerBoundVariable(Exprs.LB);
2776 Dir->setUpperBoundVariable(Exprs.UB);
2777 Dir->setStrideVariable(Exprs.ST);
2778 Dir->setEnsureUpperBound(Exprs.EUB);
2779 Dir->setNextLowerBound(Exprs.NLB);
2780 Dir->setNextUpperBound(Exprs.NUB);
2781 Dir->setNumIterations(Exprs.NumIterations);
2782 Dir->setCounters(Exprs.Counters);
2783 Dir->setPrivateCounters(Exprs.PrivateCounters);
2784 Dir->setInits(Exprs.Inits);
2785 Dir->setUpdates(Exprs.Updates);
2786 Dir->setFinals(Exprs.Finals);
2787 Dir->setDependentCounters(Exprs.DependentCounters);
2788 Dir->setDependentInits(Exprs.DependentInits);
2789 Dir->setFinalsConditions(Exprs.FinalsConditions);
2790 Dir->setPreInits(Exprs.PreInits);
2796 unsigned NumClauses,
2797 unsigned CollapsedNum,
2799 return createEmptyDirective<OMPTargetParallelGenericLoopDirective>(
2800 C, NumClauses,
true,
2801 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 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...