From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60048.outbound.protection.outlook.com [40.107.6.48]) by sourceware.org (Postfix) with ESMTPS id 181F73858D32 for ; Thu, 7 Jul 2022 07:41:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 181F73858D32 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Nu7LKtbK7bYa6WARxMJWGg6+ux0QW2uQlI4Df1xQrlXtFnXJMpq2KenNbTU5T0Ej4p/U0IV9DNxdQ8jFqzGlzsf8UHSHEt3ybBSEOsGCkJq7tKS6FINixCmHXvxJLpQl0LhCAL6IMguQCXMqQv60sx2u0LJZRB7W9zTWJWtDyL0TZOP0q7r8SnV61YEVXBUlknsKnb56nTRdeEviIOOUmMga+fBOAZ8p5GwA88DBp4IxFVqu+FlkaqQ5OInPXISukqNb4gJQvxbVeI6PZurAFxG0fFkLuj/8w4fq9JdIV57/rz1s7dmMwIxO7vRsyTAa687/rGSIaklntveBhI8IRw== 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=d3yXdbmWEbP1n2SR14k5pAaY70TMC4Db4DF/9X8BauE=; b=BahE+K4fBAH5pdhyvVJl4SReoV9esg9GG1Rg8W0vUnSgxc9VN+qkDqY26A4W72FuvHvR88+AzHeKETx00u76AS8g7eTiQDfzXvv73EYUF70vRi5UohUR/uVFCXfyuemekn/VO91MwI41dRq0RHUCD42AnUgu5gim6CHy2lVeEIBXa9V5Sa4pmWBWBT/BZlCpSUbQ8p/+dkX7HZWIx/aswOxHZ06+53wRDcdj+/DOxCafaMMolUZMUsgYQr+hwXuyBdQe1ZDfrmeOZiGwAtvRMngBPcCdUNO6WOPHNZeskpY0Qs1De6T6YSkXAreocijoQCj1iMgZO1u8b1umO6v0gw== 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 AS8PR05CA0006.eurprd05.prod.outlook.com (2603:10a6:20b:311::11) by DB7PR08MB3707.eurprd08.prod.outlook.com (2603:10a6:10:76::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.17; Thu, 7 Jul 2022 07:41:45 +0000 Received: from VE1EUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:311:cafe::a7) by AS8PR05CA0006.outlook.office365.com (2603:10a6:20b:311::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21 via Frontend Transport; Thu, 7 Jul 2022 07:41:45 +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 VE1EUR03FT025.mail.protection.outlook.com (10.152.18.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 07:41:44 +0000 Received: ("Tessian outbound 0ba541f03a2a:v122"); Thu, 07 Jul 2022 07:41:44 +0000 X-CR-MTA-TID: 64aa7808 Received: from 0f07c35723c4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DB19E4F3-38D8-4436-A1C8-5C2412EB24B0.1; Thu, 07 Jul 2022 07:41:38 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0f07c35723c4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 07 Jul 2022 07:41:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gmSWCOPP+oq934VybFyqS8fok4BvcSjxJ8AzSyQrU6fYHE47E+h9fKBT92ZyPN0uLvDfLxQOd+EHwpnLpnWjCA6x2a06Vow3VatJIYAwmO4EXOBIyFzD8Czk1w+zkByAhMnu/jQ0/32mDLCeObEqgQEXG19lHj4fZrq+HhxUinXtAfMW+4KQS3JlM/11pRBed1bmgXLKfY4E7He2JEW3tW3FsK9wl6awvEQsE8sFCafqaB19HuMp1TDqPMq6rrPkqddKxr5+oITTpxNKfrpM+gaAVgG7ujmLXbZgHMs4163XOiANtRPgcA2rm5I62vYVNXGP99u0Kcft0t6XuJ5Mgg== 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=d3yXdbmWEbP1n2SR14k5pAaY70TMC4Db4DF/9X8BauE=; b=i2EtretZ2jLAj0kPQDHS7YmTg544BK/QAEVHZAv2TVr+5wqOFgU9k7Co5qMdWFRGREVZJSSxvRpXfRaTt6KYIydiHAG6GLX0IdyvrPo0mud8lTECvJRToDyEQYDBh3Es6jxG2hwjxrFjGb5HyuAaCem2LtMK+7250rjoqiILJchzIpQXMiZMXGvb1I8I3aBOcrZVMe2TYwz4Hx/+uli+3aR1G3QiEhXiSoJ8lahJ18sxgdbXHo4+Mi2+wKwyXknjAZQ5fDo6S7aXoIT2mxiIFhI6v803stw6ioAvVCFuNN+oGmYNK5Hw4joBSZ3WmKZ028f/TSTKhQTi1Gwo8Lje2g== 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 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by AM0PR08MB5201.eurprd08.prod.outlook.com (2603:10a6:208:15b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.17; Thu, 7 Jul 2022 07:41:35 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::54e5:594b:e5fd:a9b4]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::54e5:594b:e5fd:a9b4%9]) with mapi id 15.20.5417.016; Thu, 7 Jul 2022 07:41:35 +0000 From: Tamar Christina To: Richard Biener CC: "gcc-patches@gcc.gnu.org" , nd Subject: RE: [PATCH]middle-end: don't lower past veclower [PR106063] Thread-Topic: [PATCH]middle-end: don't lower past veclower [PR106063] Thread-Index: AQHYkIACn0qAIC8Sp0es9YB1WdW/J61ygp2AgAAFYdA= Date: Thu, 7 Jul 2022 07:41:35 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 0DB389A3FA297D47834EABC75196FC3C.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-MS-Office365-Filtering-Correlation-Id: 8fdc21ce-caee-4388-7e3d-08da5fec241a x-ms-traffictypediagnostic: AM0PR08MB5201:EE_|VE1EUR03FT025:EE_|DB7PR08MB3707:EE_ 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: 3jf3gooimmQOHi1v5c+kPTd7I4gDUiFzM7DQNPWvBoBOy1bDu8iWpQ8KLg10XlgiAjoBv5gVar4JXfy41EOLR3I3okD518t+WXzsoTtKq/4kZ5yRV1DwqOGMRcyCSfLk26VVLB/8SGiBmg3fGhDb4wWgjsYf3091TrC+u2YcRkp6sNRhp7IY9t3KIQJfT1DwnBjq8p3v23BcikhlxjSn+0dD+ANvQ7tOVNyQpvwaf1J+BUmIBcpiAkGWw6/Ml7GJVCMBUt0BcBa1YRcIzG8lD9IUdXQXy6zYmzRKMWsKH9diQ9sTWft5QJ3pgN0Tmm8/obaCilXIksyqENosnffYljMwzfVf9FQAGfEfHKSKwWvxYxRS/le+bY45Ir2yzJXb99Q2PM+yMZt3VwYRx1nvm1z6edKcYns54TpPt2m2hEfqxC3HFXAvZF4Y0BOQEiIRKiErd4w8EZOmHSVmE94Fh9nrOfBbBgiPiyQ1ubGg7bpH0RTxx5sWXgQf1OyQ4JtYBRZkrw0qocsxQTFkZen01LE8iawBKMjFSgDvdpGQPvdeQXaLg0H5JJLy/et3h0aOSYtZvNTECNvLjgSfy3NzuE6mBaagEbpAFDF/0degYDIUWLq7x8ylb6727ZJ1L0Zf8CZCnPG9r7TY/2+FELXwaQ1Tg9RxEmKjx9txayciWxV7QqSIuowCYvOQ8me/P1qtvfhJb8D4Lr5bAbbg3WClIN56bwg60hpmVYej8nP2SZft4QgbSt8+wVOhvJNtM/yd/W3d1rnOmA4KYBW850OQs8hN26mFopFs87O3idMQV6WTFgwDPaTnlFg2CJbWdhWNBvMZE5+S0Ac3cDPHXVGvc8hZyTLzozXB6yBidzhLAkU= 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:(13230016)(4636009)(376002)(396003)(136003)(39860400002)(346002)(366004)(7696005)(84970400001)(55016003)(478600001)(53546011)(6506007)(76116006)(8936002)(52536014)(122000001)(41300700001)(38070700005)(4326008)(66476007)(5660300002)(2906002)(8676002)(66446008)(64756008)(38100700002)(66556008)(54906003)(71200400001)(86362001)(26005)(186003)(9686003)(6916009)(316002)(83380400001)(33656002)(66946007); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5201 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: VE1EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9283bb9a-984c-4ba0-6e4a-08da5fec1e95 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UCr/Qpl2Th4DPvxrkctVupZ2XlERxX9eS6RLxM6SGdd7Wl9M/Zx2Db9fJmjh3pUnfVc3yEwBhFIbJZgPaWrahgyjZ2FNTlepLHtMELWNvFPqMOK54P61makjyjO07RlUJG4S2On5V2hxmLmZ0LfSNkzVdnxX5tMDY4RyCcmsAxtpcaWZfqqz7o/vTZkkoOEV2wsz8FMk4Zf79IBuQ7lsh7VFQ5fLluGiJ8ie3sUls/AL00yPI1qRCWCCChabUTMBAA0h8t9tF575f1YCWiMmzuwl1zDqFCJEbuM16eEiMYJ+7jLOi2aSKsjdf4LZZHOGFfjMhsK/Hzhiwk4mDtaVLKnIIWc2h1Dqocv69yjgdLsYE/m432T1w6YmZB/PbdzVTnSPHbWmDFvKMA7uVAQ1ZiMPSrF6kofBrqR+WhGMYBHWaIvb5IZQGLRZylQr/DewpFZYheVh4BTNDjV3PpiXnOTZM8Ya640dyEfZ8Nk9eGOY04G7kVWAWb6FQmqYekTiYVgOWwDxc5RVbbMYBjzYfPhOxIhlEBprINfWPLVagtEjEn1P3YZHdzcuCXBESZZ+gNNvOFH3J9GXaWmvRnikZonxbQcxVA+NcuqIHjfRN3nfzNCESJawihC1EVbcUlxCSf0vJviq2BFt1M/ZuoxWxuccSiyjUHnkgKDp+B10OUHkDrHC4ZyFyAVxTaPn1PK7We6nP6qJmp7UJM1MrvRayfRMu3o9D6ge97Khl5MYK6dZt7ezmQgpD1/Tm8LgW1zkj0Stb9UmXRz48zGUb06YrxdsNO69W50DaF9UbGpzz9pOpj7rkOEnWYuGKgPQ+7zl8lMo89rGGzF/isV0GSjNDlM7YyIzC5mc97da5vHebTA= 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:(13230016)(4636009)(346002)(136003)(396003)(376002)(39860400002)(36840700001)(46966006)(40470700004)(40460700003)(82310400005)(9686003)(47076005)(41300700001)(26005)(186003)(86362001)(336012)(54906003)(316002)(52536014)(6862004)(70206006)(81166007)(2906002)(83380400001)(6506007)(53546011)(8936002)(55016003)(7696005)(84970400001)(478600001)(40480700001)(36860700001)(8676002)(4326008)(33656002)(70586007)(356005)(82740400003)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 07:41:44.7889 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8fdc21ce-caee-4388-7e3d-08da5fec241a 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: VE1EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3707 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, 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-List-Received-Date: Thu, 07 Jul 2022 07:41:53 -0000 > -----Original Message----- > From: Richard Biener > Sent: Thursday, July 7, 2022 8:19 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd > Subject: Re: [PATCH]middle-end: don't lower past veclower [PR106063] >=20 > On Tue, 5 Jul 2022, Tamar Christina wrote: >=20 > > Hi All, > > > > My previous patch can cause a problem if the pattern matches after > > veclower as it may replace the construct with a vector sequence which > > the target may not directly support. > > > > As such don't perform the rewriting if after veclower. >=20 > Note that when doing the rewriting before veclower to a variant not > supported by the target can cause veclower to generate absymal code. In > some cases we are very careful and try to at least preserve code supporte= d > by the target over transforming that into a variant not supported. >=20 > That said, a better fix would be to check whether the target can perform = the > new comparison. Before veclower it would be OK to do the transform > nevertheless in case it cannot do the original transform. This last statement is somewhat confusing. Did you want me to change it suc= h that before veclower the rewrite is always done and after veclowering only if th= e target supports it? Or did you want me to never do the rewrite if the target doesn't support it= ? Thanks, Tamar >=20 > Richard. >=20 > > Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu > > and no issues. > > > > Ok for master? and backport to GCC 12? > > > > Thanks, > > Tamar > > > > > > gcc/ChangeLog: > > > > PR tree-optimization/106063 > > * match.pd: Do not apply pattern after veclower. > > > > gcc/testsuite/ChangeLog: > > > > PR tree-optimization/106063 > > * gcc.dg/pr106063.c: New test. > > > > --- inline copy of patch -- > > diff --git a/gcc/match.pd b/gcc/match.pd index > > > 40c09bedadb89dabb6622559a8f69df5384e61fd..ba161892a98756c0278dc40fc > 377 > > d7d0deaacbcf 100644 > > --- a/gcc/match.pd > > +++ b/gcc/match.pd > > @@ -6040,7 +6040,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) > > (simplify > > (cmp (bit_and:c@2 @0 cst@1) integer_zerop) > > (with { tree csts =3D bitmask_inv_cst_vector_p (@1); } > > - (if (csts && (VECTOR_TYPE_P (TREE_TYPE (@1)) || single_use (@2))) > > + (if (csts && (VECTOR_TYPE_P (TREE_TYPE (@1)) || single_use (@2)) > > + && optimize_vectors_before_lowering_p ()) > > (if (TYPE_UNSIGNED (TREE_TYPE (@1))) > > (icmp @0 { csts; }) > > (with { tree utype =3D unsigned_type_for (TREE_TYPE (@1)); } > > diff --git a/gcc/testsuite/gcc.dg/pr106063.c > > b/gcc/testsuite/gcc.dg/pr106063.c new file mode 100644 index > > > 0000000000000000000000000000000000000000..b23596724f6bb98c53af2dce77 > d3 > > 1509bab10378 > > --- /dev/null > > +++ b/gcc/testsuite/gcc.dg/pr106063.c > > @@ -0,0 +1,9 @@ > > +/* { dg-do compile } */ > > +/* { dg-options "-O2 -fno-tree-forwprop --disable-tree-evrp" } */ > > +typedef __int128 __attribute__((__vector_size__ (16))) V; > > + > > +V > > +foo (V v) > > +{ > > + return (v & (V){15}) =3D=3D v; > > +} > > > > > > > > > > >=20 > -- > Richard Biener > SUSE Software Solutions Germany GmbH, Frankenstra