From 5f286f4a1aeb494e84f4134dce04e451b9580d19 Mon Sep 17 00:00:00 2001
From: Yao Qi <yao@codesourcery.com>
Date: Tue, 7 Dec 2010 12:28:46 +0000
Subject: Makefile.in: Add $(TARGET_H) to the regrename.o rule.

        * Makefile.in: Add $(TARGET_H) to the regrename.o rule.
        * regrename.c (struct du_head): Add new element length.
        (sort_du_head, get_element, merge, merge_sort_comparison):
        New functions of merge sort implementation to du_head list.
        (regrename_optimize): Sort du_head linked list by length.
        Iterate registers in a preferred-register-first order.
        Move some code to ...
        (check_new_reg_p): here.  New function.
        (create_new_chain):  Initialize length.
        (scan_rtx_reg): Increase length for non-debug insns.
        * target.def: New hook preferred_rename_class.
        * targhook.c (default_preferred_rename_class): New.
        * targhook.h: Declare it.
        * doc/tm.texi.in: New hook TARGET_PREFERRED_RENAME_CLASS.
        * doc/tm.texi: Regenerate.

From-SVN: r167534
---
 gcc/target.def | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'gcc/target.def')

diff --git a/gcc/target.def b/gcc/target.def
index a486ffa..7e4fe12 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -2224,6 +2224,21 @@ DEFHOOK
  bool, (reg_class_t rclass),
  default_class_likely_spilled_p)
 
+DEFHOOK
+(preferred_rename_class,
+ "A target hook that places additional preference on the register\
+ class to use when it is necessary to rename a register in class\
+ @var{class} to another class, or perhaps @var{NO_REGS}, if no\
+ prefered register class is found or hook @code{preferred_rename_class}\
+ is not implemented.\
+ Sometimes returning a more restrictive class makes better code.  For\
+ example, on ARM, thumb-2 instructions using @code{LO_REGS} may be\
+ smaller than instructions using @code{GENERIC_REGS}.  By returning\
+ @code{LO_REGS} from @code{preferred_rename_class}, code size can\
+ be reduced.",
+ reg_class_t, (reg_class_t rclass),
+ default_preferred_rename_class)
+
 /* This target hook allows the backend to perform additional
    processing while initializing for variable expansion.  */
 DEFHOOK
-- 
cgit v1.1

