00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GCC_BASIC_BLOCK_H
00023 #define GCC_BASIC_BLOCK_H
00024
00025 #include "bitmap.h"
00026 #include "sbitmap.h"
00027 #include "varray.h"
00028 #include "partition.h"
00029 #include "hard-reg-set.h"
00030 #include "predict.h"
00031 #include "vec.h"
00032 #include "function.h"
00033
00034
00035 typedef bitmap_head regset_head;
00036
00037
00038 typedef bitmap regset;
00039
00040
00041 #define ALLOC_REG_SET(OBSTACK) BITMAP_ALLOC (OBSTACK)
00042
00043
00044 #define FREE_REG_SET(REGSET) BITMAP_FREE (REGSET)
00045
00046
00047 #define INIT_REG_SET(HEAD) bitmap_initialize (HEAD, ®_obstack)
00048
00049
00050 #define CLEAR_REG_SET(HEAD) bitmap_clear (HEAD)
00051
00052
00053 #define COPY_REG_SET(TO, FROM) bitmap_copy (TO, FROM)
00054
00055
00056 #define REG_SET_EQUAL_P(A, B) bitmap_equal_p (A, B)
00057
00058
00059 #define AND_REG_SET(TO, FROM) bitmap_and_into (TO, FROM)
00060
00061
00062 #define AND_COMPL_REG_SET(TO, FROM) bitmap_and_compl_into (TO, FROM)
00063
00064
00065 #define IOR_REG_SET(TO, FROM) bitmap_ior_into (TO, FROM)
00066
00067
00068 #define XOR_REG_SET(TO, FROM) bitmap_xor_into (TO, FROM)
00069
00070
00071 #define IOR_AND_COMPL_REG_SET(TO, FROM1, FROM2) \
00072 bitmap_ior_and_compl_into (TO, FROM1, FROM2)
00073
00074
00075 #define CLEAR_REGNO_REG_SET(HEAD, REG) bitmap_clear_bit (HEAD, REG)
00076
00077
00078 #define SET_REGNO_REG_SET(HEAD, REG) bitmap_set_bit (HEAD, REG)
00079
00080
00081 #define REGNO_REG_SET_P(TO, REG) bitmap_bit_p (TO, REG)
00082
00083
00084 extern void reg_set_to_hard_reg_set (HARD_REG_SET *, bitmap);
00085 #define REG_SET_TO_HARD_REG_SET(TO, FROM) \
00086 do { \
00087 CLEAR_HARD_REG_SET (TO); \
00088 reg_set_to_hard_reg_set (&TO, FROM); \
00089 } while (0)
00090
00091 typedef bitmap_iterator reg_set_iterator;
00092
00093
00094
00095 #define EXECUTE_IF_SET_IN_REG_SET(REGSET, MIN, REGNUM, RSI) \
00096 EXECUTE_IF_SET_IN_BITMAP (REGSET, MIN, REGNUM, RSI)
00097
00098
00099
00100
00101 #define EXECUTE_IF_AND_COMPL_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, RSI) \
00102 EXECUTE_IF_AND_COMPL_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, RSI)
00103
00104
00105
00106
00107 #define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, RSI) \
00108 EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, RSI) \
00109
00110
00111
00112
00113
00114
00115 typedef HOST_WIDEST_INT gcov_type;
00116
00117
00118 struct edge_def GTY(())
00119 {
00120
00121 struct basic_block_def *src;
00122 struct basic_block_def *dest;
00123
00124
00125 union edge_def_insns {
00126 rtx GTY ((tag ("0"))) r;
00127 tree GTY ((tag ("1"))) t;
00128 } GTY ((desc ("ir_type ()"))) insns;
00129
00130
00131 PTR GTY ((skip (""))) aux;
00132
00133
00134 source_locus goto_locus;
00135
00136 int flags;
00137 int probability;
00138 gcov_type count;
00139
00140
00141
00142
00143 unsigned int dest_idx;
00144 };
00145
00146 typedef struct edge_def *edge;
00147 DEF_VEC_P(edge);
00148 DEF_VEC_ALLOC_P(edge,gc);
00149
00150 #define EDGE_FALLTHRU 1
00151 #define EDGE_ABNORMAL 2
00152
00153 #define EDGE_ABNORMAL_CALL 4
00154
00155 #define EDGE_EH 8
00156 #define EDGE_FAKE 16
00157 #define EDGE_DFS_BACK 32
00158 #define EDGE_CAN_FALLTHRU 64
00159
00160 #define EDGE_IRREDUCIBLE_LOOP 128
00161 #define EDGE_SIBCALL 256
00162 #define EDGE_LOOP_EXIT 512
00163 #define EDGE_TRUE_VALUE 1024
00164
00165 #define EDGE_FALSE_VALUE 2048
00166
00167 #define EDGE_EXECUTABLE 4096
00168
00169 #define EDGE_CROSSING 8192
00170
00171
00172 #define EDGE_ALL_FLAGS 16383
00173
00174 #define EDGE_COMPLEX (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_EH)
00175
00176
00177
00178 extern const struct gcov_ctr_summary *profile_info;
00179
00180
00181 struct loop;
00182 struct loops;
00183
00184
00185 struct edge_prediction;
00186 struct rtl_bb_info;
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214 struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")))
00215 {
00216 /* Pointers to the first and last trees of the block. */
00217 tree stmt_list;
00218
00219 /* The edges into and out of the block. */
00220 VEC(edge,gc) *preds;
00221 VEC(edge,gc) *succs;
00222
00223 /* Auxiliary info specific to a pass. */
00224 PTR GTY ((skip (""))) aux;
00225
00226 /* Innermost loop containing the block. */
00227 struct loop * GTY ((skip (""))) loop_father;
00228
00229 /* The dominance and postdominance information node. */
00230 struct et_node * GTY ((skip (""))) dom[2];
00231
00232 /* Previous and next blocks in the chain. */
00233 struct basic_block_def *prev_bb;
00234 struct basic_block_def *next_bb;
00235
00236 union basic_block_il_dependent {
00237 struct rtl_bb_info * GTY ((tag ("1"))) rtl;
00238 } GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il;
00239
00240 /* Chain of PHI nodes for this block. */
00241 tree phi_nodes;
00242
00243 /* A list of predictions. */
00244 struct edge_prediction *predictions;
00245
00246 /* Expected number of executions: calculated in profile.c. */
00247 gcov_type count;
00248
00249 /* The index of this block. */
00250 int index;
00251
00252 /* The loop depth of this block. */
00253 int loop_depth;
00254
00255 /* Expected frequency. Normalized to be in range 0 to BB_FREQ_MAX. */
00256 int frequency;
00257
00258 /* Various flags. See BB_* below. */
00259 int flags;
00260 };
00261
00262 struct rtl_bb_info GTY(())
00263 {
00264 /* The first and last insns of the block. */
00265 rtx head_;
00266 rtx end_;
00267
00268 /* The registers that are live on entry to this block. */
00269 bitmap GTY ((skip (""))) global_live_at_start;
00270
00271 /* The registers that are live on exit from this block. */
00272 bitmap GTY ((skip (""))) global_live_at_end;
00273
00274 /* In CFGlayout mode points to insn notes/jumptables to be placed just before
00275 and after the block. */
00276 rtx header;
00277 rtx footer;
00278
00279 /* This field is used by the bb-reorder and tracer passes. */
00280 int visited;
00281 };
00282
00283 typedef struct basic_block_def *basic_block;
00284
00285 DEF_VEC_P(basic_block);
00286 DEF_VEC_ALLOC_P(basic_block,gc);
00287 DEF_VEC_ALLOC_P(basic_block,heap);
00288
00289 #define BB_FREQ_MAX 10000
00290
00291 /* Masks for basic_block.flags.
00292
00293 BB_HOT_PARTITION and BB_COLD_PARTITION should be preserved throughout
00294 the compilation, so they are never cleared.
00295
00296 All other flags may be cleared by clear_bb_flags(). It is generally
00297 a bad idea to rely on any flags being up-to-date. */
00298
00299 enum bb_flags
00300 {
00301
00302 /* Set if insns in BB have are modified. Used for updating liveness info. */
00303 BB_DIRTY = 1,
00304
00305 /* Only set on blocks that have just been created by create_bb. */
00306 BB_NEW = 2,
00307
00308 /* Set by find_unreachable_blocks. Do not rely on this being set in any
00309 pass. */
00310 BB_REACHABLE = 4,
00311
00312 /* Set for blocks in an irreducible loop by loop analysis. */
00313 BB_IRREDUCIBLE_LOOP = 8,
00314
00315 /* Set on blocks that may actually not be single-entry single-exit block. */
00316 BB_SUPERBLOCK = 16,
00317
00318 /* Set on basic blocks that the scheduler should not touch. This is used
00319 by SMS to prevent other schedulers from messing with the loop schedule. */
00320 BB_DISABLE_SCHEDULE = 32,
00321
00322 /* Set on blocks that should be put in a hot section. */
00323 BB_HOT_PARTITION = 64,
00324
00325 /* Set on blocks that should be put in a cold section. */
00326 BB_COLD_PARTITION = 128,
00327
00328 /* Set on block that was duplicated. */
00329 BB_DUPLICATED = 256,
00330
00331 /* Set on blocks that are in RTL format. */
00332 BB_RTL = 1024,
00333
00334 /* Set on blocks that are forwarder blocks.
00335 Only used in cfgcleanup.c. */
00336 BB_FORWARDER_BLOCK = 2048,
00337
00338 /* Set on blocks that cannot be threaded through.
00339 Only used in cfgcleanup.c. */
00340 BB_NONTHREADABLE_BLOCK = 4096
00341 };
00342
00343 /* Dummy flag for convenience in the hot/cold partitioning code. */
00344 #define BB_UNPARTITIONED 0
00345
00346 /* Partitions, to be used when partitioning hot and cold basic blocks into
00347 separate sections. */
00348 #define BB_PARTITION(bb) ((bb)->flags & (BB_HOT_PARTITION|BB_COLD_PARTITION))
00349 #define BB_SET_PARTITION(bb, part) do { \
00350 basic_block bb_ = (bb); \
00351 bb_->flags = ((bb_->flags & ~(BB_HOT_PARTITION|BB_COLD_PARTITION)) \
00352 | (part)); \
00353 } while (0)
00354
00355 #define BB_COPY_PARTITION(dstbb, srcbb) \
00356 BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb))
00357
00358 /* A structure to group all the per-function control flow graph data.
00359 The x_* prefixing is necessary because otherwise references to the
00360 fields of this struct are interpreted as the defines for backward
00361 source compatibility following the definition of this struct. */
00362 struct control_flow_graph GTY(())
00363 {
00364 /* Block pointers for the exit and entry of a function.
00365 These are always the head and tail of the basic block list. */
00366 basic_block x_entry_block_ptr;
00367 basic_block x_exit_block_ptr;
00368
00369 /* Index by basic block number, get basic block struct info. */
00370 VEC(basic_block,gc) *x_basic_block_info;
00371
00372 /* Number of basic blocks in this flow graph. */
00373 int x_n_basic_blocks;
00374
00375 /* Number of edges in this flow graph. */
00376 int x_n_edges;
00377
00378 /* The first free basic block number. */
00379 int x_last_basic_block;
00380
00381 /* Mapping of labels to their associated blocks. At present
00382 only used for the tree CFG. */
00383 VEC(basic_block,gc) *x_label_to_block_map;
00384
00385 enum profile_status {
00386 PROFILE_ABSENT,
00387 PROFILE_GUESSED,
00388 PROFILE_READ
00389 } x_profile_status;
00390 };
00391
00392 /* Defines for accessing the fields of the CFG structure for function FN. */
00393 #define ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_entry_block_ptr)
00394 #define EXIT_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_exit_block_ptr)
00395 #define basic_block_info_for_function(FN) ((FN)->cfg->x_basic_block_info)
00396 #define n_basic_blocks_for_function(FN) ((FN)->cfg->x_n_basic_blocks)
00397 #define n_edges_for_function(FN) ((FN)->cfg->x_n_edges)
00398 #define last_basic_block_for_function(FN) ((FN)->cfg->x_last_basic_block)
00399 #define label_to_block_map_for_function(FN) ((FN)->cfg->x_label_to_block_map)
00400
00401 #define BASIC_BLOCK_FOR_FUNCTION(FN,N) \
00402 (VEC_index (basic_block, basic_block_info_for_function(FN), (N)))
00403
00404 /* Defines for textual backward source compatibility. */
00405 #define ENTRY_BLOCK_PTR (cfun->cfg->x_entry_block_ptr)
00406 #define EXIT_BLOCK_PTR (cfun->cfg->x_exit_block_ptr)
00407 #define basic_block_info (cfun->cfg->x_basic_block_info)
00408 #define n_basic_blocks (cfun->cfg->x_n_basic_blocks)
00409 #define n_edges (cfun->cfg->x_n_edges)
00410 #define last_basic_block (cfun->cfg->x_last_basic_block)
00411 #define label_to_block_map (cfun->cfg->x_label_to_block_map)
00412 #define profile_status (cfun->cfg->x_profile_status)
00413
00414 #define BASIC_BLOCK(N) (VEC_index (basic_block, basic_block_info, (N)))
00415 #define SET_BASIC_BLOCK(N,BB) (VEC_replace (basic_block, basic_block_info, (N), (BB)))
00416
00417 /* For iterating over basic blocks. */
00418 #define FOR_BB_BETWEEN(BB, FROM, TO, DIR) \
00419 for (BB = FROM; BB != TO; BB = BB->DIR)
00420
00421 #define FOR_EACH_BB_FN(BB, FN) \
00422 FOR_BB_BETWEEN (BB, (FN)->cfg->x_entry_block_ptr->next_bb, (FN)->cfg->x_exit_block_ptr, next_bb)
00423
00424 #define FOR_EACH_BB(BB) FOR_EACH_BB_FN (BB, cfun)
00425
00426 #define FOR_EACH_BB_REVERSE_FN(BB, FN) \
00427 FOR_BB_BETWEEN (BB, (FN)->cfg->x_exit_block_ptr->prev_bb, (FN)->cfg->x_entry_block_ptr, prev_bb)
00428
00429 #define FOR_EACH_BB_REVERSE(BB) FOR_EACH_BB_REVERSE_FN(BB, cfun)
00430
00431 /* For iterating over insns in basic block. */
00432 #define FOR_BB_INSNS(BB, INSN) \
00433 for ((INSN) = BB_HEAD (BB); \
00434 (INSN) && (INSN) != NEXT_INSN (BB_END (BB)); \
00435 (INSN) = NEXT_INSN (INSN))
00436
00437 #define FOR_BB_INSNS_REVERSE(BB, INSN) \
00438 for ((INSN) = BB_END (BB); \
00439 (INSN) && (INSN) != PREV_INSN (BB_HEAD (BB)); \
00440 (INSN) = PREV_INSN (INSN))
00441
00442 /* Cycles through _all_ basic blocks, even the fake ones (entry and
00443 exit block). */
00444
00445 #define FOR_ALL_BB(BB) \
00446 for (BB = ENTRY_BLOCK_PTR; BB; BB = BB->next_bb)
00447
00448 #define FOR_ALL_BB_FN(BB, FN) \
00449 for (BB = ENTRY_BLOCK_PTR_FOR_FUNCTION (FN); BB; BB = BB->next_bb)
00450
00451 extern bitmap_obstack reg_obstack;
00452
00453 /* Indexed by n, gives number of basic block that (REG n) is used in.
00454 If the value is REG_BLOCK_GLOBAL (-2),
00455 it means (REG n) is used in more than one basic block.
00456 REG_BLOCK_UNKNOWN (-1) means it hasn't been seen yet so we don't know.
00457 This information remains valid for the rest of the compilation
00458 of the current function; it is used to control register allocation. */
00459
00460 #define REG_BLOCK_UNKNOWN -1
00461 #define REG_BLOCK_GLOBAL -2
00462
00463 #define REG_BASIC_BLOCK(N) \
00464 (VEC_index (reg_info_p, reg_n_info, N)->basic_block)
00465
00466 /* Stuff for recording basic block info. */
00467
00468 #define BB_HEAD(B) (B)->il.rtl->head_
00469 #define BB_END(B) (B)->il.rtl->end_
00470
00471 /* Special block numbers [markers] for entry and exit. */
00472 #define ENTRY_BLOCK (0)
00473 #define EXIT_BLOCK (1)
00474
00475 /* The two blocks that are always in the cfg. */
00476 #define NUM_FIXED_BLOCKS (2)
00477
00478
00479 #define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0)
00480 #define set_block_for_insn(INSN, BB) (BLOCK_FOR_INSN (INSN) = BB)
00481
00482 extern void compute_bb_for_insn (void);
00483 extern unsigned int free_bb_for_insn (void);
00484 extern void update_bb_for_insn (basic_block);
00485
00486 extern void free_basic_block_vars (void);
00487
00488 extern void insert_insn_on_edge (rtx, edge);
00489
00490 extern void commit_edge_insertions (void);
00491 extern void commit_edge_insertions_watch_calls (void);
00492
00493 extern void remove_fake_edges (void);
00494 extern void remove_fake_exit_edges (void);
00495 extern void add_noreturn_fake_exit_edges (void);
00496 extern void connect_infinite_loops_to_exit (void);
00497 extern edge unchecked_make_edge (basic_block, basic_block, int);
00498 extern edge cached_make_edge (sbitmap, basic_block, basic_block, int);
00499 extern edge make_edge (basic_block, basic_block, int);
00500 extern edge make_single_succ_edge (basic_block, basic_block, int);
00501 extern void remove_edge (edge);
00502 extern void redirect_edge_succ (edge, basic_block);
00503 extern edge redirect_edge_succ_nodup (edge, basic_block);
00504 extern void redirect_edge_pred (edge, basic_block);
00505 extern basic_block create_basic_block_structure (rtx, rtx, rtx, basic_block);
00506 extern void clear_bb_flags (void);
00507 extern int post_order_compute (int *, bool);
00508 extern int pre_and_rev_post_order_compute (int *, int *, bool);
00509 extern int dfs_enumerate_from (basic_block, int,
00510 bool (*)(basic_block, void *),
00511 basic_block *, int, void *);
00512 extern void compute_dominance_frontiers (bitmap *);
00513 extern void dump_bb_info (basic_block, bool, bool, int, const char *, FILE *);
00514 extern void dump_edge_info (FILE *, edge, int);
00515 extern void brief_dump_cfg (FILE *);
00516 extern void clear_edges (void);
00517 extern rtx first_insn_after_basic_block_note (basic_block);
00518 extern void scale_bbs_frequencies_int (basic_block *, int, int, int);
00519 extern void scale_bbs_frequencies_gcov_type (basic_block *, int, gcov_type,
00520 gcov_type);
00521
00522 /* Structure to group all of the information to process IF-THEN and
00523 IF-THEN-ELSE blocks for the conditional execution support. This
00524 needs to be in a public file in case the IFCVT macros call
00525 functions passing the ce_if_block data structure. */
00526
00527 typedef struct ce_if_block
00528 {
00529 basic_block test_bb; /* First test block. */
00530 basic_block then_bb; /* THEN block. */
00531 basic_block else_bb; /* ELSE block or NULL. */
00532 basic_block join_bb; /* Join THEN/ELSE blocks. */
00533 basic_block last_test_bb; /* Last bb to hold && or || tests. */
00534 int num_multiple_test_blocks; /* # of && and || basic blocks. */
00535 int num_and_and_blocks; /* # of && blocks. */
00536 int num_or_or_blocks; /* # of || blocks. */
00537 int num_multiple_test_insns; /* # of insns in && and || blocks. */
00538 int and_and_p; /* Complex test is &&. */
00539 int num_then_insns; /* # of insns in THEN block. */
00540 int num_else_insns; /* # of insns in ELSE block. */
00541 int pass; /* Pass number. */
00542
00543 #ifdef IFCVT_EXTRA_FIELDS
00544 IFCVT_EXTRA_FIELDS /* Any machine dependent fields. */
00545 #endif
00546
00547 } ce_if_block_t;
00548
00549 /* This structure maintains an edge list vector. */
00550 struct edge_list
00551 {
00552 int num_blocks;
00553 int num_edges;
00554 edge *index_to_edge;
00555 };
00556
00557 /* The base value for branch probability notes and edge probabilities. */
00558 #define REG_BR_PROB_BASE 10000
00559
00560 /* This is the value which indicates no edge is present. */
00561 #define EDGE_INDEX_NO_EDGE -1
00562
00563 /* EDGE_INDEX returns an integer index for an edge, or EDGE_INDEX_NO_EDGE
00564 if there is no edge between the 2 basic blocks. */
00565 #define EDGE_INDEX(el, pred, succ) (find_edge_index ((el), (pred), (succ)))
00566
00567 /* INDEX_EDGE_PRED_BB and INDEX_EDGE_SUCC_BB return a pointer to the basic
00568 block which is either the pred or succ end of the indexed edge. */
00569 #define INDEX_EDGE_PRED_BB(el, index) ((el)->index_to_edge[(index)]->src)
00570 #define INDEX_EDGE_SUCC_BB(el, index) ((el)->index_to_edge[(index)]->dest)
00571
00572 /* INDEX_EDGE returns a pointer to the edge. */
00573 #define INDEX_EDGE(el, index) ((el)->index_to_edge[(index)])
00574
00575 /* Number of edges in the compressed edge list. */
00576 #define NUM_EDGES(el) ((el)->num_edges)
00577
00578 /* BB is assumed to contain conditional jump. Return the fallthru edge. */
00579 #define FALLTHRU_EDGE(bb) (EDGE_SUCC ((bb), 0)->flags & EDGE_FALLTHRU \
00580 ? EDGE_SUCC ((bb), 0) : EDGE_SUCC ((bb), 1))
00581
00582 /* BB is assumed to contain conditional jump. Return the branch edge. */
00583 #define BRANCH_EDGE(bb) (EDGE_SUCC ((bb), 0)->flags & EDGE_FALLTHRU \
00584 ? EDGE_SUCC ((bb), 1) : EDGE_SUCC ((bb), 0))
00585
00586 /* Return expected execution frequency of the edge E. */
00587 #define EDGE_FREQUENCY(e) (((e)->src->frequency \
00588 * (e)->probability \
00589 + REG_BR_PROB_BASE / 2) \
00590 / REG_BR_PROB_BASE)
00591
00592 /* Return nonzero if edge is critical. */
00593 #define EDGE_CRITICAL_P(e) (EDGE_COUNT ((e)->src->succs) >= 2 \
00594 && EDGE_COUNT ((e)->dest->preds) >= 2)
00595
00596 #define EDGE_COUNT(ev) VEC_length (edge, (ev))
00597 #define EDGE_I(ev,i) VEC_index (edge, (ev), (i))
00598 #define EDGE_PRED(bb,i) VEC_index (edge, (bb)->preds, (i))
00599 #define EDGE_SUCC(bb,i) VEC_index (edge, (bb)->succs, (i))
00600
00601 /* Returns true if BB has precisely one successor. */
00602
00603 static inline bool
00604 single_succ_p (basic_block bb)
00605 {
00606 return EDGE_COUNT (bb->succs) == 1;
00607 }
00608
00609 /* Returns true if BB has precisely one predecessor. */
00610
00611 static inline bool
00612 single_pred_p (basic_block bb)
00613 {
00614 return EDGE_COUNT (bb->preds) == 1;
00615 }
00616
00617 /* Returns the single successor edge of basic block BB. Aborts if
00618 BB does not have exactly one successor. */
00619
00620 static inline edge
00621 single_succ_edge (basic_block bb)
00622 {
00623 gcc_assert (single_succ_p (bb));
00624 return EDGE_SUCC (bb, 0);
00625 }
00626
00627 /* Returns the single predecessor edge of basic block BB. Aborts
00628 if BB does not have exactly one predecessor. */
00629
00630 static inline edge
00631 single_pred_edge (basic_block bb)
00632 {
00633 gcc_assert (single_pred_p (bb));
00634 return EDGE_PRED (bb, 0);
00635 }
00636
00637 /* Returns the single successor block of basic block BB. Aborts
00638 if BB does not have exactly one successor. */
00639
00640 static inline basic_block
00641 single_succ (basic_block bb)
00642 {
00643 return single_succ_edge (bb)->dest;
00644 }
00645
00646 /* Returns the single predecessor block of basic block BB. Aborts
00647 if BB does not have exactly one predecessor.*/
00648
00649 static inline basic_block
00650 single_pred (basic_block bb)
00651 {
00652 return single_pred_edge (bb)->src;
00653 }
00654
00655 /* Iterator object for edges. */
00656
00657 typedef struct {
00658 unsigned index;
00659 VEC(edge,gc) **container;
00660 } edge_iterator;
00661
00662 static inline VEC(edge,gc) *
00663 ei_container (edge_iterator i)
00664 {
00665 gcc_assert (i.container);
00666 return *i.container;
00667 }
00668
00669 #define ei_start(iter) ei_start_1 (&(iter))
00670 #define ei_last(iter) ei_last_1 (&(iter))
00671
00672 /* Return an iterator pointing to the start of an edge vector. */
00673 static inline edge_iterator
00674 ei_start_1 (VEC(edge,gc) **ev)
00675 {
00676 edge_iterator i;
00677
00678 i.index = 0;
00679 i.container = ev;
00680
00681 return i;
00682 }
00683
00684 /* Return an iterator pointing to the last element of an edge
00685 vector. */
00686 static inline edge_iterator
00687 ei_last_1 (VEC(edge,gc) **ev)
00688 {
00689 edge_iterator i;
00690
00691 i.index = EDGE_COUNT (*ev) - 1;
00692 i.container = ev;
00693
00694 return i;
00695 }
00696
00697 /* Is the iterator `i' at the end of the sequence? */
00698 static inline bool
00699 ei_end_p (edge_iterator i)
00700 {
00701 return (i.index == EDGE_COUNT (ei_container (i)));
00702 }
00703
00704 /* Is the iterator `i' at one position before the end of the
00705 sequence? */
00706 static inline bool
00707 ei_one_before_end_p (edge_iterator i)
00708 {
00709 return (i.index + 1 == EDGE_COUNT (ei_container (i)));
00710 }
00711
00712 /* Advance the iterator to the next element. */
00713 static inline void
00714 ei_next (edge_iterator *i)
00715 {
00716 gcc_assert (i->index < EDGE_COUNT (ei_container (*i)));
00717 i->index++;
00718 }
00719
00720 /* Move the iterator to the previous element. */
00721 static inline void
00722 ei_prev (edge_iterator *i)
00723 {
00724 gcc_assert (i->index > 0);
00725 i->index--;
00726 }
00727
00728 /* Return the edge pointed to by the iterator `i'. */
00729 static inline edge
00730 ei_edge (edge_iterator i)
00731 {
00732 return EDGE_I (ei_container (i), i.index);
00733 }
00734
00735 /* Return an edge pointed to by the iterator. Do it safely so that
00736 NULL is returned when the iterator is pointing at the end of the
00737 sequence. */
00738 static inline edge
00739 ei_safe_edge (edge_iterator i)
00740 {
00741 return !ei_end_p (i) ? ei_edge (i) : NULL;
00742 }
00743
00744 /* Return 1 if we should continue to iterate. Return 0 otherwise.
00745 *Edge P is set to the next edge if we are to continue to iterate
00746 and NULL otherwise. */
00747
00748 static inline bool
00749 ei_cond (edge_iterator ei, edge *p)
00750 {
00751 if (!ei_end_p (ei))
00752 {
00753 *p = ei_edge (ei);
00754 return 1;
00755 }
00756 else
00757 {
00758 *p = NULL;
00759 return 0;
00760 }
00761 }
00762
00763 /* This macro serves as a convenient way to iterate each edge in a
00764 vector of predecessor or successor edges. It must not be used when
00765 an element might be removed during the traversal, otherwise
00766 elements will be missed. Instead, use a for-loop like that shown
00767 in the following pseudo-code:
00768
00769 FOR (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
00770 {
00771 IF (e != taken_edge)
00772 remove_edge (e);
00773 ELSE
00774 ei_next (&ei);
00775 }
00776 */
00777
00778 #define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC) \
00779 for ((ITER) = ei_start ((EDGE_VEC)); \
00780 ei_cond ((ITER), &(EDGE)); \
00781 ei_next (&(ITER)))
00782
00783 struct edge_list * create_edge_list (void);
00784 void free_edge_list (struct edge_list *);
00785 void print_edge_list (FILE *, struct edge_list *);
00786 void verify_edge_list (FILE *, struct edge_list *);
00787 int find_edge_index (struct edge_list *, basic_block, basic_block);
00788 edge find_edge (basic_block, basic_block);
00789
00790
00791 enum update_life_extent
00792 {
00793 UPDATE_LIFE_LOCAL = 0,
00794 UPDATE_LIFE_GLOBAL = 1,
00795 UPDATE_LIFE_GLOBAL_RM_NOTES = 2
00796 };
00797
00798 /* Flags for life_analysis and update_life_info. */
00799
00800 #define PROP_DEATH_NOTES 1 /* Create DEAD and UNUSED notes. */
00801 #define PROP_LOG_LINKS 2 /* Create LOG_LINKS. */
00802 #define PROP_REG_INFO 4 /* Update regs_ever_live et al. */
00803 #define PROP_KILL_DEAD_CODE 8 /* Remove dead code. */
00804 #define PROP_SCAN_DEAD_CODE 16 /* Scan for dead code. */
00805 #define PROP_ALLOW_CFG_CHANGES 32 /* Allow the CFG to be changed
00806 by dead code removal. */
00807 #define PROP_AUTOINC 64 /* Create autoinc mem references. */
00808 #define PROP_SCAN_DEAD_STORES 128 /* Scan for dead code. */
00809 #define PROP_ASM_SCAN 256 /* Internal flag used within flow.c
00810 to flag analysis of asms. */
00811 #define PROP_DEAD_INSN 1024 /* Internal flag used within flow.c
00812 to flag analysis of dead insn. */
00813 #define PROP_POST_REGSTACK 2048 /* We run after reg-stack and need
00814 to preserve REG_DEAD notes for
00815 stack regs. */
00816 #define PROP_FINAL (PROP_DEATH_NOTES | PROP_LOG_LINKS \
00817 | PROP_REG_INFO | PROP_KILL_DEAD_CODE \
00818 | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \
00819 | PROP_ALLOW_CFG_CHANGES \
00820 | PROP_SCAN_DEAD_STORES)
00821 #define PROP_POSTRELOAD (PROP_DEATH_NOTES \
00822 | PROP_KILL_DEAD_CODE \
00823 | PROP_SCAN_DEAD_CODE \
00824 | PROP_SCAN_DEAD_STORES)
00825
00826 #define CLEANUP_EXPENSIVE 1 /* Do relatively expensive optimizations
00827 except for edge forwarding */
00828 #define CLEANUP_CROSSJUMP 2 /* Do crossjumping. */
00829 #define CLEANUP_POST_REGSTACK 4 /* We run after reg-stack and need
00830 to care REG_DEAD notes. */
00831 #define CLEANUP_UPDATE_LIFE 8 /* Keep life information up to date. */
00832 #define CLEANUP_THREADING 16 /* Do jump threading. */
00833 #define CLEANUP_NO_INSN_DEL 32 /* Do not try to delete trivially dead
00834 insns. */
00835 #define CLEANUP_CFGLAYOUT 64 /* Do cleanup in cfglayout mode. */
00836 #define CLEANUP_LOG_LINKS 128 /* Update log links. */
00837
00838 /* The following are ORed in on top of the CLEANUP* flags in calls to
00839 struct_equiv_block_eq. */
00840 #define STRUCT_EQUIV_START 256 /* Initializes the search range. */
00841 #define STRUCT_EQUIV_RERUN 512 /* Rerun to find register use in
00842 found equivalence. */
00843 #define STRUCT_EQUIV_FINAL 1024 /* Make any changes necessary to get
00844 actual equivalence. */
00845 #define STRUCT_EQUIV_NEED_FULL_BLOCK 2048 /* struct_equiv_block_eq is required
00846 to match only full blocks */
00847 #define STRUCT_EQUIV_MATCH_JUMPS 4096 /* Also include the jumps at the end of the block in the comparison. */
00848
00849 extern void life_analysis (int);
00850 extern int update_life_info (sbitmap, enum update_life_extent, int);
00851 extern int update_life_info_in_dirty_blocks (enum update_life_extent, int);
00852 extern int count_or_remove_death_notes (sbitmap, int);
00853 extern int propagate_block (basic_block, regset, regset, regset, int);
00854
00855 struct propagate_block_info;
00856 extern rtx propagate_one_insn (struct propagate_block_info *, rtx);
00857 extern struct propagate_block_info *init_propagate_block_info
00858 (basic_block, regset, regset, regset, int);
00859 extern void free_propagate_block_info (struct propagate_block_info *);
00860
00861 /* In lcm.c */
00862 extern struct edge_list *pre_edge_lcm (int, sbitmap *, sbitmap *,
00863 sbitmap *, sbitmap *, sbitmap **,
00864 sbitmap **);
00865 extern struct edge_list *pre_edge_rev_lcm (int, sbitmap *,
00866 sbitmap *, sbitmap *,
00867 sbitmap *, sbitmap **,
00868 sbitmap **);
00869 extern void compute_available (sbitmap *, sbitmap *, sbitmap *, sbitmap *);
00870
00871 /* In predict.c */
00872 extern void expected_value_to_br_prob (void);
00873 extern bool maybe_hot_bb_p (basic_block);
00874 extern bool probably_cold_bb_p (basic_block);
00875 extern bool probably_never_executed_bb_p (basic_block);
00876 extern bool tree_predicted_by_p (basic_block, enum br_predictor);
00877 extern bool rtl_predicted_by_p (basic_block, enum br_predictor);
00878 extern void tree_predict_edge (edge, enum br_predictor, int);
00879 extern void rtl_predict_edge (edge, enum br_predictor, int);
00880 extern void predict_edge_def (edge, enum br_predictor, enum prediction);
00881 extern void guess_outgoing_edge_probabilities (basic_block);
00882 extern void remove_predictions_associated_with_edge (edge);
00883 extern bool edge_probability_reliable_p (edge);
00884 extern bool br_prob_note_reliable_p (rtx);
00885
00886 /* In flow.c */
00887 extern void init_flow (void);
00888 extern void debug_bb (basic_block);
00889 extern basic_block debug_bb_n (int);
00890 extern void dump_regset (regset, FILE *);
00891 extern void debug_regset (regset);
00892 extern void allocate_reg_life_data (void);
00893 extern void expunge_block (basic_block);
00894 extern void link_block (basic_block, basic_block);
00895 extern void unlink_block (basic_block);
00896 extern void compact_blocks (void);
00897 extern basic_block alloc_block (void);
00898 extern void find_unreachable_blocks (void);
00899 extern int delete_noop_moves (void);
00900 extern basic_block force_nonfallthru (edge);
00901 extern rtx block_label (basic_block);
00902 extern bool forwarder_block_p (basic_block);
00903 extern bool purge_all_dead_edges (void);
00904 extern bool purge_dead_edges (basic_block);
00905 extern void find_many_sub_basic_blocks (sbitmap);
00906 extern void rtl_make_eh_edge (sbitmap, basic_block, rtx);
00907 extern bool can_fallthru (basic_block, basic_block);
00908 extern bool could_fall_through (basic_block, basic_block);
00909 extern void flow_nodes_print (const char *, const sbitmap, FILE *);
00910 extern void flow_edge_list_print (const char *, const edge *, int, FILE *);
00911 extern void alloc_aux_for_block (basic_block, int);
00912 extern void alloc_aux_for_blocks (int);
00913 extern void clear_aux_for_blocks (void);
00914 extern void free_aux_for_blocks (void);
00915 extern void alloc_aux_for_edge (edge, int);
00916 extern void alloc_aux_for_edges (int);
00917 extern void clear_aux_for_edges (void);
00918 extern void free_aux_for_edges (void);
00919 extern void find_basic_blocks (rtx);
00920 extern bool cleanup_cfg (int);
00921 extern bool delete_unreachable_blocks (void);
00922 extern bool merge_seq_blocks (void);
00923
00924 typedef struct conflict_graph_def *conflict_graph;
00925
00926 /* Callback function when enumerating conflicts. The arguments are
00927 the smaller and larger regno in the conflict. Returns zero if
00928 enumeration is to continue, nonzero to halt enumeration. */
00929 typedef int (*conflict_graph_enum_fn) (int, int, void *);
00930
00931
00932 /* Prototypes of operations on conflict graphs. */
00933
00934 extern conflict_graph conflict_graph_new
00935 (int);
00936 extern void conflict_graph_delete (conflict_graph);
00937 extern int conflict_graph_add (conflict_graph, int, int);
00938 extern int conflict_graph_conflict_p (conflict_graph, int, int);
00939 extern void conflict_graph_enum (conflict_graph, int, conflict_graph_enum_fn,
00940 void *);
00941 extern void conflict_graph_merge_regs (conflict_graph, int, int);
00942 extern void conflict_graph_print (conflict_graph, FILE*);
00943 extern bool mark_dfs_back_edges (void);
00944 extern void set_edge_can_fallthru_flag (void);
00945 extern void update_br_prob_note (basic_block);
00946 extern void fixup_abnormal_edges (void);
00947 extern bool inside_basic_block_p (rtx);
00948 extern bool control_flow_insn_p (rtx);
00949 extern rtx get_last_bb_insn (basic_block);
00950
00951 /* In bb-reorder.c */
00952 extern void reorder_basic_blocks (unsigned int);
00953
00954 /* In dominance.c */
00955
00956 enum cdi_direction
00957 {
00958 CDI_DOMINATORS,
00959 CDI_POST_DOMINATORS
00960 };
00961
00962 enum dom_state
00963 {
00964 DOM_NONE, /* Not computed at all. */
00965 DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */
00966 DOM_OK /* Everything is ok. */
00967 };
00968
00969 extern enum dom_state dom_computed[2];
00970
00971 extern bool dom_info_available_p (enum cdi_direction);
00972 extern void calculate_dominance_info (enum cdi_direction);
00973 extern void free_dominance_info (enum cdi_direction);
00974 extern basic_block nearest_common_dominator (enum cdi_direction,
00975 basic_block, basic_block);
00976 extern basic_block nearest_common_dominator_for_set (enum cdi_direction,
00977 bitmap);
00978 extern void set_immediate_dominator (enum cdi_direction, basic_block,
00979 basic_block);
00980 extern basic_block get_immediate_dominator (enum cdi_direction, basic_block);
00981 extern bool dominated_by_p (enum cdi_direction, basic_block, basic_block);
00982 extern int get_dominated_by (enum cdi_direction, basic_block, basic_block **);
00983 extern unsigned get_dominated_by_region (enum cdi_direction, basic_block *,
00984 unsigned, basic_block *);
00985 extern void add_to_dominance_info (enum cdi_direction, basic_block);
00986 extern void delete_from_dominance_info (enum cdi_direction, basic_block);
00987 basic_block recount_dominator (enum cdi_direction, basic_block);
00988 extern void redirect_immediate_dominators (enum cdi_direction, basic_block,
00989 basic_block);
00990 extern void iterate_fix_dominators (enum cdi_direction, basic_block *, int);
00991 extern void verify_dominators (enum cdi_direction);
00992 extern basic_block first_dom_son (enum cdi_direction, basic_block);
00993 extern basic_block next_dom_son (enum cdi_direction, basic_block);
00994 unsigned bb_dom_dfs_in (enum cdi_direction, basic_block);
00995 unsigned bb_dom_dfs_out (enum cdi_direction, basic_block);
00996
00997 extern edge try_redirect_by_replacing_jump (edge, basic_block, bool);
00998 extern void break_superblocks (void);
00999 extern void check_bb_profile (basic_block, FILE *);
01000 extern void update_bb_profile_for_threading (basic_block, int, gcov_type, edge);
01001 extern void init_rtl_bb_info (basic_block);
01002
01003 extern void initialize_original_copy_tables (void);
01004 extern void free_original_copy_tables (void);
01005 extern void set_bb_original (basic_block, basic_block);
01006 extern basic_block get_bb_original (basic_block);
01007 extern void set_bb_copy (basic_block, basic_block);
01008 extern basic_block get_bb_copy (basic_block);
01009
01010 extern rtx insert_insn_end_bb_new (rtx, basic_block);
01011
01012 #include "cfghooks.h"
01013
01014 /* In struct-equiv.c */
01015
01016 /* Constants used to size arrays in struct equiv_info (currently only one).
01017 When these limits are exceeded, struct_equiv returns zero.
01018 The maximum number of pseudo registers that are different in the two blocks,
01019 but appear in equivalent places and are dead at the end (or where one of
01020 a pair is dead at the end). */
01021 #define STRUCT_EQUIV_MAX_LOCAL 16
01022 /* The maximum number of references to an input register that struct_equiv
01023 can handle. */
01024
01025 /* Structure used to track state during struct_equiv that can be rolled
01026 back when we find we can't match an insn, or if we want to match part
01027 of it in a different way.
01028 This information pertains to the pair of partial blocks that has been
01029 matched so far. Since this pair is structurally equivalent, this is
01030 conceptually just one partial block expressed in two potentially
01031 different ways. */
01032 struct struct_equiv_checkpoint
01033 {
01034 int ninsns; /* Insns are matched so far. */
01035 int local_count; /* Number of block-local registers. */
01036 int input_count; /* Number of inputs to the block. */
01037
01038 /* X_START and Y_START are the first insns (in insn stream order)
01039 of the partial blocks that have been considered for matching so far.
01040 Since we are scanning backwards, they are also the instructions that
01041 are currently considered - or the last ones that have been considered -
01042 for matching (Unless we tracked back to these because a preceding
01043 instruction failed to match). */
01044 rtx x_start, y_start;
01045
01046 /* INPUT_VALID indicates if we have actually set up X_INPUT / Y_INPUT
01047 during the current pass; we keep X_INPUT / Y_INPUT around between passes
01048 so that we can match REG_EQUAL / REG_EQUIV notes referring to these. */
01049 bool input_valid;
01050
01051 /* Some information would be expensive to exactly checkpoint, so we
01052 merely increment VERSION any time information about local
01053 registers, inputs and/or register liveness changes. When backtracking,
01054 it is decremented for changes that can be undone, and if a discrepancy
01055 remains, NEED_RERUN in the relevant struct equiv_info is set to indicate
01056 that a new pass should be made over the entire block match to get
01057 accurate register information. */
01058 int version;
01059 };
01060
01061 /* A struct equiv_info is used to pass information to struct_equiv and
01062 to gather state while two basic blocks are checked for structural
01063 equivalence. */
01064
01065 struct equiv_info
01066 {
01067 /* Fields set up by the caller to struct_equiv_block_eq */
01068
01069 basic_block x_block, y_block; /* The two blocks being matched. */
01070
01071 /* MODE carries the mode bits from cleanup_cfg if we are called from
01072 try_crossjump_to_edge, and additionally it carries the
01073 STRUCT_EQUIV_* bits described above. */
01074 int mode;
01075
01076 /* INPUT_COST is the cost that adding an extra input to the matched blocks
01077 is supposed to have, and is taken into account when considering if the
01078 matched sequence should be extended backwards. input_cost < 0 means
01079 don't accept any inputs at all. */
01080 int input_cost;
01081
01082
01083 /* Fields to track state inside of struct_equiv_block_eq. Some of these
01084 are also outputs. */
01085
01086 /* X_INPUT and Y_INPUT are used by struct_equiv to record a register that
01087 is used as an input parameter, i.e. where different registers are used
01088 as sources. This is only used for a register that is live at the end
01089 of the blocks, or in some identical code at the end of the blocks;
01090 Inputs that are dead at the end go into X_LOCAL / Y_LOCAL. */
01091 rtx x_input, y_input;
01092 /* When a previous pass has identified a valid input, INPUT_REG is set
01093 by struct_equiv_block_eq, and it is henceforth replaced in X_BLOCK
01094 for the input. */
01095 rtx input_reg;
01096
01097 /* COMMON_LIVE keeps track of the registers which are currently live
01098 (as we scan backwards from the end) and have the same numbers in both
01099 blocks. N.B. a register that is in common_live is unsuitable to become
01100 a local reg. */
01101 regset common_live;
01102 /* Likewise, X_LOCAL_LIVE / Y_LOCAL_LIVE keep track of registers that are
01103 local to one of the blocks; these registers must not be accepted as
01104 identical when encountered in both blocks. */
01105 regset x_local_live, y_local_live;
01106
01107 /* EQUIV_USED indicates for which insns a REG_EQUAL or REG_EQUIV note is
01108 being used, to avoid having to backtrack in the next pass, so that we
01109 get accurate life info for this insn then. For each such insn,
01110 the bit with the number corresponding to the CUR.NINSNS value at the
01111 time of scanning is set. */
01112 bitmap equiv_used;
01113
01114 /* Current state that can be saved & restored easily. */
01115 struct struct_equiv_checkpoint cur;
01116 /* BEST_MATCH is used to store the best match so far, weighing the
01117 cost of matched insns COSTS_N_INSNS (CUR.NINSNS) against the cost
01118 CUR.INPUT_COUNT * INPUT_COST of setting up the inputs. */
01119 struct struct_equiv_checkpoint best_match;
01120 /* If a checkpoint restore failed, or an input conflict newly arises,
01121 NEED_RERUN is set. This has to be tested by the caller to re-run
01122 the comparison if the match appears otherwise sound. The state kept in
01123 x_start, y_start, equiv_used and check_input_conflict ensures that
01124 we won't loop indefinitely. */
01125 bool need_rerun;
01126 /* If there is indication of an input conflict at the end,
01127 CHECK_INPUT_CONFLICT is set so that we'll check for input conflicts
01128 for each insn in the next pass. This is needed so that we won't discard
01129 a partial match if there is a longer match that has to be abandoned due
01130 to an input conflict. */
01131 bool check_input_conflict;
01132 /* HAD_INPUT_CONFLICT is set if CHECK_INPUT_CONFLICT was already set and we
01133 have passed a point where there were multiple dying inputs. This helps
01134 us decide if we should set check_input_conflict for the next pass. */
01135 bool had_input_conflict;
01136
01137 /* LIVE_UPDATE controls if we want to change any life info at all. We
01138 set it to false during REG_EQUAL / REG_EUQIV note comparison of the final
01139 pass so that we don't introduce new registers just for the note; if we
01140 can't match the notes without the current register information, we drop
01141 them. */
01142 bool live_update;
01143
01144 /* X_LOCAL and Y_LOCAL are used to gather register numbers of register pairs
01145 that are local to X_BLOCK and Y_BLOCK, with CUR.LOCAL_COUNT being the index
01146 to the next free entry. */
01147 rtx x_local[STRUCT_EQUIV_MAX_LOCAL], y_local[STRUCT_EQUIV_MAX_LOCAL];
01148 /* LOCAL_RVALUE is nonzero if the corresponding X_LOCAL / Y_LOCAL entry
01149 was a source operand (including STRICT_LOW_PART) for the last invocation
01150 of struct_equiv mentioning it, zero if it was a destination-only operand.
01151 Since we are scanning backwards, this means the register is input/local
01152 for the (partial) block scanned so far. */
01153 bool local_rvalue[STRUCT_EQUIV_MAX_LOCAL];
01154
01155
01156 /* Additional fields that are computed for the convenience of the caller. */
01157
01158 /* DYING_INPUTS is set to the number of local registers that turn out
01159 to be inputs to the (possibly partial) block. */
01160 int dying_inputs;
01161 /* X_END and Y_END are the last insns in X_BLOCK and Y_BLOCK, respectively,
01162 that are being compared. A final jump insn will not be included. */
01163 rtx x_end, y_end;
01164
01165 /* If we are matching tablejumps, X_LABEL in X_BLOCK corresponds to
01166 Y_LABEL in Y_BLOCK. */
01167 rtx x_label, y_label;
01168
01169 };
01170
01171 extern bool insns_match_p (rtx, rtx, struct equiv_info *);
01172 extern int struct_equiv_block_eq (int, struct equiv_info *);
01173 extern bool struct_equiv_init (int, struct equiv_info *);
01174 extern bool rtx_equiv_p (rtx *, rtx, int, struct equiv_info *);
01175
01176 /* In cfgrtl.c */
01177 extern bool condjump_equiv_p (struct equiv_info *, bool);
01178
01179 /* Return true when one of the predecessor edges of BB is marked with EDGE_EH. */
01180 static inline bool bb_has_eh_pred (basic_block bb)
01181 {
01182 edge e;
01183 edge_iterator ei;
01184
01185 FOR_EACH_EDGE (e, ei, bb->preds)
01186 {
01187 if (e->flags & EDGE_EH)
01188 return true;
01189 }
01190 return false;
01191 }
01192
01193 #endif /* GCC_BASIC_BLOCK_H */