@@ -658,49 +658,42 @@ mark_target_live_regs (rtx_insn *insns, rtx target_maybe_return, struct resource
res->cc = 0;
/* See if we have computed this value already. */
- if (target_hash_table != NULL)
- {
- for (tinfo = target_hash_table[INSN_UID (target) % TARGET_HASH_PRIME];
- tinfo; tinfo = tinfo->next)
- if (tinfo->uid == INSN_UID (target))
- break;
-
- /* Start by getting the basic block number. If we have saved
- information, we can get it from there unless the insn at the
- start of the basic block has been deleted. */
- if (tinfo && tinfo->block != -1
- && ! BB_HEAD (BASIC_BLOCK_FOR_FN (cfun, tinfo->block))->deleted ())
- b = tinfo->block;
- }
+ for (tinfo = target_hash_table[INSN_UID (target) % TARGET_HASH_PRIME];
+ tinfo; tinfo = tinfo->next)
+ if (tinfo->uid == INSN_UID (target))
+ break;
+
+ /* Start by getting the basic block number. If we have saved
+ information, we can get it from there unless the insn at the
+ start of the basic block has been deleted. */
+ if (tinfo && tinfo->block != -1
+ && ! BB_HEAD (BASIC_BLOCK_FOR_FN (cfun, tinfo->block))->deleted ())
+ b = tinfo->block;
if (b == -1)
b = BLOCK_FOR_INSN (target)->index;
gcc_assert (b != -1);
- if (target_hash_table != NULL)
+ if (tinfo)
{
- if (tinfo)
+ /* If the information is up-to-date, use it. Otherwise, we will
+ update it below. */
+ if (b == tinfo->block && tinfo->bb_tick == bb_ticks[b])
{
- /* If the information is up-to-date, use it. Otherwise, we will
- update it below. */
- if (b == tinfo->block && tinfo->bb_tick == bb_ticks[b])
- {
- res->regs = tinfo->live_regs;
- return;
- }
- }
- else
- {
- /* Allocate a place to put our results and chain it into the
- hash table. */
- tinfo = XNEW (struct target_info);
- tinfo->uid = INSN_UID (target);
- tinfo->block = b;
- tinfo->next
- = target_hash_table[INSN_UID (target) % TARGET_HASH_PRIME];
- target_hash_table[INSN_UID (target) % TARGET_HASH_PRIME] = tinfo;
+ res->regs = tinfo->live_regs;
+ return;
}
}
+ else
+ {
+ /* Allocate a place to put our results and chain it into the hash
+ table. */
+ tinfo = XNEW (struct target_info);
+ tinfo->uid = INSN_UID (target);
+ tinfo->block = b;
+ tinfo->next = target_hash_table[INSN_UID (target) % TARGET_HASH_PRIME];
+ target_hash_table[INSN_UID (target) % TARGET_HASH_PRIME] = tinfo;
+ }
CLEAR_HARD_REG_SET (pending_dead_regs);
@@ -825,13 +818,12 @@ mark_target_live_regs (rtx_insn *insns, rtx target_maybe_return, struct resource
to be live here still are. The fallthrough edge may have
left a live register uninitialized. */
bb = BLOCK_FOR_INSN (real_insn);
- if (bb)
- {
- HARD_REG_SET extra_live;
+ gcc_assert (bb);
- REG_SET_TO_HARD_REG_SET (extra_live, DF_LR_IN (bb));
- current_live_regs |= extra_live;
- }
+ HARD_REG_SET extra_live;
+
+ REG_SET_TO_HARD_REG_SET (extra_live, DF_LR_IN (bb));
+ current_live_regs |= extra_live;
}
/* The beginning of the epilogue corresponds to the end of the
@@ -847,10 +839,8 @@ mark_target_live_regs (rtx_insn *insns, rtx target_maybe_return, struct resource
{
tinfo->block = b;
tinfo->bb_tick = bb_ticks[b];
+ tinfo->live_regs = res->regs;
}
-
- if (tinfo != NULL)
- tinfo->live_regs = res->regs;
}
/* Initialize the resources required by mark_target_live_regs ().
@@ -939,31 +929,25 @@ init_resource_info (rtx_insn *epilogue_insn)
void
free_resource_info (void)
{
- if (target_hash_table != NULL)
+ int i;
+
+ for (i = 0; i < TARGET_HASH_PRIME; ++i)
{
- int i;
+ struct target_info *ti = target_hash_table[i];
- for (i = 0; i < TARGET_HASH_PRIME; ++i)
+ while (ti)
{
- struct target_info *ti = target_hash_table[i];
-
- while (ti)
- {
- struct target_info *next = ti->next;
- free (ti);
- ti = next;
- }
+ struct target_info *next = ti->next;
+ free (ti);
+ ti = next;
}
-
- free (target_hash_table);
- target_hash_table = NULL;
}
- if (bb_ticks != NULL)
- {
- free (bb_ticks);
- bb_ticks = NULL;
- }
+ free (target_hash_table);
+ target_hash_table = NULL;
+
+ free (bb_ticks);
+ bb_ticks = NULL;
free_bb_for_insn ();
}
@@ -975,16 +959,13 @@ clear_hashed_info_for_insn (rtx_insn *insn)
{
struct target_info *tinfo;
- if (target_hash_table != NULL)
- {
- for (tinfo = target_hash_table[INSN_UID (insn) % TARGET_HASH_PRIME];
- tinfo; tinfo = tinfo->next)
- if (tinfo->uid == INSN_UID (insn))
- break;
+ for (tinfo = target_hash_table[INSN_UID (insn) % TARGET_HASH_PRIME];
+ tinfo; tinfo = tinfo->next)
+ if (tinfo->uid == INSN_UID (insn))
+ break;
- if (tinfo)
- tinfo->block = -1;
- }
+ if (tinfo)
+ tinfo->block = -1;
}
/* Clear any hashed information that we have stored for instructions