#include "cfglayout.h"
#include "fibheap.h"
#include "flags.h"
+#include "timevar.h"
#include "params.h"
#include "coverage.h"
-static int count_insns PARAMS ((basic_block));
-static bool ignore_bb_p PARAMS ((basic_block));
-static bool better_p PARAMS ((edge, edge));
-static edge find_best_successor PARAMS ((basic_block));
-static edge find_best_predecessor PARAMS ((basic_block));
-static int find_trace PARAMS ((basic_block, basic_block *));
-static void tail_duplicate PARAMS ((void));
-static void layout_superblocks PARAMS ((void));
+static int count_insns (basic_block);
+static bool ignore_bb_p (basic_block);
+static bool better_p (edge, edge);
+static edge find_best_successor (basic_block);
+static edge find_best_predecessor (basic_block);
+static int find_trace (basic_block, basic_block *);
+static void tail_duplicate (void);
+static void layout_superblocks (void);
/* Minimal outgoing edge probability considered for superblock formation. */
static int probability_cutoff;
/* Return true if we should ignore the basic block for purposes of tracing. */
static bool
-ignore_bb_p (bb)
- basic_block bb;
+ignore_bb_p (basic_block bb)
{
if (bb->index < 0)
return true;
/* Return number of instructions in the block. */
static int
-count_insns (bb)
- basic_block bb;
+count_insns (basic_block bb)
{
rtx insn;
int n = 0;
- for (insn = bb->head; insn != NEXT_INSN (bb->end); insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb);
+ insn != NEXT_INSN (BB_END (bb));
+ insn = NEXT_INSN (insn))
if (active_insn_p (insn))
n++;
return n;
/* Return true if E1 is more frequent than E2. */
static bool
-better_p (e1, e2)
- edge e1, e2;
+better_p (edge e1, edge e2)
{
if (e1->count != e2->count)
return e1->count > e2->count;
/* Return most frequent successor of basic block BB. */
static edge
-find_best_successor (bb)
- basic_block bb;
+find_best_successor (basic_block bb)
{
edge e;
edge best = NULL;
/* Return most frequent predecessor of basic block BB. */
static edge
-find_best_predecessor (bb)
- basic_block bb;
+find_best_predecessor (basic_block bb)
{
edge e;
edge best = NULL;
Return number of basic blocks recorded. */
static int
-find_trace (bb, trace)
- basic_block bb;
- basic_block *trace;
+find_trace (basic_block bb, basic_block *trace)
{
int i = 0;
edge e;
if profitable. */
static void
-tail_duplicate ()
+tail_duplicate (void)
{
fibnode_t *blocks = xcalloc (last_basic_block, sizeof (fibnode_t));
basic_block *trace = xmalloc (sizeof (basic_block) * n_basic_blocks);
change though. */
static void
-layout_superblocks ()
+layout_superblocks (void)
{
basic_block end = ENTRY_BLOCK_PTR->succ->dest;
basic_block bb = ENTRY_BLOCK_PTR->succ->dest->next_bb;
/* Main entry point to this file. */
void
-tracer ()
+tracer (void)
{
if (n_basic_blocks <= 1)
return;
+
+ timevar_push (TV_TRACER);
+
cfg_layout_initialize ();
mark_dfs_back_edges ();
if (rtl_dump_file)
if (rtl_dump_file)
dump_flow_info (rtl_dump_file);
cfg_layout_finalize ();
+
/* Merge basic blocks in duplicated traces. */
cleanup_cfg (CLEANUP_EXPENSIVE);
+
+ timevar_pop (TV_TRACER);
}