[V2] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}

Message ID 20230623234157.331911-1-juzhe.zhong@rivai.ai
State Accepted
Headers
Series [V2] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE} |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

juzhe.zhong@rivai.ai June 23, 2023, 11:41 p.m. UTC
  From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>

Hi, Jeff. I fix format as you suggested.
Ok for trunk ?

gcc/ChangeLog:

        * tree-ssa-loop-ivopts.cc (get_mem_type_for_internal_fn): Apply LEN_MASK_{LOAD,STORE}.
---
 gcc/tree-ssa-loop-ivopts.cc | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
  

Comments

Jeff Law June 24, 2023, 1:28 a.m. UTC | #1
On 6/23/23 17:41, juzhe.zhong@rivai.ai wrote:
> From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
> 
> Hi, Jeff. I fix format as you suggested.
> Ok for trunk ?
> 
> gcc/ChangeLog:
> 
>          * tree-ssa-loop-ivopts.cc (get_mem_type_for_internal_fn): Apply LEN_MASK_{LOAD,STORE}.
Yes.  Sorry I wasn't explicit that it was OK with the formatting change.

Jeff
  
Li, Pan2 via Gcc-patches June 24, 2023, 1:09 p.m. UTC | #2
Committed as passed bootstrap and regression test, thanks Jeff.

Pan

-----Original Message-----
From: Gcc-patches <gcc-patches-bounces+pan2.li=intel.com@gcc.gnu.org> On Behalf Of Jeff Law via Gcc-patches
Sent: Saturday, June 24, 2023 9:29 AM
To: juzhe.zhong@rivai.ai; gcc-patches@gcc.gnu.org
Cc: rguenther@suse.de; richard.sandiford@arm.com
Subject: Re: [PATCH V2] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}



On 6/23/23 17:41, juzhe.zhong@rivai.ai wrote:
> From: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
> 
> Hi, Jeff. I fix format as you suggested.
> Ok for trunk ?
> 
> gcc/ChangeLog:
> 
>          * tree-ssa-loop-ivopts.cc (get_mem_type_for_internal_fn): Apply LEN_MASK_{LOAD,STORE}.
Yes.  Sorry I wasn't explicit that it was OK with the formatting change.

Jeff
  

Patch

diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc
index 6671ff6db5a..dc7a29fead2 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,9 +2450,16 @@  get_mem_type_for_internal_fn (gcall *call, tree *op_p)
     case IFN_MASK_STORE:
     case IFN_MASK_STORE_LANES:
     case IFN_LEN_STORE:
-      if (op_p == gimple_call_arg_ptr (call, 0))
-	return TREE_TYPE (gimple_call_arg (call, 3));
-      return NULL_TREE;
+    case IFN_LEN_MASK_STORE:
+      {
+	if (op_p == gimple_call_arg_ptr (call, 0))
+	  {
+	    internal_fn ifn = gimple_call_internal_fn (call);
+	    int index = internal_fn_stored_value_index (ifn);
+	    return TREE_TYPE (gimple_call_arg (call, index));
+	  }
+	return NULL_TREE;
+      }
 
     default:
       return NULL_TREE;