* 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
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75710
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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) \
#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 *);
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)
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;
}
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
"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