File tree Expand file tree Collapse file tree 4 files changed +5
-8
lines changed
Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -3772,7 +3772,7 @@ class OMPReductionClause final
37723772 void setPrivateVariableReductionFlags (ArrayRef<bool > Flags) {
37733773 assert (Flags.size () == varlist_size () &&
37743774 " Number of private flags does not match vars" );
3775- std ::copy (Flags. begin (), Flags. end (), getTrailingObjects<bool >());
3775+ llvm ::copy (Flags, getTrailingObjects<bool >());
37763776 }
37773777
37783778 // / Get the list of help private variable reduction flags
Original file line number Diff line number Diff line change @@ -18955,18 +18955,16 @@ static bool actOnOMPReductionKindClause(
1895518955 OpenMPDirectiveKind CurrDir = Stack->getCurrentDirective();
1895618956 OpenMPDirectiveKind ParentDir = Stack->getParentDirective();
1895718957 // Check if the construct is orphaned (has no enclosing OpenMP context)
18958- IsOrphaned = (ParentDir == OMPD_unknown);
18959- IsPrivate =
18958+ IsOrphaned = ParentDir == OMPD_unknown;
18959+ // OpenMP 6.0: Private DSA check
18960+ IsPrivate = (S.getLangOpts().OpenMP > 52) &&
1896018961 ((isOpenMPPrivate(DVar.CKind) && DVar.CKind != OMPC_reduction &&
1896118962 isOpenMPWorksharingDirective(CurrDir) &&
1896218963 !isOpenMPParallelDirective(CurrDir) &&
1896318964 !isOpenMPTeamsDirective(CurrDir) &&
1896418965 !isOpenMPSimdDirective(ParentDir)) ||
1896518966 (IsOrphaned && DVar.CKind == OMPC_unknown) ||
1896618967 RD.OrigSharingModifier != OMPC_ORIGINAL_SHARING_shared);
18967- // Disable private handling for OpenMP versions <= 5.2
18968- if (S.getLangOpts().OpenMP <= 52)
18969- IsPrivate = false;
1897018968
1897118969 // OpenMP [2.14.3.6, Restrictions, p.1]
1897218970 // A list item that appears in a reduction clause of a worksharing
Original file line number Diff line number Diff line change @@ -11724,7 +11724,7 @@ void OMPClauseReader::VisitOMPReductionClause(OMPReductionClause *C) {
1172411724 unsigned NumFlags = Record.readInt ();
1172511725 SmallVector<bool , 16 > Flags;
1172611726 Flags.reserve (NumFlags);
11727- for (unsigned i = 0 ; i != NumFlags; ++i )
11727+ for (unsigned I : llvm::seq< unsigned >( NumFlags) )
1172811728 Flags.push_back (Record.readInt ());
1172911729 C->setPrivateVariableReductionFlags (Flags);
1173011730}
Original file line number Diff line number Diff line change @@ -8022,7 +8022,6 @@ void OMPClauseWriter::VisitOMPReductionClause(OMPReductionClause *C) {
80228022 }
80238023 auto PrivateFlags = C->private_var_reduction_flags ();
80248024 Record.push_back (std::distance (PrivateFlags.begin (), PrivateFlags.end ()));
8025- // Record.push_back(PrivateFlags.size());
80268025 for (bool Flag : PrivateFlags)
80278026 Record.push_back (Flag);
80288027}
You can’t perform that action at this time.
0 commit comments