Hi Nathan!

On Sun, 25 Oct 2015 10:01:55 -0400, Nathan Sidwell <nat...@acm.org> wrote:
> I've applied this patch to gomp4 branch.  It's the reworking of IFN_UNIQUE 
> suggested by Richard & Jakub.

> 
> 1) IFN_UNIQUE is a ctrl-altering call, and thus ends up at the end of a BB.
> 2) tracer only needs to check that stmt (and it'a already looking at it for 
> other reasons)
> 3) IFN_UNIQUE is no longer ECF_LEAF
> 4) Inserted a data dependency chain to the had & tail call sequence.  The 2nd 
> param is the result of  the previous call in the chain.

> --- gcc/internal-fn.c (revision 229276)
> +++ gcc/internal-fn.c (working copy)
> @@ -1962,8 +1962,9 @@ static void
>  expand_UNIQUE (gcall *stmt)
>  {
>    rtx pattern = NULL_RTX;
> +  int code = TREE_INT_CST_LOW (gimple_call_arg (stmt, 0));
>  
> -  switch (TREE_INT_CST_LOW (gimple_call_arg (stmt, 0)))
> +  switch (code)
>      {
>      default:
>        gcc_unreachable ();
> @@ -1975,21 +1976,34 @@ expand_UNIQUE (gcall *stmt)
>        break;
>  
>      case IFN_UNIQUE_OACC_FORK:
> +    case IFN_UNIQUE_OACC_JOIN:
> +      {
> +     tree lhs = gimple_call_lhs (stmt);
> +     rtx target = const0_rtx;
> +
> +     if (lhs)
> +       target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE);
> +
> +     rtx data_dep = expand_normal (gimple_call_arg (stmt, 1));
> +     rtx axis = expand_normal (gimple_call_arg (stmt, 2));
> +
> +     if (code == IFN_UNIQUE_OACC_FORK)
> +       {
>  #ifdef HAVE_oacc_fork
> -      pattern = expand_normal (gimple_call_arg (stmt, 1));
> -      pattern = gen_oacc_fork (pattern);
> +         pattern = gen_oacc_fork (target, data_dep, axis);
>  #else
> -      gcc_unreachable ();
> +         gcc_unreachable ();
>  #endif
> -      break;
> -
> -    case IFN_UNIQUE_OACC_JOIN:
> +       }
> +     else
> +       {
>  #ifdef HAVE_oacc_join
> -      pattern = expand_normal (gimple_call_arg (stmt, 1));
> -      pattern = gen_oacc_join (pattern);
> +         pattern = gen_oacc_join (target, data_dep, axis);
>  #else
> -      gcc_unreachable ();
> +         gcc_unreachable ();
>  #endif
> +       }
> +      }
>        break;
>      }

    [...]/source-gcc/gcc/internal-fn.c: In function 'void 
expand_UNIQUE(gcall*)':
    [...]/source-gcc/gcc/internal-fn.c:1982:6: error: variable 'target' set but 
not used [-Werror=unused-but-set-variable]
      rtx target = const0_rtx;
          ^
    [...]/source-gcc/gcc/internal-fn.c:1987:6: error: unused variable 
'data_dep' [-Werror=unused-variable]
      rtx data_dep = expand_normal (gimple_call_arg (stmt, 1));
          ^
    [...]/source-gcc/gcc/internal-fn.c:1988:6: error: unused variable 'axis' 
[-Werror=unused-variable]
      rtx axis = expand_normal (gimple_call_arg (stmt, 2));
          ^


Grüße
 Thomas

Attachment: signature.asc
Description: PGP signature

Reply via email to