[gomp4] acc enter/exit data

Jakub Jelinek jakub@redhat.com
Wed Dec 10 09:59:00 GMT 2014


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



More information about the Gcc-patches mailing list