From patchwork Fri Jun 23 23:41:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 112386 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6105228vqr; Fri, 23 Jun 2023 16:42:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ73Tj87QgFJbSwnt8pHh3JYKgO0c3KTFREBiTX4X0IBcCoInU04V8Ncf78IIJ3eHqOdAZsN X-Received: by 2002:a17:907:2d9e:b0:989:29f5:7f8b with SMTP id gt30-20020a1709072d9e00b0098929f57f8bmr9932312ejc.37.1687563767721; Fri, 23 Jun 2023 16:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687563767; cv=none; d=google.com; s=arc-20160816; b=FtbPb9Rd02HgYobH58yOElJDVJl72Ralhe9y3EoaHxe/Qe6DraOyma3QgHbdzC6N28 4PYQld2fj4mnOjqhcZwMV5Lns+b+DvtpnmvBmfVf0DTQxMssPMlj8iMEqqc5N8LLbEwT Z959KkOoI3O1svVKy2lr4ynEdw7NTDQHqcxF6FIkHOH+Lh4WU0PgP1JN3+L93CrqPSCU ShFo846BSDC/dZoxvX3VbstgcyjJjCR7T7aylX3oVPK0IlAa22sFeVUHwpj06PazHx3K 4u3LV8s/yTUhK05pPtAhXGrLrOesGVpuRIdNiSSmlZDCDWGggb++SKXZCObKtbYzYj5a C4qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dmarc-filter:delivered-to; bh=SiP2vF0yzoI8wyr/wurkSFy3G0VWijRc1RsAhLmmPdQ=; fh=hx66BbOgvUAUfThFlD5/iU6vHZejHIMgBWcd8m06y7A=; b=FiToCtFgAk16QdnX1J2dHjtaePEMQpawd/0PkXbY40RDCmSXW82FqMcIfB/0hYCX7W uTeb0jhdEL+QxMfYSW+yFVPSjzpdpwqQyn4rCPXrmRYGaR9KjLK9QVmjkQB5klmXnulD f0cfegLX5xP/A0bQXvl5r8nRh1zajcmBdug9xTu2s0Kstf0BXtSwxLpx/kLMeuSiRS7y G4fAHeHnLL3ypFE/UlAmlWeR3IkS5DWFi8sIDiZYsW/1UYS4fRAWe91SnRp1F0uapsL3 6fjgd91WH3zv59BiQ07B+iasow7iLfe9s32l65u3mLUUM6ZssK7xCIJDHSYtGi30ThyI j4bQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id j6-20020a170906254600b0098831afb89bsi200511ejb.84.2023.06.23.16.42.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 16:42:47 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 96C3B3858C3A for ; Fri, 23 Jun 2023 23:42:41 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbg154.qq.com (smtpbg154.qq.com [15.184.224.54]) by sourceware.org (Postfix) with ESMTPS id D44CF3858C3A for ; Fri, 23 Jun 2023 23:42:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D44CF3858C3A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp85t1687563719tifr35am Received: from rios-cad5.localdomain ( [58.60.1.11]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 24 Jun 2023 07:41:58 +0800 (CST) X-QQ-SSF: 01400000000000G0S000000A0000000 X-QQ-FEAT: XBN7tc9DADLASRXhOpFxh5XlbzGXRmwzh9z6ltweQ3YVOnYuUNEuVHussalRE 71LUrxbb8Z9ljDUZAr4eR7PTntfIVmEccTHcl3Jq6HmvpaDYtrjs6hM4H27+C9zxmPv0AWg ZyOxnoaaFDeXEs0Arc/1JqJ7o2ziAqSy/YFlxdDzHW/KtyDLRWKh4Bz6MNUZn8BhAX2q0gp /b1zmf3SehG9cUJcrVcZ0kynOBZHu6IKXIaXGGDrvqOClng2B/3IhSHybnoxYKO62NJoNsK WCbTeRaMQi/ec+V+qL1QYI2jCZMhvtg12aW2/cgKEWPVA7okzUfa4zFygWVCwIm2vfEJNTl eXd9PsstinD2Ej2R+tjir6uTo2CKiISFnsFnOikVql+Bk856CH2lndltUYYBw== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 10710474143285400065 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Cc: jeffreyalaw@gmail.com, rguenther@suse.de, richard.sandiford@arm.com, Ju-Zhe Zhong Subject: [PATCH V2] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE} Date: Sat, 24 Jun 2023 07:41:57 +0800 Message-Id: <20230623234157.331911-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz7a-one-0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769502603519680126?= X-GMAIL-MSGID: =?utf-8?q?1769538865330330403?= From: Ju-Zhe Zhong 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(-) 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;