Mercurial > hg > CbC > CbC_gcc
diff gcc/cfghooks.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line diff
--- a/gcc/cfghooks.h Thu Oct 25 07:37:49 2018 +0900 +++ b/gcc/cfghooks.h Thu Feb 13 11:34:05 2020 +0900 @@ -1,5 +1,5 @@ /* Hooks for cfg representation specific functions. - Copyright (C) 2003-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2020 Free Software Foundation, Inc. Contributed by Sebastian Pop <s.pop@laposte.net> This file is part of GCC. @@ -38,22 +38,36 @@ { /* 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]; + int num_mismatched_freq_in; /* Likewise for a basic block's successors. */ - int num_mismatched_freq_out[2]; + int num_mismatched_freq_out; /* 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]; + int num_mismatched_count_in; /* Likewise for a basic block's successors. */ - int num_mismatched_count_out[2]; + int num_mismatched_count_out; /* A weighted cost of the run-time of the function body. */ - gcov_type time[2]; + gcov_type_unsigned time; /* A weighted cost of the size of the function body. */ - int size[2]; + int size; /* True iff this pass actually was run. */ bool run; }; +typedef int_hash <unsigned short, 0> dependence_hash; + +/* Optional data for duplicate_block. */ + +class copy_bb_data +{ +public: + copy_bb_data() : dependence_map (NULL) {} + ~copy_bb_data () { delete dependence_map; } + + /* A map from the copied BBs dependence info cliques to + equivalents in the BBs duplicated to. */ + hash_map<dependence_hash, unsigned short> *dependence_map; +}; struct cfg_hooks { @@ -112,7 +126,7 @@ bool (*can_duplicate_block_p) (const_basic_block a); /* Duplicate block A. */ - basic_block (*duplicate_block) (basic_block a); + basic_block (*duplicate_block) (basic_block a, copy_bb_data *); /* Higher level functions representable by primitive operations above if we didn't have some oddities in RTL and Tree representations. */ @@ -152,7 +166,7 @@ /* A hook for duplicating loop in CFG, currently this is used in loop versioning. */ - bool (*cfg_hook_duplicate_loop_to_header_edge) (struct loop *, edge, + bool (*cfg_hook_duplicate_loop_to_header_edge) (class loop *, edge, unsigned, sbitmap, edge, vec<edge> *, int); @@ -182,7 +196,7 @@ basic_block (*split_block_before_cond_jump) (basic_block); /* Do book-keeping of a basic block for the profile consistency checker. */ - void (*account_profile_record) (basic_block, int, struct profile_record *); + void (*account_profile_record) (basic_block, struct profile_record *); }; extern void verify_flow_info (void); @@ -227,7 +241,8 @@ extern void predict_edge (edge e, enum br_predictor predictor, int probability); extern bool predicted_by_p (const_basic_block bb, enum br_predictor predictor); extern bool can_duplicate_block_p (const_basic_block); -extern basic_block duplicate_block (basic_block, edge, basic_block); +extern basic_block duplicate_block (basic_block, edge, basic_block, + copy_bb_data * = NULL); extern bool block_ends_with_call_p (basic_block bb); extern bool empty_block_p (basic_block); extern basic_block split_block_before_cond_jump (basic_block); @@ -235,7 +250,7 @@ extern int flow_call_edges_add (sbitmap); extern void execute_on_growing_pred (edge); extern void execute_on_shrinking_pred (edge); -extern bool cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge, +extern bool cfg_hook_duplicate_loop_to_header_edge (class loop *loop, edge, unsigned int ndupl, sbitmap wont_exit, edge orig, @@ -251,10 +266,11 @@ extern bool can_copy_bbs_p (basic_block *, unsigned); extern void copy_bbs (basic_block *, unsigned, basic_block *, - edge *, unsigned, edge *, struct loop *, + edge *, unsigned, edge *, class loop *, basic_block, bool); -void account_profile_record (struct profile_record *, int); +void profile_record_check_consistency (profile_record *); +void profile_record_account_profile (profile_record *); /* Hooks containers. */ extern struct cfg_hooks gimple_cfg_hooks;