From: Ju-Zhe Zhong <juzhe.zh...@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

Reply via email to