comparison gcc/basic-block.h @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents b7f97abdc517
children 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
97 97
98 /* Declared in cfgloop.h. */ 98 /* Declared in cfgloop.h. */
99 struct loop; 99 struct loop;
100 100
101 /* Declared in tree-flow.h. */ 101 /* Declared in tree-flow.h. */
102 struct edge_prediction;
103 struct rtl_bb_info; 102 struct rtl_bb_info;
104 103
105 /* A basic block is a sequence of instructions with only entry and 104 /* A basic block is a sequence of instructions with only entry and
106 only one exit. If any one of the instructions are executed, they 105 only one exit. If any one of the instructions are executed, they
107 will all be executed, and in sequence from first to last. 106 will all be executed, and in sequence from first to last.
244 Only used in cfgcleanup.c. */ 243 Only used in cfgcleanup.c. */
245 BB_FORWARDER_BLOCK = 1 << 10, 244 BB_FORWARDER_BLOCK = 1 << 10,
246 245
247 /* Set on blocks that cannot be threaded through. 246 /* Set on blocks that cannot be threaded through.
248 Only used in cfgcleanup.c. */ 247 Only used in cfgcleanup.c. */
249 BB_NONTHREADABLE_BLOCK = 1 << 11 248 BB_NONTHREADABLE_BLOCK = 1 << 11,
249
250 /* Set on blocks that were modified in some way. This bit is set in
251 df_set_bb_dirty, but not cleared by df_analyze, so it can be used
252 to test whether a block has been modified prior to a df_analyze
253 call. */
254 BB_MODIFIED = 1 << 12
250 }; 255 };
251 256
252 /* Dummy flag for convenience in the hot/cold partitioning code. */ 257 /* Dummy flag for convenience in the hot/cold partitioning code. */
253 #define BB_UNPARTITIONED 0 258 #define BB_UNPARTITIONED 0
254 259
301 int x_n_edges; 306 int x_n_edges;
302 307
303 /* The first free basic block number. */ 308 /* The first free basic block number. */
304 int x_last_basic_block; 309 int x_last_basic_block;
305 310
311 /* UIDs for LABEL_DECLs. */
312 int last_label_uid;
313
306 /* Mapping of labels to their associated blocks. At present 314 /* Mapping of labels to their associated blocks. At present
307 only used for the gimple CFG. */ 315 only used for the gimple CFG. */
308 VEC(basic_block,gc) *x_label_to_block_map; 316 VEC(basic_block,gc) *x_label_to_block_map;
309 317
310 enum profile_status_d x_profile_status; 318 enum profile_status_d x_profile_status;
316 unsigned x_n_bbs_in_dom_tree[2]; 324 unsigned x_n_bbs_in_dom_tree[2];
317 325
318 /* Maximal number of entities in the single jumptable. Used to estimate 326 /* Maximal number of entities in the single jumptable. Used to estimate
319 final flowgraph size. */ 327 final flowgraph size. */
320 int max_jumptable_ents; 328 int max_jumptable_ents;
321
322 /* UIDs for LABEL_DECLs. */
323 int last_label_uid;
324 }; 329 };
325 330
326 /* Defines for accessing the fields of the CFG structure for function FN. */ 331 /* Defines for accessing the fields of the CFG structure for function FN. */
327 #define ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_entry_block_ptr) 332 #define ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_entry_block_ptr)
328 #define EXIT_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_exit_block_ptr) 333 #define EXIT_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_exit_block_ptr)
441 extern int inverted_post_order_compute (int *); 446 extern int inverted_post_order_compute (int *);
442 extern int pre_and_rev_post_order_compute (int *, int *, bool); 447 extern int pre_and_rev_post_order_compute (int *, int *, bool);
443 extern int dfs_enumerate_from (basic_block, int, 448 extern int dfs_enumerate_from (basic_block, int,
444 bool (*)(const_basic_block, const void *), 449 bool (*)(const_basic_block, const void *),
445 basic_block *, int, const void *); 450 basic_block *, int, const void *);
446 extern void compute_dominance_frontiers (bitmap *); 451 extern void compute_dominance_frontiers (struct bitmap_head_def *);
447 extern bitmap compute_idf (bitmap, bitmap *); 452 extern bitmap compute_idf (bitmap, struct bitmap_head_def *);
448 extern void dump_bb_info (basic_block, bool, bool, int, const char *, FILE *); 453 extern void dump_bb_info (basic_block, bool, bool, int, const char *, FILE *);
449 extern void dump_edge_info (FILE *, edge, int); 454 extern void dump_edge_info (FILE *, edge, int);
450 extern void brief_dump_cfg (FILE *); 455 extern void brief_dump_cfg (FILE *);
451 extern void clear_edges (void); 456 extern void clear_edges (void);
452 extern void scale_bbs_frequencies_int (basic_block *, int, int, int); 457 extern void scale_bbs_frequencies_int (basic_block *, int, int, int);
552 BB does not have exactly one successor. */ 557 BB does not have exactly one successor. */
553 558
554 static inline edge 559 static inline edge
555 single_succ_edge (const_basic_block bb) 560 single_succ_edge (const_basic_block bb)
556 { 561 {
557 gcc_assert (single_succ_p (bb)); 562 gcc_checking_assert (single_succ_p (bb));
558 return EDGE_SUCC (bb, 0); 563 return EDGE_SUCC (bb, 0);
559 } 564 }
560 565
561 /* Returns the single predecessor edge of basic block BB. Aborts 566 /* Returns the single predecessor edge of basic block BB. Aborts
562 if BB does not have exactly one predecessor. */ 567 if BB does not have exactly one predecessor. */
563 568
564 static inline edge 569 static inline edge
565 single_pred_edge (const_basic_block bb) 570 single_pred_edge (const_basic_block bb)
566 { 571 {
567 gcc_assert (single_pred_p (bb)); 572 gcc_checking_assert (single_pred_p (bb));
568 return EDGE_PRED (bb, 0); 573 return EDGE_PRED (bb, 0);
569 } 574 }
570 575
571 /* Returns the single successor block of basic block BB. Aborts 576 /* Returns the single successor block of basic block BB. Aborts
572 if BB does not have exactly one successor. */ 577 if BB does not have exactly one successor. */
594 } edge_iterator; 599 } edge_iterator;
595 600
596 static inline VEC(edge,gc) * 601 static inline VEC(edge,gc) *
597 ei_container (edge_iterator i) 602 ei_container (edge_iterator i)
598 { 603 {
599 gcc_assert (i.container); 604 gcc_checking_assert (i.container);
600 return *i.container; 605 return *i.container;
601 } 606 }
602 607
603 #define ei_start(iter) ei_start_1 (&(iter)) 608 #define ei_start(iter) ei_start_1 (&(iter))
604 #define ei_last(iter) ei_last_1 (&(iter)) 609 #define ei_last(iter) ei_last_1 (&(iter))
645 650
646 /* Advance the iterator to the next element. */ 651 /* Advance the iterator to the next element. */
647 static inline void 652 static inline void
648 ei_next (edge_iterator *i) 653 ei_next (edge_iterator *i)
649 { 654 {
650 gcc_assert (i->index < EDGE_COUNT (ei_container (*i))); 655 gcc_checking_assert (i->index < EDGE_COUNT (ei_container (*i)));
651 i->index++; 656 i->index++;
652 } 657 }
653 658
654 /* Move the iterator to the previous element. */ 659 /* Move the iterator to the previous element. */
655 static inline void 660 static inline void
656 ei_prev (edge_iterator *i) 661 ei_prev (edge_iterator *i)
657 { 662 {
658 gcc_assert (i->index > 0); 663 gcc_checking_assert (i->index > 0);
659 i->index--; 664 i->index--;
660 } 665 }
661 666
662 /* Return the edge pointed to by the iterator `i'. */ 667 /* Return the edge pointed to by the iterator `i'. */
663 static inline edge 668 static inline edge
747 extern bool probably_never_executed_bb_p (const_basic_block); 752 extern bool probably_never_executed_bb_p (const_basic_block);
748 extern bool optimize_bb_for_size_p (const_basic_block); 753 extern bool optimize_bb_for_size_p (const_basic_block);
749 extern bool optimize_bb_for_speed_p (const_basic_block); 754 extern bool optimize_bb_for_speed_p (const_basic_block);
750 extern bool optimize_edge_for_size_p (edge); 755 extern bool optimize_edge_for_size_p (edge);
751 extern bool optimize_edge_for_speed_p (edge); 756 extern bool optimize_edge_for_speed_p (edge);
752 extern bool optimize_function_for_size_p (struct function *);
753 extern bool optimize_function_for_speed_p (struct function *);
754 extern bool optimize_loop_for_size_p (struct loop *); 757 extern bool optimize_loop_for_size_p (struct loop *);
755 extern bool optimize_loop_for_speed_p (struct loop *); 758 extern bool optimize_loop_for_speed_p (struct loop *);
756 extern bool optimize_loop_nest_for_size_p (struct loop *); 759 extern bool optimize_loop_nest_for_size_p (struct loop *);
757 extern bool optimize_loop_nest_for_speed_p (struct loop *); 760 extern bool optimize_loop_nest_for_speed_p (struct loop *);
758 extern bool gimple_predicted_by_p (const_basic_block, enum br_predictor); 761 extern bool gimple_predicted_by_p (const_basic_block, enum br_predictor);
773 extern void expunge_block (basic_block); 776 extern void expunge_block (basic_block);
774 extern void link_block (basic_block, basic_block); 777 extern void link_block (basic_block, basic_block);
775 extern void unlink_block (basic_block); 778 extern void unlink_block (basic_block);
776 extern void compact_blocks (void); 779 extern void compact_blocks (void);
777 extern basic_block alloc_block (void); 780 extern basic_block alloc_block (void);
778 extern void alloc_aux_for_block (basic_block, int);
779 extern void alloc_aux_for_blocks (int); 781 extern void alloc_aux_for_blocks (int);
780 extern void clear_aux_for_blocks (void); 782 extern void clear_aux_for_blocks (void);
781 extern void free_aux_for_blocks (void); 783 extern void free_aux_for_blocks (void);
782 extern void alloc_aux_for_edge (edge, int);
783 extern void alloc_aux_for_edges (int); 784 extern void alloc_aux_for_edges (int);
784 extern void clear_aux_for_edges (void); 785 extern void clear_aux_for_edges (void);
785 extern void free_aux_for_edges (void); 786 extern void free_aux_for_edges (void);
786 787
787 /* In cfganal.c */ 788 /* In cfganal.c */
844 extern bool dominated_by_p (enum cdi_direction, const_basic_block, const_basic_block); 845 extern bool dominated_by_p (enum cdi_direction, const_basic_block, const_basic_block);
845 extern VEC (basic_block, heap) *get_dominated_by (enum cdi_direction, basic_block); 846 extern VEC (basic_block, heap) *get_dominated_by (enum cdi_direction, basic_block);
846 extern VEC (basic_block, heap) *get_dominated_by_region (enum cdi_direction, 847 extern VEC (basic_block, heap) *get_dominated_by_region (enum cdi_direction,
847 basic_block *, 848 basic_block *,
848 unsigned); 849 unsigned);
850 extern VEC (basic_block, heap) *get_dominated_to_depth (enum cdi_direction,
851 basic_block, int);
849 extern VEC (basic_block, heap) *get_all_dominated_blocks (enum cdi_direction, 852 extern VEC (basic_block, heap) *get_all_dominated_blocks (enum cdi_direction,
850 basic_block); 853 basic_block);
851 extern void add_to_dominance_info (enum cdi_direction, basic_block); 854 extern void add_to_dominance_info (enum cdi_direction, basic_block);
852 extern void delete_from_dominance_info (enum cdi_direction, basic_block); 855 extern void delete_from_dominance_info (enum cdi_direction, basic_block);
853 basic_block recompute_dominator (enum cdi_direction, basic_block); 856 basic_block recompute_dominator (enum cdi_direction, basic_block);
875 extern void set_bb_copy (basic_block, basic_block); 878 extern void set_bb_copy (basic_block, basic_block);
876 extern basic_block get_bb_copy (basic_block); 879 extern basic_block get_bb_copy (basic_block);
877 void set_loop_copy (struct loop *, struct loop *); 880 void set_loop_copy (struct loop *, struct loop *);
878 struct loop *get_loop_copy (struct loop *); 881 struct loop *get_loop_copy (struct loop *);
879 882
880
881 extern rtx insert_insn_end_bb_new (rtx, basic_block);
882
883 #include "cfghooks.h" 883 #include "cfghooks.h"
884 884
885 /* Return true when one of the predecessor edges of BB is marked with EDGE_EH. */ 885 /* Return true when one of the predecessor edges of BB is marked with EDGE_EH. */
886 static inline bool 886 static inline bool
887 bb_has_eh_pred (basic_block bb) 887 bb_has_eh_pred (basic_block bb)
910 return true; 910 return true;
911 } 911 }
912 return false; 912 return false;
913 } 913 }
914 914
915 /* Return the fallthru edge in EDGES if it exists, NULL otherwise. */
916 static inline edge
917 find_fallthru_edge (VEC(edge,gc) *edges)
918 {
919 edge e;
920 edge_iterator ei;
921
922 FOR_EACH_EDGE (e, ei, edges)
923 if (e->flags & EDGE_FALLTHRU)
924 break;
925
926 return e;
927 }
928
915 /* In cfgloopmanip.c. */ 929 /* In cfgloopmanip.c. */
916 extern edge mfb_kj_edge; 930 extern edge mfb_kj_edge;
917 extern bool mfb_keep_just (edge); 931 extern bool mfb_keep_just (edge);
918 932
919 /* In cfgexpand.c. */ 933 /* In cfgexpand.c. */