*** empty log message ***

From-SVN: r1313
This commit is contained in:
Richard Kenner 1992-06-27 13:49:28 -04:00
parent b0dda4b14d
commit e4600702d9
7 changed files with 886 additions and 443 deletions

View File

@ -817,7 +817,7 @@ combine.o : combine.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h \
insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \
basic-block.h recog.h real.h
regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
basic-block.h regs.h insn-config.h recog.h
basic-block.h regs.h insn-config.h recog.h reload.h real.h
local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h \
regs.h hard-reg-set.h insn-config.h recog.h output.h
global-alloc.o : global-alloc.c $(CONFIG_H) $(RTL_H) flags.h \

View File

@ -5836,6 +5836,37 @@ cse_insn (insn, in_libcall_block)
}
}
/* See if we have a CONST_INT that is already in a register in a
wider mode. */
if (src_const && src_related == 0 && GET_CODE (src_const) == CONST_INT
&& GET_MODE_CLASS (mode) == MODE_INT
&& GET_MODE_BITSIZE (mode) < BITS_PER_WORD)
{
enum machine_mode wider_mode;
for (wider_mode = GET_MODE_WIDER_MODE (mode);
GET_MODE_BITSIZE (wider_mode) <= BITS_PER_WORD
&& src_related == 0;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
struct table_elt *const_elt
= lookup (src_const, HASH (src_const, wider_mode), wider_mode);
if (const_elt == 0)
continue;
for (const_elt = const_elt->first_same_value;
const_elt; const_elt = const_elt->next_same_value)
if (GET_CODE (const_elt->exp) == REG)
{
src_related = gen_lowpart_if_possible (mode,
const_elt->exp);
break;
}
}
}
/* Another possibility is that we have an AND with a constant in
a mode narrower than a word. If so, it might have been generated
as part of an "if" which would narrow the AND. If we already

View File

@ -2554,7 +2554,7 @@ dump_flow_info (file)
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
if (reg_n_refs[i])
{
enum reg_class class;
enum reg_class class, altclass;
fprintf (file, "\nRegister %d used %d times across %d insns",
i, reg_n_refs[i], reg_live_length[i]);
if (reg_basic_block[i] >= 0)
@ -2568,12 +2568,17 @@ dump_flow_info (file)
if (PSEUDO_REGNO_BYTES (i) != UNITS_PER_WORD)
fprintf (file, "; %d bytes", PSEUDO_REGNO_BYTES (i));
class = reg_preferred_class (i);
if (class != GENERAL_REGS)
altclass = reg_alternate_class (i);
if (class != GENERAL_REGS || altclass != ALL_REGS)
{
if (reg_preferred_or_nothing (i))
if (altclass == ALL_REGS || class == ALL_REGS)
fprintf (file, "; pref %s", reg_class_names[(int) class]);
else if (altclass == NO_REGS)
fprintf (file, "; %s or none", reg_class_names[(int) class]);
else
fprintf (file, "; pref %s", reg_class_names[(int) class]);
fprintf (file, "; pref %s, else %s",
reg_class_names[(int) class],
reg_class_names[(int) altclass]);
}
if (REGNO_POINTER_FLAG (i))
fprintf (file, "; pointer");

View File

@ -145,9 +145,10 @@ static enum machine_mode *qty_mode;
static int *qty_n_calls_crossed;
/* Nonzero means don't allocate qty Q if we can't get its preferred class. */
/* Register class within which we allocate qty Q if we can't get
its preferred class. */
static char *qty_preferred_or_nothing;
static enum reg_class *qty_alternate_class;
/* Element Q is the SCRATCH expression for which this quantity is being
allocated or 0 if this quantity is allocating registers. */
@ -258,7 +259,7 @@ alloc_qty (regno, mode, size, birth)
qty_birth[qty] = birth;
qty_n_calls_crossed[qty] = reg_n_calls_crossed[regno];
qty_min_class[qty] = reg_preferred_class (regno);
qty_preferred_or_nothing[qty] = reg_preferred_or_nothing (regno);
qty_alternate_class[qty] = reg_alternate_class (regno);
qty_n_refs[qty] = reg_n_refs[regno];
}
@ -344,7 +345,7 @@ alloc_qty_for_scratch (scratch, n, insn, insn_code_num, insn_number)
qty_death[qty] = 2 * insn_number + 1;
qty_n_calls_crossed[qty] = 0;
qty_min_class[qty] = class;
qty_preferred_or_nothing[qty] = 1;
qty_alternate_class[qty] = NO_REGS;
qty_n_refs[qty] = 1;
}
@ -389,7 +390,7 @@ local_alloc ()
qty_mode = (enum machine_mode *) alloca (max_qty * sizeof (enum machine_mode));
qty_n_calls_crossed = (int *) alloca (max_qty * sizeof (int));
qty_min_class = (enum reg_class *) alloca (max_qty * sizeof (enum reg_class));
qty_preferred_or_nothing = (char *) alloca (max_qty);
qty_alternate_class = (enum reg_class *) alloca (max_qty * sizeof (enum reg_class));
qty_n_refs = (short *) alloca (max_qty * sizeof (short));
reg_qty = (int *) alloca (max_regno * sizeof (int));
@ -413,7 +414,7 @@ local_alloc ()
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
{
if (reg_basic_block[i] >= 0 && reg_n_deaths[i] == 1
&& (reg_preferred_or_nothing (i)
&& (reg_alternate_class (i) == NO_REGS
|| reg_class_size[(int) reg_preferred_class (i)] > 1))
reg_qty[i] = -2;
else
@ -1336,8 +1337,8 @@ block_alloc (b)
continue;
}
if (!qty_preferred_or_nothing[q])
qty_phys_reg[q] = find_free_reg (ALL_REGS,
if (qty_alternate_class[q] != NO_REGS)
qty_phys_reg[q] = find_free_reg (qty_alternate_class[q],
qty_mode[q], q, 0, 0,
qty_birth[q], qty_death[q]);
}
@ -1596,8 +1597,6 @@ combine_regs (usedreg, setreg, may_save_copy, insn_number, insn, already_dead)
/* Update info about quantity SQTY. */
qty_n_calls_crossed[sqty] += reg_n_calls_crossed[sreg];
qty_n_refs[sqty] += reg_n_refs[sreg];
if (! reg_preferred_or_nothing (sreg))
qty_preferred_or_nothing[sqty] = 0;
if (usize < ssize)
{
register int i;
@ -1662,6 +1661,10 @@ update_qty_class (qty, reg)
enum reg_class rclass = reg_preferred_class (reg);
if (reg_class_subset_p (rclass, qty_min_class[qty]))
qty_min_class[qty] = rclass;
rclass = reg_alternate_class (reg);
if (reg_class_subset_p (rclass, qty_alternate_class[qty]))
qty_alternate_class[qty] = rclass;
}
/* Handle something which alters the value of an rtx REG.

File diff suppressed because it is too large Load Diff

View File

@ -1502,7 +1502,7 @@ operands_match_p (x, y)
/* Return the number of times character C occurs in string S. */
static int
int
n_occurrences (c, s)
char c;
char *s;
@ -2045,7 +2045,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
? reg_preferred_class (REGNO (recog_operand[i])) : NO_REGS);
pref_or_nothing[i]
= (code == REG && REGNO (recog_operand[i]) > FIRST_PSEUDO_REGISTER
&& reg_preferred_or_nothing (REGNO (recog_operand[i])));
&& reg_alternate_class (REGNO (recog_operand[i])) == NO_REGS);
}
/* If this is simply a copy from operand 1 to operand 0, merge the

View File

@ -642,6 +642,7 @@ extern char *decode_asm_operands ();
#ifdef BITS_PER_WORD
/* Conditional is to detect when config.h has been included. */
extern enum reg_class reg_preferred_class ();
extern enum reg_class reg_alternate_class ();
#endif
extern rtx get_first_nonparm_insn ();