initialization. ALLOCNUM need not be the regno of REG. */
static void
init_live_subregs (bool init_value, sbitmap *live_subregs,
- int *live_subregs_used, int allocnum, rtx reg)
+ bitmap live_subregs_used, int allocnum, rtx reg)
{
unsigned int regno = REGNO (SUBREG_REG (reg));
int size = GET_MODE_SIZE (GET_MODE (regno_reg_rtx[regno]));
gcc_assert (size > 0);
/* Been there, done that. */
- if (live_subregs_used[allocnum])
+ if (bitmap_bit_p (live_subregs_used, allocnum))
return;
- /* Create a new one with zeros. */
+ /* Create a new one. */
if (live_subregs[allocnum] == NULL)
live_subregs[allocnum] = sbitmap_alloc (size);
else
sbitmap_zero (live_subregs[allocnum]);
- /* Set the number of bits that we really want. */
- live_subregs_used[allocnum] = size;
+ bitmap_set_bit (live_subregs_used, allocnum);
}
/* Walk the insns of the current function and build reload_insn_chain,
which hardregs are live in multiword pseudos. live_subregs and
live_subregs_used are indexed by pseudo number. The live_subreg
entry for a particular pseudo is only used if the corresponding
- element is non zero in live_subregs_used. The value in
- live_subregs_used is number of bytes that the pseudo can
+ element is non zero in live_subregs_used. The sbitmap size of
+ live_subreg[allocno] is number of bytes that the pseudo can
occupy. */
sbitmap *live_subregs = XCNEWVEC (sbitmap, max_regno);
- int *live_subregs_used = XNEWVEC (int, max_regno);
+ bitmap live_subregs_used = BITMAP_ALLOC (NULL);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (eliminable_regset, i))
rtx insn;
CLEAR_REG_SET (live_relevant_regs);
- memset (live_subregs_used, 0, max_regno * sizeof (int));
+ bitmap_clear (live_subregs_used);
EXECUTE_IF_SET_IN_BITMAP (DF_LR_OUT (bb), 0, i, bi)
{
}
/* Ignore the paradoxical bits. */
- if ((int)last > live_subregs_used[regno])
- last = live_subregs_used[regno];
+ if (last > SBITMAP_SIZE (live_subregs[regno]))
+ last = SBITMAP_SIZE (live_subregs[regno]);
while (start < last)
{
if (sbitmap_empty_p (live_subregs[regno]))
{
- live_subregs_used[regno] = 0;
+ bitmap_clear_bit (live_subregs_used, regno);
bitmap_clear_bit (live_relevant_regs, regno);
}
else
modeling the def as a killing def. */
if (!DF_REF_FLAGS_IS_SET (def, DF_REF_PARTIAL))
{
+ bitmap_clear_bit (live_subregs_used, regno);
bitmap_clear_bit (live_relevant_regs, regno);
- live_subregs_used[regno] = 0;
}
}
}
live_subregs, live_subregs_used, regno, reg);
/* Ignore the paradoxical bits. */
- if ((int)last > live_subregs_used[regno])
- last = live_subregs_used[regno];
+ if (last > SBITMAP_SIZE (live_subregs[regno]))
+ last = SBITMAP_SIZE (live_subregs[regno]);
while (start < last)
{
effectively saying do not use the subregs
because we are reading the whole
pseudo. */
- live_subregs_used[regno] = 0;
+ bitmap_clear_bit (live_subregs_used, regno);
bitmap_set_bit (live_relevant_regs, regno);
}
}
}
}
- for (i = 0; i < (unsigned int) max_regno; i++)
- free (live_subregs[i]);
-
reload_insn_chain = c;
*p = NULL;
+ for (i = 0; i < (unsigned int) max_regno; i++)
+ if (live_subregs[i] != NULL)
+ sbitmap_free (live_subregs[i]);
free (live_subregs);
- free (live_subregs_used);
+ BITMAP_FREE (live_subregs_used);
BITMAP_FREE (live_relevant_regs);
BITMAP_FREE (elim_regset);