From patchwork Thu Jul 11 08:51:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Xue OS X-Patchwork-Id: 1959158 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.a=rsa-sha256 header.s=selector2 header.b=ij0z4RGT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WKT4h6hdSz1xpd for ; Thu, 11 Jul 2024 18:52:20 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2CB9D384A438 for ; Thu, 11 Jul 2024 08:52:19 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from CY4PR05CU001.outbound.protection.outlook.com (mail-westcentralusazlp170100000.outbound.protection.outlook.com [IPv6:2a01:111:f403:c112::]) by sourceware.org (Postfix) with ESMTPS id 16D943858D3C for ; Thu, 11 Jul 2024 08:51:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 16D943858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=os.amperecomputing.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=os.amperecomputing.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 16D943858D3C Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c112:: ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1720687907; cv=pass; b=VNsURP7uwcrwkw1oMU1PrV+8/fKko1P68tgvj9SiSKayQg/Tv3GJmpTg0QcfHQG5zlsWjl4A+XmsetkYnmuW0nNSmqH4+Yxb/Pm4KYWK5NlpfcMgaIPW8zwPRkuw/sYOujKM+xBA/CHid38zMLjU+et4HMwXkBKQhuFfiD/4Aj4= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1720687907; c=relaxed/simple; bh=rvNPcS8LDcIKRqX7XQimbrcNU98KC5QXrg6oOUgh2JA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KlL98iwytXhqBHQoxz3AS9n2e+qbfVba6SjsGeL/ID887bPX2X0/P+fmTVu44C0xm7hDkHN+afp8rkdKIQygAm8ccifANLQOagKvHACOACTdtgX77Ke+zQYK7WV7YXpqAJuxYLpsQSn70fPiCS3sHnkYcqauUmCf+vl/FTalTFk= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MJIK6qtjteF7F+vpXzmpSL0dtnJZYf64VM6sOSR/cwzuyKS/CGjOKGp18QL4nU+wuoR0n0B7ymeEOptIfN2Zn6BpF4Dl1kS/87RqTt26rANx/gEue/jSYwzBma45MAEmyhQdocrtAlxd0A5oGhEGkrUJDy/nXpLN8BoLPokcz9K9J5pzwPDLBw++M9mt33LQvaj6XrU9tc+pDfJM1WVhKL2X2KDKmDbsS4HOdar+L6kDDku1o2r8TcWrgCyl9aXw7reSCnz69FEbzXD2kNmAppLWem0pZbi5v8WZ9/tAyDSSPtYGaGB9cRYApLZTU/bbcEB94vpPEbwmkUCPs4jyMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hsVdKH7GmQ6DnTRhHupWHKR64BlgYPglPMleDZ9KhJ8=; b=wAOqCA0/2OcIkKC+EzFUw/uleKqWJji4l6q/mMWwhRhECLxwjBe6dk4P08MgEPXLqWLd1HHS8V9LYDT49FvcV0oPVOOfE8H6w80VMRBCDP9KYPjY7rq971fPc6kbscJYaDxPzFCDFFHAWKxAI5OlQyU10SpK+7UqhhCo2Ha3WbR1bcLgexG0K62LFP4C0lpcagUEXVqm5wNAqC6R5c4LeIUxLXv4z7XI+wXdFUC14yMFxcP3qR91MLQcs9ZAxt/Qv4zGwHDeYiE/LheX+nifqBdsXXZCKKNNCuPHGAkujvZZJHn0Maw7aRM8MMufyUcY2TF5zMQYvHX5cfiQinhYkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hsVdKH7GmQ6DnTRhHupWHKR64BlgYPglPMleDZ9KhJ8=; b=ij0z4RGTCYcX4Bhfrn65N/v2V+Dl1KqNcgfp70N56Qc5gqxScAqetLfOByW5GqC4DDeCAbsu5N94BfE/TO5nbFKz2UYLmMDxeRXjgjQpN2D54xpTaVgeebXjBKJ/o7zqFykYTYx2Oso4SPekPqbQkpzQtHjBQZ2ssyCXk+z/O8c= Received: from LV2PR01MB7839.prod.exchangelabs.com (2603:10b6:408:14f::13) by IA0PR01MB8569.prod.exchangelabs.com (2603:10b6:208:487::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.22; Thu, 11 Jul 2024 08:51:35 +0000 Received: from LV2PR01MB7839.prod.exchangelabs.com ([fe80::2ac3:5a77:36fd:9c63]) by LV2PR01MB7839.prod.exchangelabs.com ([fe80::2ac3:5a77:36fd:9c63%4]) with mapi id 15.20.7741.033; Thu, 11 Jul 2024 08:51:35 +0000 From: Feng Xue OS To: Richard Biener , "gcc-patches@gcc.gnu.org" Subject: [PATCH 1/4] vect: Shorten name of macro SLP_TREE_NUMBER_OF_VEC_STMTS Thread-Topic: [PATCH 1/4] vect: Shorten name of macro SLP_TREE_NUMBER_OF_VEC_STMTS Thread-Index: AQHa025r87blfFCaJEKW6yaQ6TZ+dQ== Date: Thu, 11 Jul 2024 08:51:35 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Enabled=True; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_SiteId=3bc2b170-fd94-476d-b0ce-4229bdc904a7; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_SetDate=2024-07-11T08:51:34.688Z; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Name=Confidential; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_ContentBits=0; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Method=Standard; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV2PR01MB7839:EE_|IA0PR01MB8569:EE_ x-ms-office365-filtering-correlation-id: 882bfbcd-daf9-4fc4-03ab-08dca186ab44 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?gAUaRR53SyLC09auuYSZVdKPbm?= =?iso-8859-1?q?K3QEbz8LGdfVfUM2HARlA4qis4DW62TB3/+v7XQlMcadix20Tl6BkqhEn+Nr?= =?iso-8859-1?q?S2WNnbxAUyGwBXWtZQVHsVR/zzPlgSLmm1xYUEGagRfRPdhw0nGLlf8tC/MY?= =?iso-8859-1?q?WEHwTBLkm23IGWg0Q6ofrLi6PJrSXbatVAX9U1zM68RWXIn+2D4e/GSEBz5m?= =?iso-8859-1?q?CwN+cpyza6YCA4v6v83b5ysSY4wCAOk8TkHVzl98cTgnBcKCzt7PeGCr0y6i?= =?iso-8859-1?q?e9Fj064cyY36l7EdJ1Q4h1AeFEkhN4IU1T9jgr8GRmJngs1JUFPzB6ne2jNJ?= =?iso-8859-1?q?znE8BhLZL5s3MHfNY+aCqVea+4MOFGYUpzOLroemfFmq6hBeoaYWW0H31/3V?= =?iso-8859-1?q?2GEUywHM47MF05AVJgLjW6+31O2oLYg8RLm4mHwt13/CSwPAERCR1k8UFfyu?= =?iso-8859-1?q?bGCM7Yoch6a5ee7vcYReHIlQIM+eQF+ONdcT12YR/VcVWGcvjQbfla6G46oI?= =?iso-8859-1?q?XTj3dBoDlJD1MIEjiopKGYKMCnOXySdxEJzIZuW+nsbyr/PiFWK9xzqIZvqs?= =?iso-8859-1?q?1kY4VI/agPUqEZOFy4xIZqrKvXzpXo9Eh68QgSWwXEIXSAnn+wt3mp3/69OC?= =?iso-8859-1?q?xwWBrxx6lrYna9Y3nFnG1gM0eE+1ft7S/HCwmkDSafeUxaWeV3DzXkyvsbvN?= =?iso-8859-1?q?Okf2Dyh2NYznTNRtCGOW+WQ8J7o+jZdZlH1+YqdKAkL7g+Juwkb0oamjIXBE?= =?iso-8859-1?q?S+YdbihKVyRatSTt6lLBGns6Q6iY9zDG+eg8hXFtps/Z2ewQ8StWo4XHaOkh?= =?iso-8859-1?q?ha2RU9vTBtW5ZrrUYXpTx8p8EpvAXXYR6hW3RfBi5CX65B1PxI/CzEO7G5Z+?= =?iso-8859-1?q?xUL42mGrvpYNT9nFD1YJzQKygtSD8kTcYzqNPYK6Svqt5CgAyrGz5kXLdV/b?= =?iso-8859-1?q?j8ri3Z5wRjgkSY2++TuWKWHFPD5qMK3Kn/VA8701uMoOO1/nY0MHyTwqeEk8?= =?iso-8859-1?q?VILVdqpFUM7Z7tsM6pQodLB0wHaOd6ujRU2riRwHql9OyPop6n/bXtWaOMKB?= =?iso-8859-1?q?JZwwz4o66fu3oJDfVghvwmA3DznWJ4H+BBhKLEHCZ/WElH+c1HDn9jC3PnGF?= =?iso-8859-1?q?S3MwxPEpiz7N4xbBA7IYSMNaNPHDQLYxdTpZI1LVaT7aXgj9QJKwrGl2H+28?= =?iso-8859-1?q?7qlgN/fDmEu+NZsK8+K5vqUz5E21q1ulr76HGwNk+U+X4/0WI1cbLGnMVRcR?= =?iso-8859-1?q?9t+smZWeJr30Rz2igv+0d5kozuhBb1rgG+wMoB0RFYOBtxwVGnHgBZgdoOC6?= =?iso-8859-1?q?hlL0F5PqCQid18oLV6MMjQXuY3EHORxpW0BZeJq04BTsDLoENSauQGS2IOmn?= =?iso-8859-1?q?pxiGfybGludnPoXwCHs3pfF3MP03DWYNsYmQWm2mlQ79r2dQL5+EMpelvhJ1?= =?iso-8859-1?q?yJJOaoYhlB/Rw22Tl6oVpsBg=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LV2PR01MB7839.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?EBZehOOukZVc04dD4T/eRti?= =?iso-8859-1?q?hvQLmqdoj+UuExUh1R8tnv1o5DisNBZ35QC7rIUqP9+TuVJLHLTNqbkl9D/2?= =?iso-8859-1?q?QK2FdIDwmR4IE6k/gaSXEiSA0Fc8a1v8VeJmxz4me3Io3Jvy03INwPpL5vm0?= =?iso-8859-1?q?EuFWPOs//ekYKlwwmFN8nuWHvsMx8Ff1kPXYwTG1jHKG+zXbOMo/pheidGm8?= =?iso-8859-1?q?XLiE+/9mQUnx0aTCDAGEhD298x81PKbj0Fmpx3IE4mSQourxFtqtRj62LgdM?= =?iso-8859-1?q?LsYjlMBMZR9HC4VT1vD9mzWKU3U8MBCREozMTJkDQOVOtDdRSqmZhWwedecU?= =?iso-8859-1?q?qXBFNx/brK3ofusnogyNA2phDUqihFjNVpbjPslVRcKxmmMcCGt3Jm/yZ/FB?= =?iso-8859-1?q?sHqJfQuYJkuoDfkoAo/r9E/VhYntRyBUbsH0f+E75og7c7Ox/kuXWd/X1SpL?= =?iso-8859-1?q?h1lp6PkGWjzBRc/0zdfGHGCuUa8006OkeccZqy876zp2kHZgkAxvmZ2lC/Yx?= =?iso-8859-1?q?orzPaGNSnIwPcTClZENKh48RhufghtU4hUHBbns6DQH1VZTFd/S7a5XUwbTs?= =?iso-8859-1?q?CM8TEtQqdX3/TtFy0XoWdTjAozBo61qj1GoAw2kzeNUvrYNPxdjj8ul6Bf+3?= =?iso-8859-1?q?Tzc0XGMAvBqmfLkPazu3L9b8wHStuxEmGCADyaIm3WQK/MJ2LXtI7iPnSHNa?= =?iso-8859-1?q?ZPtshopQzDxo+HyEsRYTDl8dq636m3P5XWGJZw6K2vYIrIxxreP/k2DU/Hs0?= =?iso-8859-1?q?gvhWbx8+dy9Jf46+f5LuSDZE4WauL1Nh5Hg+XokIk6+5RVtSFn8isfjOyjDO?= =?iso-8859-1?q?DFOpe4xdV0hFUNWUlW7UHogPT/Rvo4YSwncICW6meCUkYDz/so/h5PVGHmmc?= =?iso-8859-1?q?J0OB+Lr3EFo5C0BxNH0iHz5Hxse2GKExmrI/J8v0sexVggz7KNY3DYWxv6G7?= =?iso-8859-1?q?lM5WmpX8U07ekk09XDxXD9rFVXku/pY+uARTegKGgADM+sq3rlS8GgYdLAgW?= =?iso-8859-1?q?45HbLp81yIaWdkonavhoc3nsDxVMniXs2mPOxxkV2iXIABn6R2vWIZC2ilHt?= =?iso-8859-1?q?kgENO1HZ/b8G58udPab/2FkTYmEwaPdi7Wcv6mFOLv3KxC1WhI1ffEPLvQhr?= =?iso-8859-1?q?iNVDufciCSkpXcOuv0u8Rt5dhxanw/gusOGlkf/aJvcv4heeOIBVskw5ERip?= =?iso-8859-1?q?M9Lb5+lr1MMnsquUs027WieYd2gTpIgWYfaoBdUbylF5GQ5U4Cl+u+wr2C3t?= =?iso-8859-1?q?ZDeu2HyTHQB5ndrRAbrsDoKOHJwc7VLxIRChoOG1OlgNbGHg4udvRI7RdkWj?= =?iso-8859-1?q?CDIMpsczn3vBlDLoAzW8C7fNPUKKsh3FOO+XYp0ESoSFJLloC5zleStGH7U6?= =?iso-8859-1?q?ny5++E48pfb6VlAvDsuHL+tC94JLOdVVcpQrj8qF2PeuAy+pbo1PT0ZDc2VG?= =?iso-8859-1?q?UvkwOeT1nZh78rPRFT7rUAxXJ1lFCZKxEQ4CxPBx4IdnBiNPd1BGDWKzL/du?= =?iso-8859-1?q?+wbPQyE8C7ycbsDuFFrP1SVOFKBnluBTFEQKL2YlBYIBxyPGa/qOmmQU6QmL?= =?iso-8859-1?q?gdCqxXHu9Nb+pSOR0CV/A2zS8K8pzE4wDmUFzkaOExUhoNj0zntsZx3eGAsv?= =?iso-8859-1?q?PBcTnbOeeSNRM2HH4?= MIME-Version: 1.0 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV2PR01MB7839.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 882bfbcd-daf9-4fc4-03ab-08dca186ab44 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jul 2024 08:51:35.0799 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: uDDub+qkEtyljQ8mG5Ipqy2Ez+FlhOAkZPBXRN1HY9Enw+lDDT+FCbegYvluOGwY/jLkvKK4vStymzrv8QzTFKDztmmMb2jxPA5+FKXCHPg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR01MB8569 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, 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: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org This patch series are recomposed and split from https://gcc.gnu.org/pipermail/gcc-patches/2024-June/655974.html. As I will add a new field tightly coupled with "vec_stmts_size", if following naming conversion as original, the new macro would be very long. So better to choose samely meaningful but shorter names, the patch makes change for this macro, the other new patch would handle the new field and macro accordingly as this. Thanks, Feng --- gcc/ * tree-vectorizer.h (SLP_TREE_NUMBER_OF_VEC_STMTS): Change the macro to SLP_TREE_VEC_STMTS_NUM. * tree-vect-stmts.cc (vect_model_simple_cost): Likewise. (check_load_store_for_partial_vectors): Likewise. (vectorizable_bswap): Likewise. (vectorizable_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_shift): Likewise. And replace direct field reference to "vec_stmts_size" with the new macro. (vectorizable_operation): Likewise. (vectorizable_store): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. * tree-vect-loop.cc (vect_reduction_update_partial_vector_usage): Likewise. (vectorizable_reduction): Likewise. (vect_transform_reduction): Likewise. (vectorizable_phi): Likewise. (vectorizable_recurr): Likewise. (vectorizable_induction): Likewise. (vectorizable_live_operation): Likewise. * tree-vect-slp.cc (_slp_tree::_slp_tree): Likewise. (vect_slp_analyze_node_operations_1): Likewise. (vect_prologue_cost_for_slp): Likewise. (vect_slp_analyze_node_operations): Likewise. (vect_create_constant_vectors): Likewise. (vect_get_slp_vect_def): Likewise. (vect_transform_slp_perm_load_1): Likewise. (vectorizable_slp_permutation_1): Likewise. (vect_schedule_slp_node): Likewise. (vectorize_slp_instance_root_stmt): Likewise. --- gcc/tree-vect-loop.cc | 17 +++++++------- gcc/tree-vect-slp.cc | 34 +++++++++++++-------------- gcc/tree-vect-stmts.cc | 52 ++++++++++++++++++++---------------------- gcc/tree-vectorizer.h | 2 +- 4 files changed, 51 insertions(+), 54 deletions(-) From 8e8d034ce3ea72e7e8ba9e6821f7ad83c7d216d3 Mon Sep 17 00:00:00 2001 From: Feng Xue Date: Mon, 1 Jul 2024 15:39:05 +0800 Subject: [PATCH 1/4] vect: Shorten name of macro SLP_TREE_NUMBER_OF_VEC_STMTS Will add a new field tightly coupled with "vec_stmts_size", if following naming conversion as original, the new macro would be very long. So better to choose samely meaningful but shorter names, the patch makes change for this macro, the other new patch would handle the new field and macro accordingly as this. 2024-07-01 Feng Xue gcc/ * tree-vectorizer.h (SLP_TREE_NUMBER_OF_VEC_STMTS): Change the macro to SLP_TREE_VEC_STMTS_NUM. * tree-vect-stmts.cc (vect_model_simple_cost): Likewise. (check_load_store_for_partial_vectors): Likewise. (vectorizable_bswap): Likewise. (vectorizable_call): Likewise. (vectorizable_conversion): Likewise. (vectorizable_shift): Likewise. And replace direct field reference to "vec_stmts_size" with the new macro. (vectorizable_operation): Likewise. (vectorizable_store): Likewise. (vectorizable_load): Likewise. (vectorizable_condition): Likewise. * tree-vect-loop.cc (vect_reduction_update_partial_vector_usage): Likewise. (vectorizable_reduction): Likewise. (vect_transform_reduction): Likewise. (vectorizable_phi): Likewise. (vectorizable_recurr): Likewise. (vectorizable_induction): Likewise. (vectorizable_live_operation): Likewise. * tree-vect-slp.cc (_slp_tree::_slp_tree): Likewise. (vect_slp_analyze_node_operations_1): Likewise. (vect_prologue_cost_for_slp): Likewise. (vect_slp_analyze_node_operations): Likewise. (vect_create_constant_vectors): Likewise. (vect_get_slp_vect_def): Likewise. (vect_transform_slp_perm_load_1): Likewise. (vectorizable_slp_permutation_1): Likewise. (vect_schedule_slp_node): Likewise. (vectorize_slp_instance_root_stmt): Likewise. --- gcc/tree-vect-loop.cc | 17 +++++++------- gcc/tree-vect-slp.cc | 34 +++++++++++++-------------- gcc/tree-vect-stmts.cc | 52 ++++++++++++++++++++---------------------- gcc/tree-vectorizer.h | 2 +- 4 files changed, 51 insertions(+), 54 deletions(-) diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index a64b5082bd1..c183e2b6068 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -7471,7 +7471,7 @@ vect_reduction_update_partial_vector_usage (loop_vec_info loop_vinfo, unsigned nvectors; if (slp_node) - nvectors = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + nvectors = SLP_TREE_VEC_STMTS_NUM (slp_node); else nvectors = vect_get_num_copies (loop_vinfo, vectype_in); @@ -8121,7 +8121,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo, || reduction_type == CONST_COND_REDUCTION || reduction_type == EXTRACT_LAST_REDUCTION) && slp_node - && SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) > 1) + && SLP_TREE_VEC_STMTS_NUM (slp_node) > 1) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, @@ -8600,7 +8600,7 @@ vect_transform_reduction (loop_vec_info loop_vinfo, if (slp_node) { ncopies = 1; - vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + vec_num = SLP_TREE_VEC_STMTS_NUM (slp_node); } else { @@ -9196,7 +9196,7 @@ vectorizable_phi (vec_info *, for the scalar and the vector PHIs. This avoids artificially favoring the vector path (but may pessimize it in some cases). */ if (gimple_phi_num_args (as_a (stmt_info->stmt)) > 1) - record_stmt_cost (cost_vec, SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node), + record_stmt_cost (cost_vec, SLP_TREE_VEC_STMTS_NUM (slp_node), vector_stmt, stmt_info, vectype, 0, vect_body); STMT_VINFO_TYPE (stmt_info) = phi_info_type; return true; @@ -9304,7 +9304,7 @@ vectorizable_recurr (loop_vec_info loop_vinfo, stmt_vec_info stmt_info, tree vectype = STMT_VINFO_VECTYPE (stmt_info); unsigned ncopies; if (slp_node) - ncopies = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + ncopies = SLP_TREE_VEC_STMTS_NUM (slp_node); else ncopies = vect_get_num_copies (loop_vinfo, vectype); poly_int64 nunits = TYPE_VECTOR_SUBPARTS (vectype); @@ -10217,8 +10217,7 @@ vectorizable_induction (loop_vec_info loop_vinfo, } /* loop cost for vec_loop. */ inside_cost - = record_stmt_cost (cost_vec, - SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node), + = record_stmt_cost (cost_vec, SLP_TREE_VEC_STMTS_NUM (slp_node), vector_stmt, stmt_info, 0, vect_body); /* prologue cost for vec_init (if not nested) and step. */ prologue_cost = record_stmt_cost (cost_vec, 1 + !nested_in_vect_loop, @@ -10289,7 +10288,7 @@ vectorizable_induction (loop_vec_info loop_vinfo, } /* Now generate the IVs. */ - unsigned nvects = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + unsigned nvects = SLP_TREE_VEC_STMTS_NUM (slp_node); gcc_assert ((const_nunits * nvects) % group_size == 0); unsigned nivs; if (nested_in_vect_loop) @@ -10949,7 +10948,7 @@ vectorizable_live_operation (vec_info *vinfo, stmt_vec_info stmt_info, all the slp vectors. Calculate which slp vector it is and the index within. */ int num_scalar = SLP_TREE_LANES (slp_node); - int num_vec = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + int num_vec = SLP_TREE_VEC_STMTS_NUM (slp_node); poly_uint64 pos = (num_vec * nunits) - num_scalar + slp_index; /* Calculate which vector contains the result, and which lane of diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index d0a8531fd3b..00863398fd0 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -113,7 +113,7 @@ _slp_tree::_slp_tree () SLP_TREE_SCALAR_STMTS (this) = vNULL; SLP_TREE_SCALAR_OPS (this) = vNULL; SLP_TREE_VEC_DEFS (this) = vNULL; - SLP_TREE_NUMBER_OF_VEC_STMTS (this) = 0; + SLP_TREE_VEC_STMTS_NUM (this) = 0; SLP_TREE_CHILDREN (this) = vNULL; SLP_TREE_LOAD_PERMUTATION (this) = vNULL; SLP_TREE_LANE_PERMUTATION (this) = vNULL; @@ -6567,8 +6567,8 @@ vect_slp_analyze_node_operations_1 (vec_info *vinfo, slp_tree node, for (unsigned i = 0; i < SLP_TREE_CHILDREN (node).length (); ++i) if (SLP_TREE_DEF_TYPE (SLP_TREE_CHILDREN (node)[i]) == vect_internal_def) { - SLP_TREE_NUMBER_OF_VEC_STMTS (node) - = SLP_TREE_NUMBER_OF_VEC_STMTS (SLP_TREE_CHILDREN (node)[i]); + SLP_TREE_VEC_STMTS_NUM (node) + = SLP_TREE_VEC_STMTS_NUM (SLP_TREE_CHILDREN (node)[i]); break; } } @@ -6581,7 +6581,7 @@ vect_slp_analyze_node_operations_1 (vec_info *vinfo, slp_tree node, vf = 1; unsigned int group_size = SLP_TREE_LANES (node); tree vectype = SLP_TREE_VECTYPE (node); - SLP_TREE_NUMBER_OF_VEC_STMTS (node) + SLP_TREE_VEC_STMTS_NUM (node) = vect_get_num_vectors (vf * group_size, vectype); } @@ -6704,13 +6704,13 @@ vect_prologue_cost_for_slp (slp_tree node, unsigned HOST_WIDE_INT const_nunits; unsigned nelt_limit; auto ops = &SLP_TREE_SCALAR_OPS (node); - auto_vec starts (SLP_TREE_NUMBER_OF_VEC_STMTS (node)); + auto_vec starts (SLP_TREE_VEC_STMTS_NUM (node)); if (TYPE_VECTOR_SUBPARTS (vectype).is_constant (&const_nunits) && ! multiple_p (const_nunits, group_size)) { nelt_limit = const_nunits; hash_set vector_ops; - for (unsigned int i = 0; i < SLP_TREE_NUMBER_OF_VEC_STMTS (node); ++i) + for (unsigned int i = 0; i < SLP_TREE_VEC_STMTS_NUM (node); ++i) if (!vector_ops.add ({ ops, i * const_nunits, const_nunits })) starts.quick_push (i * const_nunits); } @@ -6855,7 +6855,7 @@ vect_slp_analyze_node_operations (vec_info *vinfo, slp_tree node, poly_uint64 vf = 1; if (loop_vec_info loop_vinfo = dyn_cast (vinfo)) vf = loop_vinfo->vectorization_factor; - SLP_TREE_NUMBER_OF_VEC_STMTS (child) + SLP_TREE_VEC_STMTS_NUM (child) = vect_get_num_vectors (vf * group_size, vector_type); /* And cost them. */ vect_prologue_cost_for_slp (child, cost_vec); @@ -8750,7 +8750,7 @@ vect_create_constant_vectors (vec_info *vinfo, slp_tree op_node) /* We always want SLP_TREE_VECTYPE (op_node) here correctly set. */ vector_type = SLP_TREE_VECTYPE (op_node); - unsigned int number_of_vectors = SLP_TREE_NUMBER_OF_VEC_STMTS (op_node); + unsigned int number_of_vectors = SLP_TREE_VEC_STMTS_NUM (op_node); SLP_TREE_VEC_DEFS (op_node).create (number_of_vectors); auto_vec voprnds (number_of_vectors); @@ -8956,7 +8956,7 @@ vect_get_slp_vect_def (slp_tree slp_node, unsigned i) void vect_get_slp_defs (slp_tree slp_node, vec *vec_defs) { - vec_defs->create (SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node)); + vec_defs->create (SLP_TREE_VEC_STMTS_NUM (slp_node)); vec_defs->splice (SLP_TREE_VEC_DEFS (slp_node)); } @@ -9010,7 +9010,7 @@ vect_transform_slp_perm_load_1 (vec_info *vinfo, slp_tree node, mode = TYPE_MODE (vectype); poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype); - unsigned int nstmts = SLP_TREE_NUMBER_OF_VEC_STMTS (node); + unsigned int nstmts = SLP_TREE_VEC_STMTS_NUM (node); /* Initialize the vect stmts of NODE to properly insert the generated stmts later. */ @@ -9210,7 +9210,7 @@ vect_transform_slp_perm_load_1 (vec_info *vinfo, slp_tree node, if (n_loads) { if (repeating_p) - *n_loads = SLP_TREE_NUMBER_OF_VEC_STMTS (node); + *n_loads = SLP_TREE_VEC_STMTS_NUM (node); else { /* Enforced above when !repeating_p. */ @@ -9445,7 +9445,7 @@ vectorizable_slp_permutation_1 (vec_info *vinfo, gimple_stmt_iterator *gsi, that we use for permutes requires 3n elements. */ npatterns = SLP_TREE_LANES (node); nelts_per_pattern = ncopies = 3; - noutputs_per_mask = SLP_TREE_NUMBER_OF_VEC_STMTS (node); + noutputs_per_mask = SLP_TREE_VEC_STMTS_NUM (node); } else { @@ -9691,8 +9691,8 @@ vect_schedule_slp_node (vec_info *vinfo, stmt_vec_info stmt_info = SLP_TREE_REPRESENTATIVE (node); - gcc_assert (SLP_TREE_NUMBER_OF_VEC_STMTS (node) != 0); - SLP_TREE_VEC_DEFS (node).create (SLP_TREE_NUMBER_OF_VEC_STMTS (node)); + gcc_assert (SLP_TREE_VEC_STMTS_NUM (node) != 0); + SLP_TREE_VEC_DEFS (node).create (SLP_TREE_VEC_STMTS_NUM (node)); if (SLP_TREE_CODE (node) != VEC_PERM_EXPR && STMT_VINFO_DATA_REF (stmt_info)) @@ -9951,7 +9951,7 @@ vectorize_slp_instance_root_stmt (slp_tree node, slp_instance instance) if (instance->kind == slp_inst_kind_ctor) { - if (SLP_TREE_NUMBER_OF_VEC_STMTS (node) == 1) + if (SLP_TREE_VEC_STMTS_NUM (node) == 1) { tree vect_lhs = SLP_TREE_VEC_DEFS (node)[0]; tree root_lhs = gimple_get_lhs (instance->root_stmts[0]->stmt); @@ -9961,9 +9961,9 @@ vectorize_slp_instance_root_stmt (slp_tree node, slp_instance instance) vect_lhs); rstmt = gimple_build_assign (root_lhs, vect_lhs); } - else if (SLP_TREE_NUMBER_OF_VEC_STMTS (node) > 1) + else if (SLP_TREE_VEC_STMTS_NUM (node) > 1) { - int nelts = SLP_TREE_NUMBER_OF_VEC_STMTS (node); + int nelts = SLP_TREE_VEC_STMTS_NUM (node); tree child_def; int j; vec *v; diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index fdcda0d2aba..16af1421204 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -890,7 +890,7 @@ vect_model_simple_cost (vec_info *, /* ??? Somehow we need to fix this at the callers. */ if (node) - ncopies = SLP_TREE_NUMBER_OF_VEC_STMTS (node); + ncopies = SLP_TREE_VEC_STMTS_NUM (node); if (!node) /* Cost the "broadcast" of a scalar operand in to a vector operand. @@ -1508,7 +1508,7 @@ check_load_store_for_partial_vectors (loop_vec_info loop_vinfo, tree vectype, unsigned int nvectors; if (slp_node) - nvectors = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + nvectors = SLP_TREE_VEC_STMTS_NUM (slp_node); else nvectors = vect_get_num_copies (loop_vinfo, vectype); @@ -3084,8 +3084,7 @@ vectorizable_bswap (vec_info *vinfo, record_stmt_cost (cost_vec, 1, vector_stmt, stmt_info, 0, vect_prologue); record_stmt_cost (cost_vec, - slp_node - ? SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) : ncopies, + slp_node ? SLP_TREE_VEC_STMTS_NUM (slp_node) : ncopies, vec_perm, stmt_info, 0, vect_body); return true; } @@ -3459,9 +3458,7 @@ vectorizable_call (vec_info *vinfo, else { unsigned int nvectors - = (slp_node - ? SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) - : ncopies); + = (slp_node ? SLP_TREE_VEC_STMTS_NUM (slp_node) : ncopies); tree scalar_mask = NULL_TREE; if (mask_opno >= 0) scalar_mask = gimple_call_arg (stmt_info->stmt, mask_opno); @@ -5585,7 +5582,7 @@ vectorizable_conversion (vec_info *vinfo, STMT_VINFO_TYPE (stmt_info) = type_demotion_vec_info_type; /* The final packing step produces one vector result per copy. */ unsigned int nvectors - = (slp_node ? SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) : ncopies); + = (slp_node ? SLP_TREE_VEC_STMTS_NUM (slp_node) : ncopies); vect_model_promotion_demotion_cost (stmt_info, dt, nvectors, multi_step_cvt, cost_vec, widen_arith); @@ -5598,7 +5595,7 @@ vectorizable_conversion (vec_info *vinfo, so >> MULTI_STEP_CVT divides by 2^(number of steps - 1). */ unsigned int nvectors = (slp_node - ? SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) >> multi_step_cvt + ? SLP_TREE_VEC_STMTS_NUM (slp_node) >> multi_step_cvt : ncopies * 2); vect_model_promotion_demotion_cost (stmt_info, dt, nvectors, multi_step_cvt, cost_vec, @@ -6204,7 +6201,7 @@ vectorizable_shift (vec_info *vinfo, scalar shift operand but code-generation below simply always takes the first. */ if (dt[1] == vect_internal_def - && maybe_ne (nunits_out * SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node), + && maybe_ne (nunits_out * SLP_TREE_VEC_STMTS_NUM (slp_node), stmts.length ())) scalar_shift_arg = false; } @@ -6377,6 +6374,8 @@ vectorizable_shift (vec_info *vinfo, TREE_TYPE (vectype), NULL); } + unsigned vec_num = slp_node ? SLP_TREE_VEC_STMTS_NUM (slp_node) : ncopies; + /* Handle def. */ vec_dest = vect_create_destination_var (scalar_dest, vectype); @@ -6393,15 +6392,14 @@ vectorizable_shift (vec_info *vinfo, dump_printf_loc (MSG_NOTE, vect_location, "operand 1 using scalar mode.\n"); vec_oprnd1 = op1; - vec_oprnds1.create (slp_node ? slp_node->vec_stmts_size : ncopies); + vec_oprnds1.create (vec_num); vec_oprnds1.quick_push (vec_oprnd1); /* Store vec_oprnd1 for every vector stmt to be created. We check during the analysis that all the shift arguments are the same. TODO: Allow different constants for different vector stmts generated for an SLP instance. */ - for (k = 0; - k < (slp_node ? slp_node->vec_stmts_size - 1 : ncopies - 1); k++) + for (k = 0; k < vec_num - 1; k++) vec_oprnds1.quick_push (vec_oprnd1); } } @@ -6416,8 +6414,8 @@ vectorizable_shift (vec_info *vinfo, !loop_vinfo ? gsi : NULL); vec_oprnd1 = vect_init_vector (vinfo, stmt_info, op1, vectype, !loop_vinfo ? gsi : NULL); - vec_oprnds1.create (slp_node->vec_stmts_size); - for (k = 0; k < slp_node->vec_stmts_size; k++) + vec_oprnds1.create (vec_num); + for (k = 0; k < vec_num; k++) vec_oprnds1.quick_push (vec_oprnd1); } else if (dt[1] == vect_constant_def) @@ -6680,7 +6678,7 @@ vectorizable_operation (vec_info *vinfo, if (slp_node) { ncopies = 1; - vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + vec_num = SLP_TREE_VEC_STMTS_NUM (slp_node); } else { @@ -6818,7 +6816,7 @@ vectorizable_operation (vec_info *vinfo, vector stmt. See below for the actual lowering that will be applied. */ unsigned n - = slp_node ? SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) : ncopies; + = slp_node ? SLP_TREE_VEC_STMTS_NUM (slp_node) : ncopies; switch (code) { case PLUS_EXPR: @@ -8158,7 +8156,7 @@ vectorizable_store (vec_info *vinfo, /* FORNOW. This restriction should be relaxed. */ if (loop && nested_in_vect_loop_p (loop, stmt_info) - && (ncopies > 1 || (slp && SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) > 1))) + && (ncopies > 1 || (slp && SLP_TREE_VEC_STMTS_NUM (slp_node) > 1))) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, @@ -8334,7 +8332,7 @@ vectorizable_store (vec_info *vinfo, grouped_store = false; /* VEC_NUM is the number of vect stmts to be created for this group. */ - vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + vec_num = SLP_TREE_VEC_STMTS_NUM (slp_node); first_stmt_info = SLP_TREE_SCALAR_STMTS (slp_node)[0]; gcc_assert (DR_GROUP_FIRST_ELEMENT (first_stmt_info) == first_stmt_info); @@ -8501,7 +8499,7 @@ vectorizable_store (vec_info *vinfo, } } ltype = build_aligned_type (ltype, TYPE_ALIGN (elem_type)); - ncopies = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + ncopies = SLP_TREE_VEC_STMTS_NUM (slp_node); } if (!costing_p) @@ -9901,7 +9899,7 @@ vectorizable_load (vec_info *vinfo, /* FORNOW. This restriction should be relaxed. */ if (nested_in_vect_loop - && (ncopies > 1 || (slp && SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) > 1))) + && (ncopies > 1 || (slp && SLP_TREE_VEC_STMTS_NUM (slp_node) > 1))) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, @@ -10174,7 +10172,7 @@ vectorizable_load (vec_info *vinfo, } gimple *new_stmt = SSA_NAME_DEF_STMT (new_temp); if (slp) - for (j = 0; j < (int) SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); ++j) + for (j = 0; j < (int) SLP_TREE_VEC_STMTS_NUM (slp_node); ++j) slp_node->push_vec_def (new_stmt); else { @@ -10325,7 +10323,7 @@ vectorizable_load (vec_info *vinfo, dr_chain.create (ncopies); } else - ncopies = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + ncopies = SLP_TREE_VEC_STMTS_NUM (slp_node); } unsigned int group_el = 0; unsigned HOST_WIDE_INT @@ -10518,7 +10516,7 @@ vectorizable_load (vec_info *vinfo, /* We do not support grouped accesses in a nested loop, instead the access is contiguous but it might be permuted. No gap adjustment is needed though. */ - vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + vec_num = SLP_TREE_VEC_STMTS_NUM (slp_node); else if (slp_perm && (group_size != scalar_lanes || !multiple_p (nunits, group_size))) @@ -10532,7 +10530,7 @@ vectorizable_load (vec_info *vinfo, } else { - vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + vec_num = SLP_TREE_VEC_STMTS_NUM (slp_node); group_gap_adj = group_size - scalar_lanes; } @@ -10550,7 +10548,7 @@ vectorizable_load (vec_info *vinfo, group_gap_adj = 0; ref_type = reference_alias_ptr_type (DR_REF (first_dr_info->dr)); if (slp) - vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + vec_num = SLP_TREE_VEC_STMTS_NUM (slp_node); } gcc_assert (alignment_support_scheme); @@ -12096,7 +12094,7 @@ vectorizable_condition (vec_info *vinfo, if (slp_node) { ncopies = 1; - vec_num = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node); + vec_num = SLP_TREE_VEC_STMTS_NUM (slp_node); } else { diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 8eb3ec4df86..ef89ff1b3e4 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -303,7 +303,7 @@ public: #define SLP_TREE_SCALAR_OPS(S) (S)->ops #define SLP_TREE_REF_COUNT(S) (S)->refcnt #define SLP_TREE_VEC_DEFS(S) (S)->vec_defs -#define SLP_TREE_NUMBER_OF_VEC_STMTS(S) (S)->vec_stmts_size +#define SLP_TREE_VEC_STMTS_NUM(S) (S)->vec_stmts_size #define SLP_TREE_LOAD_PERMUTATION(S) (S)->load_permutation #define SLP_TREE_LANE_PERMUTATION(S) (S)->lane_permutation #define SLP_TREE_SIMD_CLONE_INFO(S) (S)->simd_clone_info -- 2.17.1