diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2019-10-18 16:47:35 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-10-18 16:47:35 +0000 |
| commit | b8552abfe7ce0c4cd37d136bbcf8cb319a28f260 (patch) | |
| tree | 9d8564667394f0f86888e46034f37dd822d9e5f8 /clang/lib/AST | |
| parent | 7e1637451d20d40553165f806094ada30cb0a708 (diff) | |
| download | bcm5719-llvm-b8552abfe7ce0c4cd37d136bbcf8cb319a28f260.tar.gz bcm5719-llvm-b8552abfe7ce0c4cd37d136bbcf8cb319a28f260.zip | |
[OPENMP50]Add support for master taskloop simd.
Added trsing/semantics/codegen for combined construct master taskloop simd.
llvm-svn: 375255
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/StmtOpenMP.cpp | 54 | ||||
| -rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 6 | ||||
| -rw-r--r-- | clang/lib/AST/StmtProfile.cpp | 5 |
3 files changed, 65 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtOpenMP.cpp b/clang/lib/AST/StmtOpenMP.cpp index 7440e6c861c..da1364ebffc 100644 --- a/clang/lib/AST/StmtOpenMP.cpp +++ b/clang/lib/AST/StmtOpenMP.cpp @@ -1073,6 +1073,60 @@ OMPMasterTaskLoopDirective::CreateEmpty(const ASTContext &C, return new (Mem) OMPMasterTaskLoopDirective(CollapsedNum, NumClauses); } +OMPMasterTaskLoopSimdDirective *OMPMasterTaskLoopSimdDirective::Create( + const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, + const HelperExprs &Exprs) { + unsigned Size = llvm::alignTo(sizeof(OMPMasterTaskLoopSimdDirective), + alignof(OMPClause *)); + void *Mem = + C.Allocate(Size + sizeof(OMPClause *) * Clauses.size() + + sizeof(Stmt *) * + numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd)); + auto *Dir = new (Mem) OMPMasterTaskLoopSimdDirective( + 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->setDependentCounters(Exprs.DependentCounters); + Dir->setDependentInits(Exprs.DependentInits); + Dir->setFinalsConditions(Exprs.FinalsConditions); + Dir->setPreInits(Exprs.PreInits); + return Dir; +} + +OMPMasterTaskLoopSimdDirective * +OMPMasterTaskLoopSimdDirective::CreateEmpty(const ASTContext &C, + unsigned NumClauses, + unsigned CollapsedNum, EmptyShell) { + unsigned Size = llvm::alignTo(sizeof(OMPMasterTaskLoopSimdDirective), + alignof(OMPClause *)); + void *Mem = + C.Allocate(Size + sizeof(OMPClause *) * NumClauses + + sizeof(Stmt *) * + numLoopChildren(CollapsedNum, OMPD_master_taskloop_simd)); + return new (Mem) OMPMasterTaskLoopSimdDirective(CollapsedNum, NumClauses); +} + OMPParallelMasterTaskLoopDirective *OMPParallelMasterTaskLoopDirective::Create( const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 70fe484751c..5b92ca0ac9c 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -829,6 +829,12 @@ void StmtPrinter::VisitOMPMasterTaskLoopDirective( PrintOMPExecutableDirective(Node); } +void StmtPrinter::VisitOMPMasterTaskLoopSimdDirective( + OMPMasterTaskLoopSimdDirective *Node) { + Indent() << "#pragma omp master taskloop simd"; + PrintOMPExecutableDirective(Node); +} + void StmtPrinter::VisitOMPParallelMasterTaskLoopDirective( OMPParallelMasterTaskLoopDirective *Node) { Indent() << "#pragma omp parallel master taskloop"; diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index 1cc36623d45..0c4916e6ab3 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -927,6 +927,11 @@ void StmtProfiler::VisitOMPMasterTaskLoopDirective( VisitOMPLoopDirective(S); } +void StmtProfiler::VisitOMPMasterTaskLoopSimdDirective( + const OMPMasterTaskLoopSimdDirective *S) { + VisitOMPLoopDirective(S); +} + void StmtProfiler::VisitOMPParallelMasterTaskLoopDirective( const OMPParallelMasterTaskLoopDirective *S) { VisitOMPLoopDirective(S); |

