From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2070.outbound.protection.outlook.com [40.107.103.70]) by sourceware.org (Postfix) with ESMTPS id E0DA53858D20 for ; Tue, 22 Nov 2022 11:02:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E0DA53858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mAqKOxyeN5RoV/poUQ/ImQzm/0tIUqZDgzaV1e2idiw=; b=8Utr2IGUYwcbFnlmCEOkQ6myhknjhQF+r8q4NuxmG8ZqkC24yUe6sJ6ZfIY8bJmS+fe+UiYf9W/XkK8Y88c1xJuPC6zJ8rEjlFczco1LcqM+ZBdYZcTSz7STknUEN2OBXo+8SyZmP1m2jnpL/yun4KTv1yY5NyiFgFyBaau+3nI= Received: from FR3P281CA0191.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a4::9) by DBAPR08MB5590.eurprd08.prod.outlook.com (2603:10a6:10:1aa::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17; Tue, 22 Nov 2022 11:02:21 +0000 Received: from VI1EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a4:cafe::9c) by FR3P281CA0191.outlook.office365.com (2603:10a6:d10:a4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17 via Frontend Transport; Tue, 22 Nov 2022 11:02:20 +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 VI1EUR03FT005.mail.protection.outlook.com (100.127.144.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.8 via Frontend Transport; Tue, 22 Nov 2022 11:02:20 +0000 Received: ("Tessian outbound f394866f3f2b:v130"); Tue, 22 Nov 2022 11:02:20 +0000 X-CR-MTA-TID: 64aa7808 Received: from e25d985d1f95.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E87CD9CA-226F-43BF-B791-0C97ABE472E3.1; Tue, 22 Nov 2022 11:02:09 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e25d985d1f95.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 22 Nov 2022 11:02:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SZSFTCGP2ql8ZvnMXnQ1IP3crwNKVCMyJf2akZvPyxby/sxnP5SRYJyFUNj/FfCYCZuuX07ltrewx0bP9v0Mg9mOfUqTboWXGDGD6SqUBT2TQ7dW6yhboK9mQLiryKpixmAU1UBU2Z1SSdNSpAtvT4GAoXREQldxQz7YSyS35opRELIFjTffGGKzclLyz+wnS3Q0yEGyF33Txwx3fe39wj5lPxgAhMnciJmfECrOwfAsuOUcc2L5cw2wDNDyrVrWhaGq/AGD1OcEeqj3VXh/2tOSRAZIXN4Us3/g3iKMmi1XJiSqPNJ5SMAsMyHdrA4/yNX2jhWuulaKaW1sZ/beGA== 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=mAqKOxyeN5RoV/poUQ/ImQzm/0tIUqZDgzaV1e2idiw=; b=Bqoj5CzuK/mGnOEsJ/hVl8Q5y+EwBzUDU+esCEER83m/oVjHwGzvn9V6d6pKukKqAKC3NftdJA8/I0DkqFIZR6JXRJlK9u2NFlXPFS5UBEZwXWWkbn3k3RAW4EzXd9jkykqsuNrXiTQhWfkRzjMG1skZjqD7tuFn5hOdqaaNoOuMCXNfvpr6Ueb3KhITP4sK//5dlVteLUE2VCe7qMUFscfZt/yw0Yk6AnmruBzTfAihxbiKPmIUwOpeKye1RjqisyP30IRQvBuWv70/h3U2fAzbNo6LnFzyU6pdXDC2ONS2JOP1cLqFeZkarmVn0kH4+tDyUHHUIVUhXul9c8xOfw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mAqKOxyeN5RoV/poUQ/ImQzm/0tIUqZDgzaV1e2idiw=; b=8Utr2IGUYwcbFnlmCEOkQ6myhknjhQF+r8q4NuxmG8ZqkC24yUe6sJ6ZfIY8bJmS+fe+UiYf9W/XkK8Y88c1xJuPC6zJ8rEjlFczco1LcqM+ZBdYZcTSz7STknUEN2OBXo+8SyZmP1m2jnpL/yun4KTv1yY5NyiFgFyBaau+3nI= Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by AM9PR08MB6018.eurprd08.prod.outlook.com (2603:10a6:20b:2df::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17; Tue, 22 Nov 2022 11:02:08 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::bd2a:aff9:b1a0:2fc7]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::bd2a:aff9:b1a0:2fc7%4]) with mapi id 15.20.5857.017; Tue, 22 Nov 2022 11:02:08 +0000 From: Tamar Christina To: Richard Biener , Richard Sandiford CC: Tamar Christina via Gcc-patches , Richard Biener , nd Subject: RE: [PATCH 1/8]middle-end: Recognize scalar reductions from bitfields and array_refs Thread-Topic: [PATCH 1/8]middle-end: Recognize scalar reductions from bitfields and array_refs Thread-Index: AQHY7R/YJ6y2Qwxo8kur+QPMVvoT0K4wOnUAgALVNWCAADpngIAAAoeAgAAPqACAAAMYYIAXgxedgAAGJYCAAAAmYA== Date: Tue, 22 Nov 2022 11:02:06 +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: 9362E4217FEBD24092AB008AC57B393A.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-traffictypediagnostic: VI1PR08MB5325:EE_|AM9PR08MB6018:EE_|VI1EUR03FT005:EE_|DBAPR08MB5590:EE_ X-MS-Office365-Filtering-Correlation-Id: 111d831c-5a7e-47c1-d882-08dacc790704 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: 7s0E028SV8Bz58BVxVaBenSFqx0O30N7h6TZR+f/aOf02l8lEwGhYqPM3eeOlnq7mhyo3uS5KABwjeJJnJs4TsWYn1EM1pmDJH46o6w2tb1UmpiDzYYzz7qmcLFuXSDkWudPrdr8Sqx/1UanNeq9fCE5AUFibRpy0cy6vJaepYvcBnB3N2pbJbUfI+KNaDra8/7upgl12AeVVNPYPOSr9XsrmYtZlly1hXhFSQN8unbbrgVAJo5ItWqv8OZ0+jvxYrnswiLIInoTOiLMoCh9BxNzHciBSOCip6JajarvogvepCetxecyHERHaD2/wwE12QMpcjjVVyjLtxhyUsk4Ndgoxjw0Pi5DV2epIvYXGOA5c6pdJOz0ccE64+111t/T17watpRz8yh63vjkNmtbriZm8Knk+y2VaezmVVwVrrNUxU5pFRg1VdwWDzJg9QGI+QWcNkW4H4aWk9iN08LLBDH2ttMRPSzeXt3DrcigBPCk1e4W80vOjk6DRKLgGxCdH2GYKcga0yA1autGHadezrTAlSdQ9IOdFvULsCs7/eg00Fd+J6vSAh/44i4Djvc0Lerm9XHSQyJtyy8OymNbW8hybmxGarvrKVyBghR9oUV7uXBIWDbfZN+LrrJn9x5VBZytPXGfRGpeSX8fvJMhSSzbxd55lm6vuloq/JwA9++fLSHsqOZMJk4zdWaA5ZyKqweBc5scLQI7AnIschxdUw== 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)(396003)(366004)(136003)(376002)(346002)(39860400002)(451199015)(86362001)(66946007)(4326008)(8676002)(66476007)(66556008)(66446008)(64756008)(76116006)(83380400001)(186003)(53546011)(122000001)(38070700005)(38100700002)(55016003)(6506007)(71200400001)(478600001)(9686003)(7696005)(110136005)(6636002)(316002)(26005)(54906003)(8936002)(2906002)(52536014)(33656002)(41300700001)(5660300002);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: AM9PR08MB6018 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: VI1EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 45728344-9e0f-4394-8969-08dacc78feb8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XMSsxsqGJm5/L2JXfZbV9SCjBiTEZplEElo9eE6ZFRSC4Rj3SKn+ABN12U/BvN/rknzGyuUEZB2Byka3Y5eq95D4Jrvd5IeTxWp9JlC0tOw0XKOE0+eucXhSwXTKstmXBVd60Qu4miYB30kQVKHHvPt5Fh6Y+89Qj3OaW2OmUbNFlB2rMRhPOm2rt+LJMRrgKnz47phZiw4rzCxXAFIcZEJazyFVhCH4qwukgMHOscNJhwZUcBzZwg/A2Z104zbThF6Qtl7a54WVzrf5vENM8SS0rzpPjBpCxuVWwC0T6shhe93y50N8Eos4ZnGuAuYCT7KhMQeZ+BErupnce10c1fD2t/4msbJXLle1BRy6Rm8930GYtKE3EDpgwFBW9NOg++SzrM1ZVeX66E5szyD2E8pn1SGgzfJUXb9XkCX5ObEocZyizTcbggfHN8A6xZ0a6aGpJ2R7dCkNTBU2/Vq6WrT+W5zBVKtp1Vk/C3BmGqMmRZ/d3OeAO6nCC2hkiXjlXxQAxCvQDtMXIaRxnPBJTQDMWk7xpW6kX3M9wzIVFak5inmOC9hzW13h346cJ0K3yk5fcuqFMsd/uG+KOn9pBFz/R6u4nCnUt6MxSzzNcRWLiyrdS8IS2Yl01TWml4YEBlJufNvuHyZ8dmyXUvttSAAU68uRvs8DYIg2W/uhUgyC0Eo7zB08fQQlIsWdgym/UncJcPkY9r1FIOCo9UIFjA== 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)(376002)(396003)(346002)(39860400002)(136003)(451199015)(40470700004)(46966006)(36840700001)(26005)(2906002)(356005)(110136005)(81166007)(55016003)(82740400003)(6506007)(86362001)(83380400001)(478600001)(9686003)(53546011)(40460700003)(36860700001)(33656002)(7696005)(336012)(47076005)(82310400005)(186003)(8936002)(52536014)(41300700001)(40480700001)(4326008)(8676002)(70586007)(5660300002)(70206006)(316002)(6636002)(54906003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2022 11:02:20.6120 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 111d831c-5a7e-47c1-d882-08dacc790704 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: VI1EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5590 X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > -----Original Message----- > From: Richard Biener > Sent: Tuesday, November 22, 2022 10:59 AM > To: Richard Sandiford > Cc: Tamar Christina via Gcc-patches ; Tamar > Christina ; Richard Biener > ; nd > Subject: Re: [PATCH 1/8]middle-end: Recognize scalar reductions from > bitfields and array_refs >=20 > On Tue, 22 Nov 2022, Richard Sandiford wrote: >=20 > > Tamar Christina via Gcc-patches writes: > > >> So it's not easily possible the within current infrastructure. But > > >> it does look like ARM might eventually benefit from something like S= TV > on x86? > > >> > > > > > > I'm not sure. The problem with trying to do this in RTL is that > > > you'd have to be able to decide from two psuedos whether they come > > > from extracts that are sequential. When coming in from a hard > > > register that's easy yes. When coming in from a load, or any other > operation that produces psuedos that becomes harder. > > > > Yeah. > > > > Just in case anyone reading the above is tempted to implement STV for > > AArch64: I think it would set a bad precedent if we had a > > paste-&-adjust version of the x86 pass. AFAIK, the target > > capabilities and constraints are mostly modelled correctly using > > existing mechanisms, so I don't think there's anything particularly > > target-specific about the process of forcing things to be on the genera= l or > SIMD/FP side. > > > > So if we did have an STV-ish thing for AArch64, I think it should be a > > target-independent pass that uses hooks and recog, even if the pass is > > initially enabled for AArch64 only. >=20 > Agreed - maybe some of the x86 code can be leveraged, but of course the > cost modeling is the most difficult to get right - IIRC the x86 backend r= esorts > to backend specific tuning flags rather than trying to get rtx_cost or in= sn_cost > "correct" here. >=20 > > (FWIW, on the patch itself, I tend to agree that this is really an SLP > > optimisation. If the vectoriser fails to see the benefit, or if it > > fails to handle more complex cases, then it would be good to try to > > fix that.) >=20 > Also agreed - but costing is hard ;) I guess, I still disagree here but I've clearly been out-Richard. The prob= lem is still that this is just basic codegen. I still don't think it requires -O2 to be= usable. So I guess the only correct implementation is to use an STV-like patch. Bu= t given that this is already the second attempt, first RTL one was rejected by Rich= ard, second GIMPLE one was rejected by Richi I'd like to get an agreement on thi= s STV thing before I waste months more.. Thanks, Tamar >=20 > Richard.