This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gomp4] acc enter/exit data
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Cesar Philippidis <cesar at codesourcery dot com>, fortran at gcc dot gnu dot org
- Date: Wed, 10 Dec 2014 10:59:34 +0100
- Subject: Re: [gomp4] acc enter/exit data
- Authentication-results: sourceware.org; auth=none
- References: <5452D398 dot 2030709 at codesourcery dot com> <871to796ey dot fsf at kepler dot schwinge dot homeip dot net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Dec 10, 2014 at 10:54:13AM +0100, Thomas Schwinge wrote:
> --- gcc/omp-low.c
> +++ gcc/omp-low.c
> @@ -9404,7 +9404,9 @@ build_omp_regions_1 (basic_block bb, struct omp_region *parent,
> else if (code == GIMPLE_OMP_TARGET
> && (gimple_omp_target_kind (stmt) == GF_OMP_TARGET_KIND_UPDATE
> || (gimple_omp_target_kind (stmt)
> - == GF_OMP_TARGET_KIND_OACC_UPDATE)))
> + == GF_OMP_TARGET_KIND_OACC_UPDATE)
> + || (gimple_omp_target_kind (stmt)
> + == GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA)))
> new_omp_region (bb, code, parent);
> else
> {
> @@ -12270,7 +12272,9 @@ make_gimple_omp_edges (basic_block bb, struct omp_region **region,
> cur_region = new_omp_region (bb, code, cur_region);
> fallthru = true;
> if (gimple_omp_target_kind (last) == GF_OMP_TARGET_KIND_UPDATE
> - || gimple_omp_target_kind (last) == GF_OMP_TARGET_KIND_OACC_UPDATE)
> + || gimple_omp_target_kind (last) == GF_OMP_TARGET_KIND_OACC_UPDATE
> + || (gimple_omp_target_kind (last)
> + == GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA))
I'd say that at this point a
switch (gimple_omp_target_kind (last))
{
case GF_OMP_TARGET_KIND_UPDATE:
case GF_OMP_TARGET_KIND_OACC_UPDATE:
case GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA:
...
default:
...
}
would be cleaner. The first hunk is more questionable, because there is
else and it would require duplicating of the else body in default:, goto
or similar, but perhaps it would be better that way too.
Jakub