Commit 0443f602 by Jeffrey Oldham Committed by Jeffrey D. Oldham

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

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

	* Makefile.in (reorg.o): Add params.h dependence.
	* params.def: Fix typographical error in comment.
	(MAX_DELAY_SLOT_INSN_SEARCH): New parameter.
	* params.h: Modify introductory comment.
	(MAX_DELAY_SLOT_INSN_SEARCH): New parameter.
	* reorg.c: Add dependence on params.h.
	(redundant_insn): Add parameterized throttle for search.
	(fill_simple_delay_slots): Add a comment explaining a variable.
	Move conditional out of loop, simplifying code.
	(fill_eager_delay_slots): Fix typographical error in comment.

From-SVN: r39948
parent 7e6d8ba1
2001-02-21 Jeffrey Oldham <oldham@codesourcery.com>
* Makefile.in (reorg.o): Add params.h dependence.
* params.def: Fix typographical error in comment.
(MAX_DELAY_SLOT_INSN_SEARCH): New parameter.
* params.h: Modify introductory comment.
(MAX_DELAY_SLOT_INSN_SEARCH): New parameter.
* reorg.c: Add dependence on params.h.
(redundant_insn): Add parameterized throttle for search.
(fill_simple_delay_slots): Add a comment explaining a variable.
Move conditional out of loop, simplifying code.
(fill_eager_delay_slots): Fix typographical error in comment.
2001-02-20 Aldy Hernandez <aldyh@redhat.com>
* tm.texi (REVERSE_CONDEXEC_PREDICATES_P): New macro documentation.
......
......@@ -1481,7 +1481,7 @@ caller-save.o : caller-save.c $(CONFIG_H) system.h $(RTL_H) flags.h \
$(RECOG_H) reload.h $(EXPR_H) toplev.h
reorg.o : reorg.c $(CONFIG_H) system.h $(RTL_H) conditions.h hard-reg-set.h \
$(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) insn-flags.h \
$(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h
$(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h params.h
alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \
$(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) insn-flags.h \
$(GGC_H) function.h cselib.h $(TREE_H)
......
......@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA.
/* This file contains definitions for language-independent
parameters. The DEFPARAM macro takes 4 arguments:
- The enumeral corresonding to this parameter.
- The enumeral corresponding to this parameter.
- The name that can be used to set this parameter using the
command-line option `--param <name>=<value>'.
......@@ -44,6 +44,17 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS,
"The maximum number of instructions in a function that is eligible for inlining",
10000)
/* The maximum number of instructions to consider when looking for an
instruction to fill a delay slot. If more than this arbitrary
number of instructions is searched, the time savings from filling
the delay slot will be minimal so stop searching. Increasing
values mean more aggressive optimization, making the compile time
increase with probably small improvement in executable run time. */
DEFPARAM (PARAM_MAX_DELAY_SLOT_INSN_SEARCH,
"max-delay-slot-insn-search",
"The maximum number of instructions to consider to fill a delay slot",
100)
/*
Local variables:
mode:c
......
......@@ -27,7 +27,10 @@ Boston, MA 02111-1307, USA.
place. The values of the parameters can be set on the
command-line, thereby providing a way to control the amount of
effort spent on particular optimization passes, or otherwise tune
the behavior of the compiler. */
the behavior of the compiler.
Since their values can be set on the command-line, these parameters
should not be used for non-dynamic memory allocation. */
#ifndef PARAMS_H
#define PARAMS_H
......@@ -81,5 +84,7 @@ typedef enum compiler_param
/* Macros for the various parameters. */
#define MAX_INLINE_INSNS \
PARAM_VALUE (PARAM_MAX_INLINE_INSNS)
#define MAX_DELAY_SLOT_INSN_SEARCH \
PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH)
#endif /* PARAMS_H */
......@@ -139,6 +139,7 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h"
#include "insn-attr.h"
#include "resource.h"
#include "params.h"
#ifdef DELAY_SLOTS
......@@ -1635,6 +1636,7 @@ redundant_insn (insn, target, delay_list)
rtx trial, pat;
struct resources needed, set;
int i;
unsigned insns_to_search;
/* If INSN has any REG_UNUSED notes, it can't match anything since we
are allowed to not actually assign to such a register. */
......@@ -1642,7 +1644,10 @@ redundant_insn (insn, target, delay_list)
return 0;
/* Scan backwards looking for a match. */
for (trial = PREV_INSN (target); trial; trial = PREV_INSN (trial))
for (trial = PREV_INSN (target),
insns_to_search = MAX_DELAY_SLOT_INSN_SEARCH;
trial && insns_to_search > 0;
trial = PREV_INSN (trial), --insns_to_search)
{
if (GET_CODE (trial) == CODE_LABEL)
return 0;
......@@ -1743,9 +1748,10 @@ redundant_insn (insn, target, delay_list)
/* Scan backwards until we reach a label or an insn that uses something
INSN sets or sets something insn uses or sets. */
for (trial = PREV_INSN (target);
trial && GET_CODE (trial) != CODE_LABEL;
trial = PREV_INSN (trial))
for (trial = PREV_INSN (target),
insns_to_search = MAX_DELAY_SLOT_INSN_SEARCH;
trial && GET_CODE (trial) != CODE_LABEL && insns_to_search > 0;
trial = PREV_INSN (trial), --insns_to_search)
{
if (GET_CODE (trial) != INSN && GET_CODE (trial) != CALL_INSN
&& GET_CODE (trial) != JUMP_INSN)
......@@ -2223,9 +2229,11 @@ fill_simple_delay_slots (non_jumps_p)
&& ! simplejump_p (insn)
&& JUMP_LABEL (insn) != 0)))
{
/* Invariant: If insn is a JUMP_INSN, the insn's jump
label. Otherwise, zero. */
rtx target = 0;
int maybe_never = 0;
struct resources needed_at_jump;
rtx pat, trial_delay;
CLEAR_RESOURCE (&needed);
CLEAR_RESOURCE (&set);
......@@ -2244,10 +2252,9 @@ fill_simple_delay_slots (non_jumps_p)
target = JUMP_LABEL (insn);
}
if (target == 0)
for (trial = next_nonnote_insn (insn); trial; trial = next_trial)
{
rtx pat, trial_delay;
next_trial = next_nonnote_insn (trial);
if (GET_CODE (trial) == CODE_LABEL
......@@ -2268,31 +2275,13 @@ fill_simple_delay_slots (non_jumps_p)
else
trial_delay = trial;
/* If this is a jump insn to our target, indicate that we have
seen another jump to it. If we aren't handling a conditional
jump, stop our search. Otherwise, compute the needs at its
target and add them to NEEDED. */
/* Stop our search when seeing an unconditional jump. */
if (GET_CODE (trial_delay) == JUMP_INSN)
{
if (target == 0)
break;
else if (JUMP_LABEL (trial_delay) != target)
{
rtx ninsn =
next_active_insn (JUMP_LABEL (trial_delay));
mark_target_live_regs (get_insns (), ninsn,
&needed_at_jump);
needed.memory |= needed_at_jump.memory;
needed.unch_memory |= needed_at_jump.unch_memory;
IOR_HARD_REG_SET (needed.regs, needed_at_jump.regs);
}
}
/* See if we have a resource problem before we try to
split. */
if (target == 0
&& GET_CODE (pat) != SEQUENCE
if (GET_CODE (pat) != SEQUENCE
&& ! insn_references_resource_p (trial, &set, 1)
&& ! insn_sets_resource_p (trial, &set, 1)
&& ! insn_sets_resource_p (trial, &needed, 1)
......@@ -2982,7 +2971,7 @@ fill_eager_delay_slots ()
}
/* If this insn is expected to branch, first try to get insns from our
target, then our fallthrough insns. If it is not, expected to branch,
target, then our fallthrough insns. If it is not expected to branch,
try the other order. */
if (prediction > 0)
......
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