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
This commit is contained in:
parent
852d3dad0d
commit
497786446b
5 changed files with 46 additions and 25 deletions
|
@ -1,3 +1,17 @@
|
|||
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>
|
||||
|
||||
* function.c (struct temp_slot): ALIGN now unsigned.
|
||||
|
|
|
@ -90,10 +90,6 @@
|
|||
#include "output.h"
|
||||
#include "cfglayout.h"
|
||||
|
||||
#ifndef HAVE_epilogue
|
||||
#define HAVE_epilogue 0
|
||||
#endif
|
||||
|
||||
/* Local function prototypes. */
|
||||
static void make_reorder_chain PARAMS ((void));
|
||||
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
|
||||
make_reorder_chain ()
|
||||
{
|
||||
basic_block last_block = NULL;
|
||||
basic_block prev = NULL;
|
||||
int nbb_m1 = n_basic_blocks - 1;
|
||||
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. */
|
||||
do
|
||||
{
|
||||
|
@ -144,13 +128,6 @@ make_reorder_chain ()
|
|||
prev = make_reorder_chain_1 (next, prev);
|
||||
}
|
||||
while (next);
|
||||
|
||||
/* Terminate the chain. */
|
||||
if (! HAVE_epilogue)
|
||||
{
|
||||
RBI (prev)->next = last_block;
|
||||
prev = last_block;
|
||||
}
|
||||
RBI (prev)->next = NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -6783,13 +6783,12 @@ c_expand_body (fndecl, nested_p, can_defer_p)
|
|||
if (flag_syntax_only)
|
||||
return;
|
||||
|
||||
timevar_push (TV_EXPAND);
|
||||
|
||||
if (flag_inline_trees)
|
||||
{
|
||||
/* First, cache whether the current function is inlinable. Some
|
||||
predicates depend on cfun and current_function_decl to
|
||||
function completely. */
|
||||
timevar_push (TV_INTEGRATION);
|
||||
uninlinable = ! tree_inlinable_function_p (fndecl);
|
||||
|
||||
if (! uninlinable && 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. */
|
||||
(*debug_hooks->deferred_inline_function) (fndecl);
|
||||
timevar_pop (TV_INTEGRATION);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Then, inline any functions called in it. */
|
||||
optimize_inline_calls (fndecl);
|
||||
timevar_pop (TV_INTEGRATION);
|
||||
}
|
||||
|
||||
timevar_push (TV_EXPAND);
|
||||
|
||||
if (nested_p)
|
||||
{
|
||||
/* Make sure that we will evaluate variable-sized types involved
|
||||
|
|
|
@ -110,6 +110,7 @@ static rtx get_next_bb_note PARAMS ((rtx));
|
|||
static rtx get_prev_bb_note PARAMS ((rtx));
|
||||
|
||||
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
|
||||
associated with BB (e.g., barriers). If there are any such insns,
|
||||
|
@ -1041,6 +1042,30 @@ verify_insn_chain ()
|
|||
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
|
||||
CFG layout changes. */
|
||||
|
@ -1062,6 +1087,7 @@ cfg_layout_initialize ()
|
|||
void
|
||||
cfg_layout_finalize ()
|
||||
{
|
||||
fixup_fallthru_exit_predecesor ();
|
||||
fixup_reorder_chain ();
|
||||
#ifdef ENABLE_CHECKING
|
||||
verify_insn_chain ();
|
||||
|
|
|
@ -540,6 +540,7 @@ expected_value_to_br_prob ()
|
|||
{
|
||||
ev = NOTE_EXPECTED_VALUE (insn);
|
||||
ev_reg = XEXP (ev, 0);
|
||||
delete_insn (insn);
|
||||
}
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue