From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1012) id 913E03858402; Thu, 28 Sep 2023 16:01:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 913E03858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695916863; bh=Xk3009PuW7V8F9sOj/5ErciYt0YvBXWISnnr8YHu3vU=; h=From:To:Subject:Date:From; b=xPs4tlLaZmHASc3M2uS6qJ246vgwWmjcOcoui2Z6ArAAQqEcFPaHsFcnjRRD9p6yL QNp/5aFPNKGttkpOY6vXkFMubuobEmQqm5pF1PXNDG0xjECViQ3YfpgQiHTk8nTE4U 4M05Bc6StUN42A6JnIBq2Ai77jBH0dcmKOm1icDA= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Vladimir Makarov To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-4312] Revert "[RA]: Improve cost calculation of pseudos with equivalences" X-Act-Checkin: gcc X-Git-Author: Vladimir N. Makarov X-Git-Refname: refs/heads/trunk X-Git-Oldrev: d8b56c95782aeeee79ec40932ca88d00fd9f2ee2 X-Git-Newrev: 8552dcd8e4448c02fe230662093756b75dd94399 Message-Id: <20230928160103.913E03858402@sourceware.org> Date: Thu, 28 Sep 2023 16:01:03 +0000 (GMT) List-Id: https://gcc.gnu.org/g:8552dcd8e4448c02fe230662093756b75dd94399 commit r14-4312-g8552dcd8e4448c02fe230662093756b75dd94399 Author: Vladimir N. Makarov Date: Thu Sep 28 11:53:51 2023 -0400 Revert "[RA]: Improve cost calculation of pseudos with equivalences" This reverts commit 3c834d85f2ec42c60995c2b678196a06cb744959. Although the patch improves x86-64 specfp2007, it also results in performance and code size regression on different targets and new GCC testsuite failures on tests expecting a specific output. Diff: --- gcc/ira-costs.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ira-costs.cc b/gcc/ira-costs.cc index 8c93ace5094..d9e700e8947 100644 --- a/gcc/ira-costs.cc +++ b/gcc/ira-costs.cc @@ -1947,8 +1947,15 @@ find_costs_and_classes (FILE *dump_file) } if (i >= first_moveable_pseudo && i < last_moveable_pseudo) i_mem_cost = 0; - else - i_mem_cost -= equiv_savings; + else if (equiv_savings < 0) + i_mem_cost = -equiv_savings; + else if (equiv_savings > 0) + { + i_mem_cost = 0; + for (k = cost_classes_ptr->num - 1; k >= 0; k--) + i_costs[k] += equiv_savings; + } + best_cost = (1 << (HOST_BITS_PER_INT - 2)) - 1; best = ALL_REGS; alt_class = NO_REGS;