[clang] 2875df0 - [OPENMP50]Perform data mapping analysis only for explicitly mapped data.
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 20 10:01:59 PDT 2020
Author: Alexey Bataev
Date: 2020-07-20T13:01:15-04:00
New Revision: 2875df0d56572168b478f80f59106284ef15d87d
URL: https://github.com/llvm/llvm-project/commit/2875df0d56572168b478f80f59106284ef15d87d
DIFF: https://github.com/llvm/llvm-project/commit/2875df0d56572168b478f80f59106284ef15d87d.diff
LOG: [OPENMP50]Perform data mapping analysis only for explicitly mapped data.
Summary:
According to OpenMP 5.0, the restrictions for mapping of overlapped data
apply only for explicitly mapped data, there is no restriction for
implicitly mapped data just like in OpenMP 4.5.
Reviewers: jdoerfert
Subscribers: yaxunl, guansong, sstefan1, cfe-commits, caomhin
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83398
Added:
Modified:
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/target_map_messages.cpp
Removed:
################################################################################
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 1e7d432217d5..3c9fdbddfa75 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -17484,6 +17484,7 @@ static void checkMappableExpressionList(
/*CurrentRegionOnly=*/true, CurComponents, CKind))
break;
if (CKind == OMPC_map &&
+ (SemaRef.getLangOpts().OpenMP <= 45 || StartLoc.isValid()) &&
checkMapConflicts(SemaRef, DSAS, CurDeclaration, SimpleExpr,
/*CurrentRegionOnly=*/false, CurComponents, CKind))
break;
diff --git a/clang/test/OpenMP/target_map_messages.cpp b/clang/test/OpenMP/target_map_messages.cpp
index 833f509cd7f0..df6591d87ea7 100644
--- a/clang/test/OpenMP/target_map_messages.cpp
+++ b/clang/test/OpenMP/target_map_messages.cpp
@@ -604,6 +604,7 @@ int main(int argc, char **argv) {
const int (&l)[5] = da;
SC1 s;
SC1 *p;
+ int Arr[10];
#pragma omp target data map // expected-error {{expected '(' after 'map'}} le45-error {{expected at least one 'map' or 'use_device_ptr' clause for '#pragma omp target data'}} le50-error {{expected at least one 'map', 'use_device_ptr', or 'use_device_addr' clause for '#pragma omp target data'}}
#pragma omp target data map( // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{expected expression}}
#pragma omp target data map() // expected-error {{expected expression}}
@@ -750,6 +751,12 @@ int main(int argc, char **argv) {
#pragma omp target map(iarr[:2:d]) // expected-error {{expected ']'}} expected-note {{to match this '['}}
{}
+#pragma omp target data map(Arr[0:4]) // le45-note {{used here}}
+ {
+#pragma omp target
+ Arr[0] = 2; // le45-error {{original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage}}
+ }
+
return tmain<int, 3>(argc)+tmain<from, 4>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<int, 4>' requested here}}
}
#endif
More information about the cfe-commits
mailing list