From c1a7b7a0779999b8896e1f221722c30d78349de3 Mon Sep 17 00:00:00 2001 From: zhenyu--zhao_admin Date: Mon, 22 Apr 2024 08:47:08 +0800 Subject: [PATCH] [BACKPORT] RA Improve cost calculation of pseudos with equivale --- gcc/ira-costs.cc | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gcc/ira-costs.cc b/gcc/ira-costs.cc index 642fda5293b..c0464aea62b 100644 --- a/gcc/ira-costs.cc +++ b/gcc/ira-costs.cc @@ -1940,15 +1940,8 @@ find_costs_and_classes (FILE *dump_file) } if (i >= first_moveable_pseudo && i < last_moveable_pseudo) i_mem_cost = 0; - 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; - } - + else + i_mem_cost -= equiv_savings; best_cost = (1 << (HOST_BITS_PER_INT - 2)) - 1; best = ALL_REGS; alt_class = NO_REGS; -- Gitee