Hi!

On Sat, May 08, 2021 at 04:12:18PM +0800, Kewen.Lin wrote:
> --- a/gcc/config/rs6000/rs6000.c
> +++ b/gcc/config/rs6000/rs6000.c
> @@ -5234,6 +5234,8 @@ typedef struct _rs6000_cost_data
>    /* For each vectorized loop, this var holds TRUE iff a non-memory vector
>       instruction is needed by the vectorization.  */
>    bool vect_nonmem;
> +  /* Indicates costing for the scalar version of a loop or block.  */
> +  bool costing_for_scalar;
>  } rs6000_cost_data;

"... this is costing for ..."?

> @@ -5255,6 +5257,12 @@ rs6000_density_test (rs6000_cost_data *data)
>    int vec_cost = data->cost[vect_body], not_vec_cost = 0;
>    int i, density_pct;
>  
> +  /* This density test only cares about the cost of vector version of the
> +     loop, early return if it's costing for the scalar version (namely
> +     computing single scalar iteration cost).  */
> +  if (data->costing_for_scalar)
> +    return;

"..., so immediately return if we are passed costing for ..."?

The patch is okay for trunk with those or similar changes.  Thanks!


Segher

Reply via email to