From patchwork Wed Jun 26 14:57:44 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: 1952683 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=uUSgr8Fh; 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 4W8Pvm505fz20X1 for ; Thu, 27 Jun 2024 00:58:12 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E125B383E51A for ; Wed, 26 Jun 2024 14:58:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20701.outbound.protection.outlook.com [IPv6:2a01:111:f403:2418::701]) by sourceware.org (Postfix) with ESMTPS id 6929F3871030 for ; Wed, 26 Jun 2024 14:57:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6929F3871030 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 6929F3871030 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2418::701 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1719413871; cv=pass; b=Uit8dcXMe1wm8CupFLareD2qHAwDrHygtrmqiptazcgE8wrB8Qs1jJKkADFGK2zqAU4lEZvTjvBv22a7J3Ip0ARQzuFntX9DEnASlXLWLDZBG2nPE7M4ZbEGcEJUOtwtJDYFP0M053EL/YV36w0q8rObyzkChhhMzv507NMIJ8o= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1719413871; c=relaxed/simple; bh=Fjxs3I1O2InPyow8z5fG8qzqxQee5miftjjLhTP4cc0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vtxxWq+Vsz8TVOk1GJCmzHt2JuyhgnvYod9hWXnCx8ECi0ELumjbPPgbXGHEHzIc1SMX9UeDAba7xQd078SMehRsRnVHATqnbC4XbZAcuQ7AMzBnRxVXVohBLwPLu4k5mY07HaCdZ2fLkGJmcpwzV2Jo05qlzRciqw6/6dGrZkQ= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QFo/ZOkxgdPEIwqC+oCISIqbW9p7GP7xb73iSzy+BFPpsQ4C6WfNaC777GU01yDo0Yd7xJm7CWiPVYQ3leCiWVohHy2wwFnMxvEtGIWzSmjeWYjO7btdVqevoGrXQgxN9vGQEtgIvJ08mmh8iHNmpOH2SJJ4jBJlEgYtuJgdS/beq4yPmVx+Tkj30gEGsUvcr1MfYRL8EQbZyCkNxvj3mjpnKdXGGS7zfgKaovj7igh9vJncO7IITbOmdykoKcIx9foHPpTX0iOF7wdicjCDL2a0H54k+VdFSbogWUv7rJfgDeseop12BIT5/4eRl3939ZWfArPnKZyPLGq+gg67aw== 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=4MSULNvP443QXy0NgMut+oof1hAZO2iAFXbQPCPvwNg=; b=OnEBg1gzOt/QfBwuXxQGFECRrEqy6fQwjSjkhVwohSFRPvR7oGqMjnREV3OC2aKwyG18GbOBgVYF6m4jzAKk6Tkk1+b85YGQyzoziI9qecN1DtlM6mLeNn+4ih9mJpiQYgkEVqzqgmro8w4ohY7lSJDr3ufhZdlh7oS9dG6CTtOsmT9VXatSmcLEUZ9tUdq1iQv/l/4zo9STZhufGHg8Na9WCBOQrDU7AwFPxDYlGFEejWafj2H+Hn0ZVp18+cR9ydpaPL29Atcy8Z7Zivonf/lQQziTddTof2hodxmwZTN+aVatoaEqqJvvfv25jY3+elrH3NqiLDe/Q4Arl+zl+w== 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=4MSULNvP443QXy0NgMut+oof1hAZO2iAFXbQPCPvwNg=; b=uUSgr8Fhm7xGveN329WS8Blogybqu+mQdCp9GrsdOEHWVOJWCCjhwS5gvm/6xTQKRmKOj3DJTdKsNXfxk4SOjuQ7ED5+eWBGjM8WZIICbjuUBNTHkFnWsEcz5mALiAQnr4O/7CQqLHbj4DulKPG/1KDyw0uEMDTo9obI+1k7h2c= Received: from LV2PR01MB7839.prod.exchangelabs.com (2603:10b6:408:14f::13) by SJ0PR01MB6285.prod.exchangelabs.com (2603:10b6:a03:295::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Wed, 26 Jun 2024 14:57:44 +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.7698.025; Wed, 26 Jun 2024 14:57:44 +0000 From: Feng Xue OS To: Richard Biener CC: "gcc-patches@gcc.gnu.org" Subject: [PATCH] vect: Fix shift-by-induction for single-lane slp Thread-Topic: [PATCH] vect: Fix shift-by-induction for single-lane slp Thread-Index: AQHax9jQeQ7/8Mx7lkSORxc/5dW1sQ== Date: Wed, 26 Jun 2024 14:57:44 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: 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-26T14:57:44.305Z; 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_|SJ0PR01MB6285:EE_ x-ms-office365-filtering-correlation-id: c05e476a-de80-4d37-c2cc-08dc95f055fa x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230038|376012|366014|1800799022|38070700016; x-microsoft-antispam-message-info: =?iso-8859-1?q?AYs5JwpBiRXTN+P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CTzzia6r1cSj8dCGdbyT0Iec/nnTVff1a/E2vZk2xH4wiM504bgpFTgKWzr?= =?iso-8859-1?q?37l9qanzPqim8uN7bhg4p8OQ8GTcdhhkaGQjO65SUWCwABeTDzGKaV47VdrA?= =?iso-8859-1?q?PAIRdPu/UjLrwRfzkrgj3YOydVK+aoCKdthjvUidj26IeUY1UZg6d3hY5z0a?= =?iso-8859-1?q?wUUky50qShR4zatV5vymIJ4isKjqx2uWBuIxvUmU8FlNNUJNMVV5anXGeWzK?= =?iso-8859-1?q?Cey+kD0rGo2hgoCjicQuQTDn3TAoTEWzFP4+XnSawVgMIwnFrvksYgkqPPAg?= =?iso-8859-1?q?T1zbhmkr825Pom4tvbfKfJjFcvD2KL8sLCjhCm48fMqC0DKp+6UuQiFWReZv?= =?iso-8859-1?q?7aH248ejlsqgFnY3b1vgkQiC4juvdhlG2sg/wEEDrjHiIYnTz/rx/4Be1Q8W?= =?iso-8859-1?q?C9kry9gj3eOp5g9k8BZw5ZtyJ4a1uwD7bMJ3PSt6X0+eDmuKFhVeJVd7cUt4?= =?iso-8859-1?q?Qj/0jXKEKSdj9sMyeoST8rH3+/IPay8dF3inWbzmM=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:(13230038)(376012)(366014)(1800799022)(38070700016); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?bA6R6EeeocrZq9bWdsmMUsS?= =?iso-8859-1?q?orG8Uq5vCKFNNMmYnj9GkgAl6f+1XSa8Hac5zWTUXqJCeJe/fzlIQfXw+4Iz?= =?iso-8859-1?q?wsIy20gB3XNWYCvskCXziQxoGe030tH0E0DcGuQ07mn2imZobP3Gc+YGNA4Q?= =?iso-8859-1?q?r5DdUo74xRXQR6c80D5HiL3Mb5KmUjK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= =?iso-8859-1?q?Zse/kjmnTYaSdgOshPJFNjhvrsW9P9kkEjvGI+PdK3ocOmXHlKA3VG4jQavY?= =?iso-8859-1?q?3ZQgMA98tfPPRfcBw7lbf3t4hJG/msDYC7s0PLeq3mKXd3TsKXc4j6LplkP1?= =?iso-8859-1?q?nEnUBwjAOP4us3ettCexvpFiLhl7E0utsNxFPLkOnLod6ZzdD6qJSmraeXqw?= =?iso-8859-1?q?Dph8ygAcMlvcrtM7VdWtdDuaHQ18q0H8Q1657nmXo/+9xvxdZzrbjI0gD4Xn?= =?iso-8859-1?q?gqyr37n1RqMBVI70n6wQRfYqvrn4KkbhqAmd8Foae1lUMoqCTLNmbLkV2nMv?= =?iso-8859-1?q?WH7l0JNhFgwnWsmSNYwaCtL/X3+AsqTG/8jElFMCGcIR4j9Teza3v1jZXW7m?= =?iso-8859-1?q?kW909XdvKYfFhorwkicNqa6dYJr7SbALOYbUkqzAQdp4UgWe8nKlhArNdmJs?= =?iso-8859-1?q?G+gC1ysAACc8rcQPQF7U01Q1OL8iy+6lb3JA1uTaDeowqhLUElOP11zQK68W?= =?iso-8859-1?q?6jyLYarLsQ87a8ricTCdFn9x8uy3ZXRf0vtTqEWu45iD/uI4EoCwtVzy8l0n?= =?iso-8859-1?q?mirXhzQ73/XufHHCk?= 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: c05e476a-de80-4d37-c2cc-08dc95f055fa X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jun 2024 14:57:44.6638 (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: /fg/pc7tgQS8BTPumLn7RzjiRSHNmzAPBrbtwOyzbMj3Q7vgtjT7NFHfkZQv5QKXN9pySpSJI71x3p/EQaehXyGFtPoO66ucy4xn3zVzJAs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR01MB6285 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, 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 Allow shift-by-induction for slp node, when it is single lane, which is aligned with the original loop-based handling. Thanks, Feng --- gcc/tree-vect-stmts.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index ca6052662a3..840e162c7f0 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -6247,7 +6247,7 @@ vectorizable_shift (vec_info *vinfo, if ((dt[1] == vect_internal_def || dt[1] == vect_induction_def || dt[1] == vect_nested_cycle) - && !slp_node) + && (!slp_node || SLP_TREE_LANES (slp_node) == 1)) scalar_shift_arg = false; else if (dt[1] == vect_constant_def || dt[1] == vect_external_def