2015-10-02 21:41:04 +08:00
|
|
|
//===--- StmtOpenMP.cpp - Classes for OpenMP directives -------------------===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2015-10-02 21:41:04 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the subclesses of Stmt class declared in StmtOpenMP.h
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "clang/AST/StmtOpenMP.h"
|
|
|
|
|
|
|
|
#include "clang/AST/ASTContext.h"
|
|
|
|
|
|
|
|
using namespace clang;
|
|
|
|
|
|
|
|
void OMPExecutableDirective::setClauses(ArrayRef<OMPClause *> Clauses) {
|
|
|
|
assert(Clauses.size() == getNumClauses() &&
|
|
|
|
"Number of clauses is not the same as the preallocated buffer");
|
|
|
|
std::copy(Clauses.begin(), Clauses.end(), getClauses().begin());
|
|
|
|
}
|
|
|
|
|
[clang][OpeMP] Model OpenMP structured-block in AST (PR40563)
Summary:
https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5.0.pdf, page 3:
```
structured block
For C/C++, an executable statement, possibly compound, with a single entry at the
top and a single exit at the bottom, or an OpenMP construct.
COMMENT: See Section 2.1 on page 38 for restrictions on structured
blocks.
```
```
2.1 Directive Format
Some executable directives include a structured block. A structured block:
• may contain infinite loops where the point of exit is never reached;
• may halt due to an IEEE exception;
• may contain calls to exit(), _Exit(), quick_exit(), abort() or functions with a
_Noreturn specifier (in C) or a noreturn attribute (in C/C++);
• may be an expression statement, iteration statement, selection statement, or try block, provided
that the corresponding compound statement obtained by enclosing it in { and } would be a
structured block; and
Restrictions
Restrictions to structured blocks are as follows:
• Entry to a structured block must not be the result of a branch.
• The point of exit cannot be a branch out of the structured block.
C / C++
• The point of entry to a structured block must not be a call to setjmp().
• longjmp() and throw() must not violate the entry/exit criteria.
```
Of particular note here is the fact that OpenMP structured blocks are as-if `noexcept`,
in the same sense as with the normal `noexcept` functions in C++.
I.e. if throw happens, and it attempts to travel out of the `noexcept` function
(here: out of the current structured-block), then the program terminates.
Now, one of course can say that since it is explicitly prohibited by the Specification,
then any and all programs that violate this Specification contain undefined behavior,
and are unspecified, and thus no one should care about them. Just don't write broken code /s
But i'm not sure this is a reasonable approach.
I have personally had oss-fuzz issues of this origin - exception thrown inside
of an OpenMP structured-block that is not caught, thus causing program termination.
This issue isn't all that hard to catch, it's not any particularly different from
diagnosing the same situation with the normal `noexcept` function.
Now, clang static analyzer does not presently model exceptions.
But clang-tidy has a simplisic [[ https://clang.llvm.org/extra/clang-tidy/checks/bugprone-exception-escape.html | bugprone-exception-escape ]] check,
and it is even refactored as a `ExceptionAnalyzer` class for reuse.
So it would be trivial to use that analyzer to check for
exceptions escaping out of OpenMP structured blocks. (D59466)
All that sounds too great to be true. Indeed, there is a caveat.
Presently, it's practically impossible to do. To check a OpenMP structured block
you need to somehow 'get' the OpenMP structured block, and you can't because
it's simply not modelled in AST. `CapturedStmt`/`CapturedDecl` is not it's representation.
Now, it is of course possible to write e.g. some AST matcher that would e.g.
match every OpenMP executable directive, and then return the whatever `Stmt` is
the structured block of said executable directive, if any.
But i said //practically//. This isn't practical for the following reasons:
1. This **will** bitrot. That matcher will need to be kept up-to-date,
and refreshed with every new OpenMP spec version.
2. Every single piece of code that would want that knowledge would need to
have such matcher. Well, okay, if it is an AST matcher, it could be shared.
But then you still have `RecursiveASTVisitor` and friends.
`2 > 1`, so now you have code duplication.
So it would be reasonable (and is fully within clang AST spirit) to not
force every single consumer to do that work, but instead store that knowledge
in the correct, and appropriate place - AST, class structure.
Now, there is another hoop we need to get through.
It isn't fully obvious //how// to model this.
The best solution would of course be to simply add a `OMPStructuredBlock` transparent
node. It would be optimal, it would give us two properties:
* Given this `OMPExecutableDirective`, what's it OpenMP structured block?
* It is trivial to check whether the `Stmt*` is a OpenMP structured block (`isa<OMPStructuredBlock>(ptr)`)
But OpenMP structured block isn't **necessarily** the first, direct child of `OMP*Directive`.
(even ignoring the clang's `CapturedStmt`/`CapturedDecl` that were inserted inbetween).
So i'm not sure whether or not we could re-create AST statements after they were already created?
There would be other costs to a new AST node: https://bugs.llvm.org/show_bug.cgi?id=40563#c12
```
1. You will need to break the representation of loops. The body should be replaced by the "structured block" entity.
2. You will need to support serialization/deserialization.
3. You will need to support template instantiation.
4. You will need to support codegen and take this new construct to account in each OpenMP directive.
```
Instead, there **is** an functionally-equivalent, alternative solution, consisting of two parts.
Part 1:
* Add a member function `isStandaloneDirective()` to the `OMPExecutableDirective` class,
that will tell whether this directive is stand-alone or not, as per the spec.
We need it because we can't just check for the existance of associated statements,
see code comment.
* Add a member function `getStructuredBlock()` to the OMPExecutableDirective` class itself,
that assert that this is not a stand-alone directive, and either return the correct loop body
if this is a loop-like directive, or the captured statement.
This way, given an `OMPExecutableDirective`, we can get it's structured block.
Also, since the knowledge is ingrained into the clang OpenMP implementation,
it will not cause any duplication, and //hopefully// won't bitrot.
Great we achieved 1 of 2 properties of `OMPStructuredBlock` approach.
Thus, there is a second part needed:
* How can we check whether a given `Stmt*` is `OMPStructuredBlock`?
Well, we can't really, in general. I can see this workaround:
```
class FunctionASTVisitor : public RecursiveASTVisitor<FunctionASTVisitor> {
using Base = RecursiveASTVisitor<FunctionASTVisitor>;
public:
bool VisitOMPExecDir(OMPExecDir *D) {
OmpStructuredStmts.emplace_back(D.getStructuredStmt());
}
bool VisitSOMETHINGELSE(???) {
if(InOmpStructuredStmt)
HI!
}
bool TraverseStmt(Stmt *Node) {
if (!Node)
return Base::TraverseStmt(Node);
if (OmpStructuredStmts.back() == Node)
++InOmpStructuredStmt;
Base::TraverseStmt(Node);
if (OmpStructuredStmts.back() == Node) {
OmpStructuredStmts.pop_back();
--InOmpStructuredStmt;
}
return true;
}
std::vector<Stmt*> OmpStructuredStmts;
int InOmpStructuredStmt = 0;
};
```
But i really don't see using it in practice.
It's just too intrusive; and again, requires knowledge duplication.
.. but no. The solution lies right on the ground.
Why don't we simply store this `i'm a openmp structured block` in the bitfield of the `Stmt` itself?
This does not appear to have any impact on the memory footprint of the clang AST,
since it's just a single extra bit in the bitfield. At least the static assertions don't fail.
Thus, indeed, we can achieve both of the properties without a new AST node.
We can cheaply set that bit right in sema, at the end of `Sema::ActOnOpenMPExecutableDirective()`,
by just calling the `getStructuredBlock()` that we just added.
Test coverage that demonstrates all this has been added.
This isn't as great with serialization though. Most of it does not use abbrevs,
so we do end up paying the full price (4 bytes?) instead of a single bit.
That price, of course, can be reclaimed by using abbrevs.
In fact, i suspect that //might// not just reclaim these bytes, but pack these PCH significantly.
I'm not seeing a third solution. If there is one, it would be interesting to hear about it.
("just don't write code that would require `isa<OMPStructuredBlock>(ptr)`" is not a solution.)
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=40563 | PR40563 ]].
Reviewers: ABataev, rjmccall, hfinkel, rsmith, riccibruno, gribozavr
Reviewed By: ABataev, gribozavr
Subscribers: mgorny, aaron.ballman, steveire, guansong, jfb, jdoerfert, cfe-commits
Tags: #clang, #openmp
Differential Revision: https://reviews.llvm.org/D59214
llvm-svn: 356570
2019-03-21 00:32:36 +08:00
|
|
|
bool OMPExecutableDirective::isStandaloneDirective() const {
|
|
|
|
// Special case: 'omp target enter data', 'omp target exit data',
|
|
|
|
// 'omp target update' are stand-alone directives, but for implementation
|
|
|
|
// reasons they have empty synthetic structured block, to simplify codegen.
|
|
|
|
if (isa<OMPTargetEnterDataDirective>(this) ||
|
|
|
|
isa<OMPTargetExitDataDirective>(this) ||
|
|
|
|
isa<OMPTargetUpdateDirective>(this))
|
|
|
|
return true;
|
|
|
|
return !hasAssociatedStmt() || !getAssociatedStmt();
|
|
|
|
}
|
|
|
|
|
|
|
|
const Stmt *OMPExecutableDirective::getStructuredBlock() const {
|
|
|
|
assert(!isStandaloneDirective() &&
|
|
|
|
"Standalone Executable Directives don't have Structured Blocks.");
|
|
|
|
if (auto *LD = dyn_cast<OMPLoopDirective>(this))
|
|
|
|
return LD->getBody();
|
|
|
|
return getInnermostCapturedStmt()->getCapturedStmt();
|
|
|
|
}
|
|
|
|
|
2015-10-02 21:41:04 +08:00
|
|
|
void OMPLoopDirective::setCounters(ArrayRef<Expr *> A) {
|
|
|
|
assert(A.size() == getCollapsedNumber() &&
|
|
|
|
"Number of loop counters is not the same as the collapsed number");
|
|
|
|
std::copy(A.begin(), A.end(), getCounters().begin());
|
|
|
|
}
|
|
|
|
|
|
|
|
void OMPLoopDirective::setPrivateCounters(ArrayRef<Expr *> A) {
|
|
|
|
assert(A.size() == getCollapsedNumber() && "Number of loop private counters "
|
|
|
|
"is not the same as the collapsed "
|
|
|
|
"number");
|
|
|
|
std::copy(A.begin(), A.end(), getPrivateCounters().begin());
|
|
|
|
}
|
|
|
|
|
|
|
|
void OMPLoopDirective::setInits(ArrayRef<Expr *> A) {
|
|
|
|
assert(A.size() == getCollapsedNumber() &&
|
|
|
|
"Number of counter inits is not the same as the collapsed number");
|
|
|
|
std::copy(A.begin(), A.end(), getInits().begin());
|
|
|
|
}
|
|
|
|
|
|
|
|
void OMPLoopDirective::setUpdates(ArrayRef<Expr *> A) {
|
|
|
|
assert(A.size() == getCollapsedNumber() &&
|
|
|
|
"Number of counter updates is not the same as the collapsed number");
|
|
|
|
std::copy(A.begin(), A.end(), getUpdates().begin());
|
|
|
|
}
|
|
|
|
|
|
|
|
void OMPLoopDirective::setFinals(ArrayRef<Expr *> A) {
|
|
|
|
assert(A.size() == getCollapsedNumber() &&
|
|
|
|
"Number of counter finals is not the same as the collapsed number");
|
|
|
|
std::copy(A.begin(), A.end(), getFinals().begin());
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPParallelDirective *OMPParallelDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
|
|
|
OMPParallelDirective *Dir =
|
|
|
|
new (Mem) OMPParallelDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setHasCancel(HasCancel);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPParallelDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPParallelDirective(NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPSimdDirective *
|
|
|
|
OMPSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc, unsigned CollapsedNum,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
|
|
|
|
OMPSimdDirective *Dir = new (Mem)
|
|
|
|
OMPSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
2016-03-29 16:58:54 +08:00
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2015-10-02 21:41:04 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPSimdDirective *OMPSimdDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPSimdDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_simd));
|
|
|
|
return new (Mem) OMPSimdDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPForDirective *
|
|
|
|
OMPForDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc, unsigned CollapsedNum,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs, bool HasCancel) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
|
|
|
|
OMPForDirective *Dir =
|
|
|
|
new (Mem) OMPForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
2016-05-25 20:36:08 +08:00
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
2015-10-02 21:41:04 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
2016-03-29 16:58:54 +08:00
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2015-10-02 21:41:04 +08:00
|
|
|
Dir->setHasCancel(HasCancel);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPForDirective *OMPForDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPForDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for));
|
|
|
|
return new (Mem) OMPForDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPForSimdDirective *
|
|
|
|
OMPForSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc, unsigned CollapsedNum,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
|
|
|
|
OMPForSimdDirective *Dir = new (Mem)
|
|
|
|
OMPForSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
2016-05-25 20:36:08 +08:00
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
2015-10-02 21:41:04 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
2016-03-29 16:58:54 +08:00
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2015-10-02 21:41:04 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPForSimdDirective *OMPForSimdDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPForSimdDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_for_simd));
|
|
|
|
return new (Mem) OMPForSimdDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPSectionsDirective *OMPSectionsDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
|
|
|
OMPSectionsDirective *Dir =
|
|
|
|
new (Mem) OMPSectionsDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setHasCancel(HasCancel);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPSectionsDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPSectionsDirective(NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C,
|
|
|
|
SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc,
|
|
|
|
Stmt *AssociatedStmt,
|
|
|
|
bool HasCancel) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
|
|
|
OMPSectionDirective *Dir = new (Mem) OMPSectionDirective(StartLoc, EndLoc);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setHasCancel(HasCancel);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPSectionDirective *OMPSectionDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPSectionDirective), alignof(Stmt *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPSectionDirective();
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPSingleDirective *OMPSingleDirective::Create(const ASTContext &C,
|
|
|
|
SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses,
|
|
|
|
Stmt *AssociatedStmt) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
|
|
|
OMPSingleDirective *Dir =
|
|
|
|
new (Mem) OMPSingleDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPSingleDirective *OMPSingleDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPSingleDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPSingleDirective(NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C,
|
|
|
|
SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc,
|
|
|
|
Stmt *AssociatedStmt) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
|
|
|
OMPMasterDirective *Dir = new (Mem) OMPMasterDirective(StartLoc, EndLoc);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPMasterDirective *OMPMasterDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPMasterDirective), alignof(Stmt *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPMasterDirective();
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPCriticalDirective *OMPCriticalDirective::Create(
|
|
|
|
const ASTContext &C, const DeclarationNameInfo &Name,
|
2015-12-15 16:19:24 +08:00
|
|
|
SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
|
2015-12-15 16:19:24 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
2015-10-02 21:41:04 +08:00
|
|
|
OMPCriticalDirective *Dir =
|
2015-12-15 16:19:24 +08:00
|
|
|
new (Mem) OMPCriticalDirective(Name, StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
2015-10-02 21:41:04 +08:00
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPCriticalDirective *OMPCriticalDirective::CreateEmpty(const ASTContext &C,
|
2015-12-15 16:19:24 +08:00
|
|
|
unsigned NumClauses,
|
2015-10-02 21:41:04 +08:00
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPCriticalDirective), alignof(OMPClause *));
|
2015-12-15 16:19:24 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPCriticalDirective(NumClauses);
|
2015-10-02 21:41:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
OMPParallelForDirective *OMPParallelForDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs, bool HasCancel) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_parallel_for));
|
|
|
|
OMPParallelForDirective *Dir = new (Mem)
|
|
|
|
OMPParallelForDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
2016-05-25 20:36:08 +08:00
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
2015-10-02 21:41:04 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
2016-03-29 16:58:54 +08:00
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2015-10-02 21:41:04 +08:00
|
|
|
Dir->setHasCancel(HasCancel);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPParallelForDirective *
|
|
|
|
OMPParallelForDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum, EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPParallelForDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_parallel_for));
|
|
|
|
return new (Mem) OMPParallelForDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
|
|
|
|
OMPParallelForSimdDirective *Dir = new (Mem) OMPParallelForSimdDirective(
|
|
|
|
StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
2016-05-25 20:36:08 +08:00
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
2015-10-02 21:41:04 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
2016-03-29 16:58:54 +08:00
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2015-10-02 21:41:04 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPParallelForSimdDirective *
|
|
|
|
OMPParallelForSimdDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum, EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPParallelForSimdDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_parallel_for_simd));
|
|
|
|
return new (Mem) OMPParallelForSimdDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, bool HasCancel) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
|
|
|
OMPParallelSectionsDirective *Dir =
|
|
|
|
new (Mem) OMPParallelSectionsDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setHasCancel(HasCancel);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPParallelSectionsDirective *
|
|
|
|
OMPParallelSectionsDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses, EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPParallelSectionsDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPParallelSectionsDirective(NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTaskDirective *
|
|
|
|
OMPTaskDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
|
|
|
|
Stmt *AssociatedStmt, bool HasCancel) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
|
|
|
OMPTaskDirective *Dir =
|
|
|
|
new (Mem) OMPTaskDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setHasCancel(HasCancel);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTaskDirective *OMPTaskDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPTaskDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPTaskDirective(NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTaskyieldDirective *OMPTaskyieldDirective::Create(const ASTContext &C,
|
|
|
|
SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc) {
|
|
|
|
void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
|
|
|
|
OMPTaskyieldDirective *Dir =
|
|
|
|
new (Mem) OMPTaskyieldDirective(StartLoc, EndLoc);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTaskyieldDirective *OMPTaskyieldDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
EmptyShell) {
|
|
|
|
void *Mem = C.Allocate(sizeof(OMPTaskyieldDirective));
|
|
|
|
return new (Mem) OMPTaskyieldDirective();
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPBarrierDirective *OMPBarrierDirective::Create(const ASTContext &C,
|
|
|
|
SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc) {
|
|
|
|
void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
|
|
|
|
OMPBarrierDirective *Dir = new (Mem) OMPBarrierDirective(StartLoc, EndLoc);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPBarrierDirective *OMPBarrierDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
EmptyShell) {
|
|
|
|
void *Mem = C.Allocate(sizeof(OMPBarrierDirective));
|
|
|
|
return new (Mem) OMPBarrierDirective();
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTaskwaitDirective *OMPTaskwaitDirective::Create(const ASTContext &C,
|
|
|
|
SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc) {
|
|
|
|
void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
|
|
|
|
OMPTaskwaitDirective *Dir = new (Mem) OMPTaskwaitDirective(StartLoc, EndLoc);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTaskwaitDirective *OMPTaskwaitDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
EmptyShell) {
|
|
|
|
void *Mem = C.Allocate(sizeof(OMPTaskwaitDirective));
|
|
|
|
return new (Mem) OMPTaskwaitDirective();
|
|
|
|
}
|
|
|
|
|
2017-07-19 04:17:46 +08:00
|
|
|
OMPTaskgroupDirective *OMPTaskgroupDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
2017-07-25 23:53:26 +08:00
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *ReductionRef) {
|
2017-07-19 04:17:46 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
|
|
|
|
sizeof(OMPClause *) * Clauses.size(),
|
|
|
|
alignof(Stmt *));
|
2017-07-25 23:53:26 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
|
2015-10-02 21:41:04 +08:00
|
|
|
OMPTaskgroupDirective *Dir =
|
2017-07-19 04:17:46 +08:00
|
|
|
new (Mem) OMPTaskgroupDirective(StartLoc, EndLoc, Clauses.size());
|
2015-10-02 21:41:04 +08:00
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
2017-07-25 23:53:26 +08:00
|
|
|
Dir->setReductionRef(ReductionRef);
|
2017-07-19 04:17:46 +08:00
|
|
|
Dir->setClauses(Clauses);
|
2015-10-02 21:41:04 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTaskgroupDirective *OMPTaskgroupDirective::CreateEmpty(const ASTContext &C,
|
2017-07-19 04:17:46 +08:00
|
|
|
unsigned NumClauses,
|
2015-10-02 21:41:04 +08:00
|
|
|
EmptyShell) {
|
2017-07-19 04:17:46 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPTaskgroupDirective) +
|
|
|
|
sizeof(OMPClause *) * NumClauses,
|
|
|
|
alignof(Stmt *));
|
2017-07-25 23:53:26 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(Stmt *) + sizeof(Expr *));
|
2017-07-19 04:17:46 +08:00
|
|
|
return new (Mem) OMPTaskgroupDirective(NumClauses);
|
2015-10-02 21:41:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
OMPCancellationPointDirective *OMPCancellationPointDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
OpenMPDirectiveKind CancelRegion) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size);
|
|
|
|
OMPCancellationPointDirective *Dir =
|
|
|
|
new (Mem) OMPCancellationPointDirective(StartLoc, EndLoc);
|
|
|
|
Dir->setCancelRegion(CancelRegion);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPCancellationPointDirective *
|
|
|
|
OMPCancellationPointDirective::CreateEmpty(const ASTContext &C, EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPCancellationPointDirective), alignof(Stmt *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size);
|
|
|
|
return new (Mem) OMPCancellationPointDirective();
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPCancelDirective *
|
|
|
|
OMPCancelDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc, ArrayRef<OMPClause *> Clauses,
|
|
|
|
OpenMPDirectiveKind CancelRegion) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
|
|
|
|
sizeof(OMPClause *) * Clauses.size(),
|
2016-10-20 22:27:22 +08:00
|
|
|
alignof(Stmt *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size);
|
|
|
|
OMPCancelDirective *Dir =
|
|
|
|
new (Mem) OMPCancelDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setCancelRegion(CancelRegion);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPCancelDirective *OMPCancelDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPCancelDirective) +
|
|
|
|
sizeof(OMPClause *) * NumClauses,
|
2016-10-20 22:27:22 +08:00
|
|
|
alignof(Stmt *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size);
|
|
|
|
return new (Mem) OMPCancelDirective(NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C,
|
|
|
|
SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size());
|
|
|
|
OMPFlushDirective *Dir =
|
|
|
|
new (Mem) OMPFlushDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPFlushDirective *OMPFlushDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPFlushDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses);
|
|
|
|
return new (Mem) OMPFlushDirective(NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPOrderedDirective *OMPOrderedDirective::Create(const ASTContext &C,
|
|
|
|
SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses,
|
|
|
|
Stmt *AssociatedStmt) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * Clauses.size());
|
|
|
|
OMPOrderedDirective *Dir =
|
|
|
|
new (Mem) OMPOrderedDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPOrderedDirective *OMPOrderedDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPOrderedDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(Stmt *) + sizeof(OMPClause *) * NumClauses);
|
|
|
|
return new (Mem) OMPOrderedDirective(NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPAtomicDirective *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) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
5 * sizeof(Stmt *));
|
|
|
|
OMPAtomicDirective *Dir =
|
|
|
|
new (Mem) OMPAtomicDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setX(X);
|
|
|
|
Dir->setV(V);
|
|
|
|
Dir->setExpr(E);
|
|
|
|
Dir->setUpdateExpr(UE);
|
|
|
|
Dir->IsXLHSInRHSPart = IsXLHSInRHSPart;
|
|
|
|
Dir->IsPostfixUpdate = IsPostfixUpdate;
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPAtomicDirective *OMPAtomicDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPAtomicDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + 5 * sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPAtomicDirective(NumClauses);
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetDirective *OMPTargetDirective::Create(const ASTContext &C,
|
|
|
|
SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses,
|
|
|
|
Stmt *AssociatedStmt) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
|
|
|
OMPTargetDirective *Dir =
|
|
|
|
new (Mem) OMPTargetDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetDirective *OMPTargetDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPTargetDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPTargetDirective(NumClauses);
|
|
|
|
}
|
|
|
|
|
2016-01-27 02:48:41 +08:00
|
|
|
OMPTargetParallelDirective *OMPTargetParallelDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
|
2016-01-27 02:48:41 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
|
|
|
OMPTargetParallelDirective *Dir =
|
|
|
|
new (Mem) OMPTargetParallelDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetParallelDirective *
|
|
|
|
OMPTargetParallelDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses, EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetParallelDirective), alignof(OMPClause *));
|
2016-01-27 02:48:41 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPTargetParallelDirective(NumClauses);
|
|
|
|
}
|
|
|
|
|
2016-02-03 23:46:42 +08:00
|
|
|
OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs, bool HasCancel) {
|
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
|
2016-10-20 22:27:22 +08:00
|
|
|
alignof(OMPClause *));
|
2016-02-03 23:46:42 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
|
|
|
|
OMPTargetParallelForDirective *Dir = new (Mem) OMPTargetParallelForDirective(
|
|
|
|
StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
2016-05-25 20:36:08 +08:00
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
2016-02-03 23:46:42 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
2016-03-29 16:58:54 +08:00
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2016-02-03 23:46:42 +08:00
|
|
|
Dir->setHasCancel(HasCancel);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetParallelForDirective *
|
|
|
|
OMPTargetParallelForDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum, EmptyShell) {
|
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForDirective),
|
2016-10-20 22:27:22 +08:00
|
|
|
alignof(OMPClause *));
|
2016-02-03 23:46:42 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_target_parallel_for));
|
|
|
|
return new (Mem) OMPTargetParallelForDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
|
|
|
|
2015-10-02 21:41:04 +08:00
|
|
|
OMPTargetDataDirective *OMPTargetDataDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
2016-10-20 22:27:22 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
|
|
|
|
sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
2015-10-02 21:41:04 +08:00
|
|
|
OMPTargetDataDirective *Dir =
|
|
|
|
new (Mem) OMPTargetDataDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetDataDirective *OMPTargetDataDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned N,
|
|
|
|
EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
llvm::alignTo(sizeof(OMPTargetDataDirective), alignof(OMPClause *)) +
|
|
|
|
sizeof(OMPClause *) * N + sizeof(Stmt *));
|
2015-10-02 21:41:04 +08:00
|
|
|
return new (Mem) OMPTargetDataDirective(N);
|
|
|
|
}
|
|
|
|
|
2016-01-20 03:15:56 +08:00
|
|
|
OMPTargetEnterDataDirective *OMPTargetEnterDataDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
2017-11-22 01:08:48 +08:00
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
2016-10-20 22:27:22 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
|
2017-11-22 01:08:48 +08:00
|
|
|
sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
2016-01-20 03:15:56 +08:00
|
|
|
OMPTargetEnterDataDirective *Dir =
|
|
|
|
new (Mem) OMPTargetEnterDataDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
2017-11-22 01:08:48 +08:00
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
2016-01-20 03:15:56 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetEnterDataDirective *
|
|
|
|
OMPTargetEnterDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
|
|
|
|
EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
llvm::alignTo(sizeof(OMPTargetEnterDataDirective), alignof(OMPClause *)) +
|
2017-11-22 01:08:48 +08:00
|
|
|
sizeof(OMPClause *) * N + sizeof(Stmt *));
|
2016-01-20 03:15:56 +08:00
|
|
|
return new (Mem) OMPTargetEnterDataDirective(N);
|
|
|
|
}
|
|
|
|
|
2017-11-22 01:08:48 +08:00
|
|
|
OMPTargetExitDataDirective *OMPTargetExitDataDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
2016-10-20 22:27:22 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
|
2017-11-22 01:08:48 +08:00
|
|
|
sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
2016-01-20 04:04:50 +08:00
|
|
|
OMPTargetExitDataDirective *Dir =
|
|
|
|
new (Mem) OMPTargetExitDataDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
2017-11-22 01:08:48 +08:00
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
2016-01-20 04:04:50 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetExitDataDirective *
|
|
|
|
OMPTargetExitDataDirective::CreateEmpty(const ASTContext &C, unsigned N,
|
|
|
|
EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
llvm::alignTo(sizeof(OMPTargetExitDataDirective), alignof(OMPClause *)) +
|
2017-11-22 01:08:48 +08:00
|
|
|
sizeof(OMPClause *) * N + sizeof(Stmt *));
|
2016-01-20 04:04:50 +08:00
|
|
|
return new (Mem) OMPTargetExitDataDirective(N);
|
|
|
|
}
|
|
|
|
|
2015-10-02 21:41:04 +08:00
|
|
|
OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C,
|
|
|
|
SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses,
|
|
|
|
Stmt *AssociatedStmt) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
|
|
|
OMPTeamsDirective *Dir =
|
|
|
|
new (Mem) OMPTeamsDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTeamsDirective *OMPTeamsDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPTeamsDirective), alignof(OMPClause *));
|
2015-10-02 21:41:04 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPTeamsDirective(NumClauses);
|
|
|
|
}
|
2015-12-01 12:18:41 +08:00
|
|
|
|
|
|
|
OMPTaskLoopDirective *OMPTaskLoopDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
|
2015-12-01 12:18:41 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
|
|
|
|
OMPTaskLoopDirective *Dir = new (Mem)
|
|
|
|
OMPTaskLoopDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
2016-05-25 20:36:08 +08:00
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
2015-12-01 12:18:41 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
2016-03-29 16:58:54 +08:00
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2015-12-01 12:18:41 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTaskLoopDirective *OMPTaskLoopDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
2016-01-15 05:00:27 +08:00
|
|
|
unsigned Size =
|
2016-10-20 22:27:22 +08:00
|
|
|
llvm::alignTo(sizeof(OMPTaskLoopDirective), alignof(OMPClause *));
|
2015-12-01 12:18:41 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_taskloop));
|
|
|
|
return new (Mem) OMPTaskLoopDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
|
|
|
|
2015-12-03 17:40:15 +08:00
|
|
|
OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
|
2015-12-03 17:40:15 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
|
|
|
|
OMPTaskLoopSimdDirective *Dir = new (Mem)
|
|
|
|
OMPTaskLoopSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
2016-05-25 20:36:08 +08:00
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
2015-12-03 17:40:15 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
2016-03-29 16:58:54 +08:00
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2015-12-03 17:40:15 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTaskLoopSimdDirective *
|
|
|
|
OMPTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum, EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTaskLoopSimdDirective), alignof(OMPClause *));
|
2015-12-03 17:40:15 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_taskloop_simd));
|
|
|
|
return new (Mem) OMPTaskLoopSimdDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
|
|
|
|
2015-12-14 22:51:25 +08:00
|
|
|
OMPDistributeDirective *OMPDistributeDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
|
2015-12-14 22:51:25 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_distribute));
|
|
|
|
OMPDistributeDirective *Dir = new (Mem)
|
|
|
|
OMPDistributeDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
2016-05-25 20:36:08 +08:00
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
2015-12-14 22:51:25 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
2016-03-29 16:58:54 +08:00
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2015-12-14 22:51:25 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPDistributeDirective *
|
|
|
|
OMPDistributeDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum, EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPDistributeDirective), alignof(OMPClause *));
|
2015-12-14 22:51:25 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_distribute));
|
|
|
|
return new (Mem) OMPDistributeDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
2016-05-27 01:30:50 +08:00
|
|
|
|
2017-11-22 01:08:48 +08:00
|
|
|
OMPTargetUpdateDirective *OMPTargetUpdateDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
|
2017-11-22 01:08:48 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
2016-05-27 01:30:50 +08:00
|
|
|
OMPTargetUpdateDirective *Dir =
|
|
|
|
new (Mem) OMPTargetUpdateDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
2017-11-22 01:08:48 +08:00
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
2016-05-27 01:30:50 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetUpdateDirective *
|
|
|
|
OMPTargetUpdateDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetUpdateDirective), alignof(OMPClause *));
|
2017-11-22 01:08:48 +08:00
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
2016-05-27 01:30:50 +08:00
|
|
|
return new (Mem) OMPTargetUpdateDirective(NumClauses);
|
|
|
|
}
|
2016-06-27 22:55:37 +08:00
|
|
|
|
|
|
|
OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
2017-11-23 04:19:50 +08:00
|
|
|
const HelperExprs &Exprs, bool HasCancel) {
|
2016-06-27 22:55:37 +08:00
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
|
2016-10-20 22:27:22 +08:00
|
|
|
alignof(OMPClause *));
|
2016-06-27 22:55:37 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
|
|
|
|
OMPDistributeParallelForDirective *Dir =
|
|
|
|
new (Mem) OMPDistributeParallelForDirective(StartLoc, EndLoc,
|
|
|
|
CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
|
|
|
|
Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
|
2017-02-18 05:29:13 +08:00
|
|
|
Dir->setDistInc(Exprs.DistInc);
|
|
|
|
Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
|
2016-06-27 22:55:37 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2017-04-20 08:39:39 +08:00
|
|
|
Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
|
|
|
|
Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
|
|
|
|
Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
|
|
|
|
Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
|
|
|
|
Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
|
|
|
|
Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
|
|
|
|
Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
|
2018-10-29 23:45:47 +08:00
|
|
|
Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
|
|
|
|
Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
|
2017-11-23 04:19:50 +08:00
|
|
|
Dir->HasCancel = HasCancel;
|
2016-06-27 22:55:37 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPDistributeParallelForDirective *
|
|
|
|
OMPDistributeParallelForDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective),
|
2016-10-20 22:27:22 +08:00
|
|
|
alignof(OMPClause *));
|
2016-06-27 22:55:37 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for));
|
|
|
|
return new (Mem) OMPDistributeParallelForDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
2016-07-05 13:00:15 +08:00
|
|
|
|
|
|
|
OMPDistributeParallelForSimdDirective *
|
|
|
|
OMPDistributeParallelForSimdDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
|
2016-10-20 22:27:22 +08:00
|
|
|
alignof(OMPClause *));
|
2016-07-05 13:00:15 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
|
|
|
|
OMPDistributeParallelForSimdDirective *Dir = new (Mem)
|
|
|
|
OMPDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
|
|
|
|
Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
|
|
|
|
Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
|
2017-02-18 05:29:13 +08:00
|
|
|
Dir->setDistInc(Exprs.DistInc);
|
|
|
|
Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
|
2016-07-05 13:00:15 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2017-04-20 08:39:39 +08:00
|
|
|
Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
|
|
|
|
Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
|
|
|
|
Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
|
|
|
|
Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
|
|
|
|
Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
|
|
|
|
Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
|
|
|
|
Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
|
2018-10-29 23:45:47 +08:00
|
|
|
Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
|
|
|
|
Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
|
2016-07-05 13:00:15 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPDistributeParallelForSimdDirective *
|
|
|
|
OMPDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForSimdDirective),
|
2016-10-20 22:27:22 +08:00
|
|
|
alignof(OMPClause *));
|
2016-07-05 13:00:15 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for_simd));
|
|
|
|
return new (Mem)
|
|
|
|
OMPDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
2016-07-06 12:45:38 +08:00
|
|
|
|
|
|
|
OMPDistributeSimdDirective *OMPDistributeSimdDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
|
2016-07-06 12:45:38 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_distribute_simd));
|
|
|
|
OMPDistributeSimdDirective *Dir = new (Mem) OMPDistributeSimdDirective(
|
|
|
|
StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPDistributeSimdDirective *
|
|
|
|
OMPDistributeSimdDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum, EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPDistributeSimdDirective), alignof(OMPClause *));
|
2016-07-06 12:45:38 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_distribute_simd));
|
|
|
|
return new (Mem) OMPDistributeSimdDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
2016-07-14 10:54:56 +08:00
|
|
|
|
|
|
|
OMPTargetParallelForSimdDirective *OMPTargetParallelForSimdDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
|
2016-10-20 22:27:22 +08:00
|
|
|
alignof(OMPClause *));
|
2016-07-14 10:54:56 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
2018-07-31 03:24:48 +08:00
|
|
|
sizeof(Stmt *) *
|
2016-07-14 10:54:56 +08:00
|
|
|
numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
|
2018-07-31 03:24:48 +08:00
|
|
|
OMPTargetParallelForSimdDirective *Dir =
|
2016-07-14 10:54:56 +08:00
|
|
|
new (Mem) OMPTargetParallelForSimdDirective(StartLoc, EndLoc,
|
|
|
|
CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetParallelForSimdDirective *
|
|
|
|
OMPTargetParallelForSimdDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPTargetParallelForSimdDirective),
|
2016-10-20 22:27:22 +08:00
|
|
|
alignof(OMPClause *));
|
2016-07-14 10:54:56 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
2018-07-31 03:24:48 +08:00
|
|
|
sizeof(Stmt *) *
|
2016-07-14 10:54:56 +08:00
|
|
|
numLoopChildren(CollapsedNum, OMPD_target_parallel_for_simd));
|
|
|
|
return new (Mem) OMPTargetParallelForSimdDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
2016-07-21 06:57:10 +08:00
|
|
|
|
|
|
|
OMPTargetSimdDirective *
|
2018-07-31 03:24:48 +08:00
|
|
|
OMPTargetSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
|
2016-07-21 06:57:10 +08:00
|
|
|
SourceLocation EndLoc, unsigned CollapsedNum,
|
|
|
|
ArrayRef<OMPClause *> Clauses,
|
|
|
|
Stmt *AssociatedStmt, const HelperExprs &Exprs) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
|
2016-07-21 06:57:10 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
2018-07-31 03:24:48 +08:00
|
|
|
sizeof(Stmt *) *
|
2016-07-21 06:57:10 +08:00
|
|
|
numLoopChildren(CollapsedNum, OMPD_target_simd));
|
|
|
|
OMPTargetSimdDirective *Dir = new (Mem)
|
|
|
|
OMPTargetSimdDirective(StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetSimdDirective *
|
|
|
|
OMPTargetSimdDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum, EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetSimdDirective), alignof(OMPClause *));
|
2016-07-21 06:57:10 +08:00
|
|
|
void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
2018-07-31 03:24:48 +08:00
|
|
|
sizeof(Stmt *) *
|
2016-07-21 06:57:10 +08:00
|
|
|
numLoopChildren(CollapsedNum, OMPD_target_simd));
|
|
|
|
return new (Mem) OMPTargetSimdDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
2016-08-05 22:37:37 +08:00
|
|
|
|
|
|
|
OMPTeamsDistributeDirective *OMPTeamsDistributeDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
|
2016-08-05 22:37:37 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
|
|
|
|
OMPTeamsDistributeDirective *Dir = new (Mem) OMPTeamsDistributeDirective(
|
|
|
|
StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTeamsDistributeDirective *
|
|
|
|
OMPTeamsDistributeDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum, EmptyShell) {
|
2016-10-20 22:27:22 +08:00
|
|
|
unsigned Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTeamsDistributeDirective), alignof(OMPClause *));
|
2016-08-05 22:37:37 +08:00
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) * numLoopChildren(CollapsedNum, OMPD_teams_distribute));
|
|
|
|
return new (Mem) OMPTeamsDistributeDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
2016-10-25 20:50:55 +08:00
|
|
|
|
|
|
|
OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
|
|
|
|
OMPTeamsDistributeSimdDirective *Dir =
|
|
|
|
new (Mem) OMPTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
|
|
|
|
Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTeamsDistributeSimdDirective *OMPTeamsDistributeSimdDirective::CreateEmpty(
|
|
|
|
const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
|
|
|
unsigned Size = llvm::alignTo(sizeof(OMPTeamsDistributeSimdDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_teams_distribute_simd));
|
|
|
|
return new (Mem) OMPTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
2016-12-01 07:51:03 +08:00
|
|
|
|
|
|
|
OMPTeamsDistributeParallelForSimdDirective *
|
|
|
|
OMPTeamsDistributeParallelForSimdDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
|
|
|
auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum,
|
|
|
|
OMPD_teams_distribute_parallel_for_simd));
|
|
|
|
OMPTeamsDistributeParallelForSimdDirective *Dir = new (Mem)
|
|
|
|
OMPTeamsDistributeParallelForSimdDirective(StartLoc, EndLoc, CollapsedNum,
|
|
|
|
Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
|
|
|
|
Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
|
2017-02-18 05:29:13 +08:00
|
|
|
Dir->setDistInc(Exprs.DistInc);
|
|
|
|
Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
|
2016-12-01 07:51:03 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2017-04-20 08:39:39 +08:00
|
|
|
Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
|
|
|
|
Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
|
|
|
|
Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
|
|
|
|
Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
|
|
|
|
Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
|
|
|
|
Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
|
|
|
|
Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
|
2018-10-29 23:45:47 +08:00
|
|
|
Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
|
|
|
|
Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
|
2016-12-01 07:51:03 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTeamsDistributeParallelForSimdDirective *
|
|
|
|
OMPTeamsDistributeParallelForSimdDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
|
|
|
auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForSimdDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum,
|
|
|
|
OMPD_teams_distribute_parallel_for_simd));
|
|
|
|
return new (Mem)
|
|
|
|
OMPTeamsDistributeParallelForSimdDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
2016-12-09 11:24:30 +08:00
|
|
|
|
|
|
|
OMPTeamsDistributeParallelForDirective *
|
|
|
|
OMPTeamsDistributeParallelForDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
2017-11-23 04:19:50 +08:00
|
|
|
const HelperExprs &Exprs, bool HasCancel) {
|
2016-12-09 11:24:30 +08:00
|
|
|
auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
|
|
|
|
OMPTeamsDistributeParallelForDirective *Dir = new (Mem)
|
|
|
|
OMPTeamsDistributeParallelForDirective(StartLoc, EndLoc, CollapsedNum,
|
|
|
|
Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
|
|
|
|
Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
|
2017-02-18 05:29:13 +08:00
|
|
|
Dir->setDistInc(Exprs.DistInc);
|
|
|
|
Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
|
2016-12-09 11:24:30 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2017-04-20 08:39:39 +08:00
|
|
|
Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
|
|
|
|
Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
|
|
|
|
Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
|
|
|
|
Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
|
|
|
|
Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
|
|
|
|
Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
|
|
|
|
Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
|
2018-10-29 23:45:47 +08:00
|
|
|
Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
|
|
|
|
Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
|
2017-11-23 04:19:50 +08:00
|
|
|
Dir->HasCancel = HasCancel;
|
2016-12-09 11:24:30 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTeamsDistributeParallelForDirective *
|
|
|
|
OMPTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
|
|
|
auto Size = llvm::alignTo(sizeof(OMPTeamsDistributeParallelForDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_teams_distribute_parallel_for));
|
|
|
|
return new (Mem)
|
|
|
|
OMPTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
|
|
|
|
2016-12-17 13:48:59 +08:00
|
|
|
OMPTargetTeamsDirective *OMPTargetTeamsDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt) {
|
|
|
|
auto Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
|
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *));
|
|
|
|
OMPTargetTeamsDirective *Dir =
|
|
|
|
new (Mem) OMPTargetTeamsDirective(StartLoc, EndLoc, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetTeamsDirective *
|
|
|
|
OMPTargetTeamsDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses,
|
|
|
|
EmptyShell) {
|
|
|
|
auto Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetTeamsDirective), alignof(OMPClause *));
|
|
|
|
void *Mem =
|
|
|
|
C.Allocate(Size + sizeof(OMPClause *) * NumClauses + sizeof(Stmt *));
|
|
|
|
return new (Mem) OMPTargetTeamsDirective(NumClauses);
|
|
|
|
}
|
2016-12-25 12:52:54 +08:00
|
|
|
|
|
|
|
OMPTargetTeamsDistributeDirective *OMPTargetTeamsDistributeDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
|
|
|
auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
|
|
|
|
OMPTargetTeamsDistributeDirective *Dir =
|
|
|
|
new (Mem) OMPTargetTeamsDistributeDirective(StartLoc, EndLoc, CollapsedNum,
|
|
|
|
Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetTeamsDistributeDirective *
|
|
|
|
OMPTargetTeamsDistributeDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
|
|
|
auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_target_teams_distribute));
|
|
|
|
return new (Mem) OMPTargetTeamsDistributeDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
2016-12-30 06:16:30 +08:00
|
|
|
|
|
|
|
OMPTargetTeamsDistributeParallelForDirective *
|
|
|
|
OMPTargetTeamsDistributeParallelForDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
2017-11-23 05:12:03 +08:00
|
|
|
const HelperExprs &Exprs, bool HasCancel) {
|
2016-12-30 06:16:30 +08:00
|
|
|
auto Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum,
|
|
|
|
OMPD_target_teams_distribute_parallel_for));
|
|
|
|
OMPTargetTeamsDistributeParallelForDirective *Dir =
|
|
|
|
new (Mem) OMPTargetTeamsDistributeParallelForDirective(
|
|
|
|
StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
|
|
|
|
Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
|
2017-02-18 05:29:13 +08:00
|
|
|
Dir->setDistInc(Exprs.DistInc);
|
|
|
|
Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
|
2016-12-30 06:16:30 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2017-04-20 08:39:39 +08:00
|
|
|
Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
|
|
|
|
Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
|
|
|
|
Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
|
|
|
|
Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
|
|
|
|
Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
|
|
|
|
Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
|
|
|
|
Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
|
2018-10-29 23:45:47 +08:00
|
|
|
Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
|
|
|
|
Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
|
2017-11-23 05:12:03 +08:00
|
|
|
Dir->HasCancel = HasCancel;
|
2016-12-30 06:16:30 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetTeamsDistributeParallelForDirective *
|
|
|
|
OMPTargetTeamsDistributeParallelForDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
|
|
|
auto Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum,
|
|
|
|
OMPD_target_teams_distribute_parallel_for));
|
|
|
|
return new (Mem)
|
|
|
|
OMPTargetTeamsDistributeParallelForDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|
2017-01-03 13:23:48 +08:00
|
|
|
|
|
|
|
OMPTargetTeamsDistributeParallelForSimdDirective *
|
|
|
|
OMPTargetTeamsDistributeParallelForSimdDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
|
|
|
auto Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForSimdDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum,
|
|
|
|
OMPD_target_teams_distribute_parallel_for_simd));
|
|
|
|
OMPTargetTeamsDistributeParallelForSimdDirective *Dir =
|
|
|
|
new (Mem) OMPTargetTeamsDistributeParallelForSimdDirective(
|
|
|
|
StartLoc, EndLoc, CollapsedNum, Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setPrevLowerBoundVariable(Exprs.PrevLB);
|
|
|
|
Dir->setPrevUpperBoundVariable(Exprs.PrevUB);
|
2017-02-18 05:29:13 +08:00
|
|
|
Dir->setDistInc(Exprs.DistInc);
|
|
|
|
Dir->setPrevEnsureUpperBound(Exprs.PrevEUB);
|
2017-01-03 13:23:48 +08:00
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
2017-04-20 08:39:39 +08:00
|
|
|
Dir->setCombinedLowerBoundVariable(Exprs.DistCombinedFields.LB);
|
|
|
|
Dir->setCombinedUpperBoundVariable(Exprs.DistCombinedFields.UB);
|
|
|
|
Dir->setCombinedEnsureUpperBound(Exprs.DistCombinedFields.EUB);
|
|
|
|
Dir->setCombinedInit(Exprs.DistCombinedFields.Init);
|
|
|
|
Dir->setCombinedCond(Exprs.DistCombinedFields.Cond);
|
|
|
|
Dir->setCombinedNextLowerBound(Exprs.DistCombinedFields.NLB);
|
|
|
|
Dir->setCombinedNextUpperBound(Exprs.DistCombinedFields.NUB);
|
2018-10-29 23:45:47 +08:00
|
|
|
Dir->setCombinedDistCond(Exprs.DistCombinedFields.DistCond);
|
|
|
|
Dir->setCombinedParForInDistCond(Exprs.DistCombinedFields.ParForInDistCond);
|
2017-01-03 13:23:48 +08:00
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetTeamsDistributeParallelForSimdDirective *
|
|
|
|
OMPTargetTeamsDistributeParallelForSimdDirective::CreateEmpty(
|
|
|
|
const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
|
|
|
auto Size =
|
|
|
|
llvm::alignTo(sizeof(OMPTargetTeamsDistributeParallelForSimdDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum,
|
|
|
|
OMPD_target_teams_distribute_parallel_for_simd));
|
|
|
|
return new (Mem) OMPTargetTeamsDistributeParallelForSimdDirective(
|
|
|
|
CollapsedNum, NumClauses);
|
|
|
|
}
|
|
|
|
|
2017-01-11 02:08:18 +08:00
|
|
|
OMPTargetTeamsDistributeSimdDirective *
|
|
|
|
OMPTargetTeamsDistributeSimdDirective::Create(
|
|
|
|
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
|
|
|
|
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
|
|
|
|
const HelperExprs &Exprs) {
|
|
|
|
auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * Clauses.size() +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
|
|
|
|
OMPTargetTeamsDistributeSimdDirective *Dir = new (Mem)
|
|
|
|
OMPTargetTeamsDistributeSimdDirective(StartLoc, EndLoc, CollapsedNum,
|
|
|
|
Clauses.size());
|
|
|
|
Dir->setClauses(Clauses);
|
|
|
|
Dir->setAssociatedStmt(AssociatedStmt);
|
|
|
|
Dir->setIterationVariable(Exprs.IterationVarRef);
|
|
|
|
Dir->setLastIteration(Exprs.LastIteration);
|
|
|
|
Dir->setCalcLastIteration(Exprs.CalcLastIteration);
|
|
|
|
Dir->setPreCond(Exprs.PreCond);
|
|
|
|
Dir->setCond(Exprs.Cond);
|
|
|
|
Dir->setInit(Exprs.Init);
|
|
|
|
Dir->setInc(Exprs.Inc);
|
|
|
|
Dir->setIsLastIterVariable(Exprs.IL);
|
|
|
|
Dir->setLowerBoundVariable(Exprs.LB);
|
|
|
|
Dir->setUpperBoundVariable(Exprs.UB);
|
|
|
|
Dir->setStrideVariable(Exprs.ST);
|
|
|
|
Dir->setEnsureUpperBound(Exprs.EUB);
|
|
|
|
Dir->setNextLowerBound(Exprs.NLB);
|
|
|
|
Dir->setNextUpperBound(Exprs.NUB);
|
|
|
|
Dir->setNumIterations(Exprs.NumIterations);
|
|
|
|
Dir->setCounters(Exprs.Counters);
|
|
|
|
Dir->setPrivateCounters(Exprs.PrivateCounters);
|
|
|
|
Dir->setInits(Exprs.Inits);
|
|
|
|
Dir->setUpdates(Exprs.Updates);
|
|
|
|
Dir->setFinals(Exprs.Finals);
|
|
|
|
Dir->setPreInits(Exprs.PreInits);
|
|
|
|
return Dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
OMPTargetTeamsDistributeSimdDirective *
|
|
|
|
OMPTargetTeamsDistributeSimdDirective::CreateEmpty(const ASTContext &C,
|
|
|
|
unsigned NumClauses,
|
|
|
|
unsigned CollapsedNum,
|
|
|
|
EmptyShell) {
|
|
|
|
auto Size = llvm::alignTo(sizeof(OMPTargetTeamsDistributeSimdDirective),
|
|
|
|
alignof(OMPClause *));
|
|
|
|
void *Mem = C.Allocate(
|
|
|
|
Size + sizeof(OMPClause *) * NumClauses +
|
|
|
|
sizeof(Stmt *) *
|
|
|
|
numLoopChildren(CollapsedNum, OMPD_target_teams_distribute_simd));
|
|
|
|
return new (Mem)
|
|
|
|
OMPTargetTeamsDistributeSimdDirective(CollapsedNum, NumClauses);
|
|
|
|
}
|