diff options
Diffstat (limited to 'gcc/basic-block.h')
-rw-r--r-- | gcc/basic-block.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 1465d9ed2d6..e5ffed4646c 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -146,6 +146,10 @@ struct edge_def GTY((chain_next ("%h.pred_next"))) int probability; /* biased by REG_BR_PROB_BASE */ gcov_type count; /* Expected number of executions calculated in profile.c */ + /* APPLE LOCAL begin hot/cold partitioning */ + bool crossing_edge; /* Crosses between hot and cold sections, when + we do partitioning. */ + /* APPLE LOCAL end hot/cold partitioning */ }; typedef struct edge_def *edge; @@ -173,6 +177,22 @@ typedef struct edge_def *edge; #define EDGE_COMPLEX (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_EH) +/* Returns the block at the beginning of the edge. */ + +static inline struct basic_block_def * +edge_source (edge e) +{ + return e->src; +} + +/* Returns the block at the end of the edge. */ + +static inline struct basic_block_def * +edge_destination (edge e) +{ + return e->dest; +} + /* Counter summary from the last set of coverage counts read by profile.c. */ extern const struct gcov_ctr_summary *profile_info; @@ -268,6 +288,12 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb") /* Various flags. See BB_* below. */ int flags; + /* APPLE LOCAL begin hot/cold partitioning */ + /* Which section block belongs in, when partitioning basic blocks. */ + int partition; + + /* APPLE LOCAL end hot/cold partitioning */ + /* The data used by basic block copying and reordering functions. */ struct reorder_block_def * GTY ((skip (""))) rbi; @@ -289,6 +315,7 @@ typedef struct reorder_block_def /* Used by loop copying. */ basic_block copy; int duplicated; + int copy_number; /* These fields are used by bb-reorder pass. */ int visited; @@ -304,6 +331,14 @@ typedef struct reorder_block_def #define BB_IRREDUCIBLE_LOOP 16 #define BB_SUPERBLOCK 32 +/* APPLE LOCAL begin hot/cold partitioning */ +/* Partitions, to be used when partitioning hot and cold basic blocks into + separate sections. */ +#define UNPARTITIONED 0 +#define HOT_PARTITION 1 +#define COLD_PARTITION 2 +/* APPLE LOCAL end hot/cold partitioning */ + /* Number of basic blocks in the current function. */ extern int n_basic_blocks; @@ -664,6 +699,14 @@ extern bool control_flow_insn_p (rtx); /* In bb-reorder.c */ extern void reorder_basic_blocks (void); +/* APPLE LOCAL begin hot/cold partitioning */ +extern void partition_hot_cold_basic_blocks (void); +/* APPLE LOCAL end hot/cold partitioning */ + +/* In cfg.c */ +extern void alloc_rbi_pool (void); +extern void initialize_bb_rbi (basic_block bb); +extern void free_rbi_pool (void); /* In cfg.c */ extern void alloc_rbi_pool (void); |