diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-08-12 18:09:57 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-08-12 18:09:57 +0200 |
commit | 21cfe724cbdc30612bf1ef59b26f19ada2210832 (patch) | |
tree | 8a7b1d52ea1fd089883e1536a4f4431b87b2cf95 /gcc/fortran/openmp.c | |
parent | fe9458c280dbd6e8b892db4ca3b64185049c376b (diff) | |
download | gcc-21cfe724cbdc30612bf1ef59b26f19ada2210832.zip gcc-21cfe724cbdc30612bf1ef59b26f19ada2210832.tar.gz gcc-21cfe724cbdc30612bf1ef59b26f19ada2210832.tar.bz2 |
Fortran: Add support for OpenMP's nontemporal clause
gcc/fortran/ChangeLog:
* gfortran.h: Add OMP_LIST_NONTEMPORAL.
* dump-parse-tree.c (show_omp_clauses): Dump it
* openmp.c (enum omp_mask1): Add OMP_CLAUSE_NOTEMPORAL.
(OMP_SIMD_CLAUSES): Add it.
(gfc_match_omp_clauses): Match nontemporal clause.
* trans-openmp.c (gfc_trans_omp_clauses): Process
nontemporal clause.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/nontemporal-1.f90: New test.
* gfortran.dg/gomp/nontemporal-2.f90: New test.
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r-- | gcc/fortran/openmp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index f402feb..c44a253 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -794,6 +794,7 @@ enum omp_mask1 OMP_CLAUSE_IS_DEVICE_PTR, OMP_CLAUSE_LINK, OMP_CLAUSE_NOGROUP, + OMP_CLAUSE_NOTEMPORAL, OMP_CLAUSE_NUM_TASKS, OMP_CLAUSE_PRIORITY, OMP_CLAUSE_SIMD, @@ -1510,6 +1511,11 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, c->nogroup = needs_space = true; continue; } + if ((mask & OMP_CLAUSE_NOTEMPORAL) + && gfc_match_omp_variable_list ("nontemporal (", + &c->lists[OMP_LIST_NONTEMPORAL], + true) == MATCH_YES) + continue; if ((mask & OMP_CLAUSE_NOTINBRANCH) && !c->notinbranch && !c->inbranch @@ -2591,7 +2597,7 @@ cleanup: (omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_LASTPRIVATE \ | OMP_CLAUSE_REDUCTION | OMP_CLAUSE_COLLAPSE | OMP_CLAUSE_SAFELEN \ | OMP_CLAUSE_LINEAR | OMP_CLAUSE_ALIGNED | OMP_CLAUSE_SIMDLEN \ - | OMP_CLAUSE_IF | OMP_CLAUSE_ORDER) + | OMP_CLAUSE_IF | OMP_CLAUSE_ORDER | OMP_CLAUSE_NOTEMPORAL) #define OMP_TASK_CLAUSES \ (omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_FIRSTPRIVATE \ | OMP_CLAUSE_SHARED | OMP_CLAUSE_IF | OMP_CLAUSE_DEFAULT \ |