aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorKwok Cheung Yeung <kcyeung@baylibre.com>2025-05-03 20:36:21 +0000
committerSandra Loosemore <sloosemore@baylibre.com>2025-05-15 20:25:52 +0000
commit441f52bd64a87eeb36e4cda2535260f4236fc040 (patch)
treed16418d67f6e678ca64e6738c5245ee01f896f3a /gcc/c
parent791936457451ad3a2867d02b7ffc743b96b04c42 (diff)
downloadgcc-441f52bd64a87eeb36e4cda2535260f4236fc040.zip
gcc-441f52bd64a87eeb36e4cda2535260f4236fc040.tar.gz
gcc-441f52bd64a87eeb36e4cda2535260f4236fc040.tar.bz2
openmp, fortran: Add support for map iterators in OpenMP target construct (Fortran)
This adds support for iterators in map clauses within OpenMP 'target' constructs in Fortran. Some special handling for struct field maps has been added to libgomp in order to handle arrays of derived types. gcc/fortran/ * dump-parse-tree.cc (show_omp_namelist): Add iterator support for OMP_LIST_MAP. * match.cc (gfc_free_namelist): Free namespace for OMP_LIST_MAP. * openmp.cc (gfc_free_omp_clauses): Free namespace in namelist for OMP_LIST_MAP. (gfc_match_omp_clauses): Parse 'iterator' modifier for 'map' clause. (resolve_omp_clauses): Resolve iterators for OMP_LIST_MAP. * trans-openmp.cc: Include tree-ssa-loop-niter.h. (gfc_trans_omp_array_section): Add iterator argument. Replace instances of iterator variables with the initial value when computing biases. (gfc_trans_omp_clauses): Handle iterators in OMP_LIST_MAP clauses. Add expressions to iter_block rather than block. Do not apply iterators to firstprivate maps. Pass iterator to gfc_trans_omp_array_section. gcc/ * gimplify.cc (compute_omp_iterator_count): Account for difference in loop boundaries in Fortran. (build_omp_iterator_loop): Change upper boundary condition for Fortran. Insert block statements into innermost loop. (remove_unused_omp_iterator_vars): Copy block subblocks of old iterator to new iterator and remove original. (contains_vars_1): New. (contains_vars): New. (extract_base_bit_offset): Add iterator argument. Remove iterator variables from base. Do not set variable_offset if the offset does not contain any remaining variables. (omp_accumulate_sibling_list): Add iterator argument to extract_base_bit_offset. * tree-pretty-print.cc (dump_block_node): Ignore BLOCK_SUBBLOCKS containing iterator block statements. gcc/testsuite/ * gfortran.dg/gomp/target-map-iterators-1.f90: New. * gfortran.dg/gomp/target-map-iterators-2.f90: New. * gfortran.dg/gomp/target-map-iterators-3.f90: New. * gfortran.dg/gomp/target-map-iterators-4.f90: New. libgomp/ * target.c (kind_to_name): Handle GOMP_MAP_STRUCT and GOMP_MAP_STRUCT_UNORD. (gomp_add_map): New. (gomp_merge_iterator_maps): Expand fields of a struct mapping breadth-first. * testsuite/libgomp.fortran/target-map-iterators-1.f90: New. * testsuite/libgomp.fortran/target-map-iterators-2.f90: New. * testsuite/libgomp.fortran/target-map-iterators-3.f90: New. Co-authored-by: Andrew Stubbs <ams@baylibre.com>
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions