public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 2/3] Remove get_reg_base_value
@ 2024-02-09 10:28 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2024-02-09 10:28 UTC (permalink / raw)
  To: gcc-patches; +Cc: jeffreyalaw

This makes recorded reg base values private to alias.cc, its computation
should go away but find_base_term can be used to cross-check that
we don't regress when only having MEM_BASE eventually.

Selective scheduling wouldn't need to avoid renaming regs with a base
value anymore, so this removes this only outside use.

	* alias.cc (get_reg_base_value): Make static.
	* rtl.h (get_reg_base_value): Remove.
	* sel-sched.cc (init_regs_for_mode): Do not worry about
	REG_BASE_VALUE when recording regs for renaming.
---
 gcc/alias.cc     | 2 +-
 gcc/rtl.h        | 1 -
 gcc/sel-sched.cc | 4 ++++
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/alias.cc b/gcc/alias.cc
index 48633aff699..541994c5047 100644
--- a/gcc/alias.cc
+++ b/gcc/alias.cc
@@ -1656,7 +1656,7 @@ record_set (rtx dest, const_rtx set, void *data ATTRIBUTE_UNUSED)
 
 /* Return REG_BASE_VALUE for REGNO.  Selective scheduler uses this to avoid
    using hard registers with non-null REG_BASE_VALUE for renaming.  */
-rtx
+static rtx
 get_reg_base_value (unsigned int regno)
 {
   return (*reg_base_value)[regno];
diff --git a/gcc/rtl.h b/gcc/rtl.h
index c84334cb945..3fcaaec49e4 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -4496,7 +4496,6 @@ extern bool may_be_sp_based_p (rtx);
 extern rtx gen_hard_reg_clobber (machine_mode, unsigned int);
 extern rtx get_reg_known_value (unsigned int);
 extern bool get_reg_known_equiv_p (unsigned int);
-extern rtx get_reg_base_value (unsigned int);
 extern rtx extract_mem_from_operand (rtx);
 
 #ifdef STACK_REGS
diff --git a/gcc/sel-sched.cc b/gcc/sel-sched.cc
index 17b71127960..77ba100023d 100644
--- a/gcc/sel-sched.cc
+++ b/gcc/sel-sched.cc
@@ -1082,9 +1082,13 @@ init_regs_for_mode (machine_mode mode)
             /* Can't use regs which aren't saved by
                the prologue.  */
             || !TEST_HARD_REG_BIT (sel_hrd.regs_ever_used, cur_reg + i)
+	    /* It's fine to elide this since REG_BASE_VALUE will go away
+	       and the info is in the MEMs itself.  */
+#if 0
 	    /* Can't use regs with non-null REG_BASE_VALUE, because adjusting
 	       it affects aliasing globally and invalidates all AV sets.  */
 	    || get_reg_base_value (cur_reg + i)
+#endif
 #ifdef LEAF_REGISTERS
             /* We can't use a non-leaf register if we're in a
                leaf function.  */
-- 
2.35.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-09 10:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 10:28 [PATCH 2/3] Remove get_reg_base_value Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).