comparison gcc/basic-block.h @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children b7f97abdc517
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
1 /* Define control and data flow tables, and regsets. 1 /* Define control and data flow tables, and regsets.
2 Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2 Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 3 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify it under 7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free 8 the terms of the GNU General Public License as published by the Free
117 flow graph is manipulated by various optimizations. A signed type 117 flow graph is manipulated by various optimizations. A signed type
118 makes those easy to detect. */ 118 makes those easy to detect. */
119 typedef HOST_WIDEST_INT gcov_type; 119 typedef HOST_WIDEST_INT gcov_type;
120 120
121 /* Control flow edge information. */ 121 /* Control flow edge information. */
122 struct edge_def GTY(()) 122 struct GTY(()) edge_def {
123 {
124 /* The two blocks at the ends of the edge. */ 123 /* The two blocks at the ends of the edge. */
125 struct basic_block_def *src; 124 struct basic_block_def *src;
126 struct basic_block_def *dest; 125 struct basic_block_def *dest;
127 126
128 /* Instructions queued on the edge. */ 127 /* Instructions queued on the edge. */
146 int probability; /* biased by REG_BR_PROB_BASE */ 145 int probability; /* biased by REG_BR_PROB_BASE */
147 gcov_type count; /* Expected number of executions calculated 146 gcov_type count; /* Expected number of executions calculated
148 in profile.c */ 147 in profile.c */
149 }; 148 };
150 149
151 typedef struct edge_def *edge;
152 typedef const struct edge_def *const_edge;
153 DEF_VEC_P(edge); 150 DEF_VEC_P(edge);
154 DEF_VEC_ALLOC_P(edge,gc); 151 DEF_VEC_ALLOC_P(edge,gc);
155 DEF_VEC_ALLOC_P(edge,heap); 152 DEF_VEC_ALLOC_P(edge,heap);
156 153
157 #define EDGE_FALLTHRU 1 /* 'Straight line' flow */ 154 #define EDGE_FALLTHRU 1 /* 'Straight line' flow */
215 Data for jump tables are stored in jump_insns that occur in no 212 Data for jump tables are stored in jump_insns that occur in no
216 basic block even though these insns can follow or precede insns in 213 basic block even though these insns can follow or precede insns in
217 basic blocks. */ 214 basic blocks. */
218 215
219 /* Basic block information indexed by block number. */ 216 /* Basic block information indexed by block number. */
220 struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) 217 struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_def {
221 {
222 /* The edges into and out of the block. */ 218 /* The edges into and out of the block. */
223 VEC(edge,gc) *preds; 219 VEC(edge,gc) *preds;
224 VEC(edge,gc) *succs; 220 VEC(edge,gc) *succs;
225 221
226 /* Auxiliary info specific to a pass. */ 222 /* Auxiliary info specific to a pass. */
251 int loop_depth; 247 int loop_depth;
252 248
253 /* Expected frequency. Normalized to be in range 0 to BB_FREQ_MAX. */ 249 /* Expected frequency. Normalized to be in range 0 to BB_FREQ_MAX. */
254 int frequency; 250 int frequency;
255 251
252 /* The discriminator for this block. */
253 int discriminator;
254
256 /* Various flags. See BB_* below. */ 255 /* Various flags. See BB_* below. */
257 int flags; 256 int flags;
258 }; 257 };
259 258
260 struct rtl_bb_info GTY(()) 259 struct GTY(()) rtl_bb_info {
261 {
262 /* The first and last insns of the block. */ 260 /* The first and last insns of the block. */
263 rtx head_; 261 rtx head_;
264 rtx end_; 262 rtx end_;
265 263
266 /* In CFGlayout mode points to insn notes/jumptables to be placed just before 264 /* In CFGlayout mode points to insn notes/jumptables to be placed just before
270 268
271 /* This field is used by the bb-reorder and tracer passes. */ 269 /* This field is used by the bb-reorder and tracer passes. */
272 int visited; 270 int visited;
273 }; 271 };
274 272
275 struct gimple_bb_info GTY(()) 273 struct GTY(()) gimple_bb_info {
276 {
277 /* Sequence of statements in this block. */ 274 /* Sequence of statements in this block. */
278 gimple_seq seq; 275 gimple_seq seq;
279 276
280 /* PHI nodes for this block. */ 277 /* PHI nodes for this block. */
281 gimple_seq phi_nodes; 278 gimple_seq phi_nodes;
282 }; 279 };
283
284 typedef struct basic_block_def *basic_block;
285 typedef const struct basic_block_def *const_basic_block;
286 280
287 DEF_VEC_P(basic_block); 281 DEF_VEC_P(basic_block);
288 DEF_VEC_ALLOC_P(basic_block,gc); 282 DEF_VEC_ALLOC_P(basic_block,gc);
289 DEF_VEC_ALLOC_P(basic_block,heap); 283 DEF_VEC_ALLOC_P(basic_block,heap);
290 284
363 DOM_NONE, /* Not computed at all. */ 357 DOM_NONE, /* Not computed at all. */
364 DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */ 358 DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */
365 DOM_OK /* Everything is ok. */ 359 DOM_OK /* Everything is ok. */
366 }; 360 };
367 361
362 /* What sort of profiling information we have. */
363 enum profile_status_d
364 {
365 PROFILE_ABSENT,
366 PROFILE_GUESSED,
367 PROFILE_READ
368 };
369
368 /* A structure to group all the per-function control flow graph data. 370 /* A structure to group all the per-function control flow graph data.
369 The x_* prefixing is necessary because otherwise references to the 371 The x_* prefixing is necessary because otherwise references to the
370 fields of this struct are interpreted as the defines for backward 372 fields of this struct are interpreted as the defines for backward
371 source compatibility following the definition of this struct. */ 373 source compatibility following the definition of this struct. */
372 struct control_flow_graph GTY(()) 374 struct GTY(()) control_flow_graph {
373 {
374 /* Block pointers for the exit and entry of a function. 375 /* Block pointers for the exit and entry of a function.
375 These are always the head and tail of the basic block list. */ 376 These are always the head and tail of the basic block list. */
376 basic_block x_entry_block_ptr; 377 basic_block x_entry_block_ptr;
377 basic_block x_exit_block_ptr; 378 basic_block x_exit_block_ptr;
378 379
390 391
391 /* Mapping of labels to their associated blocks. At present 392 /* Mapping of labels to their associated blocks. At present
392 only used for the gimple CFG. */ 393 only used for the gimple CFG. */
393 VEC(basic_block,gc) *x_label_to_block_map; 394 VEC(basic_block,gc) *x_label_to_block_map;
394 395
395 enum profile_status { 396 enum profile_status_d x_profile_status;
396 PROFILE_ABSENT,
397 PROFILE_GUESSED,
398 PROFILE_READ
399 } x_profile_status;
400 397
401 /* Whether the dominators and the postdominators are available. */ 398 /* Whether the dominators and the postdominators are available. */
402 enum dom_state x_dom_computed[2]; 399 enum dom_state x_dom_computed[2];
403 400
404 /* Number of basic blocks in the dominance tree. */ 401 /* Number of basic blocks in the dominance tree. */
464 current insn. */ 461 current insn. */
465 #define FOR_BB_INSNS_SAFE(BB, INSN, CURR) \ 462 #define FOR_BB_INSNS_SAFE(BB, INSN, CURR) \
466 for ((INSN) = BB_HEAD (BB), (CURR) = (INSN) ? NEXT_INSN ((INSN)): NULL; \ 463 for ((INSN) = BB_HEAD (BB), (CURR) = (INSN) ? NEXT_INSN ((INSN)): NULL; \
467 (INSN) && (INSN) != NEXT_INSN (BB_END (BB)); \ 464 (INSN) && (INSN) != NEXT_INSN (BB_END (BB)); \
468 (INSN) = (CURR), (CURR) = (INSN) ? NEXT_INSN ((INSN)) : NULL) 465 (INSN) = (CURR), (CURR) = (INSN) ? NEXT_INSN ((INSN)) : NULL)
469 466
470 #define FOR_BB_INSNS_REVERSE(BB, INSN) \ 467 #define FOR_BB_INSNS_REVERSE(BB, INSN) \
471 for ((INSN) = BB_END (BB); \ 468 for ((INSN) = BB_END (BB); \
472 (INSN) && (INSN) != PREV_INSN (BB_HEAD (BB)); \ 469 (INSN) && (INSN) != PREV_INSN (BB_HEAD (BB)); \
473 (INSN) = PREV_INSN (INSN)) 470 (INSN) = PREV_INSN (INSN))
474 471
492 /* Stuff for recording basic block info. */ 489 /* Stuff for recording basic block info. */
493 490
494 #define BB_HEAD(B) (B)->il.rtl->head_ 491 #define BB_HEAD(B) (B)->il.rtl->head_
495 #define BB_END(B) (B)->il.rtl->end_ 492 #define BB_END(B) (B)->il.rtl->end_
496 493
497 /* Special block numbers [markers] for entry and exit. */ 494 /* Special block numbers [markers] for entry and exit.
495 Neither of them is supposed to hold actual statements. */
498 #define ENTRY_BLOCK (0) 496 #define ENTRY_BLOCK (0)
499 #define EXIT_BLOCK (1) 497 #define EXIT_BLOCK (1)
500 498
501 /* The two blocks that are always in the cfg. */ 499 /* The two blocks that are always in the cfg. */
502 #define NUM_FIXED_BLOCKS (2) 500 #define NUM_FIXED_BLOCKS (2)
510 extern void update_bb_for_insn (basic_block); 508 extern void update_bb_for_insn (basic_block);
511 509
512 extern void insert_insn_on_edge (rtx, edge); 510 extern void insert_insn_on_edge (rtx, edge);
513 basic_block split_edge_and_insert (edge, rtx); 511 basic_block split_edge_and_insert (edge, rtx);
514 512
513 extern void commit_one_edge_insertion (edge e);
515 extern void commit_edge_insertions (void); 514 extern void commit_edge_insertions (void);
516 515
517 extern void remove_fake_edges (void); 516 extern void remove_fake_edges (void);
518 extern void remove_fake_exit_edges (void); 517 extern void remove_fake_exit_edges (void);
519 extern void add_noreturn_fake_exit_edges (void); 518 extern void add_noreturn_fake_exit_edges (void);
856 extern bool edge_probability_reliable_p (const_edge); 855 extern bool edge_probability_reliable_p (const_edge);
857 extern bool br_prob_note_reliable_p (const_rtx); 856 extern bool br_prob_note_reliable_p (const_rtx);
858 extern bool predictable_edge_p (edge); 857 extern bool predictable_edge_p (edge);
859 858
860 /* In cfg.c */ 859 /* In cfg.c */
861 extern void dump_regset (regset, FILE *);
862 extern void debug_regset (regset);
863 extern void init_flow (struct function *); 860 extern void init_flow (struct function *);
864 extern void debug_bb (basic_block); 861 extern void debug_bb (basic_block);
865 extern basic_block debug_bb_n (int); 862 extern basic_block debug_bb_n (int);
866 extern void dump_regset (regset, FILE *); 863 extern void dump_regset (regset, FILE *);
867 extern void debug_regset (regset); 864 extern void debug_regset (regset);
894 extern bool purge_dead_edges (basic_block); 891 extern bool purge_dead_edges (basic_block);
895 892
896 /* In cfgbuild.c. */ 893 /* In cfgbuild.c. */
897 extern void find_many_sub_basic_blocks (sbitmap); 894 extern void find_many_sub_basic_blocks (sbitmap);
898 extern void rtl_make_eh_edge (sbitmap, basic_block, rtx); 895 extern void rtl_make_eh_edge (sbitmap, basic_block, rtx);
899 extern void find_basic_blocks (rtx);
900 896
901 /* In cfgcleanup.c. */ 897 /* In cfgcleanup.c. */
902 extern bool cleanup_cfg (int); 898 extern bool cleanup_cfg (int);
903 extern bool delete_unreachable_blocks (void); 899 extern bool delete_unreachable_blocks (void);
904 900
936 extern bool dominated_by_p (enum cdi_direction, const_basic_block, const_basic_block); 932 extern bool dominated_by_p (enum cdi_direction, const_basic_block, const_basic_block);
937 extern VEC (basic_block, heap) *get_dominated_by (enum cdi_direction, basic_block); 933 extern VEC (basic_block, heap) *get_dominated_by (enum cdi_direction, basic_block);
938 extern VEC (basic_block, heap) *get_dominated_by_region (enum cdi_direction, 934 extern VEC (basic_block, heap) *get_dominated_by_region (enum cdi_direction,
939 basic_block *, 935 basic_block *,
940 unsigned); 936 unsigned);
937 extern VEC (basic_block, heap) *get_all_dominated_blocks (enum cdi_direction,
938 basic_block);
941 extern void add_to_dominance_info (enum cdi_direction, basic_block); 939 extern void add_to_dominance_info (enum cdi_direction, basic_block);
942 extern void delete_from_dominance_info (enum cdi_direction, basic_block); 940 extern void delete_from_dominance_info (enum cdi_direction, basic_block);
943 basic_block recompute_dominator (enum cdi_direction, basic_block); 941 basic_block recompute_dominator (enum cdi_direction, basic_block);
944 extern void redirect_immediate_dominators (enum cdi_direction, basic_block, 942 extern void redirect_immediate_dominators (enum cdi_direction, basic_block,
945 basic_block); 943 basic_block);