This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/5] omp-low: introduce omplow_simd_context


On Tue, Jan 17, 2017 at 11:07:41PM +0300, Alexander Monakov wrote:
> In preparation to handle new SIMT privatization in lower_rec_simd_input_clauses
> this patch factors out variables common to this and lower_rec_input_clauses to
> a new structure.  No functional change intended.
> 
> 	* omp-low.c (omplow_simd_context): New struct.  Use it...
>         (lower_rec_simd_input_clauses): ...here and...
>         (lower_rec_input_clauses): ...here to hold common data.  Adjust all
>         references to idx, lane, max_vf, is_simt.
> 
> ---
>  gcc/omp-low.c | 79 ++++++++++++++++++++++++++++++++---------------------------
>  1 file changed, 43 insertions(+), 36 deletions(-)
> 
> diff --git a/gcc/omp-low.c b/gcc/omp-low.c
> index e69b2b2..13d9b6b 100644
> --- a/gcc/omp-low.c
> +++ b/gcc/omp-low.c
> @@ -3445,20 +3445,28 @@ omp_clause_aligned_alignment (tree clause)
>    return build_int_cst (integer_type_node, al);
>  }
>  
> +
> +/* This structure is part of the interface between lower_rec_simd_input_clauses
> +   and lower_rec_input_clauses.  */
> +
> +struct omplow_simd_context {
> +  tree idx;
> +  tree lane;
> +  int max_vf;
> +  bool is_simt;

Any reason ivar and lvar weren't added there too?

> +  int &max_vf = sctx->max_vf;
>    if (max_vf == 0)
>      {
> -      if (omp_find_clause (gimple_omp_for_clauses (ctx->stmt),
> -			   OMP_CLAUSE__SIMT_))
> -	max_vf = omp_max_simt_vf ();
> -      else
> -	max_vf = omp_max_vf ();
> +      max_vf = sctx->is_simt ? omp_max_simt_vf () : omp_max_vf ();

I think it would be better just to use sctx->max_vf instead of max_vf,
without the reference.

Otherwise LGTM.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]