Fortran: Add LOCALITY support for DO_CONCURRENT
This patch provided by Anuj Mohite as part of the GSoC project.
It is modified slightly by Jerry DeLisle for minor formatting.
The patch provides front-end parsing of the LOCALITY specs in
DO_CONCURRENT and adds numerous test cases.
gcc/fortran/ChangeLog:
* dump-parse-tree.cc (show_code_node): Updated to use
c->ext.concur.forall_iterator instead of c->ext.forall_iterator.
* frontend-passes.cc (index_interchange): Updated to
use c->ext.concur.forall_iterator instead of c->ext.forall_iterator.
(gfc_code_walker): Likewise.
* gfortran.h (enum locality_type): Added new enum for locality types
in DO CONCURRENT constructs.
* match.cc (match_simple_forall): Updated to use
new_st.ext.concur.forall_iterator instead of new_st.ext.forall_iterator.
(gfc_match_forall): Likewise.
(gfc_match_do): Implemented support for matching DO CONCURRENT locality
specifiers (LOCAL, LOCAL_INIT, SHARED, DEFAULT(NONE), and REDUCE).
* parse.cc (parse_do_block): Updated to use
new_st.ext.concur.forall_iterator instead of new_st.ext.forall_iterator.
* resolve.cc (struct check_default_none_data): Added struct
check_default_none_data.
(do_concur_locality_specs_f2023): New function to check compliance
with F2023's C1133 constraint for DO CONCURRENT.
(check_default_none_expr): New function to check DEFAULT(NONE)
compliance.
(resolve_locality_spec): New function to resolve locality specs.
(gfc_count_forall_iterators): Updated to use
code->ext.concur.forall_iterator.
(gfc_resolve_forall): Updated to use code->ext.concur.forall_iterator.
* st.cc (gfc_free_statement): Updated to free locality specifications
and use p->ext.concur.forall_iterator.
* trans-stmt.cc (gfc_trans_forall_1): Updated to use
code->ext.concur.forall_iterator.
gcc/testsuite/ChangeLog:
* gfortran.dg/do_concurrent_10.f90: New test.
* gfortran.dg/do_concurrent_8_f2018.f90: New test.
* gfortran.dg/do_concurrent_8_f2023.f90: New test.
* gfortran.dg/do_concurrent_9.f90: New test.
* gfortran.dg/do_concurrent_all_clauses.f90: New test.
* gfortran.dg/do_concurrent_basic.f90: New test.
* gfortran.dg/do_concurrent_constraints.f90: New test.
* gfortran.dg/do_concurrent_local_init.f90: New test.
* gfortran.dg/do_concurrent_locality_specs.f90: New test.
* gfortran.dg/do_concurrent_multiple_reduce.f90: New test.
* gfortran.dg/do_concurrent_nested.f90: New test.
* gfortran.dg/do_concurrent_parser.f90: New test.
* gfortran.dg/do_concurrent_reduce_max.f90: New test.
* gfortran.dg/do_concurrent_reduce_sum.f90: New test.
* gfortran.dg/do_concurrent_shared.f90: New test.
Signed-off-by:
Anuj <anujmohite001@gmail.com>
Showing
- gcc/fortran/dump-parse-tree.cc 110 additions, 3 deletionsgcc/fortran/dump-parse-tree.cc
- gcc/fortran/frontend-passes.cc 4 additions, 4 deletionsgcc/fortran/frontend-passes.cc
- gcc/fortran/gfortran.h 31 additions, 15 deletionsgcc/fortran/gfortran.h
- gcc/fortran/match.cc 282 additions, 6 deletionsgcc/fortran/match.cc
- gcc/fortran/parse.cc 1 addition, 1 deletiongcc/fortran/parse.cc
- gcc/fortran/resolve.cc 351 additions, 3 deletionsgcc/fortran/resolve.cc
- gcc/fortran/st.cc 4 additions, 1 deletiongcc/fortran/st.cc
- gcc/fortran/trans-stmt.cc 3 additions, 3 deletionsgcc/fortran/trans-stmt.cc
- gcc/testsuite/gfortran.dg/do_concurrent_10.f90 11 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_10.f90
- gcc/testsuite/gfortran.dg/do_concurrent_8_f2018.f90 19 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_8_f2018.f90
- gcc/testsuite/gfortran.dg/do_concurrent_8_f2023.f90 23 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_8_f2023.f90
- gcc/testsuite/gfortran.dg/do_concurrent_9.f90 15 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_9.f90
- gcc/testsuite/gfortran.dg/do_concurrent_all_clauses.f90 26 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_all_clauses.f90
- gcc/testsuite/gfortran.dg/do_concurrent_basic.f90 11 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_basic.f90
- gcc/testsuite/gfortran.dg/do_concurrent_constraints.f90 126 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_constraints.f90
- gcc/testsuite/gfortran.dg/do_concurrent_local_init.f90 11 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_local_init.f90
- gcc/testsuite/gfortran.dg/do_concurrent_locality_specs.f90 14 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_locality_specs.f90
- gcc/testsuite/gfortran.dg/do_concurrent_multiple_reduce.f90 17 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_multiple_reduce.f90
- gcc/testsuite/gfortran.dg/do_concurrent_nested.f90 26 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_nested.f90
- gcc/testsuite/gfortran.dg/do_concurrent_parser.f90 20 additions, 0 deletionsgcc/testsuite/gfortran.dg/do_concurrent_parser.f90
Loading
Please register or sign in to comment