Commit 0bcf8261 by Jan Hubicka Committed by Jan Hubicka

Partial fix for PR opt/10776

	Partial fix for PR opt/10776
	* Makefile.in (reload.o): Include param.h
	* params.def (PARAM_MAX_RELOAD_SEARCH_INSNS): New parameter.
	* reload.c: Include params.h.
	(find_equiv_reg): Work limiting check.
	* invoke.texi: Document.

From-SVN: r75679
parent 09625c16
2004-01-11 Jan Hubicka <jh@suse.cz>
Partial fix for PR opt/10776
* Makefile.in (reload.o): Include param.h
* params.def (PARAM_MAX_RELOAD_SEARCH_INSNS): New parameter.
* reload.c: Include params.h.
(find_equiv_reg): Work limiting check.
* invoke.texi: Document.
2004-01-11 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.c (mips_symbolic_constant_p): Don't allow
......
......@@ -1755,7 +1755,7 @@ ra-rewrite.o : ra-rewrite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H)
output.h except.h ra.h reload.h insn-config.h
reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h output.h \
$(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) hard-reg-set.h insn-config.h \
$(REGS_H) function.h real.h toplev.h $(TM_P_H)
$(REGS_H) function.h real.h toplev.h $(TM_P_H) $(PARAMS_H)
reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h flags.h \
$(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
$(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h $(TM_P_H) \
......
......@@ -4853,6 +4853,14 @@ parameter very large effectively disables garbage collection. Setting
this parameter and @option{ggc-min-expand} to zero causes a full
collection to occur at every opportunity.
@table @gcctabopt
@item max-reload-search-insns
The maximum number of instruction reload should look backward for equivalent
register. Increasing values mean more aggressive optimization, making the
compile time increase with probably slightly better performance. The default
value is 100.
@item reorder-blocks-duplicate
@itemx reorder-blocks-duplicate-feedback
......
......@@ -260,6 +260,11 @@ DEFPARAM(GGC_MIN_HEAPSIZE,
#undef GGC_MIN_EXPAND_DEFAULT
#undef GGC_MIN_HEAPSIZE_DEFAULT
DEFPARAM(PARAM_MAX_RELOAD_SEARCH_INSNS,
"max-reload-search-insns",
"The maximum number of instructions to search backward when looking for equivalent reload",
100)
/*
Local variables:
mode:c
......
......@@ -104,6 +104,7 @@ a register with any other reload. */
#include "output.h"
#include "function.h"
#include "toplev.h"
#include "params.h"
#ifndef REGNO_MODE_OK_FOR_BASE_P
#define REGNO_MODE_OK_FOR_BASE_P(REGNO, MODE) REGNO_OK_FOR_BASE_P (REGNO)
......@@ -6383,6 +6384,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other,
int need_stable_sp = 0;
int nregs;
int valuenregs;
int num = 0;
if (goal == 0)
regno = goalreg;
......@@ -6423,6 +6425,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other,
else
return 0;
num = 0;
/* Scan insns back from INSN, looking for one that copies
a value into or out of GOAL.
Stop and give up if we reach a label. */
......@@ -6430,7 +6433,9 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other,
while (1)
{
p = PREV_INSN (p);
if (p == 0 || GET_CODE (p) == CODE_LABEL)
num++;
if (p == 0 || GET_CODE (p) == CODE_LABEL
|| num > PARAM_VALUE (PARAM_MAX_RELOAD_SEARCH_INSNS))
return 0;
if (GET_CODE (p) == INSN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment