Commit 16c5b95d by Mostafa Hagog Committed by Mostafa Hagog

gcse.c (compute_transp, [...]): Use MEM_READONLY_P.

2005-06-01 Mostafa Hagog <mustafa@il.ibm.com>

      * gcse.c (compute_transp, load_killed_in_block): Use MEM_READONLY_P.

From-SVN: r100425
parent bf3ddf8a
2005-06-01 Mostafa Hagog <mustafa@il.ibm.com>
* gcse.c (compute_transp, load_killed_in_block): Use
MEM_READONLY_P.
2005-06-01 David.Billinghurst <David.Billinghurst@riotinto.com> 2005-06-01 David.Billinghurst <David.Billinghurst@riotinto.com>
PR target/21854 PR target/21854
......
...@@ -1370,6 +1370,11 @@ static int ...@@ -1370,6 +1370,11 @@ static int
load_killed_in_block_p (basic_block bb, int uid_limit, rtx x, int avail_p) load_killed_in_block_p (basic_block bb, int uid_limit, rtx x, int avail_p)
{ {
rtx list_entry = modify_mem_list[bb->index]; rtx list_entry = modify_mem_list[bb->index];
/* If this is a readonly then we aren't going to be changing it. */
if (MEM_READONLY_P (x))
return 0;
while (list_entry) while (list_entry)
{ {
rtx setter; rtx setter;
...@@ -2462,51 +2467,53 @@ compute_transp (rtx x, int indx, sbitmap *bmap, int set_p) ...@@ -2462,51 +2467,53 @@ compute_transp (rtx x, int indx, sbitmap *bmap, int set_p)
return; return;
case MEM: case MEM:
{ if (! MEM_READONLY_P (x))
bitmap_iterator bi; {
unsigned bb_index; bitmap_iterator bi;
unsigned bb_index;
/* First handle all the blocks with calls. We don't need to
do any list walking for them. */
EXECUTE_IF_SET_IN_BITMAP (blocks_with_calls, 0, bb_index, bi)
{
if (set_p)
SET_BIT (bmap[bb_index], indx);
else
RESET_BIT (bmap[bb_index], indx);
}
/* Now iterate over the blocks which have memory modifications /* First handle all the blocks with calls. We don't need to
but which do not have any calls. */ do any list walking for them. */
EXECUTE_IF_AND_COMPL_IN_BITMAP (modify_mem_list_set, blocks_with_calls, EXECUTE_IF_SET_IN_BITMAP (blocks_with_calls, 0, bb_index, bi)
0, bb_index, bi) {
{ if (set_p)
rtx list_entry = canon_modify_mem_list[bb_index]; SET_BIT (bmap[bb_index], indx);
else
RESET_BIT (bmap[bb_index], indx);
}
while (list_entry) /* Now iterate over the blocks which have memory modifications
but which do not have any calls. */
EXECUTE_IF_AND_COMPL_IN_BITMAP (modify_mem_list_set,
blocks_with_calls,
0, bb_index, bi)
{ {
rtx dest, dest_addr; rtx list_entry = canon_modify_mem_list[bb_index];
/* LIST_ENTRY must be an INSN of some kind that sets memory. while (list_entry)
Examine each hunk of memory that is modified. */ {
rtx dest, dest_addr;
dest = XEXP (list_entry, 0); /* LIST_ENTRY must be an INSN of some kind that sets memory.
list_entry = XEXP (list_entry, 1); Examine each hunk of memory that is modified. */
dest_addr = XEXP (list_entry, 0);
if (canon_true_dependence (dest, GET_MODE (dest), dest_addr, dest = XEXP (list_entry, 0);
x, rtx_addr_varies_p)) list_entry = XEXP (list_entry, 1);
{ dest_addr = XEXP (list_entry, 0);
if (set_p)
SET_BIT (bmap[bb_index], indx); if (canon_true_dependence (dest, GET_MODE (dest), dest_addr,
else x, rtx_addr_varies_p))
RESET_BIT (bmap[bb_index], indx); {
break; if (set_p)
} SET_BIT (bmap[bb_index], indx);
list_entry = XEXP (list_entry, 1); else
RESET_BIT (bmap[bb_index], indx);
break;
}
list_entry = XEXP (list_entry, 1);
}
} }
} }
}
x = XEXP (x, 0); x = XEXP (x, 0);
goto repeat; goto repeat;
......
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