From patchwork Thu Sep 14 03:11:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 13960 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp79635vqi; Wed, 13 Sep 2023 20:13:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEIWqUNkZgyhD40ibhM388Z6r8Nt0ZcDiDzXDaN37xVPb+ea9Bt2NmA0TdUd8fPIYVpfgMo X-Received: by 2002:aa7:cd46:0:b0:52c:9ce1:f117 with SMTP id v6-20020aa7cd46000000b0052c9ce1f117mr3042874edw.40.1694661234663; Wed, 13 Sep 2023 20:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694661234; cv=none; d=google.com; s=arc-20160816; b=dXD7mL2WdtjkC9m1owX3HWFBpPijN8XWfxNo+YsE23v/VgSWbFYaAtCkL1NZHeSBr3 AHsfbq1b10nXYOCkqXnonrVS95dTwKnlXaQcXKJQ12wPJ1DfmMuXkPnMv4pNtV6ExbE2 Ycq0stIe9/gJz9bgN/qvmmCH6eZSj7LyeSXzPj31h4TKwbMA9zcWBKFhILUFknESae92 9VfVO4uQS0RY+1b8Mg5Z55Fiy47LRNgQi1WRHduoUXv3HweNG/zRmocLMkFfh6sL1phC d60cxOgLJ319lBZCiKUK2TKOU92chWZrGk5rUeeOfWu3CDMGKC+fetsEZzrijIJL+qao HcXQ== 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:mime-version :content-transfer-encoding:message-id:date:subject:cc:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=Jq4skqPQ/HoukFiCZJkFvTLenLfzbFdUgxB7FLfjywk=; fh=zWr9GOjhwRk/OR7M019xb4EqVYJlk9tsKbvwqd9am2o=; b=TDmrz09z71Aj+cYUf6hek6576fnd4gh3C3b275/ZWDz5LBQ93vpdaHQ2rXSrAZmbS+ D4sPFUW3MSPp1KtpuY36raRSotW9/WTcnXlewfLRKiWKNRR2RGVFaBWMb6+9zdaaYCFH pJlNBLaVvk+ZiS4yPLlwXyokPO4G2mM+evPXYrH355pmOueivi/j9mp+BUceq9ml+iJ6 DHc0fl9O4z0iOz7W7CYIlmSRhcQ0js3ot0g63BZLzvWeOs/ieFRu1OIcsSM1XM1Sp2s+ GsWDAzq53rJOGOwgR/aIyxK4/iTp+uPvV4UFVrBdLyP9MitKQCdHN6GbOtWM9e1DdcSV TkKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SiEitGNc; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h22-20020aa7c616000000b00529fd6decf9si505747edq.11.2023.09.13.20.13.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 20:13:54 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SiEitGNc; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 3D32638708E7 for ; Thu, 14 Sep 2023 03:12:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D32638708E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694661177; bh=Jq4skqPQ/HoukFiCZJkFvTLenLfzbFdUgxB7FLfjywk=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=SiEitGNc+ELozcRvrZouRA0lLebe2NchTa+Y9l/FyQg+XugExloipoD+CFS+ONJDa 8CA7IW2thIwTTCWKHE22DqxZWR/Jsfi+HTbV8omJE1hsVacvXGCmW0SG7eki53QHA1 PX34XwW9CQweCGip+tkR1EdlEgUfgqTyiDyoh7XI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 0572A3858C20 for ; Thu, 14 Sep 2023 03:12:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0572A3858C20 Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38E36uSD011992; Thu, 14 Sep 2023 03:12:05 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3t3rabj97e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Sep 2023 03:12:05 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 38E378LO014541; Thu, 14 Sep 2023 03:12:04 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 3t3rabj976-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Sep 2023 03:12:04 +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 38E2Htam023099; Thu, 14 Sep 2023 03:12:03 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3t141nyukd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Sep 2023 03:12:03 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38E3C1dO18612750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Sep 2023 03:12:01 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 920382004E; Thu, 14 Sep 2023 03:12:01 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8178320049; Thu, 14 Sep 2023 03:12:00 +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:00 +0000 (GMT) To: gcc-patches@gcc.gnu.org Cc: richard.guenther@gmail.com, richard.sandiford@arm.com, segher@kernel.crashing.org, bergner@linux.ibm.com Subject: [PATCH 00/10] vect: Move costing next to the transform for vect store Date: Wed, 13 Sep 2023 22:11:49 -0500 Message-Id: X-Mailer: git-send-email 2.31.1 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: wq9Dklgo3RUJQPdVdZAxcGBMli5kZ24w X-Proofpoint-ORIG-GUID: oUBPm2-aNQRc5Sgyakl4JgmjY44vLum8 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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 spamscore=0 adultscore=0 mlxscore=0 mlxlogscore=853 malwarescore=0 bulkscore=0 priorityscore=1501 clxscore=1011 phishscore=0 lowpriorityscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309140025 X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, KAM_SHORT, 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: 1776981098474906618 X-GMAIL-MSGID: 1776981098474906618 This patch series is a follow up for the previous patch series for vector load [1]. Some of associated test cases show the benefits of this kind of structuring. Like the one on vect load, this patch series makes costing not call function vect_model_store_cost any more but next to the transform. Most of them are organized according to the memory access types of vector store, hope it can make the review and bisection easy. The changes just follow the handlings in the function vect_model_store_cost first, then refine a bit by referring to the transform code, I also checked them with some typical test cases to verify. The whole series can be bootstrapped and regtested incrementally on: - x86_64-redhat-linux - aarch64-linux-gnu - powerpc64-linux-gnu P7, P8 and P9 - powerpc64le-linux-gnu P8, P9 and P10 By considering the current vector test buckets are mainly tested without cost model, I also verified the whole patch series was neutral for SPEC2017 int/fp on Power9 at O2, O3 and Ofast separately. [1] https://gcc.gnu.org/pipermail/gcc-patches/2023-June/621460.html Kewen Lin (10): vect: Ensure vect store is supported for some VMAT_ELEMENTWISE case vect: Move vect_model_store_cost next to the transform in vectorizable_store vect: Adjust vectorizable_store costing on VMAT_GATHER_SCATTER vect: Simplify costing on vectorizable_scan_store vect: Adjust vectorizable_store costing on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP vect: Adjust vectorizable_store costing on VMAT_LOAD_STORE_LANES vect: Adjust vectorizable_store costing on VMAT_CONTIGUOUS_PERMUTE aarch64: Don't use CEIL for vector_store in aarch64_stp_sequence_cost vect: Get rid of vect_model_store_cost vect: Consider vec_perm costing for VMAT_CONTIGUOUS_REVERSE gcc/config/aarch64/aarch64.cc | 2 +- .../costmodel/ppc/costmodel-vect-store-1.c | 23 + .../costmodel/ppc/costmodel-vect-store-2.c | 29 + gcc/tree-vect-stmts.cc | 717 +++++++++++------- 4 files changed, 493 insertions(+), 278 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-store-1.c create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-store-2.c