From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 26FB138582A4 for ; Tue, 13 Jun 2023 02:07:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 26FB138582A4 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35D27MMO012155; Tue, 13 Jun 2023 02:07:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=keMRaTklrUXZZ7N7PDQTPbhklNbH7OG0DuYBAvO3G2A=; b=r9olg+FUFJSdq5t6TDJhqqy0yfimesfUfTIijpGclLRS/5uWWtkwDDKIqHYWvM9i07YF gwTr/mUOf4ezqrPIfK9RHUPls1fKXN9yqJBvXwbjcqtzFVYM62lNO98lNnH2YrNYsyWk 1LYK3tG/z2tn21V5mMOBNYdJrENqbyPpeHpggUH0QwF3Pw718leAFGhvndfa0KeRCLAI e4B2htbVkIRTSazSSL+29MpQRS5fRpi0B0fqAoGTOADwVleBYVn/1Cn2tMPnw0vwGpkB P4o8NC3GHBzc/6LPXeqPdRdUyjYiocWTQEYLpUd/sKzHClIX68NXwCnIEYZpdpbVkCh+ IQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3r6f3era6n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Jun 2023 02:07:29 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35D27Sir012654; Tue, 13 Jun 2023 02:07:28 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3r6f3era0b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Jun 2023 02:07:27 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35CMjL4H009472; Tue, 13 Jun 2023 02:03:44 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3r4gt51upq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Jun 2023 02:03:44 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35D23guc61931916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Jun 2023 02:03:42 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 192FC20040; Tue, 13 Jun 2023 02:03:42 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 220F920043; Tue, 13 Jun 2023 02:03:41 +0000 (GMT) Received: from trout.aus.stglabs.ibm.com (unknown [9.40.194.100]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 13 Jun 2023 02:03:40 +0000 (GMT) From: Kewen Lin 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 0/9] vect: Move costing next to the transform for vect load Date: Mon, 12 Jun 2023 21:03:21 -0500 Message-Id: X-Mailer: git-send-email 2.31.1 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: QFn4w2O1cggRrfB9HLbGFagtUyJNqEhh X-Proofpoint-ORIG-GUID: 3OjwRguwwjvR6yCyDVvnXo2issTxP_X8 Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-12_18,2023-06-12_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 spamscore=0 malwarescore=0 adultscore=0 suspectscore=0 mlxlogscore=893 clxscore=1015 impostorscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306130016 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_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,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 List-Id: This patch series follows Richi's suggestion at the link [1], which suggest structuring vectorizable_load to make costing next to the transform, in order to make it easier to keep costing and the transform in sync. For now, it's a known issue that what we cost can be inconsistent with what we transform, as the case in PR82255 and some other associated test cases in the patches of this series show. Basically this patch series makes costing not call function vect_model_load_cost any more. To make the review and bisection easy, I organized the changes according to the memory access types of vector load. For each memory access type, firstly it follows the handlings in the function vect_model_load_costto avoid any missing, then refines further by referring to the transform code, I also checked them with some typical test cases to verify. Hope the subjects of patches are clear enough. 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/2021-January/563624.html Kewen Lin (9): vect: Move vect_model_load_cost next to the transform in vectorizable_load vect: Adjust vectorizable_load costing on VMAT_GATHER_SCATTER && gs_info.decl vect: Adjust vectorizable_load costing on VMAT_INVARIANT vect: Adjust vectorizable_load costing on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP vect: Adjust vectorizable_load costing on VMAT_GATHER_SCATTER vect: Adjust vectorizable_load costing on VMAT_LOAD_STORE_LANES vect: Adjust vectorizable_load costing on VMAT_CONTIGUOUS_REVERSE vect: Adjust vectorizable_load costing on VMAT_CONTIGUOUS_PERMUTE vect: Adjust vectorizable_load costing on VMAT_CONTIGUOUS .../vect/costmodel/ppc/costmodel-pr82255.c | 31 + .../costmodel/ppc/costmodel-vect-reversed.c | 22 + gcc/testsuite/gcc.target/i386/pr70021.c | 2 +- gcc/tree-vect-stmts.cc | 651 ++++++++++-------- 4 files changed, 432 insertions(+), 274 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr82255.c create mode 100644 gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-reversed.c -- 2.31.1