public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Cc: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com
Subject: Re: [PATCH] cleanup: Change condition order
Date: Fri, 21 Jul 2023 06:20:40 +0000 (UTC)	[thread overview]
Message-ID: <nycvar.YFH.7.77.849.2307210620350.12935@jbgna.fhfr.qr> (raw)
In-Reply-To: <20230721022343.314043-1-juzhe.zhong@rivai.ai>

On Fri, 21 Jul 2023, Juzhe-Zhong wrote:

> Hi, Richard and Richi.
> 
> I have double check the recent codes for len && mask support again.
> 
> Some places code structure:
> 
> if (len_mask_fn)
> ...
> else if (mask_fn)
> ...
> 
> some places code structure:
> 
> if (mask_len_fn)
> ...
> else if (mask)
> 
> Base on previous review comment from Richi:
> https://gcc.gnu.org/pipermail/gcc-patches/2023-July/625067.html
> 
> len mask stuff should be checked before mask.
> 
> So I reorder all condition order to check LEN MASK stuff before MASK.
> 
> This is the last clean up patch.
> 
> Boostrap and Regression is on the way.

OK.

> gcc/ChangeLog:
> 
> 	* tree-vect-stmts.cc (check_load_store_for_partial_vectors): Change condition order.
> 	(vectorizable_operation): Ditto.
> 
> ---
>  gcc/tree-vect-stmts.cc | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
> index d5b4f020332..2fe856db9ab 100644
> --- a/gcc/tree-vect-stmts.cc
> +++ b/gcc/tree-vect-stmts.cc
> @@ -1635,17 +1635,17 @@ check_load_store_for_partial_vectors (loop_vec_info loop_vinfo, tree vectype,
>        internal_fn len_ifn = (is_load
>  			     ? IFN_MASK_LEN_GATHER_LOAD
>  			     : IFN_MASK_LEN_SCATTER_STORE);
> -      if (internal_gather_scatter_fn_supported_p (ifn, vectype,
> +      if (internal_gather_scatter_fn_supported_p (len_ifn, vectype,
>  						  gs_info->memory_type,
>  						  gs_info->offset_vectype,
>  						  gs_info->scale))
> -	vect_record_loop_mask (loop_vinfo, masks, nvectors, vectype,
> -			       scalar_mask);
> -      else if (internal_gather_scatter_fn_supported_p (len_ifn, vectype,
> +	vect_record_loop_len (loop_vinfo, lens, nvectors, vectype, 1);
> +      else if (internal_gather_scatter_fn_supported_p (ifn, vectype,
>  						       gs_info->memory_type,
>  						       gs_info->offset_vectype,
>  						       gs_info->scale))
> -	vect_record_loop_len (loop_vinfo, lens, nvectors, vectype, 1);
> +	vect_record_loop_mask (loop_vinfo, masks, nvectors, vectype,
> +			       scalar_mask);
>        else
>  	{
>  	  if (dump_enabled_p ())
> @@ -6596,16 +6596,16 @@ vectorizable_operation (vec_info *vinfo,
>  	  && LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P (loop_vinfo)
>  	  && mask_out_inactive)
>  	{
> -	  if (cond_fn != IFN_LAST
> -	      && direct_internal_fn_supported_p (cond_fn, vectype,
> +	  if (cond_len_fn != IFN_LAST
> +	      && direct_internal_fn_supported_p (cond_len_fn, vectype,
>  						 OPTIMIZE_FOR_SPEED))
> -	    vect_record_loop_mask (loop_vinfo, masks, ncopies * vec_num,
> -				   vectype, NULL);
> -	  else if (cond_len_fn != IFN_LAST
> -		   && direct_internal_fn_supported_p (cond_len_fn, vectype,
> -						      OPTIMIZE_FOR_SPEED))
>  	    vect_record_loop_len (loop_vinfo, lens, ncopies * vec_num, vectype,
>  				  1);
> +	  else if (cond_fn != IFN_LAST
> +		   && direct_internal_fn_supported_p (cond_fn, vectype,
> +						      OPTIMIZE_FOR_SPEED))
> +	    vect_record_loop_mask (loop_vinfo, masks, ncopies * vec_num,
> +				   vectype, NULL);
>  	  else
>  	    {
>  	      if (dump_enabled_p ())
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg,
Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman;
HRB 36809 (AG Nuernberg)

  reply	other threads:[~2023-07-21  6:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21  2:23 Juzhe-Zhong
2023-07-21  6:20 ` Richard Biener [this message]
2023-07-21  8:38   ` =?gb18030?B?TGVodWEgRGluZw==?=

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.YFH.7.77.849.2307210620350.12935@jbgna.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).