This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Add max-gcse-passes param.
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] Add max-gcse-passes param.
- From: Daniel Berlin <dan at cgsoftware dot com>
- Date: Tue, 26 Jun 2001 16:05:11 -0400
2001-06-26 Daniel Berlin <dan@cgsoftware.com>
* doc/invoke.texi: Add description of max-gcse-passes param.
* gcse.c (gcse_main): Use MAX_GCSE_PASSES instead of MAX_PASSES.
(MAX_PASSES): Remove now unneeded macro.
* params.h (MAX_GCSE_PASSES): New macro, to get parameter value of
max-gcse-passes param.
* params.def (PARAM_MAX_GCSE_PASSES): New parameter, controlling
maximum number of GCSE passes to run. Defaults to 1 (which is what
MAX_PASSES in gcse.c used to be).
Index: params.def
===================================================================
RCS file: /cvs/gcc/egcs/gcc/params.def,v
retrieving revision 1.5
diff -c -3 -p -w -B -b -r1.5 params.def
*** params.def 2001/05/01 18:51:06 1.5
--- params.def 2001/06/26 19:42:26
*************** DEFPARAM(PARAM_MAX_GCSE_MEMORY,
*** 74,80 ****
"max-gcse-memory",
"The maximum amount of memory to be allocated by GCSE",
50 * 1024 * 1024)
!
/*
Local variables:
mode:c
--- 74,84 ----
"max-gcse-memory",
"The maximum amount of memory to be allocated by GCSE",
50 * 1024 * 1024)
! /* The number of repetitions of copy/const prop and PRE to run. */
! DEFPARAM(PARAM_MAX_GCSE_PASSES,
! "max-gcse-passes",
! "The maximum number of passes to make when doing GCSE",
! 1)
/*
Local variables:
mode:c
Index: gcse.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcse.c,v
retrieving revision 1.132
diff -c -3 -p -w -B -b -r1.132 gcse.c
*** gcse.c 2001/06/04 18:04:35 1.132
--- gcse.c 2001/06/26 19:42:32
*************** Boston, MA 02111-1307, USA. */
*** 166,174 ****
#define obstack_chunk_alloc gmalloc
#define obstack_chunk_free free
- /* Maximum number of passes to perform. */
- #define MAX_PASSES 1
-
/* Propagate flow information through back edges and thus enable PRE's
moving loop invariant calculations out of loops.
--- 166,171 ----
*************** Boston, MA 02111-1307, USA. */
*** 232,238 ****
substitutions.
PRE is quite expensive in complicated functions because the DFA can take
! awhile to converge. Hence we only perform one pass. Macro MAX_PASSES can
be modified if one wants to experiment.
**********************
--- 229,235 ----
substitutions.
PRE is quite expensive in complicated functions because the DFA can take
! awhile to converge. Hence we only perform one pass. The parameter max-gcse-passes can
be modified if one wants to experiment.
**********************
*************** gcse_main (f, file)
*** 810,816 ****
max_pass_bytes = 0;
gcse_obstack_bottom = gcse_alloc (1);
changed = 1;
! while (changed && pass < MAX_PASSES)
{
changed = 0;
if (file)
--- 807,813 ----
max_pass_bytes = 0;
gcse_obstack_bottom = gcse_alloc (1);
changed = 1;
! while (changed && pass < MAX_GCSE_PASSES)
{
changed = 0;
if (file)
Index: params.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/params.h,v
retrieving revision 1.6
diff -c -3 -p -w -B -b -r1.6 params.h
*** params.h 2001/05/26 01:31:34 1.6
--- params.h 2001/06/26 19:43:52
*************** typedef enum compiler_param
*** 92,96 ****
PARAM_VALUE (PARAM_MAX_DELAY_SLOT_LIVE_SEARCH)
#define MAX_GCSE_MEMORY \
((size_t) PARAM_VALUE (PARAM_MAX_GCSE_MEMORY))
!
#endif /* ! GCC_PARAMS_H */
--- 92,97 ----
PARAM_VALUE (PARAM_MAX_DELAY_SLOT_LIVE_SEARCH)
#define MAX_GCSE_MEMORY \
((size_t) PARAM_VALUE (PARAM_MAX_GCSE_MEMORY))
! #define MAX_GCSE_PASSES \
! PARAM_VALUE (PARAM_MAX_GCSE_PASSES)
#endif /* ! GCC_PARAMS_H */
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/doc/invoke.texi,v
retrieving revision 1.19
diff -c -3 -p -r1.19 invoke.texi
*** invoke.texi 2001/06/25 00:21:28 1.19
--- invoke.texi 2001/06/26 19:50:45
*************** order to perform the global common subex
*** 3784,3789 ****
--- 3784,3792 ----
optimization. If more memory than specified is required, the
optimization will not be done.
+ @item max-gcse-passes
+ The maximum number of passes of GCSE to run.
+
@item max-inline-insns
If an function contains more than this many instructions, it
will not be inlined. This option is precisely equivalent to
--
"If you're not part of the solution, you're part of the
precipitate.
"-Steven Wright