somewhat larger speed-up: shared rtx for hardware registers, instead of

generating them again and again.

From Jeff Law, again.
This commit is contained in:
espie 2002-06-09 00:34:37 +00:00
parent a30267600b
commit 10c0b4a5bd
6 changed files with 163 additions and 0 deletions

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-gcc_combine_c,v 1.1 2002/06/09 00:34:37 espie Exp $
--- gcc/combine.c.orig Tue Apr 30 02:42:48 2002
+++ gcc/combine.c Sat Jun 8 18:09:17 2002
@@ -11927,7 +11927,7 @@ move_deaths (x, maybe_kill_insn, from_cu
if (i < regno || i >= ourend)
REG_NOTES (where_dead)
= gen_rtx_EXPR_LIST (REG_DEAD,
- gen_rtx_REG (reg_raw_mode[i], i),
+ regno_reg_rtx[i],
REG_NOTES (where_dead));
}
@@ -11954,7 +11954,7 @@ move_deaths (x, maybe_kill_insn, from_cu
offset = 1;
for (i = regno + offset; i < ourend; i++)
- move_deaths (gen_rtx_REG (reg_raw_mode[i], i),
+ move_deaths (regno_reg_rtx[i],
maybe_kill_insn, from_cuid, to_insn, &oldnotes);
}
@@ -12576,7 +12576,7 @@ distribute_notes (notes, from_insn, i3,
for (i = regno; i < endregno;
i += HARD_REGNO_NREGS (i, reg_raw_mode[i]))
{
- rtx piece = gen_rtx_REG (reg_raw_mode[i], i);
+ rtx piece = regno_reg_rtx[i];
basic_block bb = BASIC_BLOCK (this_basic_block);
if (! dead_or_set_p (place, piece)

View File

@ -0,0 +1,32 @@
$OpenBSD: patch-gcc_df_c,v 1.1 2002/06/09 00:34:37 espie Exp $
--- gcc/df.c.orig Wed Apr 3 23:26:51 2002
+++ gcc/df.c Sat Jun 8 18:08:09 2002
@@ -633,8 +633,7 @@ static rtx df_reg_use_gen (regno)
rtx reg;
rtx use;
- reg = regno >= FIRST_PSEUDO_REGISTER
- ? regno_reg_rtx[regno] : gen_rtx_REG (reg_raw_mode[regno], regno);
+ reg = regno_reg_rtx[regno];
use = gen_rtx_USE (GET_MODE (reg), reg);
return use;
@@ -648,8 +647,7 @@ static rtx df_reg_clobber_gen (regno)
rtx reg;
rtx use;
- reg = regno >= FIRST_PSEUDO_REGISTER
- ? regno_reg_rtx[regno] : gen_rtx_REG (reg_raw_mode[regno], regno);
+ reg = regno_reg_rtx[regno];
use = gen_rtx_CLOBBER (GET_MODE (reg), reg);
return use;
@@ -905,7 +903,7 @@ df_ref_record (df, reg, loc, insn, ref_t
endregno = regno + HARD_REGNO_NREGS (regno, GET_MODE (reg));
for (i = regno; i < endregno; i++)
- df_ref_record_1 (df, gen_rtx_REG (reg_raw_mode[i], i),
+ df_ref_record_1 (df, regno_reg_rtx[i],
loc, insn, ref_type, ref_flags);
}
else

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-gcc_emit-rtl_c,v 1.1 2002/06/09 00:34:37 espie Exp $
--- gcc/emit-rtl.c.orig Fri Apr 12 14:13:26 2002
+++ gcc/emit-rtl.c Sat Jun 8 18:08:09 2002
@@ -4803,6 +4803,7 @@ void
init_emit ()
{
struct function *f = cfun;
+ int i;
f->emit = (struct emit_status *) xmalloc (sizeof (struct emit_status));
first_insn = NULL;
@@ -4832,8 +4833,13 @@ init_emit ()
f->emit->regno_decl
= (tree *) xcalloc (f->emit->regno_pointer_align_length, sizeof (tree));
+ /* Put copies of all the hard registers into regno_reg_rtx. */
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ regno_reg_rtx[i] = gen_raw_REG (reg_raw_mode[i], i);
+
/* Put copies of all the virtual register rtx into regno_reg_rtx. */
init_virtual_regs (f->emit);
+
/* Indicate that the virtual registers and stack locations are
all pointers. */

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-gcc_expr_c,v 1.1 2002/06/09 00:34:37 espie Exp $
--- gcc/expr.c.orig Tue May 7 07:43:11 2002
+++ gcc/expr.c Sat Jun 8 18:08:09 2002
@@ -2280,7 +2280,7 @@ use_regs (call_fusage, regno, nregs)
abort ();
for (i = 0; i < nregs; i++)
- use_reg (call_fusage, gen_rtx_REG (reg_raw_mode[regno + i], regno + i));
+ use_reg (call_fusage, regno_reg_rtx[regno + i]);
}
/* Add USE expressions to *CALL_FUSAGE for each REG contained in the

View File

@ -0,0 +1,41 @@
$OpenBSD: patch-gcc_flow_c,v 1.1 2002/06/09 00:34:37 espie Exp $
--- gcc/flow.c.orig Thu Apr 18 22:21:09 2002
+++ gcc/flow.c Sat Jun 8 18:08:09 2002
@@ -1721,8 +1721,7 @@ propagate_one_insn (pbi, insn)
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
{
/* We do not want REG_UNUSED notes for these registers. */
- mark_set_1 (pbi, CLOBBER, gen_rtx_REG (reg_raw_mode[i], i),
- cond, insn,
+ mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn,
pbi->flags & ~(PROP_DEATH_NOTES | PROP_REG_INFO));
}
}
@@ -1770,8 +1769,7 @@ propagate_one_insn (pbi, insn)
so they are made live. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (global_regs[i])
- mark_used_reg (pbi, gen_rtx_REG (reg_raw_mode[i], i),
- cond, insn);
+ mark_used_reg (pbi, regno_reg_rtx[i], cond, insn);
}
}
@@ -2769,7 +2767,7 @@ mark_set_1 (pbi, code, reg, cond, insn,
if (! REGNO_REG_SET_P (pbi->reg_live, i))
REG_NOTES (insn)
= alloc_EXPR_LIST (REG_UNUSED,
- gen_rtx_REG (reg_raw_mode[i], i),
+ regno_reg_rtx[i],
REG_NOTES (insn));
}
}
@@ -3577,7 +3575,7 @@ mark_used_reg (pbi, reg, cond, insn)
&& ! dead_or_set_regno_p (insn, i))
REG_NOTES (insn)
= alloc_EXPR_LIST (REG_DEAD,
- gen_rtx_REG (reg_raw_mode[i], i),
+ regno_reg_rtx[i],
REG_NOTES (insn));
}
}

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-gcc_reload1_c,v 1.1 2002/06/09 00:34:37 espie Exp $
--- gcc/reload1.c.orig Mon Apr 29 23:22:47 2002
+++ gcc/reload1.c Sat Jun 8 18:08:09 2002
@@ -7160,8 +7160,7 @@ emit_reload_insns (chain)
for (k = 1; k < nnr; k++)
reg_last_reload_reg[nregno + k]
= (nr == nnr
- ? gen_rtx_REG (reg_raw_mode[REGNO (rld[r].reg_rtx) + k],
- REGNO (rld[r].reg_rtx) + k)
+ ? regno_reg_rtx[REGNO (rld[r].reg_rtx) + k]
: 0);
/* Now do the inverse operation. */
@@ -7210,8 +7209,7 @@ emit_reload_insns (chain)
for (k = 1; k < nnr; k++)
reg_last_reload_reg[nregno + k]
= (nr == nnr
- ? gen_rtx_REG (reg_raw_mode[REGNO (rld[r].reg_rtx) + k],
- REGNO (rld[r].reg_rtx) + k)
+ ? regno_reg_rtx[REGNO (rld[r].reg_rtx) + k]
: 0);
/* Unless we inherited this reload, show we haven't