From patchwork Thu Sep 14 03:11:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 139270 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp79793vqi; Wed, 13 Sep 2023 20:14:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcdH0HE6LoiO64J2zf685pm9Eb9PHgocdFuyNuhf1ywO2QjM3h2jIm76FDFc5kXF7Ve6Yf X-Received: by 2002:a17:906:cc45:b0:9a5:d095:a8e5 with SMTP id mm5-20020a170906cc4500b009a5d095a8e5mr3275439ejb.37.1694661260043; Wed, 13 Sep 2023 20:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694661260; cv=none; d=google.com; s=arc-20160816; b=ScJsGn54aVafUDXoRldFOdZ9WxmiBKIlV3GPlL3QSGOOK3uanybhaozBlybzuJOZQN kA4dpD8OLLDo8kFFo/dyPE6e3+gVbVyoPTxKnxC245x80OJ7qs/VQjTfj1Qggz/D5nUg MdkSITXzglRI4vJDCl3UgSzbZkCO+8IRl8sjNg+5Q2zAEKo0X+6bdqnu7kn8W5c0KdID kHWVFdbhL12tC8JfpxPeTyRb3J51oKPCoPTrKpJmOxDdHYIp+hA9Fqs1pGCTKTZolNBW gyTLEVve3TDIjeSIuwmDsJRUBz1BIwLIUVgQJVOI2AXwBRQ/MeftCnk/LfgKVB2+1My8 KwNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=mTMQbMfxroKSjB8WIwwg2xt6fQit19HwdedlWzdn2uo=; fh=se0EChbRuDzWeQLxh4ma2F8om/5/For7fEVL6Npc7+A=; b=jfF/hm3v12NEi3XoVd9pRNjCJqEz+pZiX9/HA5n5f5500FukNTkIrBBFDPEraE+Cf6 kk3vJPW6k3IkLFWYLUWR4YsAmM674DO1NY1qVNCQ1UfNF8CfiB9hLgtsM1kgAFXsVqIO kpLa1IjnLvfAk5/mG2DXGEsxIqdT53gse368Dt86qCc1gX/BEca6ARoPBOyiqi7GsxxK NUfFQ+cxHl8NAVm0feQ9GyjXSHk+yGpCUWLSQyNhSSKqoMn8kryYeeXxApEWsjKfWJkl ARJH8KD0vkcS++KN7SYUlwrWBAKMTKOQD8a9YX9JB2URI9PR47eQpJzwLEyuG9idA620 RjSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rpXOR7si; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id rs5-20020a170907036500b0099283fccb49si479307ejb.232.2023.09.13.20.14.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 20:14:20 -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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rpXOR7si; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DF17E3831381 for ; Thu, 14 Sep 2023 03:13:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF17E3831381 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694661186; bh=mTMQbMfxroKSjB8WIwwg2xt6fQit19HwdedlWzdn2uo=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=rpXOR7siNbpqbz8GEPpQswM2RkLvJOV7z/z3C8kGRb7TGRdMHbUwzwHpHq6BeWa7O YDbx6gQ4PcF5WmZpa1q9z/iueDZgwvmO8j39hjEKNGC2O8xUH7eHpM/Wc7fbNGadOx h2QApagYKX/AIjEs8tpII5bmVJ5R5uZd1nmV9J/c= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 09A0D3857C45 for ; Thu, 14 Sep 2023 03:12:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09A0D3857C45 Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38E36bLC031967; Thu, 14 Sep 2023 03:12:10 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t3s7f11dc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Sep 2023 03:12:10 +0000 Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 38E36qIb001496; Thu, 14 Sep 2023 03:12:09 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t3s7f11cw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Sep 2023 03:12:09 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 38E2RMS3023152; Thu, 14 Sep 2023 03:12:08 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3t141nyum1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Sep 2023 03:12:07 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38E3C5XC60817728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Sep 2023 03:12:06 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CF18220049; Thu, 14 Sep 2023 03:12:05 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11B6120040; Thu, 14 Sep 2023 03:12:05 +0000 (GMT) Received: from trout.aus.stglabs.ibm.com (unknown [9.40.194.100]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 14 Sep 2023 03:12:04 +0000 (GMT) To: gcc-patches@gcc.gnu.org Cc: richard.guenther@gmail.com, richard.sandiford@arm.com Subject: [PATCH 04/10] vect: Simplify costing on vectorizable_scan_store Date: Wed, 13 Sep 2023 22:11:53 -0500 Message-Id: <308240b9aff98d1edc15bcba7a2f015e42cdc371.1694657494.git.linkw@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: lY6jVRNfy0m73rHMalfNnBD31Cy1ETJc X-Proofpoint-GUID: fly-IviufND_3jxUv2hNdlsiOlEbObef X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-13_19,2023-09-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 priorityscore=1501 impostorscore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309140025 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kewen Lin via Gcc-patches From: "Kewen.Lin" Reply-To: Kewen Lin Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776981125337941546 X-GMAIL-MSGID: 1776981125337941546 This patch is to simplify the costing on the case vectorizable_scan_store without calling function vect_model_store_cost any more. I considered if moving the costing into function vectorizable_scan_store is a good idea, for doing that, we have to pass several variables down which are only used for costing, and for now we just want to keep the costing as the previous, haven't tried to make this costing consistent with what the transforming does, so I think we can leave it for now. gcc/ChangeLog: * tree-vect-stmts.cc (vectorizable_store): Adjust costing on vectorizable_scan_store without calling vect_model_store_cost any more. --- gcc/tree-vect-stmts.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 3f908242fee..048c14d291c 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -8432,11 +8432,23 @@ vectorizable_store (vec_info *vinfo, else if (STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info) >= 3) { gcc_assert (memory_access_type == VMAT_CONTIGUOUS); + gcc_assert (!slp); if (costing_p) { - vect_model_store_cost (vinfo, stmt_info, ncopies, memory_access_type, - alignment_support_scheme, misalignment, - vls_type, slp_node, cost_vec); + unsigned int inside_cost = 0, prologue_cost = 0; + if (vls_type == VLS_STORE_INVARIANT) + prologue_cost += record_stmt_cost (cost_vec, 1, scalar_to_vec, + stmt_info, 0, vect_prologue); + vect_get_store_cost (vinfo, stmt_info, ncopies, + alignment_support_scheme, misalignment, + &inside_cost, cost_vec); + + if (dump_enabled_p ()) + dump_printf_loc (MSG_NOTE, vect_location, + "vect_model_store_cost: inside_cost = %d, " + "prologue_cost = %d .\n", + inside_cost, prologue_cost); + return true; } return vectorizable_scan_store (vinfo, stmt_info, gsi, vec_stmt, ncopies);