From patchwork Sun Jun 16 07:23:39 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: 1948264 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.a=rsa-sha256 header.s=selector2 header.b=mX3DTchB; 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 4W24JS3Dcwz20Ws for ; Sun, 16 Jun 2024 17:24:08 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE9DF385C6C7 for ; Sun, 16 Jun 2024 07:24:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:2416::700]) by sourceware.org (Postfix) with ESMTPS id EE5983858D26 for ; Sun, 16 Jun 2024 07:23:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EE5983858D26 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 EE5983858D26 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2416::700 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1718522628; cv=pass; b=cinTQwl/Lm21RuW1BHaMC1wAbHzHNr6GMJtolEXHA2ch9RV6txcSPsvaNBC833sB9mvhNiZlyBJFn9EyuNOUNHgzx7WO9bMF+LefGpBcV1FFB1eLJH88oOJwQvyf8io4k3WGbMrjYxreD2tcb6qr2dhaH/DzMl3Z/AsfaGtRd/Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1718522628; c=relaxed/simple; bh=kO2ajfqnqEOmv9E6vpnKaeAzwG7GOKkWqa7emoVXGjY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UGiSmONG9ep8WAzU8afQdGZqg7iwwo5UOK5dCDkEgQmFWQ4BmZWqDowS0nN3H8KVj5uS5aMclhBU7FIumkfLyUXTB50gnGi60JOxcwYYwZMBu+J5RQNINlgGMJ58d4llhkyPCcS+MaEo1WKQhr3GTwaMXnhxd6cgxqlLnIgO0z4= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q6GfqLP2qStd/NJQageQlkDR4XqZBJNOCtaTIqUBaczkTNxB5C3y5H2NN+pGEnzGWFZyWPQkZeaFwcTLAOZSTjbIg70QS5JXhRUItT6BalNYDxb6IPAeu2CdTLbqlgjjf3DIoxSIyTkvMXZTQwDNBvEXpB3Q6+I/pVVhSiUvGueJG7VHsi1nTjPX9QsImdtgdXrLxhFKIb8ROJNlMw1CIBSoqQfEqH4jBFlvxYFdNe7muW7BhOJuKIGLDal5ZwPR8y4KiRprs/A37iSavdo6jXckyPI8uDMWh72iWMfh/WM04AUMke67qNnOGiV8w/Kv9YXgrP/MrdgKZF2LxWlj6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=EsdqIgSFFGchH142bDA0mkbzlbvpX3ASv3TDGeMv/Ag=; b=c1dokfqASsT966pkOdhAT3x5JVtRz5kt9k0yGP8ow6nd7114TDkgm0CDDIMtX3Tz70DUYguo/6likPLL52zZP98sLsx0O7ijzfWscYFutaNxTSNsQe+uCVKA8Ks2hpQX2zre/vsqZwZqgvsZOZeaN1xYWvB9ywuzMYibZTLxtV/wa5w0aRjGwldtZodTahffBRF6PTcSzeS/CaiTUhXWGFmZ4zBXukepoX6Wa+Kl/2dWkL17CDPHuWzwd/FgDyBZtzxcqnAZZ5Y7R076sJhR9mSKI4asJiHdnMnchdpC5zCjrYWGJjpV3eUY0JxIi4b2MsRMAiEXWN3P8qyUlQGbNA== 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=EsdqIgSFFGchH142bDA0mkbzlbvpX3ASv3TDGeMv/Ag=; b=mX3DTchBanPzORzhSy6nEr6f4D8MNmZBMgycAgyYw1QfmTq0cqmYA39wEAIVMFHdUDsJVo8kCzfNxlrYvX7oIK9zV4EO+HaO1T6/zAFzaJ9vl0qY/DSNlfj+rTNPOzpTM3oSYavq6H+Ga80MlqqroG/u7jvcMbOoC5o54g9hPBE= Received: from LV2PR01MB7839.prod.exchangelabs.com (2603:10b6:408:14f::13) by CH7PR01MB9001.prod.exchangelabs.com (2603:10b6:610:24f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.29; Sun, 16 Jun 2024 07:23:39 +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.7677.029; Sun, 16 Jun 2024 07:23:39 +0000 From: Feng Xue OS To: Richard Biener CC: "gcc-patches@gcc.gnu.org" Subject: [PATCH 3/8] vect: Use one reduction_type local variable Thread-Topic: [PATCH 3/8] vect: Use one reduction_type local variable Thread-Index: AQHav74AxtC/0twDQU+gV5ElrJ33RQ== Date: Sun, 16 Jun 2024 07:23:39 +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-06-16T07:23:38.871Z; 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_|CH7PR01MB9001:EE_ x-ms-office365-filtering-correlation-id: d30d41bf-4ec2-443b-7adc-08dc8dd53e40 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230037|376011|1800799021|366013|38070700015; x-microsoft-antispam-message-info: =?iso-8859-1?q?6dPwCrDwZS69BfQDxMKm6p1AoV?= =?iso-8859-1?q?AEK6MOW7ISHs11HOfKIX86AwqDoY89R28pycRMsbd5dnTIQtXBQFf/WIgmE3?= =?iso-8859-1?q?Me9JcelqZEdPv1MoHaaE3NWAzYL8SQAaL7sk0/Vv0/rbIh6aH97HGM7CijME?= =?iso-8859-1?q?tXhW3w3v7Hvy4d1GyyfbQbRnYkuNODcyDCQLvw1BoOsfE4r5z+Cs1gXAxzL/?= =?iso-8859-1?q?VAtGdP6sOpRuJDCPUJOJ8wL1UKKrnKDJ2VpwSovpVmlKX0cvsIv1Miyer7ib?= =?iso-8859-1?q?4FroVYRumgGGCS0tNa+xh67radvs2OHScBpCro/HWZwCsodFKuse/aTsFnKn?= =?iso-8859-1?q?JBoHCyW8xps2dLY4/XHpxdHSuk4t6TDvPm7qGB9jn/L6Ow3kVH2cTiej3tVW?= =?iso-8859-1?q?9MujsrLAFbORmGfigTzmZYSYV2EEgmpZHpu+6WgtIp58v12Of1rNWUlwti2I?= =?iso-8859-1?q?lm46Zn3/1qY90mbM+58HpVAy3HrWcV0QQ95m4+emEKyTfN4UBiYDqsLCiH38?= =?iso-8859-1?q?8/RG3Lndl3AysJFd2uuTEsLdoh0Q8KYXcS3iK995VZJGgjLo9dIBjIQFptZu?= =?iso-8859-1?q?LNv91R6YItoaem1rrXEq9y+C+5ClWcDE7bkuoP/pX93YnXfU6F6mdQAVmVLP?= =?iso-8859-1?q?Mb5oquhPvOOaA30cSLbq91sccQUptaH9lg2hKFKfUY/lBQmC25gG42v2ibxa?= =?iso-8859-1?q?hTli4QzllMQLL0BkaKyqdztw3d9gnQ/6SAxDWbJF1DgVxHbamNjFoqmaZIJU?= =?iso-8859-1?q?wVGHWd4MVXdr96XWectz9ZCK/boPdkRPDH3UiwaA6sB8doZX5BKJA1dSAJMB?= =?iso-8859-1?q?zwYA69EM/mAx8trbk3OZUgZfKfJnyKTh9N2/1MeXi1+dLzyHCPW9CaIhj1n3?= =?iso-8859-1?q?LknWzNYnmIB0BY3za3KCRLp+VoYy1Q40Fc0svlYH/iSorV23EmZCb6RyHToZ?= =?iso-8859-1?q?7J4ASmFThN9pvn32VcKvl9f7sSLupz0ieeB9mK24VcEBsL2xCGSJvdaJCNYE?= =?iso-8859-1?q?VQ6b7LDn/Mx4crm136pjdRy/+THdHUrV+X63JEsj/wUrR19BBdWljzvaDDp9?= =?iso-8859-1?q?bxT/hMr6ve5OzP2zNvCr/36rYtqmfD2SGyUyHXkd4xzIWF+go7JVimKutjQV?= =?iso-8859-1?q?AKnH6/QnAxq5SqPg+vIMEtNPAJrXARe1nmNhLXjLX1QW7P1uZsVNTB2UL5Gq?= =?iso-8859-1?q?tLh+faef6G6Vve4pfhIrONy/DqaBJF3J6QbEehRxmbvEIF4QZrbVMX/TVPeo?= =?iso-8859-1?q?u8Vw8j2yXR7gOYC38TPbffZY2GmklKHqFwjFIfGUOeHZiIBfzNzkGTj3mMhV?= =?iso-8859-1?q?uRNJaiQp55htjXxlSwUKkRZz0l3zFw+yvqJBQtvRbq6uk7jzAIhqT/eWcXPY?= =?iso-8859-1?q?YkRIQtTsdVz+euGTlYF+Jx2jA745pezt5/rmwD6Sg=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:(13230037)(376011)(1800799021)(366013)(38070700015); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?GtlLaP8uz24SJRiOoS+58lP?= =?iso-8859-1?q?ZlESqnq6lIqXOqZcHHO3p/6nW8T3cqlSoHIBVKx8L+8i2BlVxl1EQTqfVEE5?= =?iso-8859-1?q?DaMvorv+bE9EzcfwOsTMx0VVgWmXnMEomDcJcWSmv5cxAcTfDHiAoBzk1OdU?= =?iso-8859-1?q?sNNxUviPbrPbA6a4N17eXD2P9Ff10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HdgYd?= =?iso-8859-1?q?qJRXN0PXEURdp2Dh6TWMKSmNKHIxEKN1mp3dw3Mz7Z1Y5/j08KjsiRXtkjb8?= =?iso-8859-1?q?YGWXJ//u31F1wDMryoERZ7zaZn/u/cBhMt7cMyRvn6xy9llxHUUIxUQX40MI?= =?iso-8859-1?q?8S+m71unoVkk6iHUrib+2KiY9/t6p5isOjul5uhlksDpx/sYNjp8qN2+d2Hi?= =?iso-8859-1?q?e0KV5Ei9OmIwI9fvhz0LU2O6EwsMxS9SOSRHpooU8APDQwlt8LN5ZCacoWed?= =?iso-8859-1?q?LNPamZuXjYd7VfIr+iPsdat2UYnm+suE5w5klzmaU6c6YSEpFABiGTuw7WbN?= =?iso-8859-1?q?y67Uw0pvDNHp1UZlX+zYJbJSVGhPdOLwp7rlqxwdktFa+iBjEvSRHy8Mywcf?= =?iso-8859-1?q?6pOZvSXmrjSCxJm8QKR3pHSHXVesMcII+wKOcMWvghrd15ICPxCoP9+YqCfN?= =?iso-8859-1?q?/2sm8DBlQgLwwc8MlBXYY40VMSHDUVg+RgQR+OUcRHLA3WOL41U55M0TkL5m?= =?iso-8859-1?q?SoAlFqAre5FdYSRNmTR7XcGHPyfh/hh9ISvyWHZRUeJ4FxmAMifld/W+W+1a?= =?iso-8859-1?q?jET0v5Fx3lom6clX+?= 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: d30d41bf-4ec2-443b-7adc-08dc8dd53e40 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jun 2024 07:23:39.1541 (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: yyn1+Hh6aQthOEvTCEBFVPBQIWKEFyOlFUjpdbFi5q0zrhKuVpEieMCe0cZX/Wrnon2W9tvB5pZXLoBxdgIfLKJo2ME+VK2Lnn14I9X1n5E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH7PR01MB9001 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, 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.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 Two local variables were defined to refer same STMT_VINFO_REDUC_TYPE, better to keep only one. Thanks, Feng --- gcc/ * tree-vect-loop.cc (vectorizable_reduction): Remove v_reduc_type, and replace it to another local variable reduction_type. --- gcc/tree-vect-loop.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) From 19dc1c91f10ec22e695b9003cae1f4ab5aa45250 Mon Sep 17 00:00:00 2001 From: Feng Xue Date: Sun, 16 Jun 2024 12:17:26 +0800 Subject: [PATCH 3/8] vect: Use one reduction_type local variable Two local variables were defined to refer same STMT_VINFO_REDUC_TYPE, better to keep only one. 2024-06-16 Feng Xue gcc/ * tree-vect-loop.cc (vectorizable_reduction): Remove v_reduc_type, and replace it to another local variable reduction_type. --- gcc/tree-vect-loop.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 6e8b3639daf..0f7b125e72d 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -7868,10 +7868,10 @@ vectorizable_reduction (loop_vec_info loop_vinfo, if (lane_reducing) STMT_VINFO_REDUC_VECTYPE_IN (stmt_info) = vectype_in; - enum vect_reduction_type v_reduc_type = STMT_VINFO_REDUC_TYPE (phi_info); - STMT_VINFO_REDUC_TYPE (reduc_info) = v_reduc_type; + enum vect_reduction_type reduction_type = STMT_VINFO_REDUC_TYPE (phi_info); + STMT_VINFO_REDUC_TYPE (reduc_info) = reduction_type; /* If we have a condition reduction, see if we can simplify it further. */ - if (v_reduc_type == COND_REDUCTION) + if (reduction_type == COND_REDUCTION) { if (slp_node && SLP_TREE_LANES (slp_node) != 1) return false; @@ -8038,7 +8038,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo, STMT_VINFO_REDUC_CODE (reduc_info) = orig_code; - vect_reduction_type reduction_type = STMT_VINFO_REDUC_TYPE (reduc_info); + reduction_type = STMT_VINFO_REDUC_TYPE (reduc_info); if (reduction_type == TREE_CODE_REDUCTION) { /* Check whether it's ok to change the order of the computation. -- 2.17.1