From patchwork Thu Nov 17 04:09:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 1704908 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=VUgF7DDh; dkim-atps=neutral Received: from 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NCRKQ4gVgz23mV for ; Thu, 17 Nov 2022 15:10:32 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 19A5C396E02F for ; Thu, 17 Nov 2022 04:10:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19A5C396E02F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668658230; bh=ZtSMI1U+9vlec8ZVtLqnTSzRCXrinVyjPG7HkmcKo5M=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=VUgF7DDhYSv2TTvAyJ6z6P+20wR5re+vfJhFB3LMxvRfzEVWZdZXdFHAcPluMOWBk eb3F/7b2z2NUrCxJnWmVhvj5Mq7y102ViLrZpJFs7yNe9tENnI56twUcuF2IAGkNsm QUCKAKGTOqhyt16ZOhHQJwLmHpwWCnXRAzCMg3ww= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60072.outbound.protection.outlook.com [40.107.6.72]) by sourceware.org (Postfix) with ESMTPS id C4B3F395A070 for ; Thu, 17 Nov 2022 04:10:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C4B3F395A070 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=XZhP4RpWl0Wz9yoetvS3r9BoRSqAp7T4AN/S8367rSjornHR3EzyFuS5Aqu5qFktu7LoRPRPJByxZwvPxRwJgKYVFFLwOXkWGkL5gINMvljuWEN9k0IqA9fRWjH1mPHPm4J/ezgfm4Dsro7Rgue/eQ2Gp0petKqMbi9XbalK3XOn1q2B0kLXoai6u8hB9+tkEkR+CG9GTLczQYH45UI23f2k4nsv7EG2a3XKCNxO1aYAoEFxmSdVs4fXs4VliL8d1CqqulZH4dLIoCiI1UU8IOF/tApZ4TOXP9RJxFktuEGe5/6RwOhCK+bONSfkBtbvuzUsObQADFPBwMcL4a5sAQ== ARC-Message-Signature: i=2; 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=ZtSMI1U+9vlec8ZVtLqnTSzRCXrinVyjPG7HkmcKo5M=; b=K8AtDi6gaRwypG9bvcz//UdC5pLrXaFTopJYW6b4iI5D6PzB7Jsc3Gl17d4mVvNsP0TRI/zd23hiRMmFg8PNxGDLQJNwoZskZlcxLMIzwyCaI34WIruPuRJyHHldaUYn+UG4S6YBdylRjT3E3RRlgWbiMwM45ck5rWR+RuDwZw5VtszhC1hmkSHqopixDg6eTcYG1YgDQpl+X7DCN1oMdsrxhy+PODXBW+G6J3wMeWOH7ala1sodsUMS2OLXRWlEhtiF1yxZrrUqPng8X+XONraBjyAKpItsyFUxbix5otLMvFmEEc/q1NCXzOAm4IYPcizlAejmeO5tFLcsDrlCxw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AS8P189CA0059.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:458::6) by DB4PR08MB9357.eurprd08.prod.outlook.com (2603:10a6:10:3f3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9; Thu, 17 Nov 2022 04:10:03 +0000 Received: from AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:458:cafe::1) by AS8P189CA0059.outlook.office365.com (2603:10a6:20b:458::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.19 via Frontend Transport; Thu, 17 Nov 2022 04:10:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT012.mail.protection.outlook.com (100.127.141.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.8 via Frontend Transport; Thu, 17 Nov 2022 04:10:03 +0000 Received: ("Tessian outbound 73ab5f36653e:v130"); Thu, 17 Nov 2022 04:10:03 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5e142cd66c8c8689 X-CR-MTA-TID: 64aa7808 Received: from 0eef13b464d6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 89F9166D-4AA1-4BF4-A783-345B1AA4C68A.1; Thu, 17 Nov 2022 04:09:55 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0eef13b464d6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 17 Nov 2022 04:09:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VEW2Mzzef466zJNpiIo7mVwklrxml7CynPUtH++Cmve3lTfi6VAZLW5bnBBOCqo2FYLXL7rM+cEM4REThPMNVQhxCyKliCjRP9Ys/vGFYAVG9xumPCeOn6n1bYzeuds1Y5PB0wfJG0yqqiqD1sduk1FbCfBShYi6BWxvxbEH4X4MlafBHPbxqnRZIMi0ny3hQNo/LrOoHH6W+a4pWV40cltPShgh0WzuUG11iMRlC2rqNs1T8uh0Xe8isKxaeogmxDd/0jyKGb5m/VCVK/8IEjEh1wwhWMgTjwJZpiZ43ZsljKKo9gKF1jEd/IO05wdAJR6I3Vxe485pO4ySQW3iWg== 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=ZtSMI1U+9vlec8ZVtLqnTSzRCXrinVyjPG7HkmcKo5M=; b=U5Am4iceAp/qPWoe2XTwq9WOsCkE8yX/xOd0hJuIX8QTRqFTfCD3FJ6UJiCRhnvNGga3QtZyOZNOwSUR1H/o5Gjm+9kZttroN3FjLW5aAQbUFRdQ2zPaara9SBCJ7Vp7kGJmqL1b+HLdp3dAWL8a5KPgfoL/qjd31hNXriHPZ+u9vWySSJSA5BBcZKoyaF+RnufIFOUo02pHOM/wkS1Dn99RHoAWrEfVz3eT1A3cS+fGDTV7uhsu9oNKkph00fmP30LeI/CsFTWFmjPQwAYwLyMnMML8gvmCrLElUQqifAFXENNETChc3c12EVtHXz2soZTihWKcDQWhtnPsDjNx/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by DB9PR08MB7628.eurprd08.prod.outlook.com (2603:10a6:10:30c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.7; Thu, 17 Nov 2022 04:09:53 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::bd2a:aff9:b1a0:2fc7]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::bd2a:aff9:b1a0:2fc7%5]) with mapi id 15.20.5834.009; Thu, 17 Nov 2022 04:09:52 +0000 Date: Thu, 17 Nov 2022 04:09:49 +0000 To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com Subject: [PATCH]middle-end: ensure that VEC_PERM operands get lowered to the same SSA_NAME. [PR107717] Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P123CA0254.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:194::7) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|DB9PR08MB7628:EE_|AM7EUR03FT012:EE_|DB4PR08MB9357:EE_ X-MS-Office365-Filtering-Correlation-Id: 6bd9d480-6ef7-427f-4e7b-08dac8519a6c x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: DVYaa+NIbwvThrF11Y+JnlSxCLnqwqIh1D/CuhCG1i/wOLqPnmrdxRWLyG9XxNNMe5eb0W3O1a9d7wTO8pf7cgh1tQr2KVExcCr2L7UP69qsCRtlh8ZVs0R1lisNmUSTYrn50XMqDyvJ5G54LAELVBBpnr6wmN/Ym3003/R3cRekyhCtF0/D89/UczWJILgquMCmDLrKo7Ank7PweGog8SBN6Ed9NvGu7yOIVFYZST89DADBw6j8EtAmRtH876KvTE/b2Sx8fsz51Dp7HNGOTgKhBxW2XEJZNRhAXcPxjexKSflwHos/uE7PqYGtsWMnBPObFLhhU/kLM5Y5nmEQ30inismu3YYj79nfpT1B25gzEALDmHhhE37YZfQP/V5msJosH/Nw3xmA6s70ryA4BPV2wL34wtihrWW1yxBRCiRgvHzDiVpZPz32rIk4QB2yhTRilSsgPpf7EDyvCNh4hVQOqvTMj8Oj6gRXnw3XJYvcXCETzoOgnDk0k85KOsDUcDWETjkgZKg0bjqgCMzpBa9WaIQ+xyLcttHXuDbnumxLp4kIsxBjFgQTn66jB30QqJ2XIr7roSvTnxwDYnfjhSfvwYeilFEJeE3XNDPyk0rKzvKXP0vQqWN/QNFH+WgcdG2eMTVA29leFHsNrHHPEuKL/0itXduEQm7Wp+kc/yjy8MOjDiNpfVionxdFz3+lzmfUNuSZzDoUoOj7pr5cqgmkCHeiwmyLkebscFVGMFo35Tr8mBZrh4pXEO+TzZBBfAUcTJPHdThULmuHsV4TLfFe8xJX0LbAw+PwxpntQHyKqbghoCdvAWzM6fpSUhXp X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB5325.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(376002)(396003)(136003)(346002)(366004)(451199015)(66476007)(2906002)(5660300002)(235185007)(38100700002)(316002)(66556008)(66946007)(6916009)(41300700001)(84970400001)(4326008)(8936002)(8676002)(44832011)(478600001)(6486002)(6666004)(26005)(44144004)(33964004)(6512007)(6506007)(2616005)(86362001)(36756003)(186003)(4216001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7628 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c33923a3-5b45-463d-9fea-08dac85193dd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jWf0mjt9usNw8i/M/2SjiIs2Z++5FSwi7dxoraWXio4dGGHaTbB8v2ZamQ6kSod1akM5RpkKW22JKgn01zNLt4scmTvkP0qNXuAN9XSH2WfEjh/EUtldW1UKrq8jmeYMq/MHi5wiYLUHC4jpxgYRbnw6q8bcq/YTa9o0BB7HbSyIFKbr6s20rETry3FaW1VGn58jG2RRcRHjFrTP5Ola0R7hiwtmDYzsxZ71Da9Py3NRaLlzGYd4WPGoFlmheuBZqXUQID3MNDf9tzI7D1A2Ym2zUhPYK3wgBmxShzQz617VT5/Y95QuZrkK3yA9Z0TBZNNut+YY9ZVDxdkgBkeTfc1QE+2kn/1RokWfFD6bnG5RxR1jPZ3oczAhkME5MPbQ3X+DoUph/YGg4DeeZEQ2JqilPP3ngHca5N3KfuLnZ+xtjBjTXHlQDpeygBXrfb2JDujXZp7v74/kXxTfOf1BLxO9asyQeMFXtQbxXTRhFzrWhrU/5VRBVAX2MF0eoNauVl+zEfsSOaSLKsULANfLvnev1q3o4e/S/FUChycgVyy/gRAJH/f4E/Cnw9T7o4c5pw5pov3/8mUQX5DljhrariK4EzjwPQBd3KM6WutWcX7hNxnyVmk3Q0b1a/KoKCnm6hkz/gntu6yidh96e9B+MwsTl388iYPYpPipRGgS5BhK4Q67P2LFAGomH1lTGsDNKvshTUsO+7jy3S8enBpjOL6BxRTTk3/6ClEc/tMYsOi0PoT4RSBizD+9NGjzbuM3pP5odvepilT+jGd1nH18AdZotaYZYSjwgG3K499R2nBdns1XxmcuxcZs1hBnHRoTkJDM8qKmpPkeFSylj1kWJKpfPH0saYrbsM97oskjykY= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(376002)(136003)(346002)(396003)(451199015)(40470700004)(46966006)(36840700001)(40480700001)(86362001)(356005)(81166007)(40460700003)(36756003)(8936002)(44832011)(107886003)(33964004)(2906002)(6666004)(6512007)(6506007)(44144004)(26005)(316002)(5660300002)(6486002)(478600001)(235185007)(8676002)(70206006)(70586007)(4326008)(41300700001)(6916009)(36860700001)(82740400003)(82310400005)(47076005)(2616005)(186003)(336012)(84970400001)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2022 04:10:03.4416 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6bd9d480-6ef7-427f-4e7b-08dac8519a6c X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB9357 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tamar Christina via Gcc-patches From: Tamar Christina Reply-To: Tamar Christina Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi All, At the moment when the VEC_PERMs generated by this match.pd rule is generated it creates two different SSA_NAMEs for the folded operand. Because of this it the permute switches from a single operand permute to a two operand permute and the target may no longer support a permute for this. This fixes it by ensuring we generate the same SSA_NAME for both operands. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: PR tree-optimization/107717 * match.pd: Ensure same SSA_NAME. gcc/testsuite/ChangeLog: PR tree-optimization/107717 * gcc.target/aarch64/sve2/pr107717.c: New test. --- inline copy of patch -- diff --git a/gcc/match.pd b/gcc/match.pd index 82f05bbc912e4f80f3984d930c4a8dcb010136e1..cd510d80d409a7c52ba2a78e2fd7df0fc85cab2b 100644 --- diff --git a/gcc/match.pd b/gcc/match.pd index 82f05bbc912e4f80f3984d930c4a8dcb010136e1..cd510d80d409a7c52ba2a78e2fd7df0fc85cab2b 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -8317,7 +8317,7 @@ and, (simplify (op (vec_perm @0 @0 @2) (vec_perm @1 @1 @2)) (if (VECTOR_INTEGER_TYPE_P (type)) - (vec_perm (op @0 @1) (op @0 @1) @2)))) + (vec_perm (op@3 @0 @1) @3 @2)))) /* Similar for float arithmetic when permutation constant covers all vector elements. */ @@ -8356,4 +8356,4 @@ and, } } (if (full_perm_p) - (vec_perm (op @0 @1) (op @0 @1) @2)))))) + (vec_perm (op@3 @0 @1) @3 @2)))))) --- a/gcc/match.pd +++ b/gcc/match.pd @@ -8317,7 +8317,7 @@ and, (simplify (op (vec_perm @0 @0 @2) (vec_perm @1 @1 @2)) (if (VECTOR_INTEGER_TYPE_P (type)) - (vec_perm (op @0 @1) (op @0 @1) @2)))) + (vec_perm (op@3 @0 @1) @3 @2)))) /* Similar for float arithmetic when permutation constant covers all vector elements. */ @@ -8356,4 +8356,4 @@ and, } } (if (full_perm_p) - (vec_perm (op @0 @1) (op @0 @1) @2)))))) + (vec_perm (op@3 @0 @1) @3 @2))))))