This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: patch to use DF_LIVE_{IN,OUT} in IRA.
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: Kenneth Zadeck <zadeck at naturalbridge dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Kenneth Zadeck <Kenneth dot Zadeck at naturalbridge dot com>
- Date: Mon, 30 Mar 2009 14:01:36 -0400
- Subject: Re: RFA: patch to use DF_LIVE_{IN,OUT} in IRA.
- References: <49D0FA48.4090804@redhat.com> <49D0FBA2.3010403@naturalbridge.com>
Kenneth Zadeck wrote:
Vladimir Makarov wrote:
The following patch makes IRA to use DF_LIVE_{IN,OUT}.
The patch was throughly tested on major platforms month ago.
OK to commit?
Rather than defining your own macro, you should be using the
df_get_live_{in,out}. These functions check to see if the DF_LIVE
problem has been defined and use it. Otherwise they use df_lr.
This is better than keying on the optimization level. Aside from
that, this patch is fine.
Thanks, Kenny. I've committed the following patch.
2009-03-30 Vladimir Makarov <vmakarov@redhat.com>
* reload.c (push_reload, find_dummy_reload): Use df_get_live_out
instead of DF_LR_OUT.
* ira-lives.c (process_bb_node_lives): Ditto.
* ira-color.c (ira_loop_edge_freq): Use df_get_live_{out,in}
instead of DF_LR_{OUT,IN}.
* ira-emit.c (generate_edge_moves, add_ranges_and_copies): Ditto.
* ira-build.c (create_bb_allocnos, create_loop_allocnos): Ditto.
Index: reload.c
===================================================================
--- reload.c (revision 145303)
+++ reload.c (working copy)
@@ -1549,7 +1549,7 @@ push_reload (rtx in, rtx out, rtx *inloc
&& reg_mentioned_p (XEXP (note, 0), in)
/* Check that a former pseudo is valid; see find_dummy_reload. */
&& (ORIGINAL_REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER
- || (! bitmap_bit_p (DF_LR_OUT (ENTRY_BLOCK_PTR),
+ || (! bitmap_bit_p (df_get_live_out (ENTRY_BLOCK_PTR),
ORIGINAL_REGNO (XEXP (note, 0)))
&& hard_regno_nregs[regno][GET_MODE (XEXP (note, 0))] == 1))
&& ! refers_to_regno_for_reload_p (regno,
@@ -2027,7 +2027,7 @@ find_dummy_reload (rtx real_in, rtx real
can ignore the conflict). We must never introduce writes
to such hardregs, as they would clobber the other live
pseudo. See PR 20973. */
- || (!bitmap_bit_p (DF_LR_OUT (ENTRY_BLOCK_PTR),
+ || (!bitmap_bit_p (df_get_live_out (ENTRY_BLOCK_PTR),
ORIGINAL_REGNO (in))
/* Similarly, only do this if we can be sure that the death
note is still valid. global can assign some hardreg to
Index: ira-color.c
===================================================================
--- ira-color.c (revision 145308)
+++ ira-color.c (working copy)
@@ -1020,8 +1020,8 @@ ira_loop_edge_freq (ira_loop_tree_node_t
FOR_EACH_EDGE (e, ei, loop_node->loop->header->preds)
if (e->src != loop_node->loop->latch
&& (regno < 0
- || (bitmap_bit_p (DF_LR_OUT (e->src), regno)
- && bitmap_bit_p (DF_LR_IN (e->dest), regno))))
+ || (bitmap_bit_p (df_get_live_out (e->src), regno)
+ && bitmap_bit_p (df_get_live_in (e->dest), regno))))
freq += EDGE_FREQUENCY (e);
}
else
@@ -1029,8 +1029,8 @@ ira_loop_edge_freq (ira_loop_tree_node_t
edges = get_loop_exit_edges (loop_node->loop);
for (i = 0; VEC_iterate (edge, edges, i, e); i++)
if (regno < 0
- || (bitmap_bit_p (DF_LR_OUT (e->src), regno)
- && bitmap_bit_p (DF_LR_IN (e->dest), regno)))
+ || (bitmap_bit_p (df_get_live_out (e->src), regno)
+ && bitmap_bit_p (df_get_live_in (e->dest), regno)))
freq += EDGE_FREQUENCY (e);
VEC_free (edge, heap, edges);
}
Index: ira-lives.c
===================================================================
--- ira-lives.c (revision 145303)
+++ ira-lives.c (working copy)
@@ -838,7 +838,7 @@ process_bb_node_lives (ira_loop_tree_nod
high_pressure_start_point[ira_reg_class_cover[i]] = -1;
}
curr_bb_node = loop_tree_node;
- reg_live_out = DF_LR_OUT (bb);
+ reg_live_out = df_get_live_out (bb);
sparseset_clear (allocnos_live);
REG_SET_TO_HARD_REG_SET (hard_regs_live, reg_live_out);
AND_COMPL_HARD_REG_SET (hard_regs_live, eliminable_regset);
Index: ira-emit.c
===================================================================
--- ira-emit.c (revision 145303)
+++ ira-emit.c (working copy)
@@ -390,9 +390,9 @@ generate_edge_moves (edge e)
return;
src_map = src_loop_node->regno_allocno_map;
dest_map = dest_loop_node->regno_allocno_map;
- EXECUTE_IF_SET_IN_REG_SET (DF_LR_IN (e->dest),
+ EXECUTE_IF_SET_IN_REG_SET (df_get_live_in (e->dest),
FIRST_PSEUDO_REGISTER, regno, bi)
- if (bitmap_bit_p (DF_LR_OUT (e->src), regno))
+ if (bitmap_bit_p (df_get_live_out (e->src), regno))
{
src_allocno = src_map[regno];
dest_allocno = dest_map[regno];
@@ -1028,15 +1028,16 @@ add_ranges_and_copies (void)
destination block) to use for searching allocnos by their
regnos because of subsequent IR flattening. */
node = IRA_BB_NODE (bb)->parent;
- bitmap_copy (live_through, DF_LR_IN (bb));
+ bitmap_copy (live_through, df_get_live_in (bb));
add_range_and_copies_from_move_list
(at_bb_start[bb->index], node, live_through, REG_FREQ_FROM_BB (bb));
- bitmap_copy (live_through, DF_LR_OUT (bb));
+ bitmap_copy (live_through, df_get_live_out (bb));
add_range_and_copies_from_move_list
(at_bb_end[bb->index], node, live_through, REG_FREQ_FROM_BB (bb));
FOR_EACH_EDGE (e, ei, bb->succs)
{
- bitmap_and (live_through, DF_LR_IN (e->dest), DF_LR_OUT (bb));
+ bitmap_and (live_through, df_get_live_in (e->dest),
+ df_get_live_out (bb));
add_range_and_copies_from_move_list
((move_t) e->aux, node, live_through,
REG_FREQ_FROM_EDGE_FREQ (EDGE_FREQUENCY (e)));
Index: ira-build.c
===================================================================
--- ira-build.c (revision 145308)
+++ ira-build.c (working copy)
@@ -1495,7 +1495,7 @@ create_bb_allocnos (ira_loop_tree_node_t
create_insn_allocnos (PATTERN (insn), false);
/* It might be a allocno living through from one subloop to
another. */
- EXECUTE_IF_SET_IN_REG_SET (DF_LR_IN (bb), FIRST_PSEUDO_REGISTER, i, bi)
+ EXECUTE_IF_SET_IN_REG_SET (df_get_live_in (bb), FIRST_PSEUDO_REGISTER, i, bi)
if (ira_curr_regno_allocno_map[i] == NULL)
ira_create_allocno (i, false, ira_curr_loop_tree_node);
}
@@ -1511,9 +1511,9 @@ create_loop_allocnos (edge e)
bitmap_iterator bi;
ira_loop_tree_node_t parent;
- live_in_regs = DF_LR_IN (e->dest);
+ live_in_regs = df_get_live_in (e->dest);
border_allocnos = ira_curr_loop_tree_node->border_allocnos;
- EXECUTE_IF_SET_IN_REG_SET (DF_LR_OUT (e->src),
+ EXECUTE_IF_SET_IN_REG_SET (df_get_live_out (e->src),
FIRST_PSEUDO_REGISTER, i, bi)
if (bitmap_bit_p (live_in_regs, i))
{