]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}
authorJu-Zhe Zhong <juzhe.zhong@rivai.ai>
Fri, 23 Jun 2023 23:41:57 +0000 (07:41 +0800)
committerPan Li <pan2.li@intel.com>
Sat, 24 Jun 2023 13:08:12 +0000 (21:08 +0800)
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

index 573182247a75628f3ae614db835bf216a9e1a45b..243ce86dfc49d38bce58f9a2ded72116775e03f1 100644 (file)
@@ -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;