Fix bootstrap/PR63632
[official-gcc.git] / gcc / basic-block.h
blob7731c79952e996e708cd6d8a3522f89d0c21652a
1 /* Define control flow data structures for the CFG.
2 Copyright (C) 1987-2014 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_BASIC_BLOCK_H
21 #define GCC_BASIC_BLOCK_H
23 #include "predict.h"
24 #include "vec.h"
25 #include "hashtab.h"
26 #include "hash-set.h"
27 #include "machmode.h"
28 #include "tm.h"
29 #include "hard-reg-set.h"
30 #include "input.h"
31 #include "function.h"
32 #include "cfgrtl.h"
33 #include "cfg.h"
34 #include "cfganal.h"
35 #include "lcm.h"
36 #include "cfgbuild.h"
37 #include "cfgcleanup.h"
38 #include "dominance.h"
40 /* Use gcov_type to hold basic block counters. Should be at least
41 64bit. Although a counter cannot be negative, we use a signed
42 type, because erroneous negative counts can be generated when the
43 flow graph is manipulated by various optimizations. A signed type
44 makes those easy to detect. */
46 /* Control flow edge information. */
47 struct GTY((user)) edge_def {
48 /* The two blocks at the ends of the edge. */
49 basic_block src;
50 basic_block dest;
52 /* Instructions queued on the edge. */
53 union edge_def_insns {
54 gimple_seq g;
55 rtx_insn *r;
56 } insns;
58 /* Auxiliary info specific to a pass. */
59 PTR aux;
61 /* Location of any goto implicit in the edge. */
62 location_t goto_locus;
64 /* The index number corresponding to this edge in the edge vector
65 dest->preds. */
66 unsigned int dest_idx;
68 int flags; /* see cfg-flags.def */
69 int probability; /* biased by REG_BR_PROB_BASE */
70 gcov_type count; /* Expected number of executions calculated
71 in profile.c */
74 /* Masks for edge.flags. */
75 #define DEF_EDGE_FLAG(NAME,IDX) EDGE_##NAME = 1 << IDX ,
76 enum cfg_edge_flags {
77 #include "cfg-flags.def"
78 LAST_CFG_EDGE_FLAG /* this is only used for EDGE_ALL_FLAGS */
80 #undef DEF_EDGE_FLAG
82 /* Bit mask for all edge flags. */
83 #define EDGE_ALL_FLAGS ((LAST_CFG_EDGE_FLAG - 1) * 2 - 1)
85 /* The following four flags all indicate something special about an edge.
86 Test the edge flags on EDGE_COMPLEX to detect all forms of "strange"
87 control flow transfers. */
88 #define EDGE_COMPLEX \
89 (EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_EH | EDGE_PRESERVE)
91 struct GTY(()) rtl_bb_info {
92 /* The first insn of the block is embedded into bb->il.x. */
93 /* The last insn of the block. */
94 rtx_insn *end_;
96 /* In CFGlayout mode points to insn notes/jumptables to be placed just before
97 and after the block. */
98 rtx_insn *header_;
99 rtx_insn *footer_;
102 struct GTY(()) gimple_bb_info {
103 /* Sequence of statements in this block. */
104 gimple_seq seq;
106 /* PHI nodes for this block. */
107 gimple_seq phi_nodes;
110 /* A basic block is a sequence of instructions with only one entry and
111 only one exit. If any one of the instructions are executed, they
112 will all be executed, and in sequence from first to last.
114 There may be COND_EXEC instructions in the basic block. The
115 COND_EXEC *instructions* will be executed -- but if the condition
116 is false the conditionally executed *expressions* will of course
117 not be executed. We don't consider the conditionally executed
118 expression (which might have side-effects) to be in a separate
119 basic block because the program counter will always be at the same
120 location after the COND_EXEC instruction, regardless of whether the
121 condition is true or not.
123 Basic blocks need not start with a label nor end with a jump insn.
124 For example, a previous basic block may just "conditionally fall"
125 into the succeeding basic block, and the last basic block need not
126 end with a jump insn. Block 0 is a descendant of the entry block.
128 A basic block beginning with two labels cannot have notes between
129 the labels.
131 Data for jump tables are stored in jump_insns that occur in no
132 basic block even though these insns can follow or precede insns in
133 basic blocks. */
135 /* Basic block information indexed by block number. */
136 struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_def {
137 /* The edges into and out of the block. */
138 vec<edge, va_gc> *preds;
139 vec<edge, va_gc> *succs;
141 /* Auxiliary info specific to a pass. */
142 PTR GTY ((skip (""))) aux;
144 /* Innermost loop containing the block. */
145 struct loop *loop_father;
147 /* The dominance and postdominance information node. */
148 struct et_node * GTY ((skip (""))) dom[2];
150 /* Previous and next blocks in the chain. */
151 basic_block prev_bb;
152 basic_block next_bb;
154 union basic_block_il_dependent {
155 struct gimple_bb_info GTY ((tag ("0"))) gimple;
156 struct {
157 rtx_insn *head_;
158 struct rtl_bb_info * rtl;
159 } GTY ((tag ("1"))) x;
160 } GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il;
162 /* Various flags. See cfg-flags.def. */
163 int flags;
165 /* The index of this block. */
166 int index;
168 /* Expected number of executions: calculated in profile.c. */
169 gcov_type count;
171 /* Expected frequency. Normalized to be in range 0 to BB_FREQ_MAX. */
172 int frequency;
174 /* The discriminator for this block. The discriminator distinguishes
175 among several basic blocks that share a common locus, allowing for
176 more accurate sample-based profiling. */
177 int discriminator;
180 /* This ensures that struct gimple_bb_info is smaller than
181 struct rtl_bb_info, so that inlining the former into basic_block_def
182 is the better choice. */
183 typedef int __assert_gimple_bb_smaller_rtl_bb
184 [(int) sizeof (struct rtl_bb_info)
185 - (int) sizeof (struct gimple_bb_info)];
188 #define BB_FREQ_MAX 10000
190 /* Masks for basic_block.flags. */
191 #define DEF_BASIC_BLOCK_FLAG(NAME,IDX) BB_##NAME = 1 << IDX ,
192 enum cfg_bb_flags
194 #include "cfg-flags.def"
195 LAST_CFG_BB_FLAG /* this is only used for BB_ALL_FLAGS */
197 #undef DEF_BASIC_BLOCK_FLAG
199 /* Bit mask for all basic block flags. */
200 #define BB_ALL_FLAGS ((LAST_CFG_BB_FLAG - 1) * 2 - 1)
202 /* Bit mask for all basic block flags that must be preserved. These are
203 the bit masks that are *not* cleared by clear_bb_flags. */
204 #define BB_FLAGS_TO_PRESERVE \
205 (BB_DISABLE_SCHEDULE | BB_RTL | BB_NON_LOCAL_GOTO_TARGET \
206 | BB_HOT_PARTITION | BB_COLD_PARTITION)
208 /* Dummy bitmask for convenience in the hot/cold partitioning code. */
209 #define BB_UNPARTITIONED 0
211 /* Partitions, to be used when partitioning hot and cold basic blocks into
212 separate sections. */
213 #define BB_PARTITION(bb) ((bb)->flags & (BB_HOT_PARTITION|BB_COLD_PARTITION))
214 #define BB_SET_PARTITION(bb, part) do { \
215 basic_block bb_ = (bb); \
216 bb_->flags = ((bb_->flags & ~(BB_HOT_PARTITION|BB_COLD_PARTITION)) \
217 | (part)); \
218 } while (0)
220 #define BB_COPY_PARTITION(dstbb, srcbb) \
221 BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb))
223 /* What sort of profiling information we have. */
224 enum profile_status_d
226 PROFILE_ABSENT,
227 PROFILE_GUESSED,
228 PROFILE_READ,
229 PROFILE_LAST /* Last value, used by profile streaming. */
232 /* A structure to group all the per-function control flow graph data.
233 The x_* prefixing is necessary because otherwise references to the
234 fields of this struct are interpreted as the defines for backward
235 source compatibility following the definition of this struct. */
236 struct GTY(()) control_flow_graph {
237 /* Block pointers for the exit and entry of a function.
238 These are always the head and tail of the basic block list. */
239 basic_block x_entry_block_ptr;
240 basic_block x_exit_block_ptr;
242 /* Index by basic block number, get basic block struct info. */
243 vec<basic_block, va_gc> *x_basic_block_info;
245 /* Number of basic blocks in this flow graph. */
246 int x_n_basic_blocks;
248 /* Number of edges in this flow graph. */
249 int x_n_edges;
251 /* The first free basic block number. */
252 int x_last_basic_block;
254 /* UIDs for LABEL_DECLs. */
255 int last_label_uid;
257 /* Mapping of labels to their associated blocks. At present
258 only used for the gimple CFG. */
259 vec<basic_block, va_gc> *x_label_to_block_map;
261 enum profile_status_d x_profile_status;
263 /* Whether the dominators and the postdominators are available. */
264 enum dom_state x_dom_computed[2];
266 /* Number of basic blocks in the dominance tree. */
267 unsigned x_n_bbs_in_dom_tree[2];
269 /* Maximal number of entities in the single jumptable. Used to estimate
270 final flowgraph size. */
271 int max_jumptable_ents;
274 /* Defines for accessing the fields of the CFG structure for function FN. */
275 #define ENTRY_BLOCK_PTR_FOR_FN(FN) ((FN)->cfg->x_entry_block_ptr)
276 #define EXIT_BLOCK_PTR_FOR_FN(FN) ((FN)->cfg->x_exit_block_ptr)
277 #define basic_block_info_for_fn(FN) ((FN)->cfg->x_basic_block_info)
278 #define n_basic_blocks_for_fn(FN) ((FN)->cfg->x_n_basic_blocks)
279 #define n_edges_for_fn(FN) ((FN)->cfg->x_n_edges)
280 #define last_basic_block_for_fn(FN) ((FN)->cfg->x_last_basic_block)
281 #define label_to_block_map_for_fn(FN) ((FN)->cfg->x_label_to_block_map)
282 #define profile_status_for_fn(FN) ((FN)->cfg->x_profile_status)
284 #define BASIC_BLOCK_FOR_FN(FN,N) \
285 ((*basic_block_info_for_fn (FN))[(N)])
286 #define SET_BASIC_BLOCK_FOR_FN(FN,N,BB) \
287 ((*basic_block_info_for_fn (FN))[(N)] = (BB))
289 /* For iterating over basic blocks. */
290 #define FOR_BB_BETWEEN(BB, FROM, TO, DIR) \
291 for (BB = FROM; BB != TO; BB = BB->DIR)
293 #define FOR_EACH_BB_FN(BB, FN) \
294 FOR_BB_BETWEEN (BB, (FN)->cfg->x_entry_block_ptr->next_bb, (FN)->cfg->x_exit_block_ptr, next_bb)
296 #define FOR_EACH_BB_REVERSE_FN(BB, FN) \
297 FOR_BB_BETWEEN (BB, (FN)->cfg->x_exit_block_ptr->prev_bb, (FN)->cfg->x_entry_block_ptr, prev_bb)
299 /* For iterating over insns in basic block. */
300 #define FOR_BB_INSNS(BB, INSN) \
301 for ((INSN) = BB_HEAD (BB); \
302 (INSN) && (INSN) != NEXT_INSN (BB_END (BB)); \
303 (INSN) = NEXT_INSN (INSN))
305 /* For iterating over insns in basic block when we might remove the
306 current insn. */
307 #define FOR_BB_INSNS_SAFE(BB, INSN, CURR) \
308 for ((INSN) = BB_HEAD (BB), (CURR) = (INSN) ? NEXT_INSN ((INSN)): NULL; \
309 (INSN) && (INSN) != NEXT_INSN (BB_END (BB)); \
310 (INSN) = (CURR), (CURR) = (INSN) ? NEXT_INSN ((INSN)) : NULL)
312 #define FOR_BB_INSNS_REVERSE(BB, INSN) \
313 for ((INSN) = BB_END (BB); \
314 (INSN) && (INSN) != PREV_INSN (BB_HEAD (BB)); \
315 (INSN) = PREV_INSN (INSN))
317 #define FOR_BB_INSNS_REVERSE_SAFE(BB, INSN, CURR) \
318 for ((INSN) = BB_END (BB),(CURR) = (INSN) ? PREV_INSN ((INSN)) : NULL; \
319 (INSN) && (INSN) != PREV_INSN (BB_HEAD (BB)); \
320 (INSN) = (CURR), (CURR) = (INSN) ? PREV_INSN ((INSN)) : NULL)
322 /* Cycles through _all_ basic blocks, even the fake ones (entry and
323 exit block). */
325 #define FOR_ALL_BB_FN(BB, FN) \
326 for (BB = ENTRY_BLOCK_PTR_FOR_FN (FN); BB; BB = BB->next_bb)
329 /* Stuff for recording basic block info. */
331 /* For now, these will be functions (so that they can include checked casts
332 to rtx_insn. Once the underlying fields are converted from rtx
333 to rtx_insn, these can be converted back to macros. */
335 #define BB_HEAD(B) (B)->il.x.head_
336 #define BB_END(B) (B)->il.x.rtl->end_
337 #define BB_HEADER(B) (B)->il.x.rtl->header_
338 #define BB_FOOTER(B) (B)->il.x.rtl->footer_
340 /* Special block numbers [markers] for entry and exit.
341 Neither of them is supposed to hold actual statements. */
342 #define ENTRY_BLOCK (0)
343 #define EXIT_BLOCK (1)
345 /* The two blocks that are always in the cfg. */
346 #define NUM_FIXED_BLOCKS (2)
348 /* The base value for branch probability notes and edge probabilities. */
349 #define REG_BR_PROB_BASE 10000
351 /* This is the value which indicates no edge is present. */
352 #define EDGE_INDEX_NO_EDGE -1
354 /* EDGE_INDEX returns an integer index for an edge, or EDGE_INDEX_NO_EDGE
355 if there is no edge between the 2 basic blocks. */
356 #define EDGE_INDEX(el, pred, succ) (find_edge_index ((el), (pred), (succ)))
358 /* INDEX_EDGE_PRED_BB and INDEX_EDGE_SUCC_BB return a pointer to the basic
359 block which is either the pred or succ end of the indexed edge. */
360 #define INDEX_EDGE_PRED_BB(el, index) ((el)->index_to_edge[(index)]->src)
361 #define INDEX_EDGE_SUCC_BB(el, index) ((el)->index_to_edge[(index)]->dest)
363 /* INDEX_EDGE returns a pointer to the edge. */
364 #define INDEX_EDGE(el, index) ((el)->index_to_edge[(index)])
366 /* Number of edges in the compressed edge list. */
367 #define NUM_EDGES(el) ((el)->num_edges)
369 /* BB is assumed to contain conditional jump. Return the fallthru edge. */
370 #define FALLTHRU_EDGE(bb) (EDGE_SUCC ((bb), 0)->flags & EDGE_FALLTHRU \
371 ? EDGE_SUCC ((bb), 0) : EDGE_SUCC ((bb), 1))
373 /* BB is assumed to contain conditional jump. Return the branch edge. */
374 #define BRANCH_EDGE(bb) (EDGE_SUCC ((bb), 0)->flags & EDGE_FALLTHRU \
375 ? EDGE_SUCC ((bb), 1) : EDGE_SUCC ((bb), 0))
377 #define RDIV(X,Y) (((X) + (Y) / 2) / (Y))
378 /* Return expected execution frequency of the edge E. */
379 #define EDGE_FREQUENCY(e) RDIV ((e)->src->frequency * (e)->probability, \
380 REG_BR_PROB_BASE)
382 /* Compute a scale factor (or probability) suitable for scaling of
383 gcov_type values via apply_probability() and apply_scale(). */
384 #define GCOV_COMPUTE_SCALE(num,den) \
385 ((den) ? RDIV ((num) * REG_BR_PROB_BASE, (den)) : REG_BR_PROB_BASE)
387 /* Return nonzero if edge is critical. */
388 #define EDGE_CRITICAL_P(e) (EDGE_COUNT ((e)->src->succs) >= 2 \
389 && EDGE_COUNT ((e)->dest->preds) >= 2)
391 #define EDGE_COUNT(ev) vec_safe_length (ev)
392 #define EDGE_I(ev,i) (*ev)[(i)]
393 #define EDGE_PRED(bb,i) (*(bb)->preds)[(i)]
394 #define EDGE_SUCC(bb,i) (*(bb)->succs)[(i)]
396 /* Returns true if BB has precisely one successor. */
398 static inline bool
399 single_succ_p (const_basic_block bb)
401 return EDGE_COUNT (bb->succs) == 1;
404 /* Returns true if BB has precisely one predecessor. */
406 static inline bool
407 single_pred_p (const_basic_block bb)
409 return EDGE_COUNT (bb->preds) == 1;
412 /* Returns the single successor edge of basic block BB. Aborts if
413 BB does not have exactly one successor. */
415 static inline edge
416 single_succ_edge (const_basic_block bb)
418 gcc_checking_assert (single_succ_p (bb));
419 return EDGE_SUCC (bb, 0);
422 /* Returns the single predecessor edge of basic block BB. Aborts
423 if BB does not have exactly one predecessor. */
425 static inline edge
426 single_pred_edge (const_basic_block bb)
428 gcc_checking_assert (single_pred_p (bb));
429 return EDGE_PRED (bb, 0);
432 /* Returns the single successor block of basic block BB. Aborts
433 if BB does not have exactly one successor. */
435 static inline basic_block
436 single_succ (const_basic_block bb)
438 return single_succ_edge (bb)->dest;
441 /* Returns the single predecessor block of basic block BB. Aborts
442 if BB does not have exactly one predecessor.*/
444 static inline basic_block
445 single_pred (const_basic_block bb)
447 return single_pred_edge (bb)->src;
450 /* Iterator object for edges. */
452 struct edge_iterator {
453 unsigned index;
454 vec<edge, va_gc> **container;
457 static inline vec<edge, va_gc> *
458 ei_container (edge_iterator i)
460 gcc_checking_assert (i.container);
461 return *i.container;
464 #define ei_start(iter) ei_start_1 (&(iter))
465 #define ei_last(iter) ei_last_1 (&(iter))
467 /* Return an iterator pointing to the start of an edge vector. */
468 static inline edge_iterator
469 ei_start_1 (vec<edge, va_gc> **ev)
471 edge_iterator i;
473 i.index = 0;
474 i.container = ev;
476 return i;
479 /* Return an iterator pointing to the last element of an edge
480 vector. */
481 static inline edge_iterator
482 ei_last_1 (vec<edge, va_gc> **ev)
484 edge_iterator i;
486 i.index = EDGE_COUNT (*ev) - 1;
487 i.container = ev;
489 return i;
492 /* Is the iterator `i' at the end of the sequence? */
493 static inline bool
494 ei_end_p (edge_iterator i)
496 return (i.index == EDGE_COUNT (ei_container (i)));
499 /* Is the iterator `i' at one position before the end of the
500 sequence? */
501 static inline bool
502 ei_one_before_end_p (edge_iterator i)
504 return (i.index + 1 == EDGE_COUNT (ei_container (i)));
507 /* Advance the iterator to the next element. */
508 static inline void
509 ei_next (edge_iterator *i)
511 gcc_checking_assert (i->index < EDGE_COUNT (ei_container (*i)));
512 i->index++;
515 /* Move the iterator to the previous element. */
516 static inline void
517 ei_prev (edge_iterator *i)
519 gcc_checking_assert (i->index > 0);
520 i->index--;
523 /* Return the edge pointed to by the iterator `i'. */
524 static inline edge
525 ei_edge (edge_iterator i)
527 return EDGE_I (ei_container (i), i.index);
530 /* Return an edge pointed to by the iterator. Do it safely so that
531 NULL is returned when the iterator is pointing at the end of the
532 sequence. */
533 static inline edge
534 ei_safe_edge (edge_iterator i)
536 return !ei_end_p (i) ? ei_edge (i) : NULL;
539 /* Return 1 if we should continue to iterate. Return 0 otherwise.
540 *Edge P is set to the next edge if we are to continue to iterate
541 and NULL otherwise. */
543 static inline bool
544 ei_cond (edge_iterator ei, edge *p)
546 if (!ei_end_p (ei))
548 *p = ei_edge (ei);
549 return 1;
551 else
553 *p = NULL;
554 return 0;
558 /* This macro serves as a convenient way to iterate each edge in a
559 vector of predecessor or successor edges. It must not be used when
560 an element might be removed during the traversal, otherwise
561 elements will be missed. Instead, use a for-loop like that shown
562 in the following pseudo-code:
564 FOR (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
566 IF (e != taken_edge)
567 remove_edge (e);
568 ELSE
569 ei_next (&ei);
573 #define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC) \
574 for ((ITER) = ei_start ((EDGE_VEC)); \
575 ei_cond ((ITER), &(EDGE)); \
576 ei_next (&(ITER)))
578 #define CLEANUP_EXPENSIVE 1 /* Do relatively expensive optimizations
579 except for edge forwarding */
580 #define CLEANUP_CROSSJUMP 2 /* Do crossjumping. */
581 #define CLEANUP_POST_REGSTACK 4 /* We run after reg-stack and need
582 to care REG_DEAD notes. */
583 #define CLEANUP_THREADING 8 /* Do jump threading. */
584 #define CLEANUP_NO_INSN_DEL 16 /* Do not try to delete trivially dead
585 insns. */
586 #define CLEANUP_CFGLAYOUT 32 /* Do cleanup in cfglayout mode. */
587 #define CLEANUP_CFG_CHANGED 64 /* The caller changed the CFG. */
589 #include "cfghooks.h"
591 /* Return true if BB is in a transaction. */
593 static inline bool
594 bb_in_transaction (basic_block bb)
596 return bb->flags & BB_IN_TRANSACTION;
599 /* Return true when one of the predecessor edges of BB is marked with EDGE_EH. */
600 static inline bool
601 bb_has_eh_pred (basic_block bb)
603 edge e;
604 edge_iterator ei;
606 FOR_EACH_EDGE (e, ei, bb->preds)
608 if (e->flags & EDGE_EH)
609 return true;
611 return false;
614 /* Return true when one of the predecessor edges of BB is marked with EDGE_ABNORMAL. */
615 static inline bool
616 bb_has_abnormal_pred (basic_block bb)
618 edge e;
619 edge_iterator ei;
621 FOR_EACH_EDGE (e, ei, bb->preds)
623 if (e->flags & EDGE_ABNORMAL)
624 return true;
626 return false;
629 /* Return the fallthru edge in EDGES if it exists, NULL otherwise. */
630 static inline edge
631 find_fallthru_edge (vec<edge, va_gc> *edges)
633 edge e;
634 edge_iterator ei;
636 FOR_EACH_EDGE (e, ei, edges)
637 if (e->flags & EDGE_FALLTHRU)
638 break;
640 return e;
643 /* Check tha probability is sane. */
645 static inline void
646 check_probability (int prob)
648 gcc_checking_assert (prob >= 0 && prob <= REG_BR_PROB_BASE);
651 /* Given PROB1 and PROB2, return PROB1*PROB2/REG_BR_PROB_BASE.
652 Used to combine BB probabilities. */
654 static inline int
655 combine_probabilities (int prob1, int prob2)
657 check_probability (prob1);
658 check_probability (prob2);
659 return RDIV (prob1 * prob2, REG_BR_PROB_BASE);
662 /* Apply scale factor SCALE on frequency or count FREQ. Use this
663 interface when potentially scaling up, so that SCALE is not
664 constrained to be < REG_BR_PROB_BASE. */
666 static inline gcov_type
667 apply_scale (gcov_type freq, gcov_type scale)
669 return RDIV (freq * scale, REG_BR_PROB_BASE);
672 /* Apply probability PROB on frequency or count FREQ. */
674 static inline gcov_type
675 apply_probability (gcov_type freq, int prob)
677 check_probability (prob);
678 return apply_scale (freq, prob);
681 /* Return inverse probability for PROB. */
683 static inline int
684 inverse_probability (int prob1)
686 check_probability (prob1);
687 return REG_BR_PROB_BASE - prob1;
690 /* Return true if BB has at least one abnormal outgoing edge. */
692 static inline bool
693 has_abnormal_or_eh_outgoing_edge_p (basic_block bb)
695 edge e;
696 edge_iterator ei;
698 FOR_EACH_EDGE (e, ei, bb->succs)
699 if (e->flags & (EDGE_ABNORMAL | EDGE_EH))
700 return true;
702 return false;
704 #endif /* GCC_BASIC_BLOCK_H */