diff options
author | Vladimir N. Makarov <vmakarov@redhat.com> | 2023-10-27 08:28:24 -0400 |
---|---|---|
committer | Vladimir N. Makarov <vmakarov@redhat.com> | 2023-10-27 10:19:28 -0400 |
commit | 8aa47713701b1f1878b81169852269a299272e87 (patch) | |
tree | 79a27f157077d2778a437cf2ce5cf9c20345bf63 | |
parent | 0beb16117547420a29541a00cd1db5047f1d7577 (diff) | |
download | gcc-8aa47713701b1f1878b81169852269a299272e87.zip gcc-8aa47713701b1f1878b81169852269a299272e87.tar.gz gcc-8aa47713701b1f1878b81169852269a299272e87.tar.bz2 |
[RA]: Add cost calculation for reg equivalence invariants
My recent patch improving cost calculation for pseudos with equivalence
resulted in failure of gcc.target/arm/eliminate.c on aarch64. This patch
fixes this failure.
gcc/ChangeLog:
* ira-costs.cc: (get_equiv_regno, calculate_equiv_gains):
Process reg equivalence invariants.
-rw-r--r-- | gcc/ira-costs.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ira-costs.cc b/gcc/ira-costs.cc index a59d45a..c408680 100644 --- a/gcc/ira-costs.cc +++ b/gcc/ira-costs.cc @@ -1784,6 +1784,7 @@ get_equiv_regno (rtx x, int ®no, rtx &subreg) } if (REG_P (x) && (ira_reg_equiv[REGNO (x)].memory != NULL + || ira_reg_equiv[REGNO (x)].invariant != NULL || ira_reg_equiv[REGNO (x)].constant != NULL)) { regno = REGNO (x); @@ -1826,6 +1827,7 @@ calculate_equiv_gains (void) for (regno = max_reg_num () - 1; regno >= FIRST_PSEUDO_REGISTER; regno--) if (ira_reg_equiv[regno].init_insns != NULL && (ira_reg_equiv[regno].memory != NULL + || ira_reg_equiv[regno].invariant != NULL || (ira_reg_equiv[regno].constant != NULL /* Ignore complicated constants which probably will be placed in memory: */ @@ -1876,6 +1878,8 @@ calculate_equiv_gains (void) if (subst == NULL) subst = ira_reg_equiv[regno].constant; + if (subst == NULL) + subst = ira_reg_equiv[regno].invariant; ira_assert (subst != NULL); mode = PSEUDO_REGNO_MODE (regno); ira_init_register_move_cost_if_necessary (mode); |