From patchwork Tue Apr 15 10:31:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alfie Richards X-Patchwork-Id: 110484 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B317C3857BA0 for ; Tue, 15 Apr 2025 10:48:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B317C3857BA0 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=QgImtxxj; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=QgImtxxj X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20612.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::612]) by sourceware.org (Postfix) with ESMTPS id 851DD3857BA0 for ; Tue, 15 Apr 2025 10:33:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 851DD3857BA0 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 851DD3857BA0 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::612 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1744713185; cv=pass; b=HN3tdLZIzL1VedfeFyQeDFlArjkzxYlqSFXqg2cG+vV53we0L4l6zkMVxhLVE5LQQGj6aiNCiSgRCKhbWvU67OOymN4vsjNiefNc8j7SOLzJ0co99fkNHbzGa7A91f1RPSWcVdb8l06o21jZXItOvKS/FvuJlbQdvfbnNf/tlyM= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1744713185; c=relaxed/simple; bh=Z3jJR6BDe4ki7XsGuojO0G5IyPAbNI1XPHdD/0TAtWw=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=ZOgXbIrpCSHOiIMsICENRW0FyNTiThj/mwtNmq51q9EsfqlpU77nkSAUob23FbaZP5Mn6rgkDPdUAZoR7MUgj0u8pilMTO8w38ssr4R+J3GeECK6HFCRVc0PRYXTWzjiAmBPWfPLQhqoi69fIinO/xsfWNOldcltz0Df+w3XmGg= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 851DD3857BA0 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=BvtRRd5gRqtBFk81NmpbdhtGDPLuUEJyfr0jFd4/dYAHrWx/JNQcLjqLXeBygnH9BU09m3M1NQd2ldb9n5dovM/FOEUTJ6g1Zmp0N+bp6PyYwC3LDhIpCvaxqRol8sjdLLJIkpA8DqIWYM5mvUN0FfWCyL8u0DeAuvGzd/S47vSdSDGFUuocksvCI3q+R2VTMsd3Q/6EpbNmVk/5rI4guB7oGr6xm5g2ZtzRXowbdmpIiXwK0oMvxcm4ApP6m6cnMw4BHvHvKm+zrpN8Pg6FJ3asrTNmxCdD+KROGhOiITJ7up/Y9ft0u5IgAw4bV10I+Ne5+UikTvp6C8B7CaVONg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=tmkSdTDEXfyqkPKmK5PN/3tEUBoL9LW7SF3WJC+AlL4=; b=qjV/Oz9TFvbj5lwAbB4ASHHaJLhQ8YQa/NQuvaCQ0cORGvH+m05NF5W7W8miQu5i+Hs2zQmSRibUS6aeLNp17Imh8lCtBFoNNuvNK8pTfG22D06DrX/5b4/zval1Wx80CeA+JoYvIz9zpdNzk3V+fLjjsmQMe2uJrrxi1lNADFreE25zteQzY2cUtO51Y8zvnGZvkXRv1u56BraIIDdg3yvt/1bgOvl+I9qKU8FISxKz3maQlkaKp7GBOEwojtIyS8zFG9xlCoNSHJWG9Aq0iB3gXX9sCiaWS1xlv1iuG3xqhKzUVy+H736F9gkN964Vfdayclu957007buSVda/xA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) 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=0 ltdi=1) 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=tmkSdTDEXfyqkPKmK5PN/3tEUBoL9LW7SF3WJC+AlL4=; b=QgImtxxjab0bHDZOu5ubBwUfxpVevvR59DqQFHwOby9qz2aRvuLPGLfnBuURmuLKiUUfHCfWowGruc9Y92hel4VjUVBzXmx2ikcPEx/W8C+oAysbVvqbbtlo4l9N1pn3R4Iaw3EI4y5wDHYstVidaYkBYhwJjanLWjLEX4IFOjI= Received: from CWLP265CA0329.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:57::29) by GV1PR08MB10978.eurprd08.prod.outlook.com (2603:10a6:150:1f2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.43; Tue, 15 Apr 2025 10:33:01 +0000 Received: from AMS1EPF00000041.eurprd04.prod.outlook.com (2603:10a6:401:57:cafe::82) by CWLP265CA0329.outlook.office365.com (2603:10a6:401:57::29) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8632.36 via Frontend Transport; Tue, 15 Apr 2025 10:33:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) 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 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by AMS1EPF00000041.mail.protection.outlook.com (10.167.16.38) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8606.22 via Frontend Transport; Tue, 15 Apr 2025 10:32:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kJaG3joC8E8Tc7oZ/0rUaM7FgcPCNZws7qiBnP1g3/Gi29KNx3RnaUHCgTfXqdbt47DYd0yTMySReXt56HF4qxfbBBDr2Dgy9lkSeMU8CePkoqioinOaIej69WE222SPYiWXoExKTxpocFpVAHP64Gd1YXpLGXOzSwpfbEtWPGWuRYNU6tWmWDdJgOAeFvzc8FHBMnbWbDA69eWeYxpgAMCbbUhmmQqV0DombxlglJTnf7HIyKcr3wInzC+ivE7i+UpdUnd6pHzvxmRuWzjY7cjuD2RurogdLl+zzo4FqAEWkTG+3PNGbx42aTd1qH9HKhQGbmhhHkFqyP5vauuuGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=tmkSdTDEXfyqkPKmK5PN/3tEUBoL9LW7SF3WJC+AlL4=; b=lHgu8YtQLgbQVNmsks9MqAhAJZowcccxLQqBQUxq9t291vMTL+P/tTIX8QtWjC6olzA2bdEKDFs99T8dzESzTviliYxHRng+q0YXgtqKDTFM52oiVS1SXCZlNZwgqdc35UMhD/5m6TEBEUKiXcQrguO6JiMC7yyjUU3Pm9QGZrjfz57KL4cL1xPypFYuvMUuuV2ZMDKK321p3oCRlfnfVz/wpWoCYEseloaDhL6u14vTjLcit3zKjBhPojOpo5MZ84a3YGEXF2jb5poGvpC+VZyCFgGXspK1XZIZUmhjVuXwRn/ZTofrEP+MQt2xP3GGYj3HEZf0F9slOUYJh4MwTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 172.205.89.229) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) 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=tmkSdTDEXfyqkPKmK5PN/3tEUBoL9LW7SF3WJC+AlL4=; b=QgImtxxjab0bHDZOu5ubBwUfxpVevvR59DqQFHwOby9qz2aRvuLPGLfnBuURmuLKiUUfHCfWowGruc9Y92hel4VjUVBzXmx2ikcPEx/W8C+oAysbVvqbbtlo4l9N1pn3R4Iaw3EI4y5wDHYstVidaYkBYhwJjanLWjLEX4IFOjI= Received: from AM0PR01CA0074.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::15) by PA4PR08MB5904.eurprd08.prod.outlook.com (2603:10a6:102:e5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8632.32; Tue, 15 Apr 2025 10:32:24 +0000 Received: from AMS1EPF00000044.eurprd04.prod.outlook.com (2603:10a6:208:10e:cafe::1) by AM0PR01CA0074.outlook.office365.com (2603:10a6:208:10e::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8632.34 via Frontend Transport; Tue, 15 Apr 2025 10:32:23 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=arm.com; Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; Received: from nebula.arm.com (172.205.89.229) by AMS1EPF00000044.mail.protection.outlook.com (10.167.16.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8606.22 via Frontend Transport; Tue, 15 Apr 2025 10:32:24 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX05.Arm.com (10.240.25.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 15 Apr 2025 10:32:11 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 15 Apr 2025 10:32:10 +0000 Received: from ip-10-248-139-135.eu-west-1.compute.internal (10.252.78.54) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 15 Apr 2025 10:32:10 +0000 From: Alfie Richards To: CC: , , , , , , , , , "Alfie Richards" Subject: [PATCH v4 06/20] Refactor record_function_versions. Date: Tue, 15 Apr 2025 10:31:40 +0000 Message-ID: <20250415103155.1873461-7-alfie.richards@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250415103155.1873461-1-alfie.richards@arm.com> References: <20250415103155.1873461-1-alfie.richards@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS1EPF00000044:EE_|PA4PR08MB5904:EE_|AMS1EPF00000041:EE_|GV1PR08MB10978:EE_ X-MS-Office365-Filtering-Correlation-Id: 76a0cf5f-6785-480c-318a-08dd7c08e484 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info-Original: fbBe7NHrUsazB10d2NgavKMVQk46YgoqU34ZITl27LeXzc9fp/NPX6qb4LQWsKrEh1GQrzuujsC6H/+8tgjtxKPL9rEJQqocjYpHB9WmJDfeo0D6EtcpVBG6WKMVCtPxwl9YcK+GzFYjE+xJXF8YJlf60H7RdB7nwCH5pOgiy0tNzpU9Ih9i+Q406jq5m3JHBj4L/GMpGdK/tycEBK04RzfuXeZGxZltrfXPIo37qnPZReuojRdA2T+T7fE/rg61Pb3EAKfgQIRcXNuXVTt9bVNxyGguoZu9b0bW/nugbWvb2upVacLo5cUXJU+b96u3mw4i+lBqHKkKIqUmUE9Qxj89tIyrpzduA/fncYgakrYRQQkiHOe3stCHU07iqo5BN+RNhWmRL5rpVLI3YwkR6pctEujReJSFUzUtj5MSd2NkyKEJ8GAnVwEkytcvM2CvyeN5wQPixiVhpA0cSJYbjYprWP65STF9o4bRlGUgc+xtQO1X8K8qHbNQBifGcquBuYq8CPXu5q7MoU5/WqXJKtNbifVQIYEuitb3FkzihDyQoDBBfVCrPcGbocCBYfRP9+Av+jgvA0SXLfc27hyLcOVoJRHr+pDVJgKBPVGKfhIVbsJNUFYkqpCnOO5hiy8DnJdSCD2VmJKMH7clUQZ9L1y8crjh/66w98v32CwBgUrL7zDkwuQZnuUMnqtZ0M2eSkMezLGAvy2nQVNByT7rD0d8KiiDAu3wvZFfzOpxP0tpuUxbDnIlTNfLLpJFDxecL+HnnnBqzrIFjT4wETZ4dum+976n9u0545XfYf3c2N+SpOWUdIECNIHaDOvXwdKkcgiiLkcz257QD8BnIJ3TqRJalnJpluAP6ieStdTwhR+4EOI3pK+XMFUVQLdU63reU1qh3mKsGHt2CEWvC1ingZw5wZBlY53vZ4wbIUQkb3beab5j5oYXUbX5gOO/V5OGY690BmtF/pjsS++jCcycVZAXQFPcN1ldet4fpKzd3Ge0ayHwPi1uhDkUHmKhqmr397algtdidPIaknPPxb1nO/qSQCPkMp4pivUvqHPg+yABUCZd2k40f4jaOlaIQ+LIFyF54SkjWlXF/shiUU6wLJpIIH/c18jSDCxtEAXeJ+tmUrGOgF6DO08Vc9Yb8hQPVuG5t1XD5MBhDtUJLXSEkWI6sRmssdzscXGs2IRsnsdr1qyPspjkH4/5cHrS8Urc0MExw66nTCajY93Q9hr5N89vjthUeVzWRfRW58+iBadF/ZC8d8pMsiQ8Q5xMYyCDp3hwaQs/rhAkz4+Z/j5TT4RRD+PBG2X8FEWEbJLzPToYu/MhjR4OAOJ2N+AKBtMB8kwYzSKVHH5Y7r5rcERJ+Bul8BcjauWlZiRfB0ja2/wgJRJTyFbswzj58j/A6Szh6D2KLnHXY6puEQRy8/aga7So2/BwK0w/qBlFILeiP/+GSLj6VHVM2tOJJs7RA0Q36qBwOBSJPf7oZ1jHybX/Y27UUFD5q+ozzoCR9+1fgIOQeTjS0jV+5twppr1HXx8F X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5904 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS1EPF00000041.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 08b32684-4aff-4de6-7995-08dd7c08cfc4 X-Microsoft-Antispam: BCL:0; ARA:13230040|14060799003|376014|1800799024|82310400026|36860700013|35042699022; X-Microsoft-Antispam-Message-Info: +Y4qb+Yt0T5+lz8QYn8HCwIkSq5+c4PJQRZZFVK5RObi/j5t85kec3almAEptxhGmrpvhySRw7XDRsCond8bDph+M4GodnGX+hRjEWlh3y3G1O3oGLva8Oy7MXKYZFQSRzhKvxqWHsjbxlD1F4zAhDPuxxQs59Flvu0m0CNzzXAeVs51e8kJ92fSGRJR670z8pVNz7LEt2yt+7HeVvVIBGmb5EyfirkVafQiZAvSqM5TrhIV8ow5fvBJArJGb2SLNFArFcoUuzHvxic8z2THGwpUHn5Mn/lVRFABqDBbQqlaaMn+5MAo32bqUFM+iaao9NdiW//tV+Y/qnd6Uf+HKHzTs18DivXER1OI4PJYB0wUWNcG2KMCCXDo7IfIAeY23V0tjDkbXVaEj9jRYYo0xbShQdFpLCcmi9FPc5uN6yrBosE2UN/deGhzKeNbWwbDaHXe8YUKNy6oDOJ4/xpLHEZ20v89Pe7xKK2Xn3k1E0mjD1b+ECc45BY/D2kuxVeOFVeyQhklqi+DFctqLBufy58C/f3rdbMbgJK3AhL9AeO03PdCdBK5leowKvKfi1cU7EIGj+Nhiu4PCrqI68w0CLF6QYPrPveM8WmDCjFR9MqtLS1KjhGUwpJk1tFZ67YOVBMJsivLh1mNgyrn2ZUDvC5TY7bKr4fGcW7jqpGexsKOrN0lLCzQWGNF+QAISWB9BxifT+gX4Ks5bUlV6+bL1WODdp8hZWArUkrRKkwJHosBedinXvIU4isAHNRKK1fFaY9Pi4yYrmxk7MJ4CETRymN7g2q0Gj5/Iwi3j1lhR5vkyqBmf62psk9SPAptt8ODtXPWv5y+tamr0EE0l4oNxeH/hlB6B+TusQWrn/EXNuHT1YNzRLHzE52E5AvPROayQJM4kJ47QZmYJgKu14LH0MIZfnprVP+5uxWFWkohTZArRoK/WkcPjdOLI9ZvKP0OhEJpjHxR4nbfyvmdU60TaJgeK0kuo+gov2zoQ2x8eNZR6pQssgQvsQJV/kTqVsFdX4WT3+rGJ+h/98zDteYmlm+64x6HCsgL60TugtN+FDvGypDswrHOUj58XpiZWBnwmwqlaNlPXqxcXQZV0TjT9ddimC6joOtFMMfiO3i28kdfVdkJZREFhj0fYAXFHtEO03i4sb+20eHV8ReNk0ujRlm1JOd/bssfyv/x25gvwufGX+uAKYW+I06edYVCkpQTR/fBs4l3pRlHnKuAl0TktOYkk3ep9wocb/Roawzs7o/Skd8vkkcQ37BA6paDIJOm0T/E7/PN82FIF5XAM5v2t3Gv/aEBeAAkMaF/7ib6cyNu4tGITNhnEQSVYfZDeG7OyDYWMoxN3OPY3DHPWlaNUYsYLSuLk1sRbttvIbqn3sFpaIBjEZHIWlloYw6sy/lwxmrrKuIZXXJJ1Lihtd/evuv25Vy7W2MPrWwj4nnnPbsNdC2zcxQYkrA3zXVu5kRxkzuJuDPd6HX5yfUXRfipTRejRmfJLXU7c3i959sSZ4ghMaGh40pxl4q8eXi3O6kt X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(14060799003)(376014)(1800799024)(82310400026)(36860700013)(35042699022); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2025 10:32:59.0835 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 76a0cf5f-6785-480c-318a-08dd7c08e484 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: AMS1EPF00000041.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB10978 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, 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~patchwork=sourceware.org@gcc.gnu.org Renames record_function_versions to add_function_version, and make it explicit that it is adding a single version to the function structure. Additionally, change the insertion point to always maintain priority ordering of the versions. This allows for removing logic for moving the default to the first position which was duplicated across target specific code and enables easier reasoning about function sets. gcc/ChangeLog: * cgraph.cc (cgraph_node::record_function_versions): Refactor and rename to... (cgraph_node::add_function_version): new function. * cgraph.h (cgraph_node::record_function_versions): Refactor and rename to... (cgraph_node::add_function_version): new function. * config/aarch64/aarch64.cc (aarch64_get_function_versions_dispatcher): Remove reordering. * config/i386/i386-features.cc (ix86_get_function_versions_dispatcher): Remove reordering. * config/riscv/riscv.cc (riscv_get_function_versions_dispatcher): Remove reordering. * config/rs6000/rs6000.cc (rs6000_get_function_versions_dispatcher): Remove reordering. gcc/cp/ChangeLog: * decl.cc (maybe_version_functions): Change record_function_versions call to add_function_version. --- gcc/cgraph.cc | 75 +++++++++++++++++++------------- gcc/cgraph.h | 6 +-- gcc/config/aarch64/aarch64.cc | 34 +++------------ gcc/config/i386/i386-features.cc | 33 +++----------- gcc/config/riscv/riscv.cc | 38 +++------------- gcc/config/rs6000/rs6000.cc | 35 +++------------ gcc/cp/decl.cc | 8 +++- 7 files changed, 78 insertions(+), 151 deletions(-) diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc index 6ae6a97f6f5..feaeebec40b 100644 --- a/gcc/cgraph.cc +++ b/gcc/cgraph.cc @@ -231,45 +231,60 @@ cgraph_node::delete_function_version_by_decl (tree decl) decl_node->remove (); } -/* Record that DECL1 and DECL2 are semantically identical function +/* Add decl to the structure of semantically identical function versions. + The node is inserted at the point maintaining the priority ordering on the versions. */ void -cgraph_node::record_function_versions (tree decl1, tree decl2) +cgraph_node::add_function_version (cgraph_function_version_info *fn_v, + tree decl) { - cgraph_node *decl1_node = cgraph_node::get_create (decl1); - cgraph_node *decl2_node = cgraph_node::get_create (decl2); - cgraph_function_version_info *decl1_v = NULL; - cgraph_function_version_info *decl2_v = NULL; - cgraph_function_version_info *before; - cgraph_function_version_info *after; - - gcc_assert (decl1_node != NULL && decl2_node != NULL); - decl1_v = decl1_node->function_version (); - decl2_v = decl2_node->function_version (); - - if (decl1_v != NULL && decl2_v != NULL) - return; - - if (decl1_v == NULL) - decl1_v = decl1_node->insert_new_function_version (); + cgraph_node *decl_node = cgraph_node::get_create (decl); + cgraph_function_version_info *decl_v = NULL; - if (decl2_v == NULL) - decl2_v = decl2_node->insert_new_function_version (); + gcc_assert (decl_node != NULL); - /* Chain decl2_v and decl1_v. All semantically identical versions - will be chained together. */ + decl_v = decl_node->function_version (); - before = decl1_v; - after = decl2_v; + /* If the nodes are already linked, skip. */ + if (decl_v != NULL && (decl_v->next || decl_v->prev)) + return; - while (before->next != NULL) - before = before->next; + if (decl_v == NULL) + decl_v = decl_node->insert_new_function_version (); + + gcc_assert (decl_v); + gcc_assert (fn_v); + + /* Go to start of the FMV structure. */ + while (fn_v->prev) + fn_v = fn_v->prev; + + cgraph_function_version_info *insert_point_before = NULL; + cgraph_function_version_info *insert_point_after = fn_v; + + /* Find the insertion point for the new version to maintain ordering. + The default node must always go at the beginning. */ + if (!is_function_default_version (decl)) + while (insert_point_after + && (targetm.compare_version_priority + (decl, insert_point_after->this_node->decl) > 0 + || is_function_default_version + (insert_point_after->this_node->decl) + || lookup_attribute + ("target_clones", + DECL_ATTRIBUTES (insert_point_after->this_node->decl)))) + { + insert_point_before = insert_point_after; + insert_point_after = insert_point_after->next; + } - while (after->prev != NULL) - after= after->prev; + decl_v->prev = insert_point_before; + decl_v->next= insert_point_after; - before->next = after; - after->prev = before; + if (insert_point_before) + insert_point_before->next = decl_v; + if (insert_point_after) + insert_point_after->prev = decl_v; } /* Initialize callgraph dump file. */ diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 065fcc742e8..6759505bf33 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -1319,9 +1319,9 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node return m_summary_id; } - /* Record that DECL1 and DECL2 are semantically identical function - versions. */ - static void record_function_versions (tree decl1, tree decl2); + /* Adds DECL to the FN_V structure of semantically identical functions. */ + static void add_function_version (cgraph_function_version_info *fn_v, + tree decl); /* Remove the cgraph_function_version_info and cgraph_node for DECL. This DECL is a duplicate declaration. */ diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 4e801146c60..ffaa5611eaf 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -20777,7 +20777,6 @@ aarch64_get_function_versions_dispatcher (void *decl) struct cgraph_node *node = NULL; struct cgraph_node *default_node = NULL; struct cgraph_function_version_info *node_v = NULL; - struct cgraph_function_version_info *first_v = NULL; tree dispatch_decl = NULL; @@ -20794,37 +20793,16 @@ aarch64_get_function_versions_dispatcher (void *decl) if (node_v->dispatcher_resolver != NULL) return node_v->dispatcher_resolver; - /* Find the default version and make it the first node. */ - first_v = node_v; - /* Go to the beginning of the chain. */ - while (first_v->prev != NULL) - first_v = first_v->prev; - default_version_info = first_v; - while (default_version_info != NULL) - { - if (get_feature_mask_for_version - (default_version_info->this_node->decl) == 0ULL) - break; - default_version_info = default_version_info->next; - } + /* The default node is always the beginning of the chain. */ + default_version_info = node_v; + while (default_version_info->prev) + default_version_info = default_version_info->prev; + default_node = default_version_info->this_node; /* If there is no default node, just return NULL. */ - if (default_version_info == NULL) + if (!is_function_default_version (default_node->decl)) return NULL; - /* Make default info the first node. */ - if (first_v != default_version_info) - { - default_version_info->prev->next = default_version_info->next; - if (default_version_info->next) - default_version_info->next->prev = default_version_info->prev; - first_v->prev = default_version_info; - default_version_info->next = first_v; - default_version_info->prev = NULL; - } - - default_node = default_version_info->this_node; - if (targetm.has_ifunc_p ()) { struct cgraph_function_version_info *it_v = NULL; diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc index c35ac24fd8a..2eb3a21bb5d 100644 --- a/gcc/config/i386/i386-features.cc +++ b/gcc/config/i386/i386-features.cc @@ -3962,7 +3962,6 @@ ix86_get_function_versions_dispatcher (void *decl) struct cgraph_node *node = NULL; struct cgraph_node *default_node = NULL; struct cgraph_function_version_info *node_v = NULL; - struct cgraph_function_version_info *first_v = NULL; tree dispatch_decl = NULL; @@ -3979,37 +3978,15 @@ ix86_get_function_versions_dispatcher (void *decl) if (node_v->dispatcher_resolver != NULL) return node_v->dispatcher_resolver; - /* Find the default version and make it the first node. */ - first_v = node_v; - /* Go to the beginning of the chain. */ - while (first_v->prev != NULL) - first_v = first_v->prev; - default_version_info = first_v; - while (default_version_info != NULL) - { - if (is_function_default_version - (default_version_info->this_node->decl)) - break; - default_version_info = default_version_info->next; - } + /* The default node is always the beginning of the chain. */ + default_version_info = node_v; + while (default_version_info->prev != NULL) + default_version_info = default_version_info->prev; /* If there is no default node, just return NULL. */ - if (default_version_info == NULL) + if (!is_function_default_version (default_node->decl)) return NULL; - /* Make default info the first node. */ - if (first_v != default_version_info) - { - default_version_info->prev->next = default_version_info->next; - if (default_version_info->next) - default_version_info->next->prev = default_version_info->prev; - first_v->prev = default_version_info; - default_version_info->next = first_v; - default_version_info->prev = NULL; - } - - default_node = default_version_info->this_node; - #if defined (ASM_OUTPUT_TYPE_DIRECTIVE) if (targetm.has_ifunc_p ()) { diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 38f3ae7cd84..99f548785db 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -13735,7 +13735,6 @@ riscv_get_function_versions_dispatcher (void *decl) struct cgraph_node *node = NULL; struct cgraph_node *default_node = NULL; struct cgraph_function_version_info *node_v = NULL; - struct cgraph_function_version_info *first_v = NULL; tree dispatch_decl = NULL; @@ -13752,41 +13751,16 @@ riscv_get_function_versions_dispatcher (void *decl) if (node_v->dispatcher_resolver != NULL) return node_v->dispatcher_resolver; - /* Find the default version and make it the first node. */ - first_v = node_v; - /* Go to the beginning of the chain. */ - while (first_v->prev != NULL) - first_v = first_v->prev; - default_version_info = first_v; - - while (default_version_info != NULL) - { - struct riscv_feature_bits res; - int priority; /* Unused. */ - parse_features_for_version (default_version_info->this_node->decl, - res, priority); - if (res.length == 0) - break; - default_version_info = default_version_info->next; - } + /* The default node is always the beginning of the chain. */ + default_version_info = node_v; + while (default_version_info->prev) + default_version_info = default_version_info->prev; + default_node = default_version_info->this_node; /* If there is no default node, just return NULL. */ - if (default_version_info == NULL) + if (!is_function_default_version (default_node->decl)) return NULL; - /* Make default info the first node. */ - if (first_v != default_version_info) - { - default_version_info->prev->next = default_version_info->next; - if (default_version_info->next) - default_version_info->next->prev = default_version_info->prev; - first_v->prev = default_version_info; - default_version_info->next = first_v; - default_version_info->prev = NULL; - } - - default_node = default_version_info->this_node; - if (targetm.has_ifunc_p ()) { struct cgraph_function_version_info *it_v = NULL; diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 737c3d6f7c7..c644d821b48 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -25314,7 +25314,6 @@ rs6000_get_function_versions_dispatcher (void *decl) struct cgraph_node *node = NULL; struct cgraph_node *default_node = NULL; struct cgraph_function_version_info *node_v = NULL; - struct cgraph_function_version_info *first_v = NULL; tree dispatch_decl = NULL; @@ -25334,38 +25333,16 @@ rs6000_get_function_versions_dispatcher (void *decl) if (node_v->dispatcher_resolver != NULL) return node_v->dispatcher_resolver; - /* Find the default version and make it the first node. */ - first_v = node_v; - /* Go to the beginning of the chain. */ - while (first_v->prev != NULL) - first_v = first_v->prev; - - default_version_info = first_v; - while (default_version_info != NULL) - { - const tree decl2 = default_version_info->this_node->decl; - if (is_function_default_version (decl2)) - break; - default_version_info = default_version_info->next; - } + /* The default node is always the beginning of the chain. */ + default_version_info = node_v; + while (default_version_info->prev) + default_version_info = default_version_info->prev; + default_node = default_version_info->this_node; /* If there is no default node, just return NULL. */ - if (default_version_info == NULL) + if (!is_function_default_version (default_node->decl)) return NULL; - /* Make default info the first node. */ - if (first_v != default_version_info) - { - default_version_info->prev->next = default_version_info->next; - if (default_version_info->next) - default_version_info->next->prev = default_version_info->prev; - first_v->prev = default_version_info; - default_version_info->next = first_v; - default_version_info->prev = NULL; - } - - default_node = default_version_info->this_node; - #ifndef TARGET_LIBC_PROVIDES_HWCAP_IN_TCB error_at (DECL_SOURCE_LOCATION (default_node->decl), "% attribute needs GLIBC (2.23 and newer) that " diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 9cb56eac4a9..fb6cde487d3 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -1310,7 +1310,13 @@ maybe_version_functions (tree newdecl, tree olddecl) maybe_mark_function_versioned (newdecl); } - cgraph_node::record_function_versions (olddecl, newdecl); + /* Add the new version to the function version structure. */ + cgraph_node *fn_node = cgraph_node::get_create (olddecl); + cgraph_function_version_info *fn_v = fn_node->function_version (); + if (!fn_v) + fn_v = fn_node->insert_new_function_version (); + + cgraph_node::add_function_version (fn_v, newdecl); return true; }