aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira-int.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2022-01-11 19:24:59 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2022-01-11 19:24:59 +0000
commitdb8d94a0570dc1f3de10c9eb9fe6e91df804272b (patch)
treee0feb9c63c02498aa510c36e85ce7bb40238901a /gcc/ira-int.h
parent8b35f02ed599a70cce752e3cb544a7c9f808fce8 (diff)
downloadgcc-db8d94a0570dc1f3de10c9eb9fe6e91df804272b.zip
gcc-db8d94a0570dc1f3de10c9eb9fe6e91df804272b.tar.gz
gcc-db8d94a0570dc1f3de10c9eb9fe6e91df804272b.tar.bz2
ira: Fix old-reload targets [PR103974]
The new IRA heuristics would need more work on old-reload targets, since flattening needs to be able to undo the cost propagation. It's doable, but hardly seems worth it. This patch therefore makes all the new calls to ira_subloop_allocnos_can_differ_p return false if !ira_use_lra_p. The color_pass code that predated the new function (and that was the source of ira_subloop_allocnos_can_differ_p) continues to behave as before. It's a hack, but at least it has the advantage that the new parameter would become obviously unused if reload and (!)ira_use_lra_p were removed. The hack should therefore disappear alongside reload. gcc/ PR rtl-optimization/103974 * ira-int.h (ira_subloop_allocnos_can_differ_p): Take an extra argument, default true, that says whether old-reload targets should be excluded. * ira-color.c (color_pass): Pass false.
Diffstat (limited to 'gcc/ira-int.h')
-rw-r--r--gcc/ira-int.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ira-int.h b/gcc/ira-int.h
index e1e6802..e80fdeb 100644
--- a/gcc/ira-int.h
+++ b/gcc/ira-int.h
@@ -1607,10 +1607,16 @@ ira_loop_border_costs::move_between_loops_cost () const
/* Return true if subloops that contain allocnos for A's register can
use a different assignment from A. ALLOCATED_P is true for the case
- in which allocation succeeded for A. */
+ in which allocation succeeded for A. EXCLUDE_OLD_RELOAD is true if
+ we should always return false for non-LRA targets. (This is a hack
+ and should be removed along with old reload.) */
inline bool
-ira_subloop_allocnos_can_differ_p (ira_allocno_t a, bool allocated_p = true)
+ira_subloop_allocnos_can_differ_p (ira_allocno_t a, bool allocated_p = true,
+ bool exclude_old_reload = true)
{
+ if (exclude_old_reload && !ira_use_lra_p)
+ return false;
+
auto regno = ALLOCNO_REGNO (a);
if (pic_offset_table_rtx != NULL