From patchwork Fri Jun 14 11:49:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 1947879 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=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=jinO8Qnd; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=jinO8Qnd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4W0yJt4sxhz20Pb for ; Fri, 14 Jun 2024 21:50:38 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 587F33882656 for ; Fri, 14 Jun 2024 11:50:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2606::600]) by sourceware.org (Postfix) with ESMTPS id 625543882642 for ; Fri, 14 Jun 2024 11:50:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 625543882642 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 625543882642 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2606::600 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1718365814; cv=pass; b=eOyPqzEoQceJ6thKVcepZBLNlTQIUOVwZlgUhkNk9rFDgbzD4M3Ozthj7sYpxZ7LI0ymX7zRiw4oAPszzDa35wX8nHNBToYoeWR+cuXFPSLiV4l6uc8C2UZ6u2n7oYVvPOvXb/e+mf9syFBKLb0ZOJ6IjcZwK/17TCCt9Ty5m+4= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1718365814; c=relaxed/simple; bh=uyTDcNqTYo9NgSgmrrs33ccBsRrtZmFSaXfBHb/D8Kk=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=ezvkAcXDnS/8uJU1tESDvo9yiPwbeGQOyP/hOWtk28nN55yfMC8s/rQcqB4rQdddb0fvJT2XfpHmgeMbwoEH3Kn0UV56eZCfqpzDDvrwHRgOV+4a37llsAl2NGiNjmr2o6rbszZ0Wbd0quPVmSjnjaDSWwoQiwdnyVucX9MMDZc= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=RDFHDr350IAsTk/t4JW+l03ophiDjToeSDKNVv4yLklDE1Z+N5Y9QkByurnTC1CVQ6+6YN7BnO3/As7J23jR8Bx6YWuDJ3QF172WW5C6IIhXc5UO1aGGIQyRqzx6XnW61kLmgalkrdr2urtkWvk582nbXBnnfgjwsilii9AnH6NTt92rVaOB/jqXRuPtC6H3yQtl1ndshoW7rTGGvS/oTPqArnda/1HEfy8vrFC1xw46igjMyDvU4dmwPYhaM2R0fAoIaM7vt1Ni1Nlk5B95vQ7d6hkfnbkvFdx6RO9/T27cNpawxLz1F/id78Zc6jXxnwjHwv+HsuhIOScb+nbksw== 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=3hryY/96Jodn+qPJIU5quIjLs85QbY6asuqw69ly3YM=; b=oIv+ioO6GpTlNsUP00eUpfZuC92TfWhkwlon5hPh7j0VE5lDwcgLvjJP0B3EEnfhXnMKLySdYGrdRQtu5JYcQSavvgE7Z6rz5v48g2oHwrsQC0wS73C/ekL/nuckWbWzwNti0apn9pZFpW2AcVeiP9eRNC7LsFJ+gqDl32yedE50SkYa2FYFonVG3JhtgzAdPxVmD7vgeAJL8wdB4v7pesaAFdr90VKn/eQ++QpgtzqWPrw2JRf+TH/bnlkmB7DuCQFhLHp4TEJbiY8KrFWZ1SlCZkvtzDes7oQPirX+UXm2d2j3DXh8RK9SR1xvgSjhVC356HeK3/S8IwhBbPzvIA== 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=arm.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]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3hryY/96Jodn+qPJIU5quIjLs85QbY6asuqw69ly3YM=; b=jinO8Qnd1j9cc039yARNjy9+hyHBLXBW4arOlD2cOuDXeZxUGY4mbOa2kOc4LyGnoexhixs17hTWfpH+WWwSkOFsubirWXsGT9TL/Amv34u+DWJ/NjWdTVkW9w4GJqtSHJf2sS7sj01nYdvsysGegN43xb/qfXJSLyAEEyiKX38= Received: from AS9PR05CA0352.eurprd05.prod.outlook.com (2603:10a6:20b:490::29) by DB9PR08MB9780.eurprd08.prod.outlook.com (2603:10a6:10:45f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24; Fri, 14 Jun 2024 11:50:06 +0000 Received: from AM2PEPF0001C70A.eurprd05.prod.outlook.com (2603:10a6:20b:490:cafe::26) by AS9PR05CA0352.outlook.office365.com (2603:10a6:20b:490::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25 via Frontend Transport; Fri, 14 Jun 2024 11:50:06 +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=arm.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 AM2PEPF0001C70A.mail.protection.outlook.com (10.167.16.198) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Fri, 14 Jun 2024 11:50:06 +0000 Received: ("Tessian outbound 5a0abdb578b5:v332"); Fri, 14 Jun 2024 11:50:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 46c2ed56177c04ae X-CR-MTA-TID: 64aa7808 Received: from c248a7bb88d7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 16A70198-8FE6-4DA2-8EC9-814C63730E71.1; Fri, 14 Jun 2024 11:49:58 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c248a7bb88d7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 14 Jun 2024 11:49:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WU6E0GbieFlijSBDwkGU358r0uyTFGSB1cRN8uwxhHs7gteGBuNKpWv2Nvjo27bjIvXMyBUENTJPupLjYvGdLDnprDe2aLaLX4WoJT/XDWRUqLuRDv0fhfwlYNzo3Y/2WiIupixl+kkY9B+QutdRzTIlzxk8UD3qx6biR9FoDuel3YEFQtKcwPOkyAA+Cf3CiB/xcs4A3Miypyh7sUzFY7c8a6neX0OIxNO/Ul8gJ05oTOvEhJ5fC4O7oKgTXX0KJ7kOWa0xfMWuT4mIG+0rdhFsj4VHE0tyj6syhlbzEanE3Y+vyVh7lTZxKC/rIbdi86uw2dgI5b9SDtlknoYZng== 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=3hryY/96Jodn+qPJIU5quIjLs85QbY6asuqw69ly3YM=; b=lKlMBTXSBfmGxkhv8ekv4YW2FYjoP6F09NeZyCfeD2EtcYAB5fTLINs1E374sx3kxRlvRJEw+p55gaTOxdhaYbADZ9xKCIhdI5Cnr0CfselBniwPkGEuNB6EvZuSwdR/Yk7nK3rmpnZrzGJB80YC+F5iuBBVj5+XnzEmgxFgRIbPhP0XFvGBbSqbd7aUuQ29XgnImWftVjpOCwrkEi8tKamdGAU8m65VdwKJ41qggVoyEsT7IVI155xLXohLo8tDxVW1CGPDs8qMkGT8//NiUHPWKPBxmdKqLPajtMqINguwVC6vsMFtvnzG0XuL0QMOy0DRapL1FvlKlE1qi5vqtQ== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3hryY/96Jodn+qPJIU5quIjLs85QbY6asuqw69ly3YM=; b=jinO8Qnd1j9cc039yARNjy9+hyHBLXBW4arOlD2cOuDXeZxUGY4mbOa2kOc4LyGnoexhixs17hTWfpH+WWwSkOFsubirWXsGT9TL/Amv34u+DWJ/NjWdTVkW9w4GJqtSHJf2sS7sj01nYdvsysGegN43xb/qfXJSLyAEEyiKX38= 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 AM9PR08MB6114.eurprd08.prod.outlook.com (2603:10a6:20b:287::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25; Fri, 14 Jun 2024 11:49:57 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::89dc:c731:362b:7c69]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::89dc:c731:362b:7c69%6]) with mapi id 15.20.7633.033; Fri, 14 Jun 2024 11:49:57 +0000 Date: Fri, 14 Jun 2024 12:49:54 +0100 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, bin.cheng@linux.alibaba.com Subject: [PATCH][ivopts]: use affine_tree when comparing IVs during candidate selection [PR114932] Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO3P123CA0001.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:ba::6) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|AM9PR08MB6114:EE_|AM2PEPF0001C70A:EE_|DB9PR08MB9780:EE_ X-MS-Office365-Filtering-Correlation-Id: 74430a6f-a7ab-40e5-1bbb-08dc8c68228e x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info-Original: TDWCqdvgkh6vNKy3Gyd8VDBevJY4+IA/W0j+sBDPvT5zPU+2TXBNQio8NrLPne8pm9AGopnOYV2tpRuYywj4bKxzp6xBU5UIRVd/r8WabBc3flncazwO7mUPDXzv10KDEM5on0IacPG1nhtl47WSVS/P4+l2SqxC/t5MAJ113zN+ULH3hHM3fV+s+NklStcLdlcsfLVeHezb3cbpq+LsoiePXhI9XEV8qDcxEhSpjQErC5yu8tsKL2kxrutYUkixodIDv9fbfIUKMsCQZ23uSmBKBmcZ3p9A2Gqb6IILV3cTkcIHVWsG+J3qFkKCn0QmCQ0XRz07u5ei1eQO7Qui91t+7r1/VEtsX6gynUn8MQMTfs+BwylVTZS8PyEH2ZAkPOUDlt/CMQsVvQbtK/60WGFZ/bj3Su1TpXvYEcLg12+TLrJ6gc3OStpRvJe/A51BscNqxcEb+Of2gr06GNUViCLk+VxQI3BZoJ5O7Cut9UwG4W5jQETU1cbzkkXu06xs6tCxhpxUNEd9O0Q9vfBz8A3Nu0DyTTpxxbM3Kc2xeG+M4ArJnikU2Rq0HdDiU7rsbB28epCs/VkLqnm2b6U6dbVMOxvmh4ZkdO6L8vrzSy6MW8Z4WQLsBCXVceuC+nKdIhujGkHNexM1Zq6pLFXYFkX9gcV8/7Lh0rVF875DBI2ljcFWXBgVpjrEaWdDfiTxswjXTLlQlHvGz+lIrOg8Px8r8QlhHdDCFOt9PeASInnHKFxK3XcQbViT/IHHhlXAui++Y6NMlW0AY8vbP850Dvqy7L0X94HC//fBWVDTeL3rOgvcRvHko71I1kjQ1YqzpZVJ/7DyiDf28zRp3poTPo7TVY2nCoJt4Kec9OyTOEkSxOkSteleirZtA4qnLqUVRzjiDRXKli/EhQPBGa8nLwkmW1dfwnD5u9K1Ed68fUo466uZJ1yyw1m18+u5+Dq5en1e11pzMifkYPmS/jJBwNfPzWGNfrh26vkdcLzi7tXrvONCz2WHl2h0Fug0G2AxGVUHONNDdohZEU2HbnaxCGx5snUpBcVFp+zd4X7GhVLNHqMthumcojvLX82b1eQ+1eCBq2iJ5/1+lAXd8fLfhESDoBOl47OibGI7xsgw48861V5mKa86jPZerFyN4gw3NaF53AGJp+ED5MvKHNTQnvZ3klyp3y3cMCvAtWmpW4so5IP1kePTB1nW9M0+w2wI/yHNiznUJT/xx0Fi121TuWV71BcDNZhW6wENCOteBKbbkbMzno43orzWSHqh4wNV 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:(13230037)(366013)(376011)(1800799021); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6114 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: AM2PEPF0001C70A.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 339d9af4-0982-4288-d4b8-08dc8c681cef X-Microsoft-Antispam: BCL:0; ARA:13230037|376011|36860700010|34020700013|1800799021|35042699019|82310400023; X-Microsoft-Antispam-Message-Info: =?utf-8?q?keZXpF2wqSNY/F0wrnIfshRyf+gQ7L4?= =?utf-8?q?UaMLQAiTf0NXP3QSmfNpByqeUTHXSc6IE9nnb+/A3wDApvnREfB/aVZBiw83F5L0a?= =?utf-8?q?ehjliSfKcXlEDUXCs5Remj+kU3Z7cfUq+Xqk9zlXUS5jUqzqWtbWvidUrzwIc0Dmn?= =?utf-8?q?tDBBKl+1ALT0G5qAtEqel6EuOnF7fhoAUgU0448mVswrr8WpIzhczsN+IZgmYeqnb?= =?utf-8?q?IClgeS25h/3JtfaB6tQm1QqGWqsYZV7DiGUAJj2kAY+rwH3CQH/C85lvq2MZLfSjF?= =?utf-8?q?sh1jxvicp/dM5SBGE2hRVzEbRLuOC6HhD3Wxsj4EzbIGqPElRmkqrARPcB0rYHWst?= =?utf-8?q?vw6PyH2lAMSmIFSXTNYsE3b9j9X0zNQMW4G1USt882aXQoUUmfNhuxyNbg943+UUr?= =?utf-8?q?XKMQczzENfopQMzWP2i2GcJMKLJ+1YWYxmJ4GTEE6IUYLoPVQue4W9JwT+fTxcbNh?= =?utf-8?q?b1DfAyuS+l4EWzEMUH8MzmjhH8H4hlIFpAR0oOgdUgZnaxOHbQdBAXG8mnqUzGd+U?= =?utf-8?q?egS9z3uyL4ILL1hJ/imATljqn14SbNuw5e904esIwdnqt4c4cnS31GajwRKj+Hviz?= =?utf-8?q?Lfj7pmyiyHGCwgTs8954ZT5lYl4glrapetjzS5THV/4r8zbjlPHKzBZn1a9nkkle5?= =?utf-8?q?n1O+dd//2ua+RZhiCHey5LYzumZiYnhk/YtEn8WhAyGAzBCxtcIi6/Vt26my0Mybc?= =?utf-8?q?/SqDg4KgyXd1D7kMItmtRIFyIz3V0TnQuc1WsXRHj3r/i6Nm9meGq2qwSPVd0UlFH?= =?utf-8?q?7AugDrIFT7wy3VDPM7sz1EI2iJa90hrE4A/UWyW0iayhXj9RabCAmI3Q2H7W4LelM?= =?utf-8?q?BSxRBO+mws9smvMcSEJ/o5medJ8yFsBR06H5ANqmFFWxIfAcrr9fNfnHqMYN5E4aA?= =?utf-8?q?3C4D39gzyIADdaLZ3nij91UKIqEumqqiUh4nJ3/4HhqzL7RdpFvEy5VeoIt8UgKy4?= =?utf-8?q?74OmgTkzWrNeWqOLyTTMSHcNQxLgz2snTKTXkq9ua2soqzUrgnbQyk6ADo8bV+WnD?= =?utf-8?q?WuqHTGRNcjhAsLiQ6BQr/uzrkOzAEUa2nHkqhZ74C+QFNopmwt156yLbIYr+R+hDc?= =?utf-8?q?68sZPCgNoAzmm7d6CUh/+KwP1atJSt3BrLGVA8J3AgyncghjQ7kfpxgr5t54V5/DZ?= =?utf-8?q?yf1yWL3yVs/vif9xZjMmilG5Fv1O+4OJ6YvUVqQBFRNufc2pVUNvT48LerELNfiPO?= =?utf-8?q?DYOlr4Tc8BpN1ihb3OQgPnSvnbHsNimXSNr8Ilzkilhw4+TUm5rh0dbVQrgkcVtyQ?= =?utf-8?q?5OU7XVIuYrwmusZSKHrgnEPRCgbGcaQWJBEv0pHICHPXhTWbAHR73Iew=3D?= 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:(13230037)(376011)(36860700010)(34020700013)(1800799021)(35042699019)(82310400023); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2024 11:50:06.3212 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 74430a6f-a7ab-40e5-1bbb-08dc8c68228e 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: AM2PEPF0001C70A.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9780 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_LOTSOFHASH, 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.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 Hi All, IVOPTS normally uses affine trees to perform comparisons between different IVs, but these seem to have been missing in two key spots and instead normal tree equivalencies used. In some cases where we have a structural equivalence but not a signedness equivalencies we end up generating both a signed and unsigned IV for the same candidate. This happens quite a lot with fortran but can also happen in C because this came code is unable to figure out when one expression is a multiple of another. As an example in the attached testcase we get: Initial set of candidates: cost: 24 (complexity 3) reg_cost: 9 cand_cost: 15 cand_group_cost: 0 (complexity 3) candidates: 1, 6, 8 group:0 --> iv_cand:6, cost=(0,1) group:1 --> iv_cand:1, cost=(0,0) group:2 --> iv_cand:8, cost=(0,1) group:3 --> iv_cand:8, cost=(0,1) invariant variables: 6 invariant expressions: 1, 2 : inv_expr 1: stride.3_27 * 4 inv_expr 2: (unsigned long) stride.3_27 * 4 These end up being used in the same group: Group 1: cand cost compl. inv.expr. inv.vars 1 0 0 NIL; 6 2 0 0 NIL; 6 3 0 0 NIL; 6 which ends up with IV opts picking the signed and unsigned IVs: Improved to: cost: 24 (complexity 3) reg_cost: 9 cand_cost: 15 cand_group_cost: 0 (complexity 3) candidates: 1, 6, 8 group:0 --> iv_cand:6, cost=(0,1) group:1 --> iv_cand:1, cost=(0,0) group:2 --> iv_cand:8, cost=(0,1) group:3 --> iv_cand:8, cost=(0,1) invariant variables: 6 invariant expressions: 1, 2 and so generates the same IV as both signed and unsigned: ;; basic block 21, loop depth 3, count 214748368 (estimated locally, freq 58.2545), maybe hot ;; prev block 28, next block 31, flags: (NEW, REACHABLE, VISITED) ;; pred: 28 [always] count:23622320 (estimated locally, freq 6.4080) (FALLTHRU,EXECUTABLE) ;; 25 [always] count:191126046 (estimated locally, freq 51.8465) (FALLTHRU,DFS_BACK,EXECUTABLE) # .MEM_66 = PHI <.MEM_34(28), .MEM_22(25)> # ivtmp.22_41 = PHI <0(28), ivtmp.22_82(25)> # ivtmp.26_51 = PHI # ivtmp.28_90 = PHI ... ;; basic block 24, loop depth 3, count 214748366 (estimated locally, freq 58.2545), maybe hot ;; prev block 22, next block 25, flags: (NEW, REACHABLE, VISITED)' ;; pred: 22 [always] count:95443719 (estimated locally, freq 25.8909) (FALLTHRU) ;; 21 [33.3% (guessed)] count:71582790 (estimated locally, freq 19.4182) (TRUE_VALUE,EXECUTABLE) ;; 31 [33.3% (guessed)] count:47721860 (estimated locally, freq 12.9455) (TRUE_VALUE,EXECUTABLE) # .MEM_22 = PHI <.MEM_44(22), .MEM_31(21), .MEM_79(31)> ivtmp.22_82 = ivtmp.22_41 + 1; ivtmp.26_72 = ivtmp.26_51 + _80; ivtmp.28_98 = ivtmp.28_90 + _39; These two IVs are always used as unsigned, so IV ops generates: _73 = stride.3_27 * 4; _80 = (unsigned long) _73; _54 = (unsigned long) stride.3_27; _39 = _54 * 4; Which means that in e.g. exchange2 we generate a lot of duplicate code. This is because candidate 6 and 8 are structurally equivalent but have different signs. This patch changes it so that if you have two IVs that are affine equivalent to just pick one over the other. IV already has code for this, so the patch just uses affine trees instead of tree for the check. With it we get: : inv_expr 1: stride.3_27 * 4 : Group 0: cand cost compl. inv.expr. inv.vars 5 0 2 NIL; NIL; 6 0 3 NIL; NIL; Group 1: cand cost compl. inv.expr. inv.vars 1 0 0 NIL; 6 2 0 0 NIL; 6 3 0 0 NIL; 6 4 0 0 NIL; 6 Initial set of candidates: cost: 16 (complexity 3) reg_cost: 6 cand_cost: 10 cand_group_cost: 0 (complexity 3) candidates: 1, 6 group:0 --> iv_cand:6, cost=(0,3) group:1 --> iv_cand:1, cost=(0,0) invariant variables: 6 invariant expressions: 1 The two patches together results in a 10% performance increase in exchange2 in SPECCPU 2017 and a 4% reduction in binary size and a 5% improvement in compile time. There's also a 5% performance improvement in fotonik3d and similar reduction in binary size. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: PR tree-optimization/114932 * tree-affine.cc (aff_combination_constant_multiple_p): Take zero offsets into account. * tree-ssa-loop-ivopts.cc (affine_compare_eq): New. (record_group_use): Use it. (constant_multiple_of): Also check equality under aff_combination_constant_multiple_p. gcc/testsuite/ChangeLog: PR tree-optimization/114932 * gfortran.dg/addressing-modes_2.f90: New test. --- -- diff --git a/gcc/testsuite/gfortran.dg/addressing-modes_2.f90 b/gcc/testsuite/gfortran.dg/addressing-modes_2.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8eee4be3dc4d69fecfacd4c2e24a4973c8539fae --- /dev/null +++ b/gcc/testsuite/gfortran.dg/addressing-modes_2.f90 @@ -0,0 +1,20 @@ +! { dg-do compile { target aarch64-*-* } } +! { dg-additional-options "-w -Ofast -fdump-tree-ivopts-all" } + +module a +integer, parameter :: b=3, c=b +contains +subroutine d(block) +integer f, col , block(:, :, :), e +do f = 1, c + do col = 1, c + block(:f, :, e()) = do + end do + end do + end + end + +! { dg-final { scan-tree-dump-not {Selected IV set for loop .+ niters, 3 IVs:} ivopts } } +! { dg-final { scan-tree-dump-times {Selected IV set for loop .+ niters, 2 IVs:} 1 ivopts } } +! { dg-final { scan-tree-dump-times {Selected IV set for loop .+ niters, 1 IVs:} 1 ivopts } } + diff --git a/gcc/tree-affine.cc b/gcc/tree-affine.cc index d6309c4390362b680f0aa97a41fac3281ade66fd..b141bf23c1bbea1001b1bb286346890ddeab4096 100644 --- a/gcc/tree-affine.cc +++ b/gcc/tree-affine.cc @@ -941,6 +941,13 @@ aff_combination_constant_multiple_p (aff_tree *val, aff_tree *div, &mult_set, mult)) return false; + /* Everything is a multiple of 0, which means we shoudn't enforce that + mult_set is checked, since that forced the only valid multiple of + val and div to be 0 whereas 1 is also possible. */ + if (known_eq (val->offset, 0) + && known_eq (div->offset, 0)) + mult_set = false; + for (i = 0; i < div->n; i++) { class aff_comb_elt *elt diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc index 7a277aaf18a9e0a32b8ac0d23332b7cd9945ef98..b11bd62a86092ba972a648764cd2facd9ddb4914 100644 --- a/gcc/tree-ssa-loop-ivopts.cc +++ b/gcc/tree-ssa-loop-ivopts.cc @@ -757,6 +757,19 @@ single_dom_exit (class loop *loop) return exit; } +/* Compares the given affine tree LEFT with the tree expression RIGHT and return + whether they are the same under affine equality. */ + +static bool +affine_compare_eq (aff_tree &left, tree right) +{ + aff_tree aff_right; + tree_to_aff_combination (right, TREE_TYPE (right), &aff_right); + aff_combination_scale (&aff_right, -1); + aff_combination_add (&aff_right, &left); + return aff_combination_zero_p (&aff_right); +} + /* Given a nested expression in ARG consisting of PLUS or MULT try to see if one of the arguments of each expression is a constant and that the type of the @@ -1673,6 +1686,9 @@ record_group_use (struct ivopts_data *data, tree *use_p, tree addr_base = NULL; struct iv_group *group = NULL; poly_uint64 addr_offset = 0; + aff_tree iv_step, iv_addr_base; + + tree_to_aff_combination (iv->step, TREE_TYPE (iv->step), &iv_step); /* Record non address type use in a new group. */ if (address_p (type)) @@ -1683,6 +1699,7 @@ record_group_use (struct ivopts_data *data, tree *use_p, tree addr_toffset; split_constant_offset (iv->base, &addr_base, &addr_toffset); addr_offset = int_cst_value (addr_toffset); + tree_to_aff_combination (addr_base, TREE_TYPE (addr_base), &iv_addr_base); for (i = 0; i < data->vgroups.length (); i++) { struct iv_use *use; @@ -1694,8 +1711,8 @@ record_group_use (struct ivopts_data *data, tree *use_p, /* Check if it has the same stripped base and step. */ if (operand_equal_p (iv->base_object, use->iv->base_object, 0) - && operand_equal_p (iv->step, use->iv->step, 0) - && operand_equal_p (addr_base, use->addr_base, 0)) + && affine_compare_eq (iv_step, use->iv->step) + && affine_compare_eq (iv_addr_base, use->addr_base)) break; } if (i == data->vgroups.length ()) @@ -2231,6 +2248,14 @@ constant_multiple_of (tree top, tree bot, widest_int *mul) return true; } + aff_tree aff_top, aff_bot; + tree_to_aff_combination (top, TREE_TYPE (top), &aff_top); + tree_to_aff_combination (bot, TREE_TYPE (bot), &aff_bot); + poly_widest_int poly_mul; + if (aff_combination_constant_multiple_p (&aff_top, &aff_bot, &poly_mul) + && poly_mul.is_constant (mul)) + return true; + code = TREE_CODE (top); switch (code) {