aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
authorVladimir N. Makarov <vmakarov@redhat.com>2021-01-27 14:53:28 -0500
committerVladimir N. Makarov <vmakarov@redhat.com>2021-01-27 15:59:05 -0500
commit081c96621da658760b4a67c07530805f770fa22c (patch)
tree7a1709c59076a2d211df3dfc944fba7018caa5b4 /gcc/ira.c
parent9cd7c32549fa334885b716fe98b674f6447fa7c0 (diff)
downloadgcc-081c96621da658760b4a67c07530805f770fa22c.zip
gcc-081c96621da658760b4a67c07530805f770fa22c.tar.gz
gcc-081c96621da658760b4a67c07530805f770fa22c.tar.bz2
[PR97684] IRA: Recalculate pseudo classes if we added new pseduos since last calculation before updating equiv regs
update_equiv_regs can use reg classes of pseudos and they are set up in register pressure sensitive scheduling and loop invariant motion and in live range shrinking. This info can become obsolete if we add new pseudos since the last set up. Recalculate it again if the new pseudos were added. gcc/ChangeLog: PR rtl-optimization/97684 * ira.c (ira): Call ira_set_pseudo_classes before update_equiv_regs when it is necessary. gcc/testsuite/ChangeLog: PR rtl-optimization/97684 * gcc.target/i386/pr97684.c: New.
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index f0bdbc8..c32ecf81 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -5566,6 +5566,15 @@ ira (FILE *f)
if (warn_clobbered)
generate_setjmp_warnings ();
+ /* update_equiv_regs can use reg classes of pseudos and they are set up in
+ register pressure sensitive scheduling and loop invariant motion and in
+ live range shrinking. This info can become obsolete if we add new pseudos
+ since the last set up. Recalculate it again if the new pseudos were
+ added. */
+ if (resize_reg_info () && (flag_sched_pressure || flag_live_range_shrinkage
+ || flag_ira_loop_pressure))
+ ira_set_pseudo_classes (true, ira_dump_file);
+
init_alias_analysis ();
loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
reg_equiv = XCNEWVEC (struct equivalence, max_reg_num ());
@@ -5610,9 +5619,6 @@ ira (FILE *f)
regstat_recompute_for_max_regno ();
}
- if (resize_reg_info () && flag_ira_loop_pressure)
- ira_set_pseudo_classes (true, ira_dump_file);
-
setup_reg_equiv ();
grow_reg_equivs ();
setup_reg_equiv_init ();