public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}
@ 2023-06-23 14:05 juzhe.zhong
  2023-06-23 19:14 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: juzhe.zhong @ 2023-06-23 14:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: rguenther, richard.sandiford, Ju-Zhe Zhong

From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>

gcc/ChangeLog:

        * tree-ssa-loop-ivopts.cc (get_mem_type_for_internal_fn): Apply LEN_MASK_{LOAD,STORE}.

---
 gcc/tree-ssa-loop-ivopts.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc
index 6671ff6db5a..2b66fe66bc7 100644
--- a/gcc/tree-ssa-loop-ivopts.cc
+++ b/gcc/tree-ssa-loop-ivopts.cc
@@ -2442,6 +2442,7 @@ get_mem_type_for_internal_fn (gcall *call, tree *op_p)
     case IFN_MASK_LOAD:
     case IFN_MASK_LOAD_LANES:
     case IFN_LEN_LOAD:
+    case IFN_LEN_MASK_LOAD:
       if (op_p == gimple_call_arg_ptr (call, 0))
 	return TREE_TYPE (gimple_call_lhs (call));
       return NULL_TREE;
@@ -2449,8 +2450,11 @@ get_mem_type_for_internal_fn (gcall *call, tree *op_p)
     case IFN_MASK_STORE:
     case IFN_MASK_STORE_LANES:
     case IFN_LEN_STORE:
+    case IFN_LEN_MASK_STORE:
       if (op_p == gimple_call_arg_ptr (call, 0))
-	return TREE_TYPE (gimple_call_arg (call, 3));
+	return TREE_TYPE (
+	  gimple_call_arg (call, internal_fn_stored_value_index (
+				   gimple_call_internal_fn (call))));
       return NULL_TREE;
 
     default:
-- 
2.36.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}
  2023-06-23 14:05 [PATCH] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE} juzhe.zhong
@ 2023-06-23 19:14 ` Jeff Law
  2023-06-23 23:20   ` 钟居哲
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2023-06-23 19:14 UTC (permalink / raw)
  To: juzhe.zhong, gcc-patches; +Cc: rguenther, richard.sandiford



On 6/23/23 08:05, juzhe.zhong@rivai.ai wrote:
> From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
> 
> gcc/ChangeLog:
> 
>          * tree-ssa-loop-ivopts.cc (get_mem_type_for_internal_fn): Apply LEN_MASK_{LOAD,STORE}.
> 
> ---
>   gcc/tree-ssa-loop-ivopts.cc | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc
> index 6671ff6db5a..2b66fe66bc7 100644
> --- a/gcc/tree-ssa-loop-ivopts.cc
> +++ b/gcc/tree-ssa-loop-ivopts.cc
> @@ -2442,6 +2442,7 @@ get_mem_type_for_internal_fn (gcall *call, tree *op_p)
>       case IFN_MASK_LOAD:
>       case IFN_MASK_LOAD_LANES:
>       case IFN_LEN_LOAD:
> +    case IFN_LEN_MASK_LOAD:
>         if (op_p == gimple_call_arg_ptr (call, 0))
>   	return TREE_TYPE (gimple_call_lhs (call));
>         return NULL_TREE;
> @@ -2449,8 +2450,11 @@ get_mem_type_for_internal_fn (gcall *call, tree *op_p)
>       case IFN_MASK_STORE:
>       case IFN_MASK_STORE_LANES:
>       case IFN_LEN_STORE:
> +    case IFN_LEN_MASK_STORE:
>         if (op_p == gimple_call_arg_ptr (call, 0))
> -	return TREE_TYPE (gimple_call_arg (call, 3));
> +	return TREE_TYPE (
> +	  gimple_call_arg (call, internal_fn_stored_value_index (
> +				   gimple_call_internal_fn (call))));
Formatting nit.  Compute the result of internal_fn_stored_value_index 
into a temporary and pass that temporary into gimple_call_arg which 
should clean up the formatting here.

In general, if you find yourself indenting after an open paren like 
you've done here, compute the value into a temporary.

OK with the formatting fix.

jeff


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: [PATCH] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}
  2023-06-23 19:14 ` Jeff Law
@ 2023-06-23 23:20   ` 钟居哲
  0 siblings, 0 replies; 3+ messages in thread
From: 钟居哲 @ 2023-06-23 23:20 UTC (permalink / raw)
  To: Jeff Law, gcc-patches; +Cc: rguenther, richard.sandiford

[-- Attachment #1: Type: text/plain, Size: 1878 bytes --]

Ok will send V2 soon.



juzhe.zhong@rivai.ai
 
From: Jeff Law
Date: 2023-06-24 03:14
To: juzhe.zhong; gcc-patches
CC: rguenther; richard.sandiford
Subject: Re: [PATCH] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}
 
 
On 6/23/23 08:05, juzhe.zhong@rivai.ai wrote:
> From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
> 
> gcc/ChangeLog:
> 
>          * tree-ssa-loop-ivopts.cc (get_mem_type_for_internal_fn): Apply LEN_MASK_{LOAD,STORE}.
> 
> ---
>   gcc/tree-ssa-loop-ivopts.cc | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc
> index 6671ff6db5a..2b66fe66bc7 100644
> --- a/gcc/tree-ssa-loop-ivopts.cc
> +++ b/gcc/tree-ssa-loop-ivopts.cc
> @@ -2442,6 +2442,7 @@ get_mem_type_for_internal_fn (gcall *call, tree *op_p)
>       case IFN_MASK_LOAD:
>       case IFN_MASK_LOAD_LANES:
>       case IFN_LEN_LOAD:
> +    case IFN_LEN_MASK_LOAD:
>         if (op_p == gimple_call_arg_ptr (call, 0))
>   return TREE_TYPE (gimple_call_lhs (call));
>         return NULL_TREE;
> @@ -2449,8 +2450,11 @@ get_mem_type_for_internal_fn (gcall *call, tree *op_p)
>       case IFN_MASK_STORE:
>       case IFN_MASK_STORE_LANES:
>       case IFN_LEN_STORE:
> +    case IFN_LEN_MASK_STORE:
>         if (op_p == gimple_call_arg_ptr (call, 0))
> - return TREE_TYPE (gimple_call_arg (call, 3));
> + return TREE_TYPE (
> +   gimple_call_arg (call, internal_fn_stored_value_index (
> +    gimple_call_internal_fn (call))));
Formatting nit.  Compute the result of internal_fn_stored_value_index 
into a temporary and pass that temporary into gimple_call_arg which 
should clean up the formatting here.
 
In general, if you find yourself indenting after an open paren like 
you've done here, compute the value into a temporary.
 
OK with the formatting fix.
 
jeff
 
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-23 23:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-23 14:05 [PATCH] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE} juzhe.zhong
2023-06-23 19:14 ` Jeff Law
2023-06-23 23:20   ` 钟居哲

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).