Commit d5d063d7 by Jeffrey Oldham Committed by Jeffrey D. Oldham

Makefile.in (resource.o): Add params.h dependence.

2001-02-23  Jeffrey Oldham  <oldham@codesourcery.com>

	* Makefile.in (resource.o): Add params.h dependence.
	* params.def (MAX_DELAY_SLOT_LIVE_SEARCH): New parameter.
	* params.h (MAX_DELAY_SLOT_LIVE_SEARCH): Likewise.
	* resource.c: Add dependence on params.h.
	(current_live_regs): Fix explanatory comment.
	(find_basic_block): Add new parameter to permit limiting search
	for a BARRIER.
	(mark_target_live_regs): Add new argument to find_basic_block call.
	(incr_ticks_for_insn): Likewise.

From-SVN: r40001
parent 12961d65
2001-02-23 Jeffrey Oldham <oldham@codesourcery.com>
* Makefile.in (resource.o): Add params.h dependence.
* params.def (MAX_DELAY_SLOT_LIVE_SEARCH): New parameter.
* params.h (MAX_DELAY_SLOT_LIVE_SEARCH): Likewise.
* resource.c: Add dependence on params.h.
(current_live_regs): Fix explanatory comment.
(find_basic_block): Add new parameter to permit limiting search
for a BARRIER.
(mark_target_live_regs): Add new argument to find_basic_block call.
(incr_ticks_for_insn): Likewise.
2001-02-23 Gabriel Dos Reis <gdr@merlin.codesourcery.com> 2001-02-23 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
* diagnostic.c (output_to_stream): Rename to * diagnostic.c (output_to_stream): Rename to
......
...@@ -1429,7 +1429,7 @@ sibcall.o : sibcall.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) function.h \ ...@@ -1429,7 +1429,7 @@ sibcall.o : sibcall.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) function.h \
hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H)
resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h system.h \ resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h system.h \
$(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \ $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \
$(INSN_ATTR_H) except.h $(INSN_ATTR_H) except.h params.h
lcm.o : lcm.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \ lcm.o : lcm.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H)
ssa.o : ssa.c $(CONFIG_H) system.h $(REGS_H) varray.h \ ssa.o : ssa.c $(CONFIG_H) system.h $(REGS_H) varray.h \
......
...@@ -55,6 +55,17 @@ DEFPARAM (PARAM_MAX_DELAY_SLOT_INSN_SEARCH, ...@@ -55,6 +55,17 @@ DEFPARAM (PARAM_MAX_DELAY_SLOT_INSN_SEARCH,
"The maximum number of instructions to consider to fill a delay slot", "The maximum number of instructions to consider to fill a delay slot",
100) 100)
/* When trying to fill delay slots, the maximum number of instructions
to consider when searching for a block with valid live register
information. Increasing this arbitrarily chosen value means more
aggressive optimization, increasing the compile time. This
parameter should be removed when the delay slot code is rewritten
to maintain the control-flow graph. */
DEFPARAM(PARAM_MAX_DELAY_SLOT_LIVE_SEARCH,
"max-delay-slot-live-search",
"The maximum number of instructions to consider to find accurate live register information",
333)
/* /*
Local variables: Local variables:
mode:c mode:c
......
...@@ -86,5 +86,7 @@ typedef enum compiler_param ...@@ -86,5 +86,7 @@ typedef enum compiler_param
PARAM_VALUE (PARAM_MAX_INLINE_INSNS) PARAM_VALUE (PARAM_MAX_INLINE_INSNS)
#define MAX_DELAY_SLOT_INSN_SEARCH \ #define MAX_DELAY_SLOT_INSN_SEARCH \
PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH) PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH)
#define MAX_DELAY_SLOT_LIVE_SEARCH \
PARAM_VALUE (PARAM_MAX_DELAY_SLOT_LIVE_SEARCH)
#endif /* PARAMS_H */ #endif /* PARAMS_H */
...@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */
#include "resource.h" #include "resource.h"
#include "except.h" #include "except.h"
#include "insn-attr.h" #include "insn-attr.h"
#include "params.h"
/* This structure is used to record liveness information at the targets or /* This structure is used to record liveness information at the targets or
fallthrough insns of branches. We will most likely need the information fallthrough insns of branches. We will most likely need the information
...@@ -66,7 +67,7 @@ static struct target_info **target_hash_table = NULL; ...@@ -66,7 +67,7 @@ static struct target_info **target_hash_table = NULL;
static int *bb_ticks; static int *bb_ticks;
/* Marks registers possibly live at the current place being scanned by /* Marks registers possibly live at the current place being scanned by
mark_target_live_regs. Used only by next two function. */ mark_target_live_regs. Also used by update_live_status. */
static HARD_REG_SET current_live_regs; static HARD_REG_SET current_live_regs;
...@@ -76,7 +77,7 @@ static HARD_REG_SET current_live_regs; ...@@ -76,7 +77,7 @@ static HARD_REG_SET current_live_regs;
static HARD_REG_SET pending_dead_regs; static HARD_REG_SET pending_dead_regs;
static void update_live_status PARAMS ((rtx, rtx, void *)); static void update_live_status PARAMS ((rtx, rtx, void *));
static int find_basic_block PARAMS ((rtx)); static int find_basic_block PARAMS ((rtx, int));
static rtx next_insn_no_annul PARAMS ((rtx)); static rtx next_insn_no_annul PARAMS ((rtx));
static rtx find_dead_or_set_registers PARAMS ((rtx, struct resources*, static rtx find_dead_or_set_registers PARAMS ((rtx, struct resources*,
rtx*, int, struct resources, rtx*, int, struct resources,
...@@ -115,25 +116,38 @@ update_live_status (dest, x, data) ...@@ -115,25 +116,38 @@ update_live_status (dest, x, data)
CLEAR_HARD_REG_BIT (pending_dead_regs, i); CLEAR_HARD_REG_BIT (pending_dead_regs, i);
} }
} }
/* Find the number of the basic block that starts closest to INSN. Return -1
if we couldn't find such a basic block. */ /* Find the number of the basic block with correct live register
information that starts closest to INSN. Return -1 if we couldn't
find such a basic block or the beginning is more than
SEARCH_LIMIT instructions before INSN. Use SEARCH_LIMIT = -1 for
an unlimited search.
The delay slot filling code destroys the control-flow graph so,
instead of finding the basic block containing INSN, we search
backwards toward a BARRIER where the live register information is
correct. */
static int static int
find_basic_block (insn) find_basic_block (insn, search_limit)
rtx insn; rtx insn;
int search_limit;
{ {
int i; int i;
/* Scan backwards to the previous BARRIER. Then see if we can find a /* Scan backwards to the previous BARRIER. Then see if we can find a
label that starts a basic block. Return the basic block number. */ label that starts a basic block. Return the basic block number. */
for (insn = prev_nonnote_insn (insn); for (insn = prev_nonnote_insn (insn);
insn && GET_CODE (insn) != BARRIER; insn && GET_CODE (insn) != BARRIER && search_limit != 0;
insn = prev_nonnote_insn (insn)) insn = prev_nonnote_insn (insn), --search_limit)
; ;
/* The closest BARRIER is too far away. */
if (search_limit == 0)
return -1;
/* The start of the function is basic block zero. */ /* The start of the function is basic block zero. */
if (insn == 0) else if (insn == 0)
return 0; return 0;
/* See if any of the upcoming CODE_LABELs start a basic block. If we reach /* See if any of the upcoming CODE_LABELs start a basic block. If we reach
...@@ -925,7 +939,7 @@ mark_target_live_regs (insns, target, res) ...@@ -925,7 +939,7 @@ mark_target_live_regs (insns, target, res)
} }
if (b == -1) if (b == -1)
b = find_basic_block (target); b = find_basic_block (target, MAX_DELAY_SLOT_LIVE_SEARCH);
if (target_hash_table != NULL) if (target_hash_table != NULL)
{ {
...@@ -1294,7 +1308,7 @@ void ...@@ -1294,7 +1308,7 @@ void
incr_ticks_for_insn (insn) incr_ticks_for_insn (insn)
rtx insn; rtx insn;
{ {
int b = find_basic_block (insn); int b = find_basic_block (insn, MAX_DELAY_SLOT_LIVE_SEARCH);
if (b != -1) if (b != -1)
bb_ticks[b]++; bb_ticks[b]++;
......
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