diff options
author | Michael Meissner <meissner@redhat.com> | 2002-03-14 23:31:50 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 2002-03-14 23:31:50 +0000 |
commit | 03e9dbc91c347697d6eecbd5154a545b56349157 (patch) | |
tree | 3a30648951dcf2dfa89e7bdd5075907ab94779f9 /gcc | |
parent | 1224938570e27e78f1903333272707ed42d3bf54 (diff) | |
download | gcc-03e9dbc91c347697d6eecbd5154a545b56349157.zip gcc-03e9dbc91c347697d6eecbd5154a545b56349157.tar.gz gcc-03e9dbc91c347697d6eecbd5154a545b56349157.tar.bz2 |
Add --param max-unrolled-insns=<n> support
From-SVN: r50787
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 5 | ||||
-rw-r--r-- | gcc/params.def | 7 | ||||
-rw-r--r-- | gcc/params.h | 2 | ||||
-rw-r--r-- | gcc/unroll.c | 8 |
6 files changed, 31 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 78317db..c4cf286 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2002-03-14 Michael Meissner <meissner@redhat.com> + + * params.def (PARAM_MAX_UNROLLED_INSNS): New macro, default to + 100, allowing MAX_UNROLLED_INSNS to be overridden. + + * params.h (MAX_UNROLLED_INSNS): Define so it can be overridden by + --param. + + * unroll.c (params.h): Include. + (MAX_UNROLLED_INSNS): Delete, now in params.h. + + * doc/invoke.texi (--param max-unroll-insns): Document. + + * Makefile.in (unroll.o): Add $(PARAMS_H) dependency. + 2002-03-14 Richard Earnshaw <rearnsha@arm.com> * arm.md: Fix warnings about constraints in peepholes and splits. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 0985f07..2cb9f84 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1483,7 +1483,7 @@ doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(LOOP_H) \ $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h unroll.o : unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h function.h \ $(INTEGRATE_H) $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) $(LOOP_H) toplev.h \ - hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H) $(PREDICT_H) + hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H) $(PREDICT_H) $(PARAMS_H) flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h insn-config.h \ $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \ function.h except.h $(EXPR_H) ssa.h $(GGC_H) $(TM_P_H) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index c1689c0..abb9638 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -3851,6 +3851,11 @@ If an function contains more than this many instructions, it will not be inlined. This option is precisely equivalent to @option{-finline-limit}. +@item max-unrolled-insns +The maximum number of instructions that a loop should have if that loop +is unrolled, and if the loop is unrolled, it determines how many times +the loop code is unrolled. + @end table @end table diff --git a/gcc/params.def b/gcc/params.def index 2a1d3a3..a064ca2 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -89,6 +89,13 @@ DEFPARAM(PARAM_MAX_GCSE_PASSES, "max-gcse-passes", "The maximum number of passes to make when doing GCSE", 1) + +/* This parameter limits the number of insns in a loop that will be unrolled, + and by how much the loop is unrolled. */ +DEFPARAM(PARAM_MAX_UNROLLED_INSNS, + "max-unrolled-insns", + "The maximum number of instructions to consider to unroll in a loop", + 100) /* Local variables: mode:c diff --git a/gcc/params.h b/gcc/params.h index 33eec39..36800af 100644 --- a/gcc/params.h +++ b/gcc/params.h @@ -96,4 +96,6 @@ typedef enum compiler_param ((size_t) PARAM_VALUE (PARAM_MAX_GCSE_MEMORY)) #define MAX_GCSE_PASSES \ PARAM_VALUE (PARAM_MAX_GCSE_PASSES) +#define MAX_UNROLLED_INSNS \ + PARAM_VALUE (PARAM_MAX_UNROLLED_INSNS) #endif /* ! GCC_PARAMS_H */ diff --git a/gcc/unroll.c b/gcc/unroll.c index 2b94147..fc18938 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -147,6 +147,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "hard-reg-set.h" #include "basic-block.h" #include "predict.h" +#include "params.h" /* The prime factors looked for when trying to unroll a loop by some number which is modulo the total number of iterations. Just checking @@ -169,13 +170,6 @@ enum unroll_types UNROLL_NAIVE }; -/* This controls which loops are unrolled, and by how much we unroll - them. */ - -#ifndef MAX_UNROLLED_INSNS -#define MAX_UNROLLED_INSNS 100 -#endif - /* Indexed by register number, if non-zero, then it contains a pointer to a struct induction for a DEST_REG giv which has been combined with one of more address givs. This is needed because whenever such a DEST_REG |