Partial fox for PR opt/10776 II

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

From-SVN: r75710
This commit is contained in:
Jan Hubicka 2004-01-12 10:44:16 +01:00 committed by Jan Hubicka
parent c065787208
commit c65ecebc82
5 changed files with 25 additions and 2 deletions

View File

@ -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

View File

@ -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) \

View File

@ -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;
}

View File

@ -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

View File

@ -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