17 using namespace clang;
21 assert(Clauses.size() == getNumClauses() &&
22 "Number of clauses is not the same as the preallocated buffer");
23 std::copy(Clauses.begin(), Clauses.end(), getClauses().begin());
30 if (isa<OMPTargetEnterDataDirective>(
this) ||
31 isa<OMPTargetExitDataDirective>(
this) ||
32 isa<OMPTargetUpdateDirective>(
this))
34 return !hasAssociatedStmt() || !getAssociatedStmt();
38 assert(!isStandaloneDirective() &&
39 "Standalone Executable Directives don't have Structured Blocks.");
40 if (
auto *LD = dyn_cast<OMPLoopDirective>(
this))
42 return getInnermostCapturedStmt()->getCapturedStmt();
46 bool TryImperfectlyNestedLoops) {
47 Stmt *OrigStmt = CurStmt;
50 if (TryImperfectlyNestedLoops) {
51 if (
auto *CS = dyn_cast<CompoundStmt>(CurStmt)) {
55 while (!Statements.empty()) {
56 CS = Statements.pop_back_val();
59 for (
Stmt *S : CS->body()) {
62 if (isa<ForStmt>(S) || isa<CXXForRangeStmt>(S)) {
71 S = S->IgnoreContainers();
72 if (
auto *InnerCS = dyn_cast_or_null<CompoundStmt>(S))
73 NextStatements.push_back(InnerCS);
75 if (Statements.empty()) {
79 Statements.swap(NextStatements);
93 if (
auto *For = dyn_cast<ForStmt>(Body)) {
94 Body = For->getBody();
96 assert(isa<CXXForRangeStmt>(Body) &&
97 "Expected canonical for loop or range-based for loop.");
98 Body = cast<CXXForRangeStmt>(Body)->getBody();
100 for (
unsigned Cnt = 1; Cnt < CollapsedNum; ++Cnt) {
101 Body = tryToFindNextInnerLoop(Body,
true);
102 if (
auto *For = dyn_cast<ForStmt>(Body)) {
103 Body = For->getBody();
105 assert(isa<CXXForRangeStmt>(Body) &&
106 "Expected canonical for loop or range-based for loop.");
107 Body = cast<CXXForRangeStmt>(Body)->getBody();
114 assert(A.size() == getCollapsedNumber() &&
115 "Number of loop counters is not the same as the collapsed number");
116 std::copy(A.begin(), A.end(), getCounters().begin());
120 assert(A.size() == getCollapsedNumber() &&
"Number of loop private counters " 121 "is not the same as the collapsed " 123 std::copy(A.begin(), A.end(), getPrivateCounters().begin());
127 assert(A.size() == getCollapsedNumber() &&
128 "Number of counter inits is not the same as the collapsed number");
129 std::copy(A.begin(), A.end(),
getInits().begin());
133 assert(A.size() == getCollapsedNumber() &&
134 "Number of counter updates is not the same as the collapsed number");
135 std::copy(A.begin(), A.end(),
getUpdates().begin());
139 assert(A.size() == getCollapsedNumber() &&
140 "Number of counter finals is not the same as the collapsed number");
141 std::copy(A.begin(), A.end(),
getFinals().begin());
146 A.size() == getCollapsedNumber() &&
147 "Number of dependent counters is not the same as the collapsed number");
148 llvm::copy(A, getDependentCounters().begin());
152 assert(A.size() == getCollapsedNumber() &&
153 "Number of dependent inits is not the same as the collapsed number");
154 llvm::copy(A, getDependentInits().begin());
158 assert(A.size() == getCollapsedNumber() &&
159 "Number of finals conditions is not the same as the collapsed number");
160 llvm::copy(A, getFinalsConditions().begin());
174 Dir->setHasCancel(HasCancel);
196 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
222 unsigned CollapsedNum,
227 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
239 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
241 new (Mem)
OMPForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
268 Dir->setHasCancel(HasCancel);
274 unsigned CollapsedNum,
279 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
292 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
326 unsigned CollapsedNum,
332 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
347 Dir->setHasCancel(HasCancel);
364 Stmt *AssociatedStmt,
385 Stmt *AssociatedStmt) {
410 Stmt *AssociatedStmt) {
458 numLoopChildren(CollapsedNum, OMPD_parallel_for));
487 Dir->setHasCancel(HasCancel);
498 numLoopChildren(CollapsedNum, OMPD_parallel_for));
509 Size +
sizeof(
OMPClause *) * Clauses.size() +
510 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
512 StartLoc, EndLoc, CollapsedNum, Clauses.size());
549 Size +
sizeof(
OMPClause *) * NumClauses +
550 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
564 Dir->setAssociatedStmt(AssociatedStmt);
589 Dir->setHasCancel(HasCancel);
606 Stmt *AssociatedStmt,
bool HasCancel) {
614 Dir->setHasCancel(HasCancel);
680 Dir->setReductionRef(ReductionRef);
703 Dir->setCancelRegion(CancelRegion);
726 Dir->setCancelRegion(CancelRegion);
766 Stmt *AssociatedStmt) {
791 Expr *E,
Expr *UE,
bool IsXLHSInRHSPart,
bool IsPostfixUpdate) {
803 Dir->setUpdateExpr(UE);
804 Dir->IsXLHSInRHSPart = IsXLHSInRHSPart;
805 Dir->IsPostfixUpdate = IsPostfixUpdate;
823 Stmt *AssociatedStmt) {
876 Size +
sizeof(
OMPClause *) * Clauses.size() +
877 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
879 StartLoc, EndLoc, CollapsedNum, Clauses.size());
906 Dir->setHasCancel(HasCancel);
917 Size +
sizeof(
OMPClause *) * NumClauses +
918 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
992 Stmt *AssociatedStmt) {
1005 unsigned NumClauses,
1022 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
1055 unsigned NumClauses,
1056 unsigned CollapsedNum,
1062 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
1074 numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
1113 numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
1124 Size +
sizeof(
OMPClause *) * Clauses.size() +
1125 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_master_taskloop));
1127 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1159 unsigned NumClauses,
1164 Size +
sizeof(
OMPClause *) * NumClauses +
1165 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_master_taskloop));
1178 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd));
1180 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1182 Dir->setAssociatedStmt(AssociatedStmt);
1186 Dir->setPreCond(Exprs.
PreCond);
1187 Dir->setCond(Exprs.
Cond);
1188 Dir->setInit(Exprs.
Init);
1189 Dir->setInc(Exprs.
Inc);
1190 Dir->setIsLastIterVariable(Exprs.
IL);
1191 Dir->setLowerBoundVariable(Exprs.
LB);
1192 Dir->setUpperBoundVariable(Exprs.
UB);
1193 Dir->setStrideVariable(Exprs.
ST);
1194 Dir->setEnsureUpperBound(Exprs.
EUB);
1195 Dir->setNextLowerBound(Exprs.
NLB);
1196 Dir->setNextUpperBound(Exprs.
NUB);
1200 Dir->setInits(Exprs.
Inits);
1201 Dir->setUpdates(Exprs.
Updates);
1202 Dir->setFinals(Exprs.
Finals);
1212 unsigned NumClauses,
1219 numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd));
1230 Size +
sizeof(
OMPClause *) * Clauses.size() +
1232 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop));
1234 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1236 Dir->setAssociatedStmt(AssociatedStmt);
1240 Dir->setPreCond(Exprs.
PreCond);
1241 Dir->setCond(Exprs.
Cond);
1242 Dir->setInit(Exprs.
Init);
1243 Dir->setInc(Exprs.
Inc);
1244 Dir->setIsLastIterVariable(Exprs.
IL);
1245 Dir->setLowerBoundVariable(Exprs.
LB);
1246 Dir->setUpperBoundVariable(Exprs.
UB);
1247 Dir->setStrideVariable(Exprs.
ST);
1248 Dir->setEnsureUpperBound(Exprs.
EUB);
1249 Dir->setNextLowerBound(Exprs.
NLB);
1250 Dir->setNextUpperBound(Exprs.
NUB);
1254 Dir->setInits(Exprs.
Inits);
1255 Dir->setUpdates(Exprs.
Updates);
1256 Dir->setFinals(Exprs.
Finals);
1266 unsigned NumClauses,
1267 unsigned CollapsedNum,
1272 Size +
sizeof(
OMPClause *) * NumClauses +
1274 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop));
1286 Size +
sizeof(
OMPClause *) * Clauses.size() +
1288 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd));
1290 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1292 Dir->setAssociatedStmt(AssociatedStmt);
1296 Dir->setPreCond(Exprs.
PreCond);
1297 Dir->setCond(Exprs.
Cond);
1298 Dir->setInit(Exprs.
Init);
1299 Dir->setInc(Exprs.
Inc);
1300 Dir->setIsLastIterVariable(Exprs.
IL);
1301 Dir->setLowerBoundVariable(Exprs.
LB);
1302 Dir->setUpperBoundVariable(Exprs.
UB);
1303 Dir->setStrideVariable(Exprs.
ST);
1304 Dir->setEnsureUpperBound(Exprs.
EUB);
1305 Dir->setNextLowerBound(Exprs.
NLB);
1306 Dir->setNextUpperBound(Exprs.
NUB);
1310 Dir->setInits(Exprs.
Inits);
1311 Dir->setUpdates(Exprs.
Updates);
1312 Dir->setFinals(Exprs.
Finals);
1322 unsigned NumClauses,
1323 unsigned CollapsedNum,
1328 Size +
sizeof(
OMPClause *) * NumClauses +
1330 numLoopChildren(CollapsedNum, OMPD_parallel_master_taskloop_simd));
1343 numLoopChildren(CollapsedNum, OMPD_distribute));
1382 numLoopChildren(CollapsedNum, OMPD_distribute));
1417 Size +
sizeof(
OMPClause *) * Clauses.size() +
1419 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1422 CollapsedNum, Clauses.size());
1462 Dir->HasCancel = HasCancel;
1468 unsigned NumClauses,
1469 unsigned CollapsedNum,
1474 Size +
sizeof(
OMPClause *) * NumClauses +
1476 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
1488 Size +
sizeof(
OMPClause *) * Clauses.size() +
1490 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1538 unsigned NumClauses,
1539 unsigned CollapsedNum,
1544 Size +
sizeof(
OMPClause *) * NumClauses +
1546 numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
1558 Size +
sizeof(
OMPClause *) * Clauses.size() +
1560 numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1562 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1594 unsigned NumClauses,
1599 Size +
sizeof(
OMPClause *) * NumClauses +
1601 numLoopChildren(CollapsedNum, OMPD_distribute_simd));
1612 Size +
sizeof(
OMPClause *) * Clauses.size() +
1614 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1617 CollapsedNum, Clauses.size());
1649 unsigned NumClauses,
1650 unsigned CollapsedNum,
1655 Size +
sizeof(
OMPClause *) * NumClauses +
1657 numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
1670 numLoopChildren(CollapsedNum, OMPD_target_simd));
1701 numLoopChildren(CollapsedNum, OMPD_target_simd));
1712 Size +
sizeof(
OMPClause *) * Clauses.size() +
1713 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1715 StartLoc, EndLoc, CollapsedNum, Clauses.size());
1747 unsigned NumClauses,
1752 Size +
sizeof(
OMPClause *) * NumClauses +
1753 sizeof(
Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
1766 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1800 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
1807 numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
1821 numLoopChildren(CollapsedNum,
1822 OMPD_teams_distribute_parallel_for_simd));
1870 unsigned NumClauses,
1871 unsigned CollapsedNum,
1878 numLoopChildren(CollapsedNum,
1879 OMPD_teams_distribute_parallel_for_simd));
1892 Size +
sizeof(
OMPClause *) * Clauses.size() +
1894 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1937 Dir->HasCancel = HasCancel;
1943 unsigned NumClauses,
1944 unsigned CollapsedNum,
1949 Size +
sizeof(
OMPClause *) * NumClauses +
1951 numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
1987 Size +
sizeof(
OMPClause *) * Clauses.size() +
1989 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
2024 unsigned NumClauses,
2025 unsigned CollapsedNum,
2030 Size +
sizeof(
OMPClause *) * NumClauses +
2032 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
2045 Size +
sizeof(
OMPClause *) * Clauses.size() +
2047 numLoopChildren(CollapsedNum,
2048 OMPD_target_teams_distribute_parallel_for));
2051 StartLoc, EndLoc, CollapsedNum, Clauses.size());
2091 Dir->HasCancel = HasCancel;
2097 unsigned NumClauses,
2098 unsigned CollapsedNum,
2104 Size +
sizeof(
OMPClause *) * NumClauses +
2106 numLoopChildren(CollapsedNum,
2107 OMPD_target_teams_distribute_parallel_for));
2121 Size +
sizeof(
OMPClause *) * Clauses.size() +
2123 numLoopChildren(CollapsedNum,
2124 OMPD_target_teams_distribute_parallel_for_simd));
2127 StartLoc, EndLoc, CollapsedNum, Clauses.size());
2172 const ASTContext &
C,
unsigned NumClauses,
unsigned CollapsedNum,
2178 Size +
sizeof(
OMPClause *) * NumClauses +
2180 numLoopChildren(CollapsedNum,
2181 OMPD_target_teams_distribute_parallel_for_simd));
2183 CollapsedNum, NumClauses);
2194 Size +
sizeof(
OMPClause *) * Clauses.size() +
2196 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
2231 unsigned NumClauses,
2232 unsigned CollapsedNum,
2237 Size +
sizeof(
OMPClause *) * NumClauses +
2239 numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
void setPreInits(Stmt *PreInits)
void setCombinedParForInDistCond(Expr *CombParForInDistCond)
Expr * NLB
Update of LowerBound for statically scheduled 'omp for' loops.
Defines the clang::ASTContext interface.
This represents '#pragma omp distribute simd' composite directive.
SmallVector< Expr *, 4 > Finals
Final loop counter values for GodeGen.
This represents '#pragma omp master' directive.
Expr * NUB
Update of UpperBound for statically scheduled omp loops for outer loop in combined constructs (e...
SmallVector< Expr *, 4 > Updates
Expressions for loop counters update for CodeGen.
This represents '#pragma omp task' directive.
void setEnsureUpperBound(Expr *EUB)
static OMPMasterTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMasterDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPDistributeParallelForDirective * 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 OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V, Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate)
Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see S...
static OMPParallelMasterTaskLoopDirective * 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.
void setCombinedCond(Expr *CombCond)
static OMPTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
void setCombinedLowerBoundVariable(Expr *CombLB)
static OMPTaskwaitDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPTargetParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setHasCancel(bool Has)
Set cancel state.
Stmt - This represents one statement.
static OMPTaskgroupDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
void setLastIteration(Expr *LI)
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
static OMPTaskgroupDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef)
Creates directive.
void setPrivateCounters(ArrayRef< Expr *> A)
static OMPTargetTeamsDistributeParallelForDirective * 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.
This represents '#pragma omp for simd' directive.
Expr * EUB
EnsureUpperBound – expression UB = min(UB, NumIterations).
Expr * DistInc
DistInc - increment expression for distribute loop when found combined with a further loop level (e...
This represents '#pragma omp teams distribute parallel for' composite directive.
static OMPSectionDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt, bool HasCancel)
Creates directive.
void setPrevEnsureUpperBound(Expr *PrevEUB)
This represents '#pragma omp parallel master' directive.
void setUpperBoundVariable(Expr *UB)
void setNumIterations(Expr *NI)
This represents '#pragma omp target teams distribute' combined directive.
static OMPParallelMasterDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setNextLowerBound(Expr *NLB)
static OMPMasterTaskLoopDirective * 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 for' directive.
This represents '#pragma omp target teams distribute parallel for' combined directive.
static OMPTeamsDistributeParallelForDirective * 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.
void setDependentInits(ArrayRef< Expr *> A)
void setIsLastIterVariable(Expr *IL)
Expr * PrevLB
PreviousLowerBound - local variable passed to runtime in the enclosing schedule or null if that does ...
This represents '#pragma omp target exit data' directive.
static OMPTargetTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
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 OMPParallelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for N clauses.
void setCombinedDistCond(Expr *CombDistCond)
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 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.
Expr * LastIteration
Loop last iteration number.
static OMPTargetExitDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
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 OMPTargetTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
const Stmt * getStructuredBlock() const
Returns the AST node representing OpenMP structured-block of this OpenMP executable directive...
static OMPTargetDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp parallel' directive.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
static OMPTaskLoopSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetEnterDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPTargetParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, 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.
static OMPFlushDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp target simd' directive.
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 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.
This represents '#pragma omp barrier' directive.
This represents '#pragma omp critical' directive.
static OMPCriticalDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
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 distribute parallel for' composite directive.
This represents '#pragma omp teams distribute parallel for simd' composite directive.
static OMPDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Expr * LB
DistributeLowerBound - used when composing 'omp distribute' with 'omp for' in a same construct...
Expr * EUB
DistributeEnsureUpperBound - used when composing 'omp distribute' with 'omp for' in a same construct...
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 OMPTargetTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses 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 cancellation point' directive.
void setCombinedInit(Expr *CombInit)
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
This represents '#pragma omp teams' directive.
static OMPFlushDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses)
Creates directive with a list of Clauses.
Expr * CalcLastIteration
Calculation of last iteration.
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 teams distribute simd' combined directive.
static OMPTargetParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
SmallVector< Expr *, 4 > FinalsConditions
List of final conditions required for the generation of the non-rectangular loops.
static OMPTaskyieldDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPParallelMasterTaskLoopSimdDirective * 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.
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
Expr * NUB
Update of UpperBound for statically scheduled 'omp for' loops.
Expr * Cond
Loop condition.
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 OMPTargetParallelForDirective * 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 OMPTargetDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
static OMPTeamsDistributeSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, 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)
Creates directive with a list of Clauses.
Expr * PreCond
Loop pre-condition.
This represents '#pragma omp target parallel for simd' directive.
void setDependentCounters(ArrayRef< Expr *> A)
The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest.
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 taskgroup' directive.
static OMPSingleDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPCriticalDirective * Create(const ASTContext &C, const DeclarationNameInfo &Name, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive.
Expr * DistCond
Distribute Loop condition used when composing 'omp distribute' with 'omp for' in a same construct whe...
Expr * IterationVarRef
Loop iteration variable.
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.
Expr * Init
Distribute loop iteration variable init used when composing 'omp distribute' with 'omp for' in a same...
static OMPTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp distribute' directive.
void setInits(ArrayRef< Expr *> A)
static OMPSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents one expression.
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.
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
Stmt * IgnoreContainers(bool IgnoreCaptured=false)
Skip no-op (attributed, compound) container stmts and skip captured stmt at the top, if IgnoreCaptured is true.
SmallVector< Expr *, 4 > DependentInits
List of initializers required for the generation of the non-rectangular loops.
This represents '#pragma omp master taskloop' directive.
static OMPMasterTaskLoopDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPDistributeParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, Stmt *AssociatedStmt)
Creates directive.
This represents '#pragma omp target teams distribute parallel for simd' combined 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 OMPTargetDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents '#pragma omp target teams distribute simd' combined directive.
Expr * PrevUB
PreviousUpperBound - local variable passed to runtime in the enclosing schedule or null if that does ...
static OMPOrderedDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive.
This represents '#pragma omp for' directive.
static OMPTargetEnterDataDirective * CreateEmpty(const ASTContext &C, unsigned N, EmptyShell)
Creates an empty directive with the place for N clauses.
This represents '#pragma omp target teams' directive.
void setAssociatedStmt(Stmt *S)
Set the associated statement for the directive.
static OMPDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
Expr * ParForInDistCond
'omp parallel for' loop condition used when composed with 'omp distribute' in the same construct and ...
static OMPParallelForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp cancel' directive.
void setDistInc(Expr *DistInc)
Expr * NLB
Update of LowerBound for statically scheduled omp loops for outer loop in combined constructs (e...
static OMPDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setClauses(ArrayRef< OMPClause *> Clauses)
Sets the list of variables for this clause.
static Stmt * tryToFindNextInnerLoop(Stmt *CurStmt, bool TryImperfectlyNestedLoops)
Try to find the next loop sub-statement in the specified statement CurStmt.
This represents '#pragma omp flush' directive.
This represents '#pragma omp parallel for simd' directive.
Expr * NumIterations
Loop number of iterations.
static OMPForDirective * 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.
Expr * ST
Stride - local variable passed to runtime.
This represents '#pragma omp parallel master taskloop' directive.
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 target enter data' directive.
void setUpdates(ArrayRef< Expr *> A)
SmallVector< Expr *, 4 > PrivateCounters
PrivateCounters Loop counters.
void setLowerBoundVariable(Expr *LB)
This represents '#pragma omp master taskloop simd' directive.
static OMPSectionDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
SmallVector< Expr *, 4 > Counters
Counters Loop counters.
This represents '#pragma omp single' directive.
Encodes a location in the source.
void setPrevLowerBoundVariable(Expr *PrevLB)
void setIterationVariable(Expr *IV)
MutableArrayRef< Expr * > getInits()
static OMPTaskDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTargetUpdateDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setCombinedNextLowerBound(Expr *CombNLB)
static OMPParallelForDirective * 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 OMPParallelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
static OMPTargetExitDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
static OMPAtomicDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp taskwait' directive.
Expr * PrevEUB
PrevEUB - expression similar to EUB but to be used when loop scheduling uses PrevLB and PrevUB (e...
This is a basic class for representing single OpenMP clause.
void setFinalsConditions(ArrayRef< Expr *> A)
static OMPOrderedDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
This represents '#pragma omp target' directive.
static OMPTeamsDistributeParallelForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPTeamsDistributeDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
DistCombinedHelperExprs DistCombinedFields
Expressions used when combining OpenMP loop pragmas.
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.
This represents '#pragma omp ordered' directive.
Expr * LB
LowerBound - local variable passed to runtime.
This represents '#pragma omp target update' directive.
Expr * Init
Loop iteration variable init.
This represents '#pragma omp parallel master taskloop simd' directive.
static OMPSingleDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
void * Allocate(size_t Size, unsigned Align=8) const
void setPrevUpperBoundVariable(Expr *PrevUB)
void setCombinedEnsureUpperBound(Expr *CombEUB)
static OMPForDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setCounters(ArrayRef< Expr *> A)
Dataflow Directional Tag Classes.
SmallVector< Expr *, 4 > Inits
Expressions for loop counters inits for CodeGen.
void setCombinedUpperBoundVariable(Expr *CombUB)
static OMPTargetTeamsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
This represents '#pragma omp section' directive.
SmallVector< Expr *, 4 > DependentCounters
List of counters required for the generation of the non-rectangular loops.
This represents '#pragma omp teams distribute' directive.
static OMPParallelSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
This represents '#pragma omp simd' directive.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
This represents '#pragma omp atomic' directive.
static OMPForSimdDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPBarrierDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
This file defines OpenMP AST classes for executable directives and clauses.
static OMPSectionsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel)
Creates directive with a list of Clauses.
Expr * Inc
Loop increment.
static OMPTargetTeamsDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
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.
static OMPTaskLoopDirective * 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.
Expr * UB
DistributeUpperBound - used when composing 'omp distribute' with 'omp for' in a same construct...
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
static OMPTaskyieldDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
static OMPTargetDataDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
Expr * UB
UpperBound - local variable passed to runtime.
This represents '#pragma omp target parallel' directive.
void setStrideVariable(Expr *ST)
static OMPParallelSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
static OMPBarrierDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates 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.
This represents '#pragma omp taskloop simd' directive.
static OMPSectionsDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive with the place for NumClauses clauses.
void setPreCond(Expr *PC)
static OMPCancelDirective * CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell)
Creates an empty directive.
static OMPTaskwaitDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc)
Creates directive.
This represents '#pragma omp sections' directive.
Expr * Cond
Distribute Loop condition used when composing 'omp distribute' with 'omp for' in a same construct...
Stmt * PreInits
Init statement for all captured expressions.
This represents '#pragma omp target data' directive.
void setNextUpperBound(Expr *NUB)
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 OMPCancelDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, OpenMPDirectiveKind CancelRegion)
Creates directive.
Expr * IL
IsLastIteration - local flag variable passed to runtime.
This represents '#pragma omp taskyield' directive.
This represents '#pragma omp distribute parallel for simd' composite directive.
static OMPCancellationPointDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, OpenMPDirectiveKind CancelRegion)
Creates directive.
This represents '#pragma omp parallel sections' directive.
void setCalcLastIteration(Expr *CLI)
void setCombinedNextUpperBound(Expr *CombNUB)
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 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.
void setFinals(ArrayRef< Expr *> A)
static OMPTeamsDistributeParallelForSimdDirective * 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 for' directive.
static OMPCancellationPointDirective * CreateEmpty(const ASTContext &C, EmptyShell)
Creates an empty directive.
static OMPParallelMasterDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause *> Clauses, Stmt *AssociatedStmt)
Creates directive with a list of Clauses.
This represents '#pragma omp taskloop' directive.