[PATCH] D112292: [Clang][OpenMP] Allow loop iteration var with threadprivate directive
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 22 06:15:25 PDT 2021
ABataev added inline comments.
================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:8653
? (DSAStack->hasMutipleLoops() ? OMPC_lastprivate : OMPC_linear)
- : OMPC_private;
- if (((isOpenMPSimdDirective(DKind) && DVar.CKind != OMPC_unknown &&
- DVar.CKind != PredeterminedCKind && DVar.RefExpr &&
- (LangOpts.OpenMP <= 45 || (DVar.CKind != OMPC_lastprivate &&
- DVar.CKind != OMPC_private))) ||
- ((isOpenMPWorksharingDirective(DKind) || DKind == OMPD_taskloop ||
- DKind == OMPD_master_taskloop ||
- DKind == OMPD_parallel_master_taskloop ||
- isOpenMPDistributeDirective(DKind)) &&
- !isOpenMPSimdDirective(DKind) && DVar.CKind != OMPC_unknown &&
- DVar.CKind != OMPC_private && DVar.CKind != OMPC_lastprivate)) &&
- (DVar.CKind != OMPC_private || DVar.RefExpr)) {
+ : DVar.CKind == OMPC_lastprivate ? OMPC_lastprivate
+ : OMPC_private;
----------------
Why need this change?
================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:8662-8667
+ if (LangOpts.OpenMP > 45 && isOpenMPSimdDirective(DKind)) {
+ if (DVar.CKind == OMPC_lastprivate)
+ PredeterminedCKind = OMPC_lastprivate;
+ else if (DVar.CKind == OMPC_private)
+ PredeterminedCKind = OMPC_private;
+ }
----------------
Again, why do we need this?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112292/new/
https://reviews.llvm.org/D112292
More information about the cfe-commits
mailing list