Commit 49778644 by Jan Hubicka Committed by Jan Hubicka

cfglayout.c (fixup_fallthru_exit_predecesor): New static function.

	* cfglayout.c (fixup_fallthru_exit_predecesor): New static function.
	(cfg_layout_finalize): Use it.
	* bb-reorder.c (HAVE_epilogue): Remove.
	(make_reorder_chain): Do not care special placement of
	last basic block.

	* predict.c (expected_value_to_br_prob): Delete the note
	once transformed.

	* c-decl.c (c_expand_body): Fix TV_EXPAND nesting problem;
	measure integration time separately.

From-SVN: r47019
parent 852d3dad
Wed Nov 14 19:46:08 CET 2001 Jan Hubicka <jh@suse.cz>
* cfglayout.c (fixup_fallthru_exit_predecesor): New static function.
(cfg_layout_finalize): Use it.
* bb-reorder.c (HAVE_epilogue): Remove.
(make_reorder_chain): Do not care special placement of
last basic block.
* predict.c (expected_value_to_br_prob): Delete the note
once transformed.
* c-decl.c (c_expand_body): Fix TV_EXPAND nesting problem;
measure integration time separately.
Wed Nov 14 12:30:57 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Wed Nov 14 12:30:57 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* function.c (struct temp_slot): ALIGN now unsigned. * function.c (struct temp_slot): ALIGN now unsigned.
......
...@@ -90,10 +90,6 @@ ...@@ -90,10 +90,6 @@
#include "output.h" #include "output.h"
#include "cfglayout.h" #include "cfglayout.h"
#ifndef HAVE_epilogue
#define HAVE_epilogue 0
#endif
/* Local function prototypes. */ /* Local function prototypes. */
static void make_reorder_chain PARAMS ((void)); static void make_reorder_chain PARAMS ((void));
static basic_block make_reorder_chain_1 PARAMS ((basic_block, basic_block)); static basic_block make_reorder_chain_1 PARAMS ((basic_block, basic_block));
...@@ -104,22 +100,10 @@ static basic_block make_reorder_chain_1 PARAMS ((basic_block, basic_block)); ...@@ -104,22 +100,10 @@ static basic_block make_reorder_chain_1 PARAMS ((basic_block, basic_block));
static void static void
make_reorder_chain () make_reorder_chain ()
{ {
basic_block last_block = NULL;
basic_block prev = NULL; basic_block prev = NULL;
int nbb_m1 = n_basic_blocks - 1; int nbb_m1 = n_basic_blocks - 1;
basic_block next; basic_block next;
/* If we've not got epilogue in RTL, we must fallthru to the exit.
Force the last block to be at the end. */
/* ??? Some ABIs (e.g. MIPS) require the return insn to be at the
end of the function for stack unwinding purposes. */
if (! HAVE_epilogue)
{
last_block = BASIC_BLOCK (nbb_m1);
RBI (last_block)->visited = 1;
nbb_m1 -= 1;
}
/* Loop until we've placed every block. */ /* Loop until we've placed every block. */
do do
{ {
...@@ -144,13 +128,6 @@ make_reorder_chain () ...@@ -144,13 +128,6 @@ make_reorder_chain ()
prev = make_reorder_chain_1 (next, prev); prev = make_reorder_chain_1 (next, prev);
} }
while (next); while (next);
/* Terminate the chain. */
if (! HAVE_epilogue)
{
RBI (prev)->next = last_block;
prev = last_block;
}
RBI (prev)->next = NULL; RBI (prev)->next = NULL;
} }
......
...@@ -6783,13 +6783,12 @@ c_expand_body (fndecl, nested_p, can_defer_p) ...@@ -6783,13 +6783,12 @@ c_expand_body (fndecl, nested_p, can_defer_p)
if (flag_syntax_only) if (flag_syntax_only)
return; return;
timevar_push (TV_EXPAND);
if (flag_inline_trees) if (flag_inline_trees)
{ {
/* First, cache whether the current function is inlinable. Some /* First, cache whether the current function is inlinable. Some
predicates depend on cfun and current_function_decl to predicates depend on cfun and current_function_decl to
function completely. */ function completely. */
timevar_push (TV_INTEGRATION);
uninlinable = ! tree_inlinable_function_p (fndecl); uninlinable = ! tree_inlinable_function_p (fndecl);
if (! uninlinable && can_defer_p if (! uninlinable && can_defer_p
...@@ -6800,13 +6799,17 @@ c_expand_body (fndecl, nested_p, can_defer_p) ...@@ -6800,13 +6799,17 @@ c_expand_body (fndecl, nested_p, can_defer_p)
{ {
/* Let the back-end know that this funtion exists. */ /* Let the back-end know that this funtion exists. */
(*debug_hooks->deferred_inline_function) (fndecl); (*debug_hooks->deferred_inline_function) (fndecl);
timevar_pop (TV_INTEGRATION);
return; return;
} }
/* Then, inline any functions called in it. */ /* Then, inline any functions called in it. */
optimize_inline_calls (fndecl); optimize_inline_calls (fndecl);
timevar_pop (TV_INTEGRATION);
} }
timevar_push (TV_EXPAND);
if (nested_p) if (nested_p)
{ {
/* Make sure that we will evaluate variable-sized types involved /* Make sure that we will evaluate variable-sized types involved
......
...@@ -110,6 +110,7 @@ static rtx get_next_bb_note PARAMS ((rtx)); ...@@ -110,6 +110,7 @@ static rtx get_next_bb_note PARAMS ((rtx));
static rtx get_prev_bb_note PARAMS ((rtx)); static rtx get_prev_bb_note PARAMS ((rtx));
void verify_insn_chain PARAMS ((void)); void verify_insn_chain PARAMS ((void));
static basic_block fixup_fallthru_exit_predecesor PARAMS ((void));
/* Skip over inter-block insns occurring after BB which are typically /* Skip over inter-block insns occurring after BB which are typically
associated with BB (e.g., barriers). If there are any such insns, associated with BB (e.g., barriers). If there are any such insns,
...@@ -1041,6 +1042,30 @@ verify_insn_chain () ...@@ -1041,6 +1042,30 @@ verify_insn_chain ()
abort (); abort ();
} }
} }
/* The block falling trought to exit must be last in the reordered
chain. Make it happen so. */
static basic_block
fixup_fallthru_exit_predecesor ()
{
edge e;
basic_block bb = NULL;
for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
if (e->flags & EDGE_FALLTHRU)
bb = e->src;
if (bb && RBI (bb)->next)
{
basic_block c = BASIC_BLOCK (0);
while (RBI (c)->next != bb)
c = RBI (c)->next;
RBI (c)->next = RBI (bb)->next;
while (RBI (c)->next)
c = RBI (c)->next;
RBI (c)->next = bb;
RBI (bb)->next = NULL;
}
}
/* Main entry point to this module - initialize the datastructures for /* Main entry point to this module - initialize the datastructures for
CFG layout changes. */ CFG layout changes. */
...@@ -1062,6 +1087,7 @@ cfg_layout_initialize () ...@@ -1062,6 +1087,7 @@ cfg_layout_initialize ()
void void
cfg_layout_finalize () cfg_layout_finalize ()
{ {
fixup_fallthru_exit_predecesor ();
fixup_reorder_chain (); fixup_reorder_chain ();
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
verify_insn_chain (); verify_insn_chain ();
......
...@@ -540,6 +540,7 @@ expected_value_to_br_prob () ...@@ -540,6 +540,7 @@ expected_value_to_br_prob ()
{ {
ev = NOTE_EXPECTED_VALUE (insn); ev = NOTE_EXPECTED_VALUE (insn);
ev_reg = XEXP (ev, 0); ev_reg = XEXP (ev, 0);
delete_insn (insn);
} }
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment