diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/StmtOpenMP.cpp | 69 | ||||
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 6 | ||||
-rw-r--r-- | clang/lib/AST/StmtProfile.cpp | 5 | ||||
-rw-r--r-- | clang/lib/Basic/OpenMPKinds.cpp | 27 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 4 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 12 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 2 | ||||
-rw-r--r-- | clang/lib/Parse/ParseOpenMP.cpp | 9 | ||||
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 218 | ||||
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 11 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTReaderStmt.cpp | 16 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 10 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 1 |
13 files changed, 21 insertions, 369 deletions
diff --git a/clang/lib/AST/StmtOpenMP.cpp b/clang/lib/AST/StmtOpenMP.cpp index 6b2a1719ccf..c850c099d64 100644 --- a/clang/lib/AST/StmtOpenMP.cpp +++ b/clang/lib/AST/StmtOpenMP.cpp @@ -150,8 +150,6 @@ OMPForDirective::Create(const ASTContext &C, SourceLocation StartLoc, Dir->setNextLowerBound(Exprs.NLB); Dir->setNextUpperBound(Exprs.NUB); Dir->setNumIterations(Exprs.NumIterations); - Dir->setPrevLowerBoundVariable(Exprs.PrevLB); - Dir->setPrevUpperBoundVariable(Exprs.PrevUB); Dir->setCounters(Exprs.Counters); Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setInits(Exprs.Inits); @@ -203,8 +201,6 @@ OMPForSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc, Dir->setNextLowerBound(Exprs.NLB); Dir->setNextUpperBound(Exprs.NUB); Dir->setNumIterations(Exprs.NumIterations); - Dir->setPrevLowerBoundVariable(Exprs.PrevLB); - Dir->setPrevUpperBoundVariable(Exprs.PrevUB); Dir->setCounters(Exprs.Counters); Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setInits(Exprs.Inits); @@ -372,8 +368,6 @@ OMPParallelForDirective *OMPParallelForDirective::Create( Dir->setNextLowerBound(Exprs.NLB); Dir->setNextUpperBound(Exprs.NUB); Dir->setNumIterations(Exprs.NumIterations); - Dir->setPrevLowerBoundVariable(Exprs.PrevLB); - Dir->setPrevUpperBoundVariable(Exprs.PrevUB); Dir->setCounters(Exprs.Counters); Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setInits(Exprs.Inits); @@ -423,8 +417,6 @@ OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create( Dir->setNextLowerBound(Exprs.NLB); Dir->setNextUpperBound(Exprs.NUB); Dir->setNumIterations(Exprs.NumIterations); - Dir->setPrevLowerBoundVariable(Exprs.PrevLB); - Dir->setPrevUpperBoundVariable(Exprs.PrevUB); Dir->setCounters(Exprs.Counters); Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setInits(Exprs.Inits); @@ -763,8 +755,6 @@ OMPTargetParallelForDirective *OMPTargetParallelForDirective::Create( Dir->setNextLowerBound(Exprs.NLB); Dir->setNextUpperBound(Exprs.NUB); Dir->setNumIterations(Exprs.NumIterations); - Dir->setPrevLowerBoundVariable(Exprs.PrevLB); - Dir->setPrevUpperBoundVariable(Exprs.PrevUB); Dir->setCounters(Exprs.Counters); Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setInits(Exprs.Inits); @@ -906,8 +896,6 @@ OMPTaskLoopDirective *OMPTaskLoopDirective::Create( Dir->setNextLowerBound(Exprs.NLB); Dir->setNextUpperBound(Exprs.NUB); Dir->setNumIterations(Exprs.NumIterations); - Dir->setPrevLowerBoundVariable(Exprs.PrevLB); - Dir->setPrevUpperBoundVariable(Exprs.PrevUB); Dir->setCounters(Exprs.Counters); Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setInits(Exprs.Inits); @@ -957,8 +945,6 @@ OMPTaskLoopSimdDirective *OMPTaskLoopSimdDirective::Create( Dir->setNextLowerBound(Exprs.NLB); Dir->setNextUpperBound(Exprs.NUB); Dir->setNumIterations(Exprs.NumIterations); - Dir->setPrevLowerBoundVariable(Exprs.PrevLB); - Dir->setPrevUpperBoundVariable(Exprs.PrevUB); Dir->setCounters(Exprs.Counters); Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setInits(Exprs.Inits); @@ -1048,58 +1034,3 @@ OMPTargetUpdateDirective::CreateEmpty(const ASTContext &C, unsigned NumClauses, void *Mem = C.Allocate(Size + sizeof(OMPClause *) * NumClauses); return new (Mem) OMPTargetUpdateDirective(NumClauses); } - -OMPDistributeParallelForDirective *OMPDistributeParallelForDirective::Create( - const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, - unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, - const HelperExprs &Exprs) { - unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective), - llvm::alignOf<OMPClause *>()); - 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); - 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; -} - -OMPDistributeParallelForDirective * -OMPDistributeParallelForDirective::CreateEmpty(const ASTContext &C, - unsigned NumClauses, - unsigned CollapsedNum, - EmptyShell) { - unsigned Size = llvm::alignTo(sizeof(OMPDistributeParallelForDirective), - llvm::alignOf<OMPClause *>()); - void *Mem = C.Allocate( - Size + sizeof(OMPClause *) * NumClauses + - sizeof(Stmt *) * - numLoopChildren(CollapsedNum, OMPD_distribute_parallel_for)); - return new (Mem) OMPDistributeParallelForDirective(CollapsedNum, NumClauses); -} diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index a05aef9f2ef..311187b4b39 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -1153,12 +1153,6 @@ void StmtPrinter::VisitOMPTargetUpdateDirective( PrintOMPExecutableDirective(Node); } -void StmtPrinter::VisitOMPDistributeParallelForDirective( - OMPDistributeParallelForDirective *Node) { - Indent() << "#pragma omp distribute parallel for "; - PrintOMPExecutableDirective(Node); -} - //===----------------------------------------------------------------------===// // Expr printing methods. //===----------------------------------------------------------------------===// diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index 579e7e89944..fd365843c2f 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -699,11 +699,6 @@ void StmtProfiler::VisitOMPTargetUpdateDirective( VisitOMPExecutableDirective(S); } -void StmtProfiler::VisitOMPDistributeParallelForDirective( - const OMPDistributeParallelForDirective *S) { - VisitOMPLoopDirective(S); -} - void StmtProfiler::VisitExpr(const Expr *S) { VisitStmt(S); } diff --git a/clang/lib/Basic/OpenMPKinds.cpp b/clang/lib/Basic/OpenMPKinds.cpp index 2975b7aaab3..5e0e9ba0012 100644 --- a/clang/lib/Basic/OpenMPKinds.cpp +++ b/clang/lib/Basic/OpenMPKinds.cpp @@ -566,16 +566,6 @@ bool clang::isAllowedClauseForDirective(OpenMPDirectiveKind DKind, break; } break; - case OMPD_distribute_parallel_for: - switch (CKind) { -#define OPENMP_DISTRIBUTE_PARALLEL_FOR_CLAUSE(Name) \ - case OMPC_##Name: \ - return true; -#include "clang/Basic/OpenMPKinds.def" - default: - break; - } - break; case OMPD_declare_target: case OMPD_end_declare_target: case OMPD_unknown: @@ -597,8 +587,8 @@ bool clang::isOpenMPLoopDirective(OpenMPDirectiveKind DKind) { return DKind == OMPD_simd || DKind == OMPD_for || DKind == OMPD_for_simd || DKind == OMPD_parallel_for || DKind == OMPD_parallel_for_simd || DKind == OMPD_taskloop || DKind == OMPD_taskloop_simd || - DKind == OMPD_distribute || DKind == OMPD_target_parallel_for || - DKind == OMPD_distribute_parallel_for; // TODO add next directives. + DKind == OMPD_distribute || + DKind == OMPD_target_parallel_for; // TODO add next directives. } bool clang::isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind) { @@ -606,8 +596,7 @@ bool clang::isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind) { DKind == OMPD_sections || DKind == OMPD_section || DKind == OMPD_single || DKind == OMPD_parallel_for || DKind == OMPD_parallel_for_simd || DKind == OMPD_parallel_sections || - DKind == OMPD_target_parallel_for || - DKind == OMPD_distribute_parallel_for; // TODO add next directives. + DKind == OMPD_target_parallel_for; // TODO add next directives. } bool clang::isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind) { @@ -617,8 +606,7 @@ bool clang::isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind) { bool clang::isOpenMPParallelDirective(OpenMPDirectiveKind DKind) { return DKind == OMPD_parallel || DKind == OMPD_parallel_for || DKind == OMPD_parallel_for_simd || DKind == OMPD_parallel_sections || - DKind == OMPD_target_parallel || DKind == OMPD_target_parallel_for || - DKind == OMPD_distribute_parallel_for; + DKind == OMPD_target_parallel || DKind == OMPD_target_parallel_for; // TODO add next directives. } @@ -645,8 +633,7 @@ bool clang::isOpenMPSimdDirective(OpenMPDirectiveKind DKind) { } bool clang::isOpenMPDistributeDirective(OpenMPDirectiveKind Kind) { - return Kind == OMPD_distribute || - Kind == OMPD_distribute_parallel_for; // TODO add next directives. + return Kind == OMPD_distribute; // TODO add next directives. } bool clang::isOpenMPPrivate(OpenMPClauseKind Kind) { @@ -662,7 +649,3 @@ bool clang::isOpenMPThreadPrivate(OpenMPClauseKind Kind) { bool clang::isOpenMPTaskingDirective(OpenMPDirectiveKind Kind) { return Kind == OMPD_task || isOpenMPTaskLoopDirective(Kind); } - -bool clang::isOpenMPLoopBoundSharingDirective(OpenMPDirectiveKind Kind) { - return Kind == OMPD_distribute_parallel_for; -} diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 48e99e388a0..9a93fce7b00 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -280,10 +280,6 @@ void CodeGenFunction::EmitStmt(const Stmt *S) { case Stmt::OMPTargetUpdateDirectiveClass: EmitOMPTargetUpdateDirective(cast<OMPTargetUpdateDirective>(*S)); break; - case Stmt::OMPDistributeParallelForDirectiveClass: - EmitOMPDistributeParallelForDirective( - cast<OMPDistributeParallelForDirective>(*S)); - break; } } diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index ad4e49d986c..061a07791fa 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -1865,18 +1865,6 @@ void CodeGenFunction::EmitOMPDistributeOuterLoop( S, LoopScope, /* Ordered = */ false, LB, UB, ST, IL, Chunk); } -void CodeGenFunction::EmitOMPDistributeParallelForDirective( - const OMPDistributeParallelForDirective &S) { - OMPLexicalScope Scope(*this, S, /*AsInlined=*/true); - CGM.getOpenMPRuntime().emitInlinedDirective( - *this, OMPD_distribute_parallel_for, - [&S](CodeGenFunction &CGF, PrePostActionTy &) { - OMPLoopScope PreInitScope(CGF, S); - CGF.EmitStmt( - cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt()); - }); -} - /// \brief Emit a helper variable and return corresponding lvalue. static LValue EmitOMPHelperVar(CodeGenFunction &CGF, const DeclRefExpr *Helper) { diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index e05ec374147..af7e6114af6 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -2392,8 +2392,6 @@ public: void EmitOMPTaskLoopSimdDirective(const OMPTaskLoopSimdDirective &S); void EmitOMPDistributeDirective(const OMPDistributeDirective &S); void EmitOMPDistributeLoop(const OMPDistributeDirective &S); - void EmitOMPDistributeParallelForDirective( - const OMPDistributeParallelForDirective &S); /// Emit outlined function for the target directive. static std::pair<llvm::Function * /*OutlinedFn*/, diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp index 8a15cf61ef5..b1635cfa9a0 100644 --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -40,7 +40,6 @@ enum OpenMPDirectiveKindEx { OMPD_target_enter, OMPD_target_exit, OMPD_update, - OMPD_distribute_parallel }; class ThreadprivateListParserHelper final { @@ -88,8 +87,6 @@ static OpenMPDirectiveKind ParseOpenMPDirectiveKind(Parser &P) { { OMPD_declare, OMPD_reduction, OMPD_declare_reduction }, { OMPD_declare, OMPD_simd, OMPD_declare_simd }, { OMPD_declare, OMPD_target, OMPD_declare_target }, - { OMPD_distribute, OMPD_parallel, OMPD_distribute_parallel }, - { OMPD_distribute_parallel, OMPD_for, OMPD_distribute_parallel_for }, { OMPD_end, OMPD_declare, OMPD_end_declare }, { OMPD_end_declare, OMPD_target, OMPD_end_declare_target }, { OMPD_target, OMPD_data, OMPD_target_data }, @@ -733,7 +730,6 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl( case OMPD_distribute: case OMPD_end_declare_target: case OMPD_target_update: - case OMPD_distribute_parallel_for: Diag(Tok, diag::err_omp_unexpected_directive) << getOpenMPDirectiveName(DKind); break; @@ -765,7 +761,7 @@ Parser::DeclGroupPtrTy Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl( /// 'taskgroup' | 'teams' | 'taskloop' | 'taskloop simd' | /// 'distribute' | 'target enter data' | 'target exit data' | /// 'target parallel' | 'target parallel for' | -/// 'target update' | 'distribute parallel for' {clause} +/// 'target update' {clause} /// annot_pragma_openmp_end /// StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective( @@ -869,8 +865,7 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective( case OMPD_target_parallel_for: case OMPD_taskloop: case OMPD_taskloop_simd: - case OMPD_distribute: - case OMPD_distribute_parallel_for: { + case OMPD_distribute: { ConsumeToken(); // Parse directive name of the 'critical' directive if any. if (DKind == OMPD_critical) { diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 772b3765e59..ca84b8cfed1 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -1814,21 +1814,6 @@ void Sema::ActOnOpenMPRegionStart(OpenMPDirectiveKind DKind, Scope *CurScope) { Params); break; } - case OMPD_distribute_parallel_for: { - QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1); - QualType KmpInt32PtrTy = - Context.getPointerType(KmpInt32Ty).withConst().withRestrict(); - Sema::CapturedParamNameType Params[] = { - std::make_pair(".global_tid.", KmpInt32PtrTy), - std::make_pair(".bound_tid.", KmpInt32PtrTy), - std::make_pair(".previous.lb.", Context.getSizeType()), - std::make_pair(".previous.ub.", Context.getSizeType()), - std::make_pair(StringRef(), QualType()) // __context with shared vars - }; - ActOnCapturedRegionStart(DSAStack->getConstructLoc(), CurScope, CR_OpenMP, - Params); - break; - } case OMPD_threadprivate: case OMPD_taskyield: case OMPD_barrier: @@ -2035,9 +2020,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | parallel | cancel | ! | // | parallel | taskloop | * | // | parallel | taskloop simd | * | - // | parallel | distribute | + | - // | parallel | distribute | + | - // | | parallel for | | + // | parallel | distribute | | // +------------------+-----------------+------------------------------------+ // | for | parallel | * | // | for | for | + | @@ -2073,9 +2056,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | for | cancel | ! | // | for | taskloop | * | // | for | taskloop simd | * | - // | for | distribute | + | - // | for | distribute | + | - // | | parallel for | | + // | for | distribute | | // +------------------+-----------------+------------------------------------+ // | master | parallel | * | // | master | for | + | @@ -2111,9 +2092,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | master | cancel | | // | master | taskloop | * | // | master | taskloop simd | * | - // | master | distribute | + | - // | master | distribute | + | - // | | parallel for | | + // | master | distribute | | // +------------------+-----------------+------------------------------------+ // | critical | parallel | * | // | critical | for | + | @@ -2148,9 +2127,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | critical | cancel | | // | critical | taskloop | * | // | critical | taskloop simd | * | - // | critical | distribute | + | - // | critical | distribute | + | - // | | parallel for | | + // | critical | distribute | | // +------------------+-----------------+------------------------------------+ // | simd | parallel | | // | simd | for | | @@ -2187,8 +2164,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | simd | taskloop | | // | simd | taskloop simd | | // | simd | distribute | | - // | simd | distribute | | - // | | parallel for | | // +------------------+-----------------+------------------------------------+ // | for simd | parallel | | // | for simd | for | | @@ -2225,8 +2200,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | for simd | taskloop | | // | for simd | taskloop simd | | // | for simd | distribute | | - // | for simd | distribute | | - // | | parallel for | | // +------------------+-----------------+------------------------------------+ // | parallel for simd| parallel | | // | parallel for simd| for | | @@ -2263,8 +2236,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | parallel for simd| taskloop | | // | parallel for simd| taskloop simd | | // | parallel for simd| distribute | | - // | parallel for simd| distribute | | - // | | parallel for | | // +------------------+-----------------+------------------------------------+ // | sections | parallel | * | // | sections | for | + | @@ -2300,9 +2271,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | sections | cancel | ! | // | sections | taskloop | * | // | sections | taskloop simd | * | - // | sections | distribute | + | - // | sections | distribute | + | - // | | parallel for | | + // | sections | distribute | | // +------------------+-----------------+------------------------------------+ // | section | parallel | * | // | section | for | + | @@ -2338,9 +2307,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | section | cancel | ! | // | section | taskloop | * | // | section | taskloop simd | * | - // | section | distribute | + | - // | section | distribute | + | - // | | parallel for | | + // | section | distribute | | // +------------------+-----------------+------------------------------------+ // | single | parallel | * | // | single | for | + | @@ -2376,9 +2343,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | single | cancel | | // | single | taskloop | * | // | single | taskloop simd | * | - // | single | distribute | + | - // | single | distribute | + | - // | | parallel for | | + // | single | distribute | | // +------------------+-----------------+------------------------------------+ // | parallel for | parallel | * | // | parallel for | for | + | @@ -2414,9 +2379,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | parallel for | cancel | ! | // | parallel for | taskloop | * | // | parallel for | taskloop simd | * | - // | parallel for | distribute | + | - // | parallel for | distribute | + | - // | | parallel for | | + // | parallel for | distribute | | // +------------------+-----------------+------------------------------------+ // | parallel sections| parallel | * | // | parallel sections| for | + | @@ -2452,9 +2415,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | parallel sections| cancel | ! | // | parallel sections| taskloop | * | // | parallel sections| taskloop simd | * | - // | parallel sections| distribute | + | - // | parallel sections| distribute | + | - // | | parallel for | | + // | parallel sections| distribute | | // +------------------+-----------------+------------------------------------+ // | task | parallel | * | // | task | for | + | @@ -2490,9 +2451,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | task | cancel | ! | // | task | taskloop | * | // | task | taskloop simd | * | - // | task | distribute | + | - // | task | distribute | + | - // | | parallel for | | + // | task | distribute | | // +------------------+-----------------+------------------------------------+ // | ordered | parallel | * | // | ordered | for | + | @@ -2528,9 +2487,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | ordered | cancel | | // | ordered | taskloop | * | // | ordered | taskloop simd | * | - // | ordered | distribute | + | - // | ordered | distribute | + | - // | | parallel for | | + // | ordered | distribute | | // +------------------+-----------------+------------------------------------+ // | atomic | parallel | | // | atomic | for | | @@ -2567,8 +2524,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | atomic | taskloop | | // | atomic | taskloop simd | | // | atomic | distribute | | - // | atomic | distribute | | - // | | parallel for | | // +------------------+-----------------+------------------------------------+ // | target | parallel | * | // | target | for | * | @@ -2604,9 +2559,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | target | cancel | | // | target | taskloop | * | // | target | taskloop simd | * | - // | target | distribute | + | - // | target | distribute | + | - // | | parallel for | | + // | target | distribute | | // +------------------+-----------------+------------------------------------+ // | target parallel | parallel | * | // | target parallel | for | * | @@ -2643,8 +2596,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | target parallel | taskloop | * | // | target parallel | taskloop simd | * | // | target parallel | distribute | | - // | target parallel | distribute | | - // | | parallel for | | // +------------------+-----------------+------------------------------------+ // | target parallel | parallel | * | // | for | | | @@ -2708,8 +2659,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | for | | | // | target parallel | distribute | | // | for | | | - // | parallel | distribute | | - // | for | parallel for | | // +------------------+-----------------+------------------------------------+ // | teams | parallel | * | // | teams | for | + | @@ -2746,8 +2695,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | teams | taskloop | + | // | teams | taskloop simd | + | // | teams | distribute | ! | - // | teams | distribute | ! | - // | | parallel for | | // +------------------+-----------------+------------------------------------+ // | taskloop | parallel | * | // | taskloop | for | + | @@ -2782,9 +2729,7 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | | point | | // | taskloop | cancel | | // | taskloop | taskloop | * | - // | taskloop | distribute | + | - // | taskloop | distribute | + | - // | | parallel for | | + // | taskloop | distribute | | // +------------------+-----------------+------------------------------------+ // | taskloop simd | parallel | | // | taskloop simd | for | | @@ -2821,8 +2766,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | taskloop simd | taskloop | | // | taskloop simd | taskloop simd | | // | taskloop simd | distribute | | - // | taskloop simd | distribute | | - // | | parallel for | | // +------------------+-----------------+------------------------------------+ // | distribute | parallel | * | // | distribute | for | * | @@ -2859,74 +2802,6 @@ static bool CheckNestingOfRegions(Sema &SemaRef, DSAStackTy *Stack, // | distribute | taskloop | * | // | distribute | taskloop simd | * | // | distribute | distribute | | - // | distribute | distribute | | - // | | parallel for | | - // +------------------+-----------------+------------------------------------+ - // | distribute | parallel | * | - // | parallel for | | | - // | distribute | for | * | - // | parallel for | | | - // | distribute | for simd | * | - // | parallel for | | | - // | distribute | master | * | - // | parallel for | | | - // | distribute | critical | * | - // | parallel for | | | - // | distribute | simd | * | - // | parallel for | | | - // | distribute | sections | * | - // | parallel for | | | - // | distribute | section | * | - // | parallel for | | | - // | distribute | single | * | - // | parallel for | | | - // | distribute | parallel for | * | - // | parallel for | | | - // | distribute |parallel for simd| * | - // | parallel for | | | - // | distribute |parallel sections| * | - // | parallel for | | | - // | distribute | task | * | - // | parallel for | | | - // | parallel for | | | - // | distribute | taskyield | * | - // | parallel for | | | - // | distribute | barrier | * | - // | parallel for | | | - // | distribute | taskwait | * | - // | parallel for | | | - // | distribute | taskgroup | * | - // | parallel for | | | - // | distribute | flush | * | - // | parallel for | | | - // | distribute | ordered | + | - // | parallel for | | | - // | distribute | atomic | * | - // | parallel for | | | - // | distribute | target | | - // | parallel for | | | - // | distribute | target parallel | | - // | parallel for | | | - // | distribute | target parallel | | - // | parallel for | for | | - // | distribute | target enter | | - // | parallel for | data | | - // | distribute | target exit | | - // | parallel for | data | | - // | distribute | teams | | - // | parallel for | | | - // | distribute | cancellation | + | - // | parallel for | point | | - // | distribute | cancel | + | - // | parallel for | | | - // | distribute | taskloop | * | - // | parallel for | | | - // | distribute | taskloop simd | * | - // | parallel for | | | - // | distribute | distribute | | - // | parallel for | | | - // | distribute | distribute | | - // | parallel for | parallel for | | // +------------------+-----------------+------------------------------------+ if (Stack->getCurScope()) { auto ParentRegion = Stack->getParentDirective(); @@ -3408,11 +3283,6 @@ StmtResult Sema::ActOnOpenMPExecutableDirective( ActOnOpenMPTargetUpdateDirective(ClausesWithImplicit, StartLoc, EndLoc); AllowedNameModifiers.push_back(OMPD_target_update); break; - case OMPD_distribute_parallel_for: - Res = ActOnOpenMPDistributeParallelForDirective( - ClausesWithImplicit, AStmt, StartLoc, EndLoc, VarsWithInheritedDSA); - AllowedNameModifiers.push_back(OMPD_parallel); - break; case OMPD_declare_target: case OMPD_end_declare_target: case OMPD_threadprivate: @@ -4920,7 +4790,7 @@ CheckOpenMPLoop(OpenMPDirectiveKind DKind, Expr *CollapseLoopCountExpr, SourceLocation InitLoc = IterSpaces[0].InitSrcRange.getBegin(); // Build variables passed into runtime, nesessary for worksharing directives. - ExprResult LB, UB, IL, ST, EUB, PrevLB, PrevUB; + ExprResult LB, UB, IL, ST, EUB; if (isOpenMPWorksharingDirective(DKind) || isOpenMPTaskLoopDirective(DKind) || isOpenMPDistributeDirective(DKind)) { // Lower bound variable, initialized with zero. @@ -4963,31 +4833,6 @@ CheckOpenMPLoop(OpenMPDirectiveKind DKind, Expr *CollapseLoopCountExpr, EUB = SemaRef.BuildBinOp(CurScope, InitLoc, BO_Assign, UB.get(), CondOp.get()); EUB = SemaRef.ActOnFinishFullExpr(EUB.get()); - - // If we have a combined directive that combines 'distribute', 'for' or - // 'simd' we need to be able to access the bounds of the schedule of the - // enclosing region. E.g. in 'distribute parallel for' the bounds obtained - // by scheduling 'distribute' have to be passed to the schedule of 'for'. - if (isOpenMPLoopBoundSharingDirective(DKind)) { - auto *CD = cast<CapturedStmt>(AStmt)->getCapturedDecl(); - - // We expect to have at least 2 more parameters than the 'parallel' - // directive does - the lower and upper bounds of the previous schedule. - assert(CD->getNumParams() >= 4 && - "Unexpected number of parameters in loop combined directive"); - - // Set the proper type for the bounds given what we learned from the - // enclosed loops. - auto *PrevLBDecl = CD->getParam(/*PrevLB=*/2); - auto *PrevUBDecl = CD->getParam(/*PrevUB=*/3); - - // Previous lower and upper bounds are obtained from the region - // parameters. - PrevLB = - buildDeclRefExpr(SemaRef, PrevLBDecl, PrevLBDecl->getType(), InitLoc); - PrevUB = - buildDeclRefExpr(SemaRef, PrevUBDecl, PrevUBDecl->getType(), InitLoc); - } } // Build the iteration variable and its initialization before loop. @@ -5165,8 +5010,6 @@ CheckOpenMPLoop(OpenMPDirectiveKind DKind, Expr *CollapseLoopCountExpr, Built.EUB = EUB.get(); Built.NLB = NextLB.get(); Built.NUB = NextUB.get(); - Built.PrevLB = PrevLB.get(); - Built.PrevUB = PrevUB.get(); Expr *CounterVal = SemaRef.DefaultLvalueConversion(IV.get()).get(); // Fill data for doacross depend clauses. @@ -6889,39 +6732,6 @@ StmtResult Sema::ActOnOpenMPDistributeDirective( NestedLoopCount, Clauses, AStmt, B); } -StmtResult Sema::ActOnOpenMPDistributeParallelForDirective( - ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc, - SourceLocation EndLoc, - llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA) { - if (!AStmt) - return StmtError(); - - CapturedStmt *CS = cast<CapturedStmt>(AStmt); - // 1.2.2 OpenMP Language Terminology - // Structured block - An executable statement with a single entry at the - // top and a single exit at the bottom. - // The point of exit cannot be a branch out of the structured block. - // longjmp() and throw() must not violate the entry/exit criteria. - CS->getCapturedDecl()->setNothrow(); - - OMPLoopDirective::HelperExprs B; - // In presence of clause 'collapse' with number of loops, it will - // define the nested loops number. - unsigned NestedLoopCount = CheckOpenMPLoop( - OMPD_distribute_parallel_for, getCollapseNumberExpr(Clauses), - nullptr /*ordered not a clause on distribute*/, AStmt, *this, *DSAStack, - VarsWithImplicitDSA, B); - if (NestedLoopCount == 0) - return StmtError(); - - assert((CurContext->isDependentContext() || B.builtAll()) && - "omp for loop exprs were not built"); - - getCurFunction()->setHasBranchProtectedScope(); - return OMPDistributeParallelForDirective::Create( - Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B); -} - OMPClause *Sema::ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr, SourceLocation StartLoc, SourceLocation LParenLoc, diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index c1cf9ada71e..c90e0fa2ca0 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -7526,17 +7526,6 @@ StmtResult TreeTransform<Derived>::TransformOMPDistributeDirective( return Res; } -template <typename Derived> -StmtResult TreeTransform<Derived>::TransformOMPDistributeParallelForDirective( - OMPDistributeParallelForDirective *D) { - DeclarationNameInfo DirName; - getDerived().getSema().StartOpenMPDSABlock( - OMPD_distribute_parallel_for, DirName, nullptr, D->getLocStart()); - StmtResult Res = getDerived().TransformOMPExecutableDirective(D); - getDerived().getSema().EndOpenMPDSABlock(Res.get()); - return Res; -} - //===----------------------------------------------------------------------===// // OpenMP clause transformation //===----------------------------------------------------------------------===// diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp index 69b7d972436..bff056ebc0d 100644 --- a/clang/lib/Serialization/ASTReaderStmt.cpp +++ b/clang/lib/Serialization/ASTReaderStmt.cpp @@ -2471,10 +2471,6 @@ void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) { D->setNextUpperBound(Reader.ReadSubExpr()); D->setNumIterations(Reader.ReadSubExpr()); } - if (isOpenMPLoopBoundSharingDirective(D->getDirectiveKind())) { - D->setPrevLowerBoundVariable(Reader.ReadSubExpr()); - D->setPrevUpperBoundVariable(Reader.ReadSubExpr()); - } SmallVector<Expr *, 4> Sub; unsigned CollapsedNum = D->getCollapsedNumber(); Sub.reserve(CollapsedNum); @@ -2707,10 +2703,6 @@ void ASTStmtReader::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) { ++Idx; VisitOMPExecutableDirective(D); } -void ASTStmtReader::VisitOMPDistributeParallelForDirective( - OMPDistributeParallelForDirective *D) { - VisitOMPLoopDirective(D); -} //===----------------------------------------------------------------------===// // ASTReader Implementation @@ -3387,14 +3379,6 @@ Stmt *ASTReader::ReadStmtFromStream(ModuleFile &F) { break; } - case STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE: { - unsigned NumClauses = Record[ASTStmtReader::NumStmtFields]; - unsigned CollapsedNum = Record[ASTStmtReader::NumStmtFields + 1]; - S = OMPDistributeParallelForDirective::CreateEmpty(Context, NumClauses, - CollapsedNum, Empty); - break; - } - case EXPR_CXX_OPERATOR_CALL: S = new (Context) CXXOperatorCallExpr(Context, Empty); break; diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index 333a70fe619..fe600adea39 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -2170,10 +2170,6 @@ void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) { Record.AddStmt(D->getNextUpperBound()); Record.AddStmt(D->getNumIterations()); } - if (isOpenMPLoopBoundSharingDirective(D->getDirectiveKind())) { - Record.AddStmt(D->getPrevLowerBoundVariable()); - Record.AddStmt(D->getPrevUpperBoundVariable()); - } for (auto I : D->counters()) { Record.AddStmt(I); } @@ -2421,12 +2417,6 @@ void ASTStmtWriter::VisitOMPTargetUpdateDirective(OMPTargetUpdateDirective *D) { Code = serialization::STMT_OMP_TARGET_UPDATE_DIRECTIVE; } -void ASTStmtWriter::VisitOMPDistributeParallelForDirective( - OMPDistributeParallelForDirective *D) { - VisitOMPLoopDirective(D); - Code = serialization::STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE; -} - //===----------------------------------------------------------------------===// // ASTWriter Implementation //===----------------------------------------------------------------------===// diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index e4ba1be4ba5..84515022fc0 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -842,7 +842,6 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred, case Stmt::OMPTaskLoopDirectiveClass: case Stmt::OMPTaskLoopSimdDirectiveClass: case Stmt::OMPDistributeDirectiveClass: - case Stmt::OMPDistributeParallelForDirectiveClass: llvm_unreachable("Stmt should not be in analyzer evaluation loop"); case Stmt::ObjCSubscriptRefExprClass: |