| Message ID | 20250415041957.E6ADB20436@pchp3.se.axis.com |
|---|---|
| State | New |
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> 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 CACA4385843D for <patchwork@sourceware.org>; Tue, 15 Apr 2025 04:20:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CACA4385843D Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=axis.com header.i=@axis.com header.a=rsa-sha256 header.s=selector1 header.b=pc9Eqebc X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on20628.outbound.protection.outlook.com [IPv6:2a01:111:f403:2608::628]) by sourceware.org (Postfix) with ESMTPS id 94D33385841C for <gcc-patches@gcc.gnu.org>; Tue, 15 Apr 2025 04:20:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 94D33385841C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 94D33385841C Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2608::628 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1744690804; cv=pass; b=gRivtgFLKaT6tceIkreE/SS3ZcpYKCmMGEOLsdtre6YP2gC3V55qnRECRYuIRrWuWMViTjZK8jSky0fwFe9LE/iDghDiLvKMFDEnnYIbu16QD2flGo0ZgHicxSfz1iWTXNH3Nn3SwUCwlBRIARt2R3N5an2avQgsxRvGlym/rg8= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1744690804; c=relaxed/simple; bh=Oo9NziF9rDbxKTc3rDJUEXPsFYHZMcCdpwKojioi2Cc=; h=DKIM-Signature:From:To:Subject:MIME-Version:Message-ID:Date; b=b7HVYeWbuvgAfOYWDgkWx3J//bgTTkf92SPTmc/QcYVbUckGAvzLxXa7m63d7wv1yzgUW70cYmHys8+wF8rHlVPwAEpH2bnswClGIQ3sO2HXdeNFhLb71enhcRvjC/WoaqN28yzD5iloDHFMF+rbnJWveIG38dY/f30tfXThxRM= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94D33385841C ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LHLxoa9zrc3m0zltUOC3e3pMfr+idpah3Pq0WRE/MazrkENeALL8TzXqcMs3LAMZ90ltrfHxoDo1f0XwKG5knRXHQmoSC5Ye3PNpiVO4RqV3P+JawLYpz1RxuRnjK1FlrwxmFtBjKxgOKJEX2uGXCX1AAk9uju2bbDoO1JXv+yP+Ui33dj8NXd6D7UoSuCAwavAbBzJAI9iwoK6Dfqwhp+Rd4sroP2Pv9ca3BRo4g/KG9Zsuek+WChZPkNLa8oFrcosA1CL9mSmphKr6ZBEQyKPqw4SP/Xb2dEzydgrbPGx50B3Ajr7DQKwWGOfk93ByEEvoaXeZiOV0IO7jEif33w== 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=BRkBtdn4NX7QT4fdDlSw6hEUbQg35RSudFfjI8VTMrc=; b=I8qKLwnPRAv5F8fn9GjGph5yr5nec+DPfx7wFSggLSz/erij4F7d3FubDdR1WpdxQC1yxnRWXaj51/BAAj0WmiHK+wPOunmUEWL9/5XcmMHiPwlnnnGplQoibxTZZBbG8SRPnNSMM486xlSjOx9tUESnoH2e6PyoynC2nEQbw7XXFwH++yUjwAg/whgfTgPXWKMf3+gy+fz7cxGLttHcONQh3+0JOwhgTetzanZDMtQgWdOA0goZJ3qQcGqGR0tPPzVi4BS5uK5q+eQT8YQYE/zwHrgLRjDCdOS4vDarAmbHX/ySJn1RCQVA8EZqIQjRnyPRX4PqDIN5wtNqnSQ4qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BRkBtdn4NX7QT4fdDlSw6hEUbQg35RSudFfjI8VTMrc=; b=pc9Eqebc+P5WTrPxbRW/mh/E2OUWMVtSdo9bdamTjWMc5Z3Vdjppb/GBtNGaU++Y4Hb6p0A4nX9KmITCwbKrRDMMoZis1RsriiX50e4TY/RH9L753ejPFvXMeCid7zNILo4Uh1P6A9KYjA8ey2tZXOdUSYjcC3hBtmcqZ1HMMsM= Received: from AM9P193CA0023.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:21e::28) by AS8PR02MB7109.eurprd02.prod.outlook.com (2603:10a6:20b:2b4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8632.33; Tue, 15 Apr 2025 04:19:59 +0000 Received: from AM2PEPF0001C70C.eurprd05.prod.outlook.com (2603:10a6:20b:21e:cafe::ba) by AM9P193CA0023.outlook.office365.com (2603:10a6:20b:21e::28) 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 04:19:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by AM2PEPF0001C70C.mail.protection.outlook.com (10.167.16.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8655.12 via Frontend Transport; Tue, 15 Apr 2025 04:19:58 +0000 Received: from SE-MAIL21W.axis.com (10.20.40.16) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Tue, 15 Apr 2025 06:19:58 +0200 Received: from se-mail01w.axis.com (10.20.40.7) by SE-MAIL21W.axis.com (10.20.40.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Tue, 15 Apr 2025 06:19:58 +0200 Received: from se-intmail02x.se.axis.com (10.4.0.28) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2507.44 via Frontend Transport; Tue, 15 Apr 2025 06:19:58 +0200 Received: from pchp3.se.axis.com (pchp3.se.axis.com [10.88.21.53]) by se-intmail02x.se.axis.com (Postfix) with ESMTP id F054851B; Tue, 15 Apr 2025 06:19:57 +0200 (CEST) Received: by pchp3.se.axis.com (Postfix, from userid 171) id E6ADB20436; Tue, 15 Apr 2025 06:19:57 +0200 (CEST) From: Hans-Peter Nilsson <hp@axis.com> To: <gcc-patches@gcc.gnu.org> CC: <roger@nextmovesoftware.com> Subject: [PATCH] combine: Correct comment about combine_validate_cost MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-ID: <20250415041957.E6ADB20436@pchp3.se.axis.com> Date: Tue, 15 Apr 2025 06:19:57 +0200 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C70C:EE_|AS8PR02MB7109:EE_ X-MS-Office365-Filtering-Correlation-Id: 79b0ded1-3db5-451b-43b1-08dd7bd4c89f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?q?a1FJIkkKLfP8mtoqfL2Jgotllp?= =?iso-8859-1?q?IoQqrXGVJr3JeijUV3EpCzfApPoXe5x9565OSS0ixTzq69v1vnPzxGRRDvw9?= =?iso-8859-1?q?b9giOFaasKxrO+5+xpnB6Cf6cCtI++sxDx4pIaxljVQk2MpoC5yXLTfz/dGn?= =?iso-8859-1?q?qq0+PZZJTnZQ+BspwCMReBpnmaTNZmzbXkGm46SiVW3DaSQz6nmwNtWMaCIt?= =?iso-8859-1?q?NtVe8aueOatq4t49nPL4o2KcHukOFtGmKZxs9Qqbbb+GVZJar9Wfi2GhAodX?= =?iso-8859-1?q?pSc9kP0SjWUvsKa1OuMRzopNDv2qAKa/T2kSnomZV6neYJ8D6SiRqR6HKInJ?= =?iso-8859-1?q?ACfe5E/o1J3ewE7lmBofhxS0jSU1ndQ79at3sCTx93sXz82UAuZutOzYDmvd?= =?iso-8859-1?q?cPdhuCIis3NbsaebwcUZgNgrj24j2vbPh55Kyns/JX0QGS3etMBsVpOxjnft?= =?iso-8859-1?q?Z6UQHkDKIpljHpqscJnmngtVKjBEke8IXeS5gb15eBiWba+oUUxgzojuf3I/?= =?iso-8859-1?q?bDNb9piAx3u32CFwELbQjQgAXHseQWPoSfsZH/BT4MddsgADA5rAiZAIcvSl?= =?iso-8859-1?q?NUBgrn5twJBEXrlNsp5M60FDGlLf2EP1bus5TcS4X/xCi/o9YBsnqf9tOPyV?= =?iso-8859-1?q?bjfy+LdgBKZ19rUSQQ8v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BsCRWFt0OqN6fRHfGiLv?= =?iso-8859-1?q?go5z0xY9VA?= X-Forefront-Antispam-Report: CIP:195.60.68.100; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.axis.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2025 04:19:58.5329 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 79b0ded1-3db5-451b-43b1-08dd7bd4c89f X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af; Ip=[195.60.68.100]; Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C70C.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR02MB7109 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
| Series |
combine: Correct comment about combine_validate_cost
|
|
Checks
| Context | Check | Description |
|---|---|---|
| linaro-tcwg-bot/tcwg_simplebootstrap_build--master-aarch64-bootstrap | pending | Patch applied |
| linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 | success | Build passed |
Commit Message
Hans-Peter Nilsson
April 15, 2025, 4:19 a.m. UTC
Noticed while investigating a regression for cris-elf with r15-9239-g4d7a634f6d4102 "combine: Allow 2->2 combinations, but with a tweak [PR116398]" (to-be-reported). The comment was introduced when breaking out the combine_validate_cost function, in r0-59417-g64b8935d4809f3. I thought about wordsmithing to keep the "polarity" of the statement, but "are equal to or cheaper than" didn't read well. Ok to commit? -- >8 -- The *code* has been the same since forever, but this comment, at a critical path, is misleading: if the new cost is the same (like, when doing an identity replacement), then combine_validate_cost returns true. * combine.cc (try_combine): Correct comment about combine_validate_cost. --- gcc/combine.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hans-Peter Nilsson <hp@axis.com> writes: > Noticed while investigating a regression for cris-elf with > r15-9239-g4d7a634f6d4102 "combine: Allow 2->2 combinations, > but with a tweak [PR116398]" (to-be-reported). > > The comment was introduced when breaking out the > combine_validate_cost function, in r0-59417-g64b8935d4809f3. > > I thought about wordsmithing to keep the "polarity" of the > statement, but "are equal to or cheaper than" didn't read > well. > > Ok to commit? OK, thanks. Richard > -- >8 -- > The *code* has been the same since forever, but this > comment, at a critical path, is misleading: if the new cost > is the same (like, when doing an identity replacement), then > combine_validate_cost returns true. > > * combine.cc (try_combine): Correct comment about > combine_validate_cost. > --- > gcc/combine.cc | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gcc/combine.cc b/gcc/combine.cc > index 5f085187cfef..c2c1d50ca49f 100644 > --- a/gcc/combine.cc > +++ b/gcc/combine.cc > @@ -4129,8 +4129,8 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, > } > } > > - /* Only allow this combination if insn_cost reports that the > - replacement instructions are cheaper than the originals. */ > + /* Reject this combination if insn_cost reports that the replacement > + instructions are more expensive than the originals. */ > if (!combine_validate_cost (i0, i1, i2, i3, newpat, newi2pat, other_pat)) > { > undo_all ();
diff --git a/gcc/combine.cc b/gcc/combine.cc index 5f085187cfef..c2c1d50ca49f 100644 --- a/gcc/combine.cc +++ b/gcc/combine.cc @@ -4129,8 +4129,8 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, } } - /* Only allow this combination if insn_cost reports that the - replacement instructions are cheaper than the originals. */ + /* Reject this combination if insn_cost reports that the replacement + instructions are more expensive than the originals. */ if (!combine_validate_cost (i0, i1, i2, i3, newpat, newi2pat, other_pat)) { undo_all ();