aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-11-09 11:50:14 +1030
committerAlan Modra <amodra@gcc.gnu.org>2011-11-09 11:50:14 +1030
commitffe1468659b160f34f296a3879a0894e45e644ba (patch)
treebaff6cd042f250e9fc891b81960ba3c328cc11eb /gcc/cfgrtl.c
parentdce5eb107dfddc1c8bcd04d4f12f34fb7b72964e (diff)
downloadgcc-ffe1468659b160f34f296a3879a0894e45e644ba.zip
gcc-ffe1468659b160f34f296a3879a0894e45e644ba.tar.gz
gcc-ffe1468659b160f34f296a3879a0894e45e644ba.tar.bz2
function.c (bb_active_p): Delete.
* function.c (bb_active_p): Delete. (dup_block_and_redirect, active_insn_between): New functions. (convert_jumps_to_returns, emit_return_for_exit): New functions, split out from.. (thread_prologue_and_epilogue_insns): ..here. Delete shadowing variables. Don't do prologue register clobber tests when shrink wrapping already failed. Delete all last_bb_active code. Instead compute tail block candidates for duplicating exit path. Remove these from antic set. Duplicate tails when reached from both blocks needing a prologue/epilogue and blocks not needing such. * ifcvt.c (dead_or_predicable): Test both flag_shrink_wrap and HAVE_simple_return. * bb-reorder.c (get_uncond_jump_length): Make global. * bb-reorder.h (get_uncond_jump_length): Declare. * cfgrtl.c (rtl_create_basic_block): Comment typo fix. (rtl_split_edge): Likewise. Warning fix. (rtl_duplicate_bb): New function. (rtl_cfg_hooks): Enable can_duplicate_block_p and duplicate_block. * Makefile.in (function.o): Update dependencies. From-SVN: r181188
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 6e9f70e..16e2eb3 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -322,9 +322,9 @@ create_basic_block_structure (rtx head, rtx end, rtx bb_note, basic_block after)
}
/* Create new basic block consisting of instructions in between HEAD and END
- and place it to the BB chain after block AFTER. END can be NULL in to
- create new empty basic block before HEAD. Both END and HEAD can be NULL to
- create basic block at the end of INSN chain. */
+ and place it to the BB chain after block AFTER. END can be NULL to
+ create a new empty basic block before HEAD. Both END and HEAD can be
+ NULL to create basic block at the end of INSN chain. */
static basic_block
rtl_create_basic_block (void *headp, void *endp, basic_block after)
@@ -1411,8 +1411,8 @@ rtl_split_edge (edge edge_in)
before = NULL_RTX;
/* If this is a fall through edge to the exit block, the blocks might be
- not adjacent, and the right place is the after the source. */
- if (edge_in->flags & EDGE_FALLTHRU && edge_in->dest == EXIT_BLOCK_PTR)
+ not adjacent, and the right place is after the source. */
+ if ((edge_in->flags & EDGE_FALLTHRU) && edge_in->dest == EXIT_BLOCK_PTR)
{
before = NEXT_INSN (BB_END (edge_in->src));
bb = create_basic_block (before, NULL, edge_in->src);
@@ -3177,6 +3177,21 @@ rtl_can_remove_branch_p (const_edge e)
return true;
}
+/* We do not want to declare these functions in a header file, since they
+ should only be used through the cfghooks interface, and we do not want to
+ move them here since it would require also moving quite a lot of related
+ code. They are in cfglayout.c. */
+extern bool cfg_layout_can_duplicate_bb_p (const_basic_block);
+extern basic_block cfg_layout_duplicate_bb (basic_block);
+
+static basic_block
+rtl_duplicate_bb (basic_block bb)
+{
+ bb = cfg_layout_duplicate_bb (bb);
+ bb->aux = NULL;
+ return bb;
+}
+
/* Implementation of CFG manipulation for linearized RTL. */
struct cfg_hooks rtl_cfg_hooks = {
"rtl",
@@ -3193,8 +3208,8 @@ struct cfg_hooks rtl_cfg_hooks = {
rtl_merge_blocks,
rtl_predict_edge,
rtl_predicted_by_p,
- NULL, /* can_duplicate_block_p */
- NULL, /* duplicate_block */
+ cfg_layout_can_duplicate_bb_p,
+ rtl_duplicate_bb,
rtl_split_edge,
rtl_make_forwarder_block,
rtl_tidy_fallthru_edge,
@@ -3216,13 +3231,6 @@ struct cfg_hooks rtl_cfg_hooks = {
This representation will hopefully become the default one in future
version of the compiler. */
-/* We do not want to declare these functions in a header file, since they
- should only be used through the cfghooks interface, and we do not want to
- move them here since it would require also moving quite a lot of related
- code. They are in cfglayout.c. */
-extern bool cfg_layout_can_duplicate_bb_p (const_basic_block);
-extern basic_block cfg_layout_duplicate_bb (basic_block);
-
struct cfg_hooks cfg_layout_rtl_cfg_hooks = {
"cfglayout mode",
rtl_verify_flow_info_1,