public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5250] VAX: Implement the `-mlra' command-line option
@ 2021-11-15  3:21 Maciej W. Rozycki
  0 siblings, 0 replies; only message in thread
From: Maciej W. Rozycki @ 2021-11-15  3:21 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3e09331f6aeaf5955e3deab986597d5b40c20845

commit r12-5250-g3e09331f6aeaf5955e3deab986597d5b40c20845
Author: Maciej W. Rozycki <macro@embecosm.com>
Date:   Mon Nov 15 03:14:31 2021 +0000

    VAX: Implement the `-mlra' command-line option
    
    Add the the `-mlra' command-line option for the VAX target, with the
    usual semantics of enabling Local Register Allocation, off by default.
    
    LRA remains unstable with the VAX target, with numerous ICEs throughout
    the testsuite and worse code produced overall where successful, however
    the presence of a command line option to enable it makes it easier to
    experiment with it as the compiler does not have to be rebuilt to flip
    between the old reload and LRA.
    
            gcc/
            * config/vax/vax.c (vax_lra_p): New prototype and function.
            (TARGET_LRA_P): Wire it.
            * config/vax/vax.opt (mlra): New option.
            * doc/invoke.texi (Option Summary, VAX Options): Document the
            new option.

Diff:
---
 gcc/config/vax/vax.c   | 11 ++++++++++-
 gcc/config/vax/vax.opt |  4 ++++
 gcc/doc/invoke.texi    |  9 ++++++++-
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index e26ab3b2e8e..cf77db35398 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -62,6 +62,7 @@ static rtx vax_function_arg (cumulative_args_t, const function_arg_info &);
 static void vax_function_arg_advance (cumulative_args_t,
 				      const function_arg_info &);
 static rtx vax_struct_value_rtx (tree, int);
+static bool vax_lra_p (void);
 static void vax_asm_trampoline_template (FILE *);
 static void vax_trampoline_init (rtx, tree, rtx);
 static poly_int64 vax_return_pops_args (tree, tree, poly_int64);
@@ -114,7 +115,7 @@ static HOST_WIDE_INT vax_starting_frame_offset (void);
 #define TARGET_STRUCT_VALUE_RTX vax_struct_value_rtx
 
 #undef TARGET_LRA_P
-#define TARGET_LRA_P hook_bool_void_false
+#define TARGET_LRA_P vax_lra_p
 
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P vax_legitimate_address_p
@@ -1221,6 +1222,14 @@ vax_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
   return gen_rtx_REG (Pmode, VAX_STRUCT_VALUE_REGNUM);
 }
 
+/* Return true if we use LRA instead of reload pass.  */
+
+static bool
+vax_lra_p (void)
+{
+  return TARGET_LRA;
+}
+
 /* Output integer move instructions.  */
 
 bool
diff --git a/gcc/config/vax/vax.opt b/gcc/config/vax/vax.opt
index 470e8b10f6a..712ba3a6c9e 100644
--- a/gcc/config/vax/vax.opt
+++ b/gcc/config/vax/vax.opt
@@ -42,6 +42,10 @@ munix
 Target RejectNegative Mask(UNIX_ASM)
 Generate code for UNIX assembler.
 
+mlra
+Target Mask(LRA)
+Enable Local Register Allocation.
+
 mvaxc-alignment
 Target RejectNegative Mask(VAXC_ALIGNMENT)
 Use VAXC structure conventions.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 99cdeb90c7c..2d9c1782f33 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1364,7 +1364,7 @@ See RS/6000 and PowerPC Options.
 -mbig-switch}
 
 @emph{VAX Options}
-@gccoptlist{-mg  -mgnu  -munix}
+@gccoptlist{-mg  -mgnu  -munix  -mlra}
 
 @emph{Visium Options}
 @gccoptlist{-mdebug  -msim  -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
@@ -30523,6 +30523,13 @@ GNU assembler is being used.
 @item -mg
 @opindex mg
 Output code for G-format floating-point numbers instead of D-format.
+
+@item -mlra
+@itemx -mno-lra
+@opindex mlra
+@opindex mno-lra
+Enable Local Register Allocation.  This is still experimental for the VAX,
+so by default the compiler uses standard reload.
 @end table
 
 @node Visium Options


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

only message in thread, other threads:[~2021-11-15  3:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15  3:21 [gcc r12-5250] VAX: Implement the `-mlra' command-line option Maciej W. Rozycki

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).