diff options
author | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-22 14:26:56 +0000 |
---|---|---|
committer | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-22 14:26:56 +0000 |
commit | e5a23585270353871e485949aafd400519cace07 (patch) | |
tree | 9d61392a70f0091f38c55c6d45211065e1032b6c /gcc/basic-block.h | |
parent | b53c0b3ab41c967be4431bd7d8d0d5c86dccd32a (diff) | |
download | gcc-e5a23585270353871e485949aafd400519cace07.tar.gz |
2014-10-22 Andrew MacLeod <amacleod@redhat.com>
* cfgbuild.h: New. Add prototypes for cfgbuild.c.
* cfgcleanup.h: New. Add prototypes for cfgcleanup.c.
* cfgloopmanip.h: New. Add prototypes for cfgloopmanip.c.
* dominance.h: New. Add prototypes for dominance.c.
* cfgloop.h: Move some prototypes/enum to cfgloopmanip.h and include it.
* cfghooks.h: (struct profile_record) Relocate here.
Relocate 2 prototypes from basic-block.h.
* basic-block.h: Move prototypes and struct to new header files.
Include cfgbuild.h, cfgcleanup.h, and dominance.h.
* rtl.h: Move a few prototypes to new header files.
* cfgcleanup.c (merge_memattrs): Make static.
* genopinit.c (main): Add predict.h to list of includes.
* predict.h: Update prototype list to match predict.c.
* predict.c (maybe_hot_count_p): Export.
(cgraph_edge::maybe_hot_p): Move to cgraph.c.
(cgraph_node::optimize_for_size_p): Move to cgraph.h.
* cgraph.h (cgraph_node::optimize_for_size_p): Relocate here.
* cgraph.c (cgraph_edge::maybe_hot_p): Relocate here.
* profile.h: Adjust prototypes.
* ifcvt.h: New. Relocate struct ce_if_block here.
* ifcvt.c: Include ifcvt.h.
* config/frv/frv.c: Include ifcvt.h.
* config/frv/frv-protos.h: Add 'struct' to ce_if_block * parameters.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216559 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/basic-block.h')
-rw-r--r-- | gcc/basic-block.h | 174 |
1 files changed, 3 insertions, 171 deletions
diff --git a/gcc/basic-block.h b/gcc/basic-block.h index a82db077619..7731c79952e 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -33,6 +33,9 @@ along with GCC; see the file COPYING3. If not see #include "cfg.h" #include "cfganal.h" #include "lcm.h" +#include "cfgbuild.h" +#include "cfgcleanup.h" +#include "dominance.h" /* Use gcov_type to hold basic block counters. Should be at least 64bit. Although a counter cannot be negative, we use a signed @@ -85,38 +88,6 @@ enum cfg_edge_flags { #define EDGE_COMPLEX \ (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_EH | EDGE_PRESERVE) -/* Structure to gather statistic about profile consistency, per pass. - An array of this structure, indexed by pass static number, is allocated - in passes.c. The structure is defined here so that different CFG modes - can do their book-keeping via CFG hooks. - - For every field[2], field[0] is the count before the pass runs, and - field[1] is the post-pass count. This allows us to monitor the effect - of each individual pass on the profile consistency. - - This structure is not supposed to be used by anything other than passes.c - and one CFG hook per CFG mode. */ -struct profile_record -{ - /* The number of basic blocks where sum(freq) of the block's predecessors - doesn't match reasonably well with the incoming frequency. */ - int num_mismatched_freq_in[2]; - /* Likewise for a basic block's successors. */ - int num_mismatched_freq_out[2]; - /* The number of basic blocks where sum(count) of the block's predecessors - doesn't match reasonably well with the incoming frequency. */ - int num_mismatched_count_in[2]; - /* Likewise for a basic block's successors. */ - int num_mismatched_count_out[2]; - /* A weighted cost of the run-time of the function body. */ - gcov_type time[2]; - /* A weighted cost of the size of the function body. */ - int size[2]; - /* True iff this pass actually was run. */ - bool run; -}; - - struct GTY(()) rtl_bb_info { /* The first insn of the block is embedded into bb->il.x. */ /* The last insn of the block. */ @@ -249,15 +220,6 @@ enum cfg_bb_flags #define BB_COPY_PARTITION(dstbb, srcbb) \ BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb)) -/* State of dominance information. */ - -enum dom_state -{ - DOM_NONE, /* Not computed at all. */ - DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */ - DOM_OK /* Everything is ok. */ -}; - /* What sort of profiling information we have. */ enum profile_status_d { @@ -383,31 +345,6 @@ struct GTY(()) control_flow_graph { /* The two blocks that are always in the cfg. */ #define NUM_FIXED_BLOCKS (2) - -extern edge redirect_edge_succ_nodup (edge, basic_block); - -/* Structure to group all of the information to process IF-THEN and - IF-THEN-ELSE blocks for the conditional execution support. This - needs to be in a public file in case the IFCVT macros call - functions passing the ce_if_block data structure. */ - -struct ce_if_block -{ - basic_block test_bb; /* First test block. */ - basic_block then_bb; /* THEN block. */ - basic_block else_bb; /* ELSE block or NULL. */ - basic_block join_bb; /* Join THEN/ELSE blocks. */ - basic_block last_test_bb; /* Last bb to hold && or || tests. */ - int num_multiple_test_blocks; /* # of && and || basic blocks. */ - int num_and_and_blocks; /* # of && blocks. */ - int num_or_or_blocks; /* # of || blocks. */ - int num_multiple_test_insns; /* # of insns in && and || blocks. */ - int and_and_p; /* Complex test is &&. */ - int num_then_insns; /* # of insns in THEN block. */ - int num_else_insns; /* # of insns in ELSE block. */ - int pass; /* Pass number. */ -}; - /* The base value for branch probability notes and edge probabilities. */ #define REG_BR_PROB_BASE 10000 @@ -649,97 +586,6 @@ ei_cond (edge_iterator ei, edge *p) #define CLEANUP_CFGLAYOUT 32 /* Do cleanup in cfglayout mode. */ #define CLEANUP_CFG_CHANGED 64 /* The caller changed the CFG. */ -extern void dump_flow_info (FILE *, int); - -/* In predict.c */ -extern bool maybe_hot_count_p (struct function *, gcov_type); -extern bool maybe_hot_bb_p (struct function *, const_basic_block); -extern bool maybe_hot_edge_p (edge); -extern bool probably_never_executed_bb_p (struct function *, const_basic_block); -extern bool probably_never_executed_edge_p (struct function *, edge); -extern bool optimize_bb_for_size_p (const_basic_block); -extern bool optimize_bb_for_speed_p (const_basic_block); -extern bool optimize_edge_for_size_p (edge); -extern bool optimize_edge_for_speed_p (edge); -extern bool optimize_loop_for_size_p (struct loop *); -extern bool optimize_loop_for_speed_p (struct loop *); -extern bool optimize_loop_nest_for_size_p (struct loop *); -extern bool optimize_loop_nest_for_speed_p (struct loop *); -extern bool gimple_predicted_by_p (const_basic_block, enum br_predictor); -extern bool rtl_predicted_by_p (const_basic_block, enum br_predictor); -extern void gimple_predict_edge (edge, enum br_predictor, int); -extern void rtl_predict_edge (edge, enum br_predictor, int); -extern void predict_edge_def (edge, enum br_predictor, enum prediction); -extern void guess_outgoing_edge_probabilities (basic_block); -extern void remove_predictions_associated_with_edge (edge); -extern bool edge_probability_reliable_p (const_edge); -extern bool br_prob_note_reliable_p (const_rtx); -extern bool predictable_edge_p (edge); - -/* In cfgbuild.c. */ -extern void find_many_sub_basic_blocks (sbitmap); -extern void rtl_make_eh_edge (sbitmap, basic_block, rtx); - -enum replace_direction { dir_none, dir_forward, dir_backward, dir_both }; - -/* In cfgcleanup.c. */ -extern bool cleanup_cfg (int); -extern int flow_find_cross_jump (basic_block, basic_block, rtx_insn **, - rtx_insn **, enum replace_direction*); -extern int flow_find_head_matching_sequence (basic_block, basic_block, - rtx_insn **, rtx_insn **, int); - -extern bool delete_unreachable_blocks (void); - -extern bool inside_basic_block_p (const rtx_insn *); -extern bool control_flow_insn_p (const rtx_insn *); -extern rtx_insn *get_last_bb_insn (basic_block); - -/* In dominance.c */ - -enum cdi_direction -{ - CDI_DOMINATORS = 1, - CDI_POST_DOMINATORS = 2 -}; - -extern enum dom_state dom_info_state (function *, enum cdi_direction); -extern enum dom_state dom_info_state (enum cdi_direction); -extern void set_dom_info_availability (enum cdi_direction, enum dom_state); -extern bool dom_info_available_p (function *, enum cdi_direction); -extern bool dom_info_available_p (enum cdi_direction); -extern void calculate_dominance_info (enum cdi_direction); -extern void free_dominance_info (function *, enum cdi_direction); -extern void free_dominance_info (enum cdi_direction); -extern basic_block nearest_common_dominator (enum cdi_direction, - basic_block, basic_block); -extern basic_block nearest_common_dominator_for_set (enum cdi_direction, - bitmap); -extern void set_immediate_dominator (enum cdi_direction, basic_block, - basic_block); -extern basic_block get_immediate_dominator (enum cdi_direction, basic_block); -extern bool dominated_by_p (enum cdi_direction, const_basic_block, const_basic_block); -extern vec<basic_block> get_dominated_by (enum cdi_direction, basic_block); -extern vec<basic_block> get_dominated_by_region (enum cdi_direction, - basic_block *, - unsigned); -extern vec<basic_block> get_dominated_to_depth (enum cdi_direction, - basic_block, int); -extern vec<basic_block> get_all_dominated_blocks (enum cdi_direction, - basic_block); -extern void add_to_dominance_info (enum cdi_direction, basic_block); -extern void delete_from_dominance_info (enum cdi_direction, basic_block); -basic_block recompute_dominator (enum cdi_direction, basic_block); -extern void redirect_immediate_dominators (enum cdi_direction, basic_block, - basic_block); -extern void iterate_fix_dominators (enum cdi_direction, - vec<basic_block> , bool); -extern void verify_dominators (enum cdi_direction); -extern basic_block first_dom_son (enum cdi_direction, basic_block); -extern basic_block next_dom_son (enum cdi_direction, basic_block); -unsigned bb_dom_dfs_in (enum cdi_direction, basic_block); -unsigned bb_dom_dfs_out (enum cdi_direction, basic_block); - #include "cfghooks.h" /* Return true if BB is in a transaction. */ @@ -794,20 +640,6 @@ find_fallthru_edge (vec<edge, va_gc> *edges) return e; } -/* In cfgloopmanip.c. */ -extern edge mfb_kj_edge; -extern bool mfb_keep_just (edge); - -/* In cfgexpand.c. */ -extern void rtl_profile_for_bb (basic_block); -extern void rtl_profile_for_edge (edge); -extern void default_rtl_profile (void); - -/* In profile.c. */ -typedef struct gcov_working_set_info gcov_working_set_t; -extern gcov_working_set_t *find_working_set (unsigned pct_times_10); -extern void add_working_set (gcov_working_set_t *); - /* Check tha probability is sane. */ static inline void |