diff mbox

[lra] patch to remove -flra option

Message ID 5033D43B.3090305@redhat.com
State New
Headers show

Commit Message

Vladimir Makarov Aug. 21, 2012, 6:32 p.m. UTC
The following patch mostly removes -flra option by defining a 
machine-dependent hook lra_p.  If the hook returns true, LRA is used.  
Otherwise, reload pass is used.  By default the hook returns false.  It 
returns true for 8 targets, lra was ported (i386, rs6000, arm, s390, 
ia64, sparc, mips, pa).

The patch was successfully bootstrapped on x86/x86-64.

Committed as rev. 190564.

2012-08-21  Vladimir Makarov  <vmakarov@redhat.com>

         * targhooks.h (default_lra_p): Declare.
         * targhooks.c (default_lra_p): New function.
         * target.def (lra_p): New hook.
         * ira.h (ira_use_lra_p): New external.
         * ira.c (ira_init_once, ira_init, ira_finish_once): Call
         lra_start_once, lra_init, lra_finish_once in anyway.
         (ira_setup_eliminable_regset, setup_reg_renumber): Use 
ira_use_lra_p instead of
         flra_lra.
         (ira_use_lra_p): Define.
         (ira): Set up ira_use_lra_p.  Use ira_use_lra_p instead of
         flra_lra.
         * dwarf2out.c: Add ira.h.
         (based_loc_descr, compute_frame_pointer_to_fb_displacement): Use
         ira_use_lra_p instead of ira_use_lra_p.
         * rtlanal.c (simplify_subreg_regno): Add comments.
         * Makefile.in (dwarf2out.c): Add dependence ira.h.
         * doc/passes.texi: Change LRA pass description.
         * doc/tm.texi.in: Add TARGET_LRA_P.
         * doc/tm.texi: Update.
         * doc/invoke.texi: Remove -flra option.
         * common.opt: Remove flra option.  Add description for
         flra-reg-spill.
         * reginfo.c (allocate_reg_info): Fix a comment typo.
         * config/arm/arm.c (TARGET_LRA_P): Define.
         (arm_lra_p): New function.
         * config/sparc/sparc.c (TARGET_LRA_P): Define.
         (sparc_lra_p): New function.
         * config/s390/s390.c (TARGET_LRA_P): Define.
         (s390_lra_p): New function.
         * config/i386/i386.c (TARGET_LRA_P): Define.
         (ix86_lra_p): New function.
         * config/rs6000/rs6000.c (TARGET_LRA_P): Define.
         (rs6000_lra_p): New function.
         * config/mips/mips.c (TARGET_LRA_P): Define.
         (mips_lra_p): New function.
         * config/pa/pa.c (TARGET_LRA_P): Define.
         (pa_lra_p): New function.
         * config/ia64/ia64.c (TARGET_LRA_P): Define.
         (ia64_lra_p): New function.
diff mbox

Patch

Index: targhooks.c
===================================================================
--- targhooks.c	(revision 190448)
+++ targhooks.c	(working copy)
@@ -840,6 +840,12 @@  default_branch_target_register_class (vo
   return NO_REGS;
 }
 
+extern bool
+default_lra_p (void)
+{
+  return false;
+}
+
 int
 default_register_bank (int hard_regno ATTRIBUTE_UNUSED)
 {
Index: target.def
===================================================================
--- target.def	(revision 190448)
+++ target.def	(working copy)
@@ -2332,6 +2332,16 @@  DEFHOOK
  tree, (tree type, tree expr),
  hook_tree_tree_tree_null)
 
+/* Return true if we use LRA instead of reload.  */
+DEFHOOK
+(lra_p,
+ "A target hook which returns true if we use LRA instead of reload pass.\
+  It means that LRA was ported to the target.\
+  \
+  The default version of this target hook returns always false.",
+ bool, (void),
+ default_lra_p)
+
 /* Return register bank of given hard regno for the current target.  */
 DEFHOOK
 (register_bank,
Index: targhooks.h
===================================================================
--- targhooks.h	(revision 190448)
+++ targhooks.h	(working copy)
@@ -132,6 +132,7 @@  extern rtx default_static_chain (const_t
 extern void default_trampoline_init (rtx, tree, rtx);
 extern int default_return_pops_args (tree, tree, int);
 extern reg_class_t default_branch_target_register_class (void);
+extern bool default_lra_p (void);
 extern int default_register_bank (int);
 extern bool default_different_addr_displacement_p (void);
 extern reg_class_t default_secondary_reload (bool, rtx, reg_class_t,
Index: rtlanal.c
===================================================================
--- rtlanal.c	(revision 190448)
+++ rtlanal.c	(working copy)
@@ -3501,6 +3501,7 @@  simplify_subreg_regno (unsigned int xreg
   if (GET_MODE_CLASS (xmode) != MODE_COMPLEX_INT
       && GET_MODE_CLASS (xmode) != MODE_COMPLEX_FLOAT
       && REG_CANNOT_CHANGE_MODE_P (xregno, xmode, ymode)
+      /* We can use mode change in LRA for some transformations.  */
       && ! lra_in_progress)
     return -1;
 #endif
@@ -3511,6 +3512,8 @@  simplify_subreg_regno (unsigned int xreg
     return -1;
 
   if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+      /* We should convert arg register in LRA after the elimination
+	 if it is possible.  */
       && xregno == ARG_POINTER_REGNUM
       && ! lra_in_progress)
     return -1;
Index: ira.c
===================================================================
--- ira.c	(revision 190448)
+++ ira.c	(working copy)
@@ -1634,8 +1634,7 @@  void
 ira_init_once (void)
 {
   ira_init_costs_once ();
-  if (flag_lra)
-    lra_init_once ();
+  lra_init_once ();
 }
 
 /* Free ira_max_register_move_cost, ira_may_move_in_cost and
@@ -1683,8 +1682,7 @@  ira_init (void)
   clarify_prohibited_class_mode_regs ();
   setup_hard_regno_aclass ();
   ira_init_costs ();
-  if (flag_lra)
-    lra_init ();
+  lra_init ();
 }
 
 /* Function called once at the end of compiler work.  */
@@ -1693,8 +1691,7 @@  ira_finish_once (void)
 {
   ira_finish_costs_once ();
   free_register_move_costs ();
-  if (flag_lra)
-    lra_finish_once ();
+  lra_finish_once ();
 }
 
 
@@ -1855,7 +1852,7 @@  ira_setup_eliminable_regset (bool from_i
        || crtl->stack_realign_needed
        || targetm.frame_pointer_required ());
 
-  if (from_ira_p && flag_lra)
+  if (from_ira_p && ira_use_lra_p)
     /* It can change FRAME_POINTER_NEEDED.  We call it only from IRA
        because it is expensive.  */
     lra_init_elimination ();
@@ -1940,7 +1937,7 @@  setup_reg_renumber (void)
   caller_save_needed = 0;
   FOR_EACH_ALLOCNO (a, ai)
     {
-      if (flag_lra && ALLOCNO_CAP_MEMBER (a) != NULL)
+      if (ira_use_lra_p && ALLOCNO_CAP_MEMBER (a) != NULL)
 	continue;
       /* There are no caps at this point.  */
       ira_assert (ALLOCNO_CAP_MEMBER (a) == NULL);
@@ -4321,6 +4318,11 @@  allocate_initial_values (void)
     }
 }
 
+
+/* True when we use LRA instead of reload pass for the current
+   function.  */
+bool ira_use_lra_p;
+
 /* All natural loops.  */
 struct loops ira_loops;
 
@@ -4339,6 +4341,8 @@  ira (FILE *f)
   int max_regno_before_ira, ira_max_point_before_emit;
   int rebuild_p;
 
+  ira_use_lra_p = targetm.lra_p ();
+
 #ifndef IRA_NO_OBSTACK
   gcc_obstack_init (&ira_obstack);
 #endif
@@ -4455,14 +4459,14 @@  ira (FILE *f)
     {
       if (! loops_p)
 	{
-	  if (! flag_lra)
+	  if (! ira_use_lra_p)
 	    ira_initiate_assign ();
 	}
       else
 	{
 	  expand_reg_info ();
 
-	  if (flag_lra)
+	  if (ira_use_lra_p)
 	    {
 	      ira_allocno_t a;
 	      ira_allocno_iterator ai;
@@ -4484,7 +4488,7 @@  ira (FILE *f)
 	  record_loop_exits ();
 	  current_loops = &ira_loops;
 
-	  if (! flag_lra)
+	  if (! ira_use_lra_p)
 	    {
 	      setup_allocno_assignment_flags ();
 	      ira_initiate_assign ();
@@ -4551,7 +4555,7 @@  do_reload (void)
     ira_dump_file = dump_file;
 
   timevar_push (TV_RELOAD);
-  if (flag_lra)
+  if (ira_use_lra_p)
     {
       if (current_loops != NULL)
 	{
@@ -4587,7 +4591,7 @@  do_reload (void)
 
   timevar_push (TV_IRA);
 
-  if (ira_conflicts_p && ! flag_lra)
+  if (ira_conflicts_p && ! ira_use_lra_p)
     {
       ira_free (ira_spilled_reg_stack_slots);
       ira_finish_assign ();
@@ -4599,7 +4603,7 @@  do_reload (void)
 
   flag_ira_share_spill_slots = saved_flag_ira_share_spill_slots;
 
-  if (! flag_lra)
+  if (! ira_use_lra_p)
     {
       ira_destroy ();
       if (current_loops != NULL)
Index: ira.h
===================================================================
--- ira.h	(revision 190448)
+++ ira.h	(working copy)
@@ -20,6 +20,10 @@  You should have received a copy of the G
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+/* True when we use LRA instead of reload pass for the current
+   function.  */
+extern bool ira_use_lra_p;
+
 /* True if we have allocno conflicts.  It is false for non-optimized
    mode or when the conflict table is too big.  */
 extern bool ira_conflicts_p;
Index: dwarf2out.c
===================================================================
--- dwarf2out.c	(revision 190448)
+++ dwarf2out.c	(working copy)
@@ -90,8 +90,9 @@  along with GCC; see the file COPYING3.
 #include "cgraph.h"
 #include "input.h"
 #include "gimple.h"
+#include "ira.h"
 #include "lra.h"
-#include "tree-flow.h"
+/*#include "tree-flow.h"*/
 #include "dumpfile.h"
 #include "opts.h"
 
@@ -10117,7 +10118,7 @@  based_loc_descr (rtx reg, HOST_WIDE_INT
      argument pointer and soft frame pointer rtx's.  */
   if (reg == arg_pointer_rtx || reg == frame_pointer_rtx)
     {
-      rtx elim = (flag_lra
+      rtx elim = (ira_use_lra_p
 		  ? lra_eliminate_regs (reg, VOIDmode, NULL_RTX)
 		  : eliminate_regs (reg, VOIDmode, NULL_RTX));
 
@@ -14976,7 +14977,7 @@  compute_frame_pointer_to_fb_displacement
   offset += ARG_POINTER_CFA_OFFSET (current_function_decl);
 #endif
 
-  elim = (flag_lra
+  elim = (ira_use_lra_p
 	  ? lra_eliminate_regs (reg, VOIDmode, NULL_RTX)
 	  : eliminate_regs (reg, VOIDmode, NULL_RTX));
   if (GET_CODE (elim) == PLUS)
Index: config/ia64/ia64.c
===================================================================
--- config/ia64/ia64.c	(revision 190448)
+++ config/ia64/ia64.c	(working copy)
@@ -192,6 +192,7 @@  static rtx gen_fr_spill_x (rtx, rtx, rtx
 static rtx gen_fr_restore_x (rtx, rtx, rtx);
 
 static void ia64_option_override (void);
+static bool ia64_lra_p (void);
 static bool ia64_can_eliminate (const int, const int);
 static enum machine_mode hfa_element_mode (const_tree, bool);
 static void ia64_setup_incoming_varargs (cumulative_args_t, enum machine_mode,
@@ -614,6 +615,9 @@  static const struct attribute_spec ia64_
 #undef TARGET_C_MODE_FOR_SUFFIX
 #define TARGET_C_MODE_FOR_SUFFIX ia64_c_mode_for_suffix
 
+#undef TARGET_LRA_P
+#define TARGET_LRA_P ia64_lra_p
+
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE ia64_can_eliminate
 
@@ -2894,6 +2898,13 @@  ia64_compute_frame_size (HOST_WIDE_INT s
   current_frame_info.initialized = reload_completed;
 }
 
+/* Return true if we use LRA instead of reload pass.  */
+static bool
+ia64_lra_p (void)
+{
+  return true;
+}
+
 /* Worker function for TARGET_CAN_ELIMINATE.  */
 
 bool
Index: config/s390/s390.c
===================================================================
--- config/s390/s390.c	(revision 190448)
+++ config/s390/s390.c	(working copy)
@@ -7656,6 +7656,13 @@  s390_class_max_nregs (enum reg_class rcl
   return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
 }
 
+/* Return true if we use LRA instead of reload pass.  */
+static bool
+s390_lra_p (void)
+{
+  return true;
+}
+
 /* Return true if register FROM can be eliminated via register TO.  */
 
 static bool
@@ -10811,6 +10818,9 @@  s390_loop_unroll_adjust (unsigned nunrol
 #undef TARGET_LEGITIMATE_CONSTANT_P
 #define TARGET_LEGITIMATE_CONSTANT_P s390_legitimate_constant_p
 
+#undef TARGET_LRA_P
+#define TARGET_LRA_P s390_lra_p
+
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE s390_can_eliminate
 
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 190448)
+++ config/i386/i386.c	(working copy)
@@ -31493,6 +31493,14 @@  ix86_free_from_memory (enum machine_mode
     }
 }
 
+/* Return true if we use LRA instead of reload pass.  */
+static bool
+ix86_lra_p (void)
+{
+  return true;
+}
+
+/* Return a register bank number for hard reg REGNO.  */
 static int
 ix86_register_bank (int hard_regno)
 {
@@ -40738,6 +40746,9 @@  ix86_memmodel_check (unsigned HOST_WIDE_
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P ix86_legitimate_address_p
 
+#undef TARGET_LRA_P
+#define TARGET_LRA_P ix86_lra_p
+
 #undef TARGET_REGISTER_BANK
 #define TARGET_REGISTER_BANK ix86_register_bank
 
Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c	(revision 190448)
+++ config/pa/pa.c	(working copy)
@@ -181,6 +181,7 @@  static void pa_trampoline_init (rtx, tre
 static rtx pa_trampoline_adjust_address (rtx);
 static rtx pa_delegitimize_address (rtx);
 static bool pa_print_operand_punct_valid_p (unsigned char);
+static bool pa_lra_p (void);
 static rtx pa_internal_arg_pointer (void);
 static bool pa_can_eliminate (const int, const int);
 static void pa_conditional_register_usage (void);
@@ -374,6 +375,8 @@  static size_t n_deferred_plabels = 0;
 #define TARGET_DELEGITIMIZE_ADDRESS pa_delegitimize_address
 #undef TARGET_INTERNAL_ARG_POINTER
 #define TARGET_INTERNAL_ARG_POINTER pa_internal_arg_pointer
+#undef TARGET_LRA_P
+#define TARGET_LRA_P pa_lra_p
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE pa_can_eliminate
 #undef TARGET_CONDITIONAL_REGISTER_USAGE
@@ -10207,6 +10210,14 @@  pa_delegitimize_address (rtx orig_x)
     return gen_const_mem (Pmode, XVECEXP (XEXP (x, 1), 0, 0));
   return x;
 }
+
+/* Return true if we use LRA instead of reload pass.  */
+static bool
+pa_lra_p (void)
+{
+  return true;
+}
+
 
 static rtx
 pa_internal_arg_pointer (void)
Index: config/arm/arm.c
===================================================================
--- config/arm/arm.c	(revision 190448)
+++ config/arm/arm.c	(working copy)
@@ -243,6 +243,7 @@  static tree arm_promoted_type (const_tre
 static tree arm_convert_to_type (tree type, tree expr);
 static bool arm_scalar_mode_supported_p (enum machine_mode);
 static bool arm_frame_pointer_required (void);
+static bool arm_lra_p (void);
 static bool arm_can_eliminate (const int, const int);
 static void arm_asm_trampoline_template (FILE *);
 static void arm_trampoline_init (rtx, tree, rtx);
@@ -598,6 +599,9 @@  static const struct attribute_spec arm_a
 #undef TARGET_FRAME_POINTER_REQUIRED
 #define TARGET_FRAME_POINTER_REQUIRED arm_frame_pointer_required
 
+#undef TARGET_LRA_P
+#define TARGET_LRA_P arm_lra_p
+
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE arm_can_eliminate
 
@@ -16328,6 +16332,13 @@  arm_compute_initial_elimination_offset (
     }
 }
 
+/* Return true if we use LRA instead of reload pass.  */
+static bool
+arm_lra_p (void)
+{
+  return true;
+}
+
 /* Given FROM and TO register numbers, say whether this elimination is
    allowed.  Frame pointer elimination is automatically handled.
 
Index: config/mips/mips.c
===================================================================
--- config/mips/mips.c	(revision 190448)
+++ config/mips/mips.c	(working copy)
@@ -2213,6 +2213,7 @@  mips_lx_address_p (rtx addr, enum machin
     return true;
   return false;
 }
+
 
 /* Return true if a value at OFFSET bytes from base register BASE can be
    accessed using an unextended MIPS16 instruction.  MODE is the mode of
@@ -6778,7 +6779,7 @@  mips_expand_fcc_reload (rtx dest, rtx sr
 {
   rtx fp1, fp2;
 
-  gcc_assert (! flag_lra);
+  gcc_assert (! ira_use_lra_p);
   /* Change the source to SFmode.  */
   if (MEM_P (src))
     src = adjust_address (src, SFmode, 0);
@@ -9795,6 +9796,13 @@  mips_frame_pointer_required (void)
   return false;
 }
 
+/* Return true if we use LRA instead of reload pass.  */
+static bool
+mips_lra_p (void)
+{
+  return true;
+}
+
 /* Make sure that we're not trying to eliminate to the wrong hard frame
    pointer.  */
 
@@ -11292,7 +11300,7 @@  mips_secondary_reload (bool in_p, rtx x,
 		       enum machine_mode reload_mode,
 		       secondary_reload_info *sri)
 {
-  if (flag_lra)
+  if (ira_use_lra_p)
     return NO_REGS;
   return default_secondary_reload (in_p, x, reload_class_i, reload_mode, sri);
 }
@@ -17766,6 +17774,9 @@  mips_expand_vec_minmax (rtx target, rtx
 #undef TARGET_FRAME_POINTER_REQUIRED
 #define TARGET_FRAME_POINTER_REQUIRED mips_frame_pointer_required
 
+#undef TARGET_LRA_P
+#define TARGET_LRA_P mips_lra_p
+
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE mips_can_eliminate
 
Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c	(revision 190448)
+++ config/rs6000/rs6000.c	(working copy)
@@ -1418,6 +1418,9 @@  static const struct attribute_spec rs600
 #undef TARGET_MODE_DEPENDENT_ADDRESS_P
 #define TARGET_MODE_DEPENDENT_ADDRESS_P rs6000_mode_dependent_address_p
 
+#undef TARGET_LRA_P
+#define TARGET_LRA_P rs6000_lra_p
+
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE rs6000_can_eliminate
 
@@ -6681,6 +6684,7 @@  rs6000_conditional_register_usage (void)
 	  fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1;
     }
 }
+
 
 /* Try to output insns to set TARGET equal to the constant C if it can
    be done in less than N insns.  Do all computations in MODE.
@@ -14127,7 +14131,7 @@  rs6000_alloc_sdmode_stack_slot (void)
   gcc_assert (cfun->machine->sdmode_stack_slot == NULL_RTX);
   /* We use a different approach for dealing with the secondary
      memmory in LRA.  */
-  if (flag_lra)
+  if (ira_use_lra_p)
     return;
 
   FOR_EACH_BB (bb)
@@ -27203,6 +27207,13 @@  rs6000_libcall_value (enum machine_mode
 }
 
 
+/* Return true if we use LRA instead of reload pass.  */
+static bool
+rs6000_lra_p (void)
+{
+  return true;
+}
+
 /* Given FROM and TO register numbers, say whether this elimination is allowed.
    Frame pointer elimination is automatically handled.
 
Index: config/sparc/sparc.c
===================================================================
--- config/sparc/sparc.c	(revision 190448)
+++ config/sparc/sparc.c	(working copy)
@@ -585,6 +585,7 @@  static int sparc_arg_partial_bytes (cumu
 static void sparc_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
 static void sparc_file_end (void);
 static bool sparc_frame_pointer_required (void);
+static bool sparc_lra_p (void);
 static bool sparc_can_eliminate (const int, const int);
 static rtx sparc_builtin_setjmp_frame_value (void);
 static void sparc_conditional_register_usage (void);
@@ -768,6 +769,9 @@  char sparc_hard_reg_printed[8];
 #undef TARGET_BUILTIN_SETJMP_FRAME_VALUE
 #define TARGET_BUILTIN_SETJMP_FRAME_VALUE sparc_builtin_setjmp_frame_value
 
+#undef TARGET_LRA_P
+#define TARGET_LRA_P ix86_lra_p
+
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE sparc_can_eliminate
 
@@ -11285,6 +11289,13 @@  sparc_frame_pointer_required (void)
   return !(crtl->is_leaf && only_leaf_regs_used ());
 }
 
+/* Return true if we use LRA instead of reload pass.  */
+static bool
+sparc_lra_p (void)
+{
+  return true;
+}
+
 /* The way this is structured, we can't eliminate SFP in favor of SP
    if the frame pointer is required: we want to use the SFP->HFP elimination
    in that case.  But the test in update_eliminables doesn't know we are
Index: common.opt
===================================================================
--- common.opt	(revision 190448)
+++ common.opt	(working copy)
@@ -1219,14 +1219,10 @@  floop-flatten
 Common Ignore
 Does nothing. Preserved for backward compatibility.
 
-flra
-Common Report Var(flag_lra) Init(1)
-Use local RA pass instead of reload.
-
 flra-reg-spill
 Common Report Var(flag_lra_reg_spill) Init(1)
 Spill pseudos occured only in move insns into available regs of different
-class instead of memory if it is profitable
+class instead of memory if it is profitable and we use LRA instead of reload
 
 floop-nest-optimize
 Common Report Var(flag_loop_optimize_isl) Optimization
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 190448)
+++ Makefile.in	(working copy)
@@ -2810,7 +2810,7 @@  dwarf2out.o : dwarf2out.c $(CONFIG_H) $(
    toplev.h $(DIAGNOSTIC_CORE_H) $(DWARF2OUT_H) reload.h \
    $(GGC_H) $(EXCEPT_H) dwarf2asm.h $(TM_P_H) langhooks.h $(HASHTAB_H) \
    gt-dwarf2out.h $(TARGET_H) $(CGRAPH_H) $(MD5_H) $(INPUT_H) $(FUNCTION_H) \
-   $(GIMPLE_H) lra.h $(TREE_FLOW_H) \
+   $(GIMPLE_H) ira.h lra.h $(TREE_FLOW_H) \
    $(TREE_PRETTY_PRINT_H) $(COMMON_TARGET_H) $(OPTS_H)
 dwarf2cfi.o : dwarf2cfi.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    version.h $(RTL_H) $(EXPR_H) $(REGS_H) $(FUNCTION_H) output.h \
Index: doc/tm.texi
===================================================================
--- doc/tm.texi	(revision 190448)
+++ doc/tm.texi	(working copy)
@@ -2893,6 +2893,10 @@  as below:
 @end smallexample
 @end defmac
 
+@deftypefn {Target Hook} bool TARGET_LRA_P (void)
+A target hook which returns true if we use LRA instead of reload pass.  It means that LRA was ported to the target.    The default version of this target hook returns always false.
+@end deftypefn
+
 @deftypefn {Target Hook} int TARGET_REGISTER_BANK (int)
 A target hook which returns the register bank number to which the  register @var{hard_regno} belongs to.  The smaller the number, the  more preferable the hard register usage (when all other conditions are  the same).  This hook can be used to prefer some hard register over  others in LRA.  For example, some x86-64 register usage needs  additional prefix which makes instructions longer.  The hook can  return bigger bank number for such registers make them less favorable  and as result making the generated code smaller.    The default version of this target hook returns always zero.
 @end deftypefn
Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi	(revision 190448)
+++ doc/invoke.texi	(working copy)
@@ -375,7 +375,7 @@  Objective-C and Objective-C++ Dialects}.
 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
--floop-parallelize-all -fno-lra -flto -flto-compression-level @gol
+-floop-parallelize-all -flto -flto-compression-level @gol
 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
@@ -6909,10 +6909,6 @@  If supported for the target machine, att
 to exploit instruction slots available after delayed branch
 instructions.
 
-@item -fno-lra
-@opindex fno-lra
-Run the reload pass instead of Local Register Allocator (LRA).
-
 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
 
 @item -fschedule-insns
Index: doc/tm.texi.in
===================================================================
--- doc/tm.texi.in	(revision 190448)
+++ doc/tm.texi.in	(working copy)
@@ -2869,6 +2869,8 @@  as below:
 @end smallexample
 @end defmac
 
+@hook TARGET_LRA_P
+
 @hook TARGET_REGISTER_BANK
 
 @hook TARGET_DIFFERENT_ADDR_DISPLACEMENT_P
Index: doc/passes.texi
===================================================================
--- doc/passes.texi	(revision 190448)
+++ doc/passes.texi	(working copy)
@@ -892,8 +892,7 @@  decisions are reflected in RTL as more a
 constraints as a primary source of the info and that minimizes number
 of target-depended macros/hooks.
 
-LRA is run by default.  To run the reload pass instead, use option
-@option{-fno-lra}.
+LRA is run for the targets it were ported.
 @end itemize
 
 @item Basic block reordering
Index: reginfo.c
===================================================================
--- reginfo.c	(revision 190448)
+++ reginfo.c	(working copy)
@@ -878,7 +878,7 @@  reg_allocno_class (int regno)
 
 
 
-/* Allocate space for reg info and initilized it.  */
+/* Allocate space for reg info and initilize it.  */
 static void
 allocate_reg_info (void)
 {