Commit 161b0a84 by Zdenek Dvorak Committed by Zdenek Dvorak

df.c (df_reg_clobber_gen): Removed.

	* df.c (df_reg_clobber_gen): Removed.
	(df_bb_rd_local_compute, df_insn_refs_record, df_rd_local_compute):
	Make more effective for hard regs.
	* ra-build.c (livethrough_conflicts_bb): Check contains_call.

From-SVN: r83204
parent 40bc204a
2004-06-15 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* df.c (df_reg_clobber_gen): Removed.
(df_bb_rd_local_compute, df_insn_refs_record, df_rd_local_compute):
Make more effective for hard regs.
* ra-build.c (livethrough_conflicts_bb): Check contains_call.
2004-06-15 Alexandre Oliva <aoliva@redhat.com> 2004-06-15 Alexandre Oliva <aoliva@redhat.com>
* c-pragma.h (c_lex_string_translate): Change type to int. * c-pragma.h (c_lex_string_translate): Change type to int.
......
...@@ -243,7 +243,7 @@ static void df_bb_du_chain_create (struct df *, basic_block, bitmap); ...@@ -243,7 +243,7 @@ static void df_bb_du_chain_create (struct df *, basic_block, bitmap);
static void df_du_chain_create (struct df *, bitmap); static void df_du_chain_create (struct df *, bitmap);
static void df_bb_ud_chain_create (struct df *, basic_block); static void df_bb_ud_chain_create (struct df *, basic_block);
static void df_ud_chain_create (struct df *, bitmap); static void df_ud_chain_create (struct df *, bitmap);
static void df_bb_rd_local_compute (struct df *, basic_block); static void df_bb_rd_local_compute (struct df *, basic_block, bitmap);
static void df_rd_local_compute (struct df *, bitmap); static void df_rd_local_compute (struct df *, bitmap);
static void df_bb_ru_local_compute (struct df *, basic_block); static void df_bb_ru_local_compute (struct df *, basic_block);
static void df_ru_local_compute (struct df *, bitmap); static void df_ru_local_compute (struct df *, bitmap);
...@@ -604,19 +604,6 @@ static rtx df_reg_use_gen (unsigned int regno) ...@@ -604,19 +604,6 @@ static rtx df_reg_use_gen (unsigned int regno)
use = gen_rtx_USE (GET_MODE (reg), reg); use = gen_rtx_USE (GET_MODE (reg), reg);
return use; return use;
} }
/* Return a CLOBBER for register REGNO. */
static rtx df_reg_clobber_gen (unsigned int regno)
{
rtx reg;
rtx use;
reg = regno_reg_rtx[regno];
use = gen_rtx_CLOBBER (GET_MODE (reg), reg);
return use;
}
/* Local chain manipulation routines. */ /* Local chain manipulation routines. */
...@@ -1221,16 +1208,11 @@ df_insn_refs_record (struct df *df, basic_block bb, rtx insn) ...@@ -1221,16 +1208,11 @@ df_insn_refs_record (struct df *df, basic_block bb, rtx insn)
{ {
rtx note; rtx note;
if (df->flags & DF_HARD_REGS) /* We do not record hard registers clobbered by the call,
{ since there are awfully many of them and "defs" created
/* Kill all registers invalidated by a call. */ through them are not interesting (since no use can be legally
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) reached by them). So we must just make sure we include them when
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)) computing kill bitmaps. */
{
rtx reg_clob = df_reg_clobber_gen (i);
df_defs_record (df, reg_clob, bb, insn);
}
}
/* There may be extra registers to be clobbered. */ /* There may be extra registers to be clobbered. */
for (note = CALL_INSN_FUNCTION_USAGE (insn); for (note = CALL_INSN_FUNCTION_USAGE (insn);
...@@ -1629,13 +1611,14 @@ df_lr_transfer_function (int bb ATTRIBUTE_UNUSED, int *changed, void *in, ...@@ -1629,13 +1611,14 @@ df_lr_transfer_function (int bb ATTRIBUTE_UNUSED, int *changed, void *in,
/* Compute local reaching def info for basic block BB. */ /* Compute local reaching def info for basic block BB. */
static void static void
df_bb_rd_local_compute (struct df *df, basic_block bb) df_bb_rd_local_compute (struct df *df, basic_block bb, bitmap call_killed_defs)
{ {
struct bb_info *bb_info = DF_BB_INFO (df, bb); struct bb_info *bb_info = DF_BB_INFO (df, bb);
rtx insn; rtx insn;
bitmap seen = BITMAP_XMALLOC ();
bool call_seen = false;
for (insn = BB_HEAD (bb); insn && insn != NEXT_INSN (BB_END (bb)); FOR_BB_INSNS_REVERSE (bb, insn)
insn = NEXT_INSN (insn))
{ {
unsigned int uid = INSN_UID (insn); unsigned int uid = INSN_UID (insn);
struct df_link *def_link; struct df_link *def_link;
...@@ -1649,6 +1632,12 @@ df_bb_rd_local_compute (struct df *df, basic_block bb) ...@@ -1649,6 +1632,12 @@ df_bb_rd_local_compute (struct df *df, basic_block bb)
unsigned int regno = DF_REF_REGNO (def); unsigned int regno = DF_REF_REGNO (def);
struct df_link *def2_link; struct df_link *def2_link;
if (bitmap_bit_p (seen, regno)
|| (call_seen
&& regno < FIRST_PSEUDO_REGISTER
&& TEST_HARD_REG_BIT (regs_invalidated_by_call, regno)))
continue;
for (def2_link = df->regs[regno].defs; def2_link; for (def2_link = df->regs[regno].defs; def2_link;
def2_link = def2_link->next) def2_link = def2_link->next)
{ {
...@@ -1659,16 +1648,21 @@ df_bb_rd_local_compute (struct df *df, basic_block bb) ...@@ -1659,16 +1648,21 @@ df_bb_rd_local_compute (struct df *df, basic_block bb)
be killed by this BB but it keeps things a lot be killed by this BB but it keeps things a lot
simpler. */ simpler. */
bitmap_set_bit (bb_info->rd_kill, DF_REF_ID (def2)); bitmap_set_bit (bb_info->rd_kill, DF_REF_ID (def2));
/* Zap from the set of gens for this BB. */
bitmap_clear_bit (bb_info->rd_gen, DF_REF_ID (def2));
} }
bitmap_set_bit (bb_info->rd_gen, DF_REF_ID (def)); bitmap_set_bit (bb_info->rd_gen, DF_REF_ID (def));
bitmap_set_bit (seen, regno);
}
if (GET_CODE (insn) == CALL_INSN && (df->flags & DF_HARD_REGS))
{
bitmap_operation (bb_info->rd_kill, bb_info->rd_kill,
call_killed_defs, BITMAP_IOR);
call_seen = 1;
} }
} }
bb_info->rd_valid = 1; BITMAP_XFREE (seen);
} }
...@@ -1677,11 +1671,32 @@ static void ...@@ -1677,11 +1671,32 @@ static void
df_rd_local_compute (struct df *df, bitmap blocks) df_rd_local_compute (struct df *df, bitmap blocks)
{ {
basic_block bb; basic_block bb;
bitmap killed_by_call = NULL;
unsigned regno;
struct df_link *def_link;
if (df->flags & DF_HARD_REGS)
{
killed_by_call = BITMAP_XMALLOC ();
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
{
if (!TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
continue;
for (def_link = df->regs[regno].defs;
def_link;
def_link = def_link->next)
bitmap_set_bit (killed_by_call, DF_REF_ID (def_link->ref));
}
}
FOR_EACH_BB_IN_BITMAP (blocks, 0, bb, FOR_EACH_BB_IN_BITMAP (blocks, 0, bb,
{ {
df_bb_rd_local_compute (df, bb); df_bb_rd_local_compute (df, bb, killed_by_call);
}); });
if (df->flags & DF_HARD_REGS)
BITMAP_XFREE (killed_by_call);
} }
......
...@@ -1054,7 +1054,9 @@ livethrough_conflicts_bb (basic_block bb) ...@@ -1054,7 +1054,9 @@ livethrough_conflicts_bb (basic_block bb)
/* And now, if we have found anything, make all live_through /* And now, if we have found anything, make all live_through
uses conflict with all defs, and update their other members. */ uses conflict with all defs, and update their other members. */
if (deaths > 0 || bitmap_first_set_bit (all_defs) >= 0) if (deaths > 0
|| contains_call
|| bitmap_first_set_bit (all_defs) >= 0)
EXECUTE_IF_SET_IN_BITMAP (info->live_throughout, first, use_id, EXECUTE_IF_SET_IN_BITMAP (info->live_throughout, first, use_id,
{ {
struct web_part *wp = &web_parts[df->def_id + use_id]; struct web_part *wp = &web_parts[df->def_id + use_id];
......
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