diff options
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/cselib.c | 6 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 5 | ||||
-rw-r--r-- | gcc/params.def | 5 |
5 files changed, 25 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1f23cbdf868..d7a797173d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2004-01-12 Jan Hubicka <jh@suse.cz> + + Partial fox for PR opt/10776 II + * cselib.c: Include params.h + (cselib_invalidate_mem): Limit amount of nonconflicting memory + locations. + * params.def (PARAM_MAX_CSELIB_MEMORY_LOCATIONS): New. + * Makefile.in (cselib.o): Depend on params.h + 2004-01-12 Richard Sandiford <rsandifo@redhat.com> * combine.c (combine_simplify_rtx): Don't pass VOIDmode to diff --git a/gcc/Makefile.in b/gcc/Makefile.in index fde9b844cbb..0a5c3c8227a 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1643,7 +1643,7 @@ coverage.o : coverage.c gcov-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ gt-coverage.h $(HASHTAB_H) cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ - output.h function.h cselib.h $(GGC_H) $(TM_P_H) gt-cselib.h + output.h function.h cselib.h $(GGC_H) $(TM_P_H) gt-cselib.h $(PARAMS_H) cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ output.h function.h $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \ diff --git a/gcc/cselib.c b/gcc/cselib.c index 8cb325d61a5..99c4bec1c41 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -39,6 +39,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "ggc.h" #include "hashtab.h" #include "cselib.h" +#include "params.h" static int entry_and_rtx_equal_p (const void *, const void *); static hashval_t get_value_hash (const void *); @@ -1114,6 +1115,7 @@ static void cselib_invalidate_mem (rtx mem_rtx) { cselib_val **vp, *v, *next; + int num_mems = 0; vp = &first_containing_mem; for (v = *vp; v != &dummy_val; v = next) @@ -1135,9 +1137,11 @@ cselib_invalidate_mem (rtx mem_rtx) p = &(*p)->next; continue; } - if (! cselib_mem_conflict_p (mem_rtx, x)) + if (num_mems < PARAM_VALUE (PARAM_MAX_CSELIB_MEMORY_LOCATIONS) + && ! cselib_mem_conflict_p (mem_rtx, x)) { has_mem = true; + num_mems++; p = &(*p)->next; continue; } diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 909909002b1..0b2b3664dd0 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4859,6 +4859,11 @@ register. Increasing values mean more aggressive optimization, making the compile time increase with probably slightly better performance. The default value is 100. +@item max-cselib-memory-location +The maximum number of memory locations cselib should take into acount. +Increasing values mean more aggressive optimization, making the compile time +increase with probably slightly better performance. The default value is 500. + @item reorder-blocks-duplicate @itemx reorder-blocks-duplicate-feedback diff --git a/gcc/params.def b/gcc/params.def index a5b3099ca0e..3f0d15b1854 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -238,6 +238,11 @@ DEFPARAM(PARAM_MAX_CSE_PATH_LENGTH, "The maximum length of path considered in cse", 10) +DEFPARAM(PARAM_MAX_CSELIB_MEMORY_LOCATIONS, + "max-cselib-memory-locations", + "The maximum memory locations recorded by cselib", + 500) + #ifdef ENABLE_GC_ALWAYS_COLLECT # define GGC_MIN_EXPAND_DEFAULT 0 # define GGC_MIN_HEAPSIZE_DEFAULT 0 |