45a80bb9e8
* Makefile.in (passes.o, ipa-inline.o): Add dependencies. * cgraphbuild.c (build_cgraph_edges): Compute frequencies. (rebuild_cgraph_edges): Likewise. * cgraph.c (cgraph_set_call_stmt): Add new argument frequency. (dump_cgraph_node): Dump frequencies. (cgraph_clone_edge): Add frequency scales. (cgraph_clone_node): Add freuqnecy. * cgraph.h (cgraph_edge): Add freuqnecy argument. (CGRAPH_FREQ_BASE, CGRAPH_FREQ_MAX): New constants. (cgraph_create_edge, cgraph_clone_edge, cgraph_clone_node): Update. * tree-pass.h (TODO_rebuild_frequencies): New constant. * cgraphunit.c (verify_cgraph_node): Verify frequencies. (cgraph_copy_node_for_versioning): Update call of cgraph_clone_edge. (save_inline_function_body): Likewise. * ipa-inline.c: inluce rtl.h (cgraph_clone_inlined_nods): Update call of cgraph_clone_node. (cgraph_edge_badness): Use frequencies. (cgraph_decide_recursive_inlining): Update clonning. (cgraph_decide_inlining_of_small_function): Dump frequency. * predict.c (estimate_bb_frequencies): Export. * predict.h (estimate_bb_frequencies): Declare. * tree-inline.c (copy_bb): Watch overflows. (expand_call_inline): Update call of cgraph_create_edge. (optimize_inline_calls): Use TODO flags to update frequnecies. * passes.h: Include predict.h (init_optimization_passes): Move profile ahead. (execute_function_todo): Handle TODO_rebuild_frequencies. From-SVN: r121780
44 lines
1.3 KiB
C
44 lines
1.3 KiB
C
/* Definitions for branch prediction routines in the GNU compiler.
|
|
Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
|
|
|
|
This file is part of GCC.
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
the terms of the GNU General Public License as published by the Free
|
|
Software Foundation; either version 2, or (at your option) any later
|
|
version.
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
|
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
|
02110-1301, USA. */
|
|
|
|
#ifndef GCC_PREDICT_H
|
|
#define GCC_PREDICT_H
|
|
|
|
#define DEF_PREDICTOR(ENUM, NAME, HITRATE, FLAGS) ENUM,
|
|
enum br_predictor
|
|
{
|
|
#include "predict.def"
|
|
|
|
/* Upper bound on non-language-specific builtins. */
|
|
END_PREDICTORS
|
|
};
|
|
#undef DEF_PREDICTOR
|
|
enum prediction
|
|
{
|
|
NOT_TAKEN,
|
|
TAKEN
|
|
};
|
|
|
|
extern void predict_insn_def (rtx, enum br_predictor, enum prediction);
|
|
extern int counts_to_freqs (void);
|
|
extern void estimate_bb_frequencies (void);
|
|
|
|
#endif /* GCC_PREDICT_H */
|