[2/8] add default for HARD_REGNO_RENAME_OK
diff mbox

Message ID 1430114140-15817-3-git-send-email-tbsaunde+gcc@tbsaunde.org
State New
Headers show

Commit Message

tbsaunde+gcc@tbsaunde.org April 27, 2015, 5:55 a.m. UTC
From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2015-04-27  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* defaults.h (HARD_REGNO_RENAME_OK): Add default definition to
	true.
	* regrename.c (check_new_reg_p): Remove check if
	HARD_REGNO_RENAME_OK is defined.
	* sel-sched.c (sel_hard_regno_rename_ok): Likewise.
---
 gcc/defaults.h  | 4 ++++
 gcc/regrename.c | 5 +----
 gcc/sel-sched.c | 6 ------
 3 files changed, 5 insertions(+), 10 deletions(-)

Patch
diff mbox

diff --git a/gcc/defaults.h b/gcc/defaults.h
index 4ae5d98..7e04be2 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -1213,6 +1213,10 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define NO_FUNCTION_CSE false
 #endif
 
+#ifndef HARD_REGNO_RENAME_OK
+#define HARD_REGNO_RENAME_OK(FROM, TO) true
+#endif
+
 #ifdef GCC_INSN_FLAGS_H
 /* Dependent default target macro definitions
 
diff --git a/gcc/regrename.c b/gcc/regrename.c
index 147aaa8..d45ad0a 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -333,10 +333,7 @@  check_new_reg_p (int reg ATTRIBUTE_UNUSED, int new_reg,
 	|| (crtl->is_leaf
 	    && !LEAF_REGISTERS[new_reg + i])
 #endif
-#ifdef HARD_REGNO_RENAME_OK
-	|| ! HARD_REGNO_RENAME_OK (reg + i, new_reg + i)
-#endif
-	)
+	|| ! HARD_REGNO_RENAME_OK (reg + i, new_reg + i))
       return false;
 
   /* See whether it accepts all modes that occur in
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 988f9d5..9443629 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -1047,7 +1047,6 @@  get_reg_class (rtx_insn *insn)
   return NO_REGS;
 }
 
-#ifdef HARD_REGNO_RENAME_OK
 /* Calculate HARD_REGNO_RENAME_OK data for REGNO.  */
 static void
 init_hard_regno_rename (int regno)
@@ -1066,14 +1065,12 @@  init_hard_regno_rename (int regno)
         SET_HARD_REG_BIT (sel_hrd.regs_for_rename[regno], cur_reg);
     }
 }
-#endif
 
 /* A wrapper around HARD_REGNO_RENAME_OK that will look into the hard regs
    data first.  */
 static inline bool
 sel_hard_regno_rename_ok (int from ATTRIBUTE_UNUSED, int to ATTRIBUTE_UNUSED)
 {
-#ifdef HARD_REGNO_RENAME_OK
   /* Check whether this is all calculated.  */
   if (TEST_HARD_REG_BIT (sel_hrd.regs_for_rename[from], from))
     return TEST_HARD_REG_BIT (sel_hrd.regs_for_rename[from], to);
@@ -1081,9 +1078,6 @@  sel_hard_regno_rename_ok (int from ATTRIBUTE_UNUSED, int to ATTRIBUTE_UNUSED)
   init_hard_regno_rename (from);
 
   return TEST_HARD_REG_BIT (sel_hrd.regs_for_rename[from], to);
-#else
-  return true;
-#endif
 }
 
 /* Calculate set of registers that are capable of holding MODE.  */