Commit b86ba9c8 by Geoff Keating Committed by Jeff Law

gcse.c: New definition NEVER_SET for reg_first_set...

        * gcse.c: New definition NEVER_SET for reg_first_set, reg_last_set,
        mem_first_set, mem_last_set; because 0 can be a CUID.
        (oprs_unchanged_p): Use new definition.
        (record_last_reg_set_info): Likewise.
        (record_last_mem_set_info): Likewise.
        (compute_hash_table): Likewise.

From-SVN: r22441
parent fa88e837
Wed Sep 16 00:30:56 1998 Geoff Keating <geoffk@ozemail.com.au>
* gcse.c: New definition NEVER_SET for reg_first_set, reg_last_set,
mem_first_set, mem_last_set; because 0 can be a CUID.
(oprs_unchanged_p): Use new definition.
(record_last_reg_set_info): Likewise.
(record_last_mem_set_info): Likewise.
(compute_hash_table): Likewise.
Tue Sep 15 22:59:52 1998 Jeffrey A Law (law@cygnus.com) Tue Sep 15 22:59:52 1998 Jeffrey A Law (law@cygnus.com)
* mn10200.h (ASM_OUTPUT_DWARF2_ADDR_CONST): Define. * mn10200.h (ASM_OUTPUT_DWARF2_ADDR_CONST): Define.
......
...@@ -1055,6 +1055,8 @@ compute_sets (f) ...@@ -1055,6 +1055,8 @@ compute_sets (f)
/* Hash table support. */ /* Hash table support. */
#define NEVER_SET -1
/* For each register, the cuid of the first/last insn in the block to set it, /* For each register, the cuid of the first/last insn in the block to set it,
or zero if not set. */ or zero if not set. */
static int *reg_first_set; static int *reg_first_set;
...@@ -1130,22 +1132,22 @@ oprs_unchanged_p (x, insn, avail_p) ...@@ -1130,22 +1132,22 @@ oprs_unchanged_p (x, insn, avail_p)
{ {
case REG: case REG:
if (avail_p) if (avail_p)
return (reg_last_set[REGNO (x)] == 0 return (reg_last_set[REGNO (x)] == NEVER_SET
|| reg_last_set[REGNO (x)] < INSN_CUID (insn)); || reg_last_set[REGNO (x)] < INSN_CUID (insn));
else else
return (reg_first_set[REGNO (x)] == 0 return (reg_first_set[REGNO (x)] == NEVER_SET
|| reg_first_set[REGNO (x)] >= INSN_CUID (insn)); || reg_first_set[REGNO (x)] >= INSN_CUID (insn));
case MEM: case MEM:
if (avail_p) if (avail_p)
{ {
if (mem_last_set != 0 if (mem_last_set != NEVER_SET
&& mem_last_set >= INSN_CUID (insn)) && mem_last_set >= INSN_CUID (insn))
return 0; return 0;
} }
else else
{ {
if (mem_first_set != 0 if (mem_first_set != NEVER_SET
&& mem_first_set < INSN_CUID (insn)) && mem_first_set < INSN_CUID (insn))
return 0; return 0;
} }
...@@ -1959,7 +1961,7 @@ record_last_reg_set_info (insn, regno) ...@@ -1959,7 +1961,7 @@ record_last_reg_set_info (insn, regno)
rtx insn; rtx insn;
int regno; int regno;
{ {
if (reg_first_set[regno] == 0) if (reg_first_set[regno] == NEVER_SET)
reg_first_set[regno] = INSN_CUID (insn); reg_first_set[regno] = INSN_CUID (insn);
reg_last_set[regno] = INSN_CUID (insn); reg_last_set[regno] = INSN_CUID (insn);
SET_BIT (reg_set_in_block[BLOCK_NUM (insn)], regno); SET_BIT (reg_set_in_block[BLOCK_NUM (insn)], regno);
...@@ -1971,7 +1973,7 @@ static void ...@@ -1971,7 +1973,7 @@ static void
record_last_mem_set_info (insn) record_last_mem_set_info (insn)
rtx insn; rtx insn;
{ {
if (mem_first_set == 0) if (mem_first_set == NEVER_SET)
mem_first_set = INSN_CUID (insn); mem_first_set = INSN_CUID (insn);
mem_last_set = INSN_CUID (insn); mem_last_set = INSN_CUID (insn);
mem_set_in_block[BLOCK_NUM (insn)] = 1; mem_set_in_block[BLOCK_NUM (insn)] = 1;
...@@ -2041,16 +2043,17 @@ compute_hash_table (f, set_p) ...@@ -2041,16 +2043,17 @@ compute_hash_table (f, set_p)
rtx insn; rtx insn;
int regno; int regno;
int in_libcall_block; int in_libcall_block;
int i;
/* First pass over the instructions records information used to /* First pass over the instructions records information used to
determine when registers and memory are first and last set. determine when registers and memory are first and last set.
??? The mem_set_in_block and hard-reg reg_set_in_block computation ??? The mem_set_in_block and hard-reg reg_set_in_block computation
could be moved to compute_sets since they currently don't change. */ could be moved to compute_sets since they currently don't change. */
bzero ((char *) reg_first_set, max_gcse_regno * sizeof (int)); for (i = 0; i < max_gcse_regno; i++)
bzero ((char *) reg_last_set, max_gcse_regno * sizeof (int)); reg_first_set[i] = reg_last_set[i] = NEVER_SET;
mem_first_set = 0; mem_first_set = NEVER_SET;
mem_last_set = 0; mem_last_set = NEVER_SET;
for (insn = basic_block_head[bb]; for (insn = basic_block_head[bb];
insn && insn != NEXT_INSN (basic_block_end[bb]); insn && insn != NEXT_INSN (basic_block_end[bb]);
......
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