mirror of git://gcc.gnu.org/git/gcc.git
re PR middle-end/54146 (Very slow compile with attribute((flatten)))
PR middle-end/54146 * ira.c (init_live_subregs): Take live_subregs_used as a bitmap. (build_insn_chain): Make live_subregs_used a bitmap. Use SBITMAP_SIZE to ignore the paradoxical bytes of subregs. Use sbitmap_free to free the live_subreg sbitmaps. From-SVN: r190223
This commit is contained in:
parent
985e963f0c
commit
cee784f5fb
|
|
@ -1,5 +1,11 @@
|
||||||
2012-08-08 Steven Bosscher <steven@gcc.gnu.org>
|
2012-08-08 Steven Bosscher <steven@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR middle-end/54146
|
||||||
|
* ira.c (init_live_subregs): Take live_subregs_used as a bitmap.
|
||||||
|
(build_insn_chain): Make live_subregs_used a bitmap.
|
||||||
|
Use SBITMAP_SIZE to ignore the paradoxical bytes of subregs.
|
||||||
|
Use sbitmap_free to free the live_subreg sbitmaps.
|
||||||
|
|
||||||
PR middle-end/54146
|
PR middle-end/54146
|
||||||
* ifcvt.c: Include pointer-set.h.
|
* ifcvt.c: Include pointer-set.h.
|
||||||
(cond_move_process_if_block): Change type of then_regs and
|
(cond_move_process_if_block): Change type of then_regs and
|
||||||
|
|
|
||||||
39
gcc/ira.c
39
gcc/ira.c
|
|
@ -3251,7 +3251,7 @@ pseudo_for_reload_consideration_p (int regno)
|
||||||
initialization. ALLOCNUM need not be the regno of REG. */
|
initialization. ALLOCNUM need not be the regno of REG. */
|
||||||
static void
|
static void
|
||||||
init_live_subregs (bool init_value, sbitmap *live_subregs,
|
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));
|
unsigned int regno = REGNO (SUBREG_REG (reg));
|
||||||
int size = GET_MODE_SIZE (GET_MODE (regno_reg_rtx[regno]));
|
int size = GET_MODE_SIZE (GET_MODE (regno_reg_rtx[regno]));
|
||||||
|
|
@ -3259,10 +3259,10 @@ init_live_subregs (bool init_value, sbitmap *live_subregs,
|
||||||
gcc_assert (size > 0);
|
gcc_assert (size > 0);
|
||||||
|
|
||||||
/* Been there, done that. */
|
/* Been there, done that. */
|
||||||
if (live_subregs_used[allocnum])
|
if (bitmap_bit_p (live_subregs_used, allocnum))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Create a new one with zeros. */
|
/* Create a new one. */
|
||||||
if (live_subregs[allocnum] == NULL)
|
if (live_subregs[allocnum] == NULL)
|
||||||
live_subregs[allocnum] = sbitmap_alloc (size);
|
live_subregs[allocnum] = sbitmap_alloc (size);
|
||||||
|
|
||||||
|
|
@ -3273,8 +3273,7 @@ init_live_subregs (bool init_value, sbitmap *live_subregs,
|
||||||
else
|
else
|
||||||
sbitmap_zero (live_subregs[allocnum]);
|
sbitmap_zero (live_subregs[allocnum]);
|
||||||
|
|
||||||
/* Set the number of bits that we really want. */
|
bitmap_set_bit (live_subregs_used, allocnum);
|
||||||
live_subregs_used[allocnum] = size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Walk the insns of the current function and build reload_insn_chain,
|
/* Walk the insns of the current function and build reload_insn_chain,
|
||||||
|
|
@ -3293,11 +3292,11 @@ build_insn_chain (void)
|
||||||
which hardregs are live in multiword pseudos. live_subregs and
|
which hardregs are live in multiword pseudos. live_subregs and
|
||||||
live_subregs_used are indexed by pseudo number. The live_subreg
|
live_subregs_used are indexed by pseudo number. The live_subreg
|
||||||
entry for a particular pseudo is only used if the corresponding
|
entry for a particular pseudo is only used if the corresponding
|
||||||
element is non zero in live_subregs_used. The value in
|
element is non zero in live_subregs_used. The sbitmap size of
|
||||||
live_subregs_used is number of bytes that the pseudo can
|
live_subreg[allocno] is number of bytes that the pseudo can
|
||||||
occupy. */
|
occupy. */
|
||||||
sbitmap *live_subregs = XCNEWVEC (sbitmap, max_regno);
|
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++)
|
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||||
if (TEST_HARD_REG_BIT (eliminable_regset, i))
|
if (TEST_HARD_REG_BIT (eliminable_regset, i))
|
||||||
|
|
@ -3308,7 +3307,7 @@ build_insn_chain (void)
|
||||||
rtx insn;
|
rtx insn;
|
||||||
|
|
||||||
CLEAR_REG_SET (live_relevant_regs);
|
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)
|
EXECUTE_IF_SET_IN_BITMAP (DF_LR_OUT (bb), 0, i, bi)
|
||||||
{
|
{
|
||||||
|
|
@ -3393,8 +3392,8 @@ build_insn_chain (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ignore the paradoxical bits. */
|
/* Ignore the paradoxical bits. */
|
||||||
if ((int)last > live_subregs_used[regno])
|
if (last > SBITMAP_SIZE (live_subregs[regno]))
|
||||||
last = live_subregs_used[regno];
|
last = SBITMAP_SIZE (live_subregs[regno]);
|
||||||
|
|
||||||
while (start < last)
|
while (start < last)
|
||||||
{
|
{
|
||||||
|
|
@ -3404,7 +3403,7 @@ build_insn_chain (void)
|
||||||
|
|
||||||
if (sbitmap_empty_p (live_subregs[regno]))
|
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);
|
bitmap_clear_bit (live_relevant_regs, regno);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -3422,8 +3421,8 @@ build_insn_chain (void)
|
||||||
modeling the def as a killing def. */
|
modeling the def as a killing def. */
|
||||||
if (!DF_REF_FLAGS_IS_SET (def, DF_REF_PARTIAL))
|
if (!DF_REF_FLAGS_IS_SET (def, DF_REF_PARTIAL))
|
||||||
{
|
{
|
||||||
|
bitmap_clear_bit (live_subregs_used, regno);
|
||||||
bitmap_clear_bit (live_relevant_regs, regno);
|
bitmap_clear_bit (live_relevant_regs, regno);
|
||||||
live_subregs_used[regno] = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3479,8 +3478,8 @@ build_insn_chain (void)
|
||||||
live_subregs, live_subregs_used, regno, reg);
|
live_subregs, live_subregs_used, regno, reg);
|
||||||
|
|
||||||
/* Ignore the paradoxical bits. */
|
/* Ignore the paradoxical bits. */
|
||||||
if ((int)last > live_subregs_used[regno])
|
if (last > SBITMAP_SIZE (live_subregs[regno]))
|
||||||
last = live_subregs_used[regno];
|
last = SBITMAP_SIZE (live_subregs[regno]);
|
||||||
|
|
||||||
while (start < last)
|
while (start < last)
|
||||||
{
|
{
|
||||||
|
|
@ -3493,7 +3492,7 @@ build_insn_chain (void)
|
||||||
effectively saying do not use the subregs
|
effectively saying do not use the subregs
|
||||||
because we are reading the whole
|
because we are reading the whole
|
||||||
pseudo. */
|
pseudo. */
|
||||||
live_subregs_used[regno] = 0;
|
bitmap_clear_bit (live_subregs_used, regno);
|
||||||
bitmap_set_bit (live_relevant_regs, regno);
|
bitmap_set_bit (live_relevant_regs, regno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3536,14 +3535,14 @@ build_insn_chain (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < (unsigned int) max_regno; i++)
|
|
||||||
free (live_subregs[i]);
|
|
||||||
|
|
||||||
reload_insn_chain = c;
|
reload_insn_chain = c;
|
||||||
*p = NULL;
|
*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);
|
||||||
free (live_subregs_used);
|
BITMAP_FREE (live_subregs_used);
|
||||||
BITMAP_FREE (live_relevant_regs);
|
BITMAP_FREE (live_relevant_regs);
|
||||||
BITMAP_FREE (elim_regset);
|
BITMAP_FREE (elim_regset);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue