From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2119) id 228273857731; Mon, 26 Jun 2023 20:56:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 228273857731 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687812986; bh=5prc0yyjcg3fhACWPIpNrySrBEyW0xirfjOSP6dNvzc=; h=From:To:Subject:Date:From; b=h4u/sLib/yUP9sm6IULAJVcZrZK3A5JKtaip7gAEw50kq59wYZgwdbt+kW0m/NuwH LQCSbNFXvtKun3oPaskwAJKFgJWSFcj5ClRrEL7R6u+AEEDG3NAaIIIPbv4yZ51xU4 MHTJcUmqQLbyMioWmN12D2Il7f9J8uf+9b0Xahy4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jeff Law To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] LOOP IVOPTS: Apply LEN_MASK_{LOAD, STORE} X-Act-Checkin: gcc X-Git-Author: Ju-Zhe Zhong X-Git-Refname: refs/vendors/riscv/heads/gcc-13-with-riscv-opts X-Git-Oldrev: ae0ac441659ade97b8f7502e2854684561cec873 X-Git-Newrev: 0fb73df047d385eb4b7f1d09148eec94ec615f1f Message-Id: <20230626205626.228273857731@sourceware.org> Date: Mon, 26 Jun 2023 20:56:26 +0000 (GMT) List-Id: https://gcc.gnu.org/g:0fb73df047d385eb4b7f1d09148eec94ec615f1f commit 0fb73df047d385eb4b7f1d09148eec94ec615f1f Author: Ju-Zhe Zhong Date: Sat Jun 24 07:41:57 2023 +0800 LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE} 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}. Diff: --- gcc/tree-ssa-loop-ivopts.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc index 3ca5adc99dd..f501070c917 100644 --- a/gcc/tree-ssa-loop-ivopts.cc +++ b/gcc/tree-ssa-loop-ivopts.cc @@ -2439,6 +2439,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; @@ -2446,9 +2447,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;