* cfgrtl.c (cfg_layout_merge_blocks): Cleanup.

From-SVN: r184925
This commit is contained in:
Jakub Jelinek 2012-03-05 12:53:01 +01:00 committed by Jakub Jelinek
parent 45c0175b88
commit f9df6f16c7
2 changed files with 18 additions and 25 deletions

View File

@ -1,3 +1,7 @@
2012-03-05 Jakub Jelinek <jakub@redhat.com>
* cfgrtl.c (cfg_layout_merge_blocks): Cleanup.
2012-03-05 Richard Guenther <rguenther@suse.de>
* tree.c (integer_zerop): Handle VECTOR_CSTs.

View File

@ -2818,6 +2818,7 @@ static void
cfg_layout_merge_blocks (basic_block a, basic_block b)
{
bool forwarder_p = (b->flags & BB_FORWARDER_BLOCK) != 0;
rtx insn;
gcc_checking_assert (cfg_layout_can_merge_blocks_p (a, b));
@ -2883,40 +2884,28 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
/* In the case basic blocks are not adjacent, move them around. */
if (NEXT_INSN (BB_END (a)) != BB_HEAD (b))
{
rtx first = unlink_insn_chain (BB_HEAD (b), BB_END (b));
insn = unlink_insn_chain (BB_HEAD (b), BB_END (b));
emit_insn_after_noloc (first, BB_END (a), a);
/* Skip possible DELETED_LABEL insn. */
if (!NOTE_INSN_BASIC_BLOCK_P (first))
first = NEXT_INSN (first);
gcc_assert (NOTE_INSN_BASIC_BLOCK_P (first));
BB_HEAD (b) = NULL;
/* emit_insn_after_noloc doesn't call df_insn_change_bb.
We need to explicitly call. */
update_bb_for_insn_chain (NEXT_INSN (first),
BB_END (b),
a);
delete_insn (first);
emit_insn_after_noloc (insn, BB_END (a), a);
}
/* Otherwise just re-associate the instructions. */
else
{
rtx insn;
update_bb_for_insn_chain (BB_HEAD (b), BB_END (b), a);
insn = BB_HEAD (b);
/* Skip possible DELETED_LABEL insn. */
if (!NOTE_INSN_BASIC_BLOCK_P (insn))
insn = NEXT_INSN (insn);
gcc_assert (NOTE_INSN_BASIC_BLOCK_P (insn));
BB_HEAD (b) = NULL;
BB_END (a) = BB_END (b);
delete_insn (insn);
}
/* emit_insn_after_noloc doesn't call df_insn_change_bb.
We need to explicitly call. */
update_bb_for_insn_chain (insn, BB_END (b), a);
/* Skip possible DELETED_LABEL insn. */
if (!NOTE_INSN_BASIC_BLOCK_P (insn))
insn = NEXT_INSN (insn);
gcc_assert (NOTE_INSN_BASIC_BLOCK_P (insn));
BB_HEAD (b) = NULL;
delete_insn (insn);
df_bb_delete (b->index);
/* Possible tablejumps and barriers should appear after the block. */