From e5a7a08d5c6d89efdb915cd8ab2fdb1647d69406 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Sun, 29 Sep 2024 05:22:22 -0700
Subject: [PATCH] sparc: Remove -m{,no-}lra option

---
 gcc/config/sparc/sparc.cc       | 16 ----------------
 gcc/config/sparc/sparc.md       |  1 -
 gcc/config/sparc/sparc.opt      |  4 ----
 gcc/config/sparc/sparc.opt.urls |  3 ---
 4 files changed, 24 deletions(-)

diff --git a/gcc/config/sparc/sparc.cc b/gcc/config/sparc/sparc.cc
index 4bc249da825..353837d73e5 100644
--- a/gcc/config/sparc/sparc.cc
+++ b/gcc/config/sparc/sparc.cc
@@ -697,7 +697,6 @@ static const char *sparc_mangle_type (const_tree);
 static void sparc_trampoline_init (rtx, tree, rtx);
 static machine_mode sparc_preferred_simd_mode (scalar_mode);
 static reg_class_t sparc_preferred_reload_class (rtx x, reg_class_t rclass);
-static bool sparc_lra_p (void);
 static bool sparc_print_operand_punct_valid_p (unsigned char);
 static void sparc_print_operand (FILE *, rtx, int);
 static void sparc_print_operand_address (FILE *, machine_mode, rtx);
@@ -921,9 +920,6 @@ char sparc_hard_reg_printed[8];
 #define TARGET_MANGLE_TYPE sparc_mangle_type
 #endif
 
-#undef TARGET_LRA_P
-#define TARGET_LRA_P sparc_lra_p
-
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P sparc_legitimate_address_p
 
@@ -1957,10 +1953,6 @@ sparc_option_override (void)
   if (TARGET_ARCH32)
     target_flags &= ~MASK_STACK_BIAS;
 
-  /* Use LRA instead of reload, unless otherwise instructed.  */
-  if (!(target_flags_explicit & MASK_LRA))
-    target_flags |= MASK_LRA;
-
   /* Enable applicable errata workarounds for LEON3FT.  */
   if (sparc_fix_ut699 || sparc_fix_ut700 || sparc_fix_gr712rc)
     {
@@ -13286,14 +13278,6 @@ sparc_preferred_reload_class (rtx x, reg_class_t rclass)
   return rclass;
 }
 
-/* Return true if we use LRA instead of reload pass.  */
-
-static bool
-sparc_lra_p (void)
-{
-  return TARGET_LRA;
-}
-
 /* Output a wide multiply instruction in V8+ mode.  INSN is the instruction,
    OPERANDS are its operands and OPCODE is the mnemonic to be used.  */
 
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 736307926f9..98f3223d212 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -270,7 +270,6 @@
 
 (define_attr "enabled" ""
   (cond [(eq_attr "cpu_feature" "none")
-           (cond [(eq_attr "lra" "disabled") (symbol_ref "!TARGET_LRA")] (const_int 1))
          (eq_attr "cpu_feature" "fpu") (symbol_ref "TARGET_FPU")
          (eq_attr "cpu_feature" "fpunotv9") (symbol_ref "TARGET_FPU && !TARGET_V9")
          (eq_attr "cpu_feature" "v9") (symbol_ref "TARGET_V9")
diff --git a/gcc/config/sparc/sparc.opt b/gcc/config/sparc/sparc.opt
index afede3f40ce..235974c16a8 100644
--- a/gcc/config/sparc/sparc.opt
+++ b/gcc/config/sparc/sparc.opt
@@ -57,10 +57,6 @@ msoft-quad-float
 Target RejectNegative InverseMask(HARD_QUAD)
 Do not use hardware quad fp instructions.
 
-mlra
-Target Mask(LRA)
-Enable Local Register Allocation.
-
 mv8plus
 Target Mask(V8PLUS)
 Compile for V8+ ABI.
diff --git a/gcc/config/sparc/sparc.opt.urls b/gcc/config/sparc/sparc.opt.urls
index 24cc22e4cbc..2a6ffa258e0 100644
--- a/gcc/config/sparc/sparc.opt.urls
+++ b/gcc/config/sparc/sparc.opt.urls
@@ -24,9 +24,6 @@ UrlSuffix(gcc/SPARC-Options.html#index-mhard-quad-float)
 msoft-quad-float
 UrlSuffix(gcc/SPARC-Options.html#index-msoft-quad-float)
 
-mlra
-UrlSuffix(gcc/SPARC-Options.html#index-mlra-3)
-
 mv8plus
 UrlSuffix(gcc/SPARC-Options.html#index-mv8plus)
 
-- 
2.46.2

