This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
tree profile merge: multiple CFGs at a time
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com, stevenb at suse dot de
- Date: Sat, 9 Apr 2005 20:33:25 +0200
- Subject: tree profile merge: multiple CFGs at a time
Hi,
this patch makes it possible to have CFGs available for multiple functions at a
time. This is needed for CFG transparent inlining I would like to proceed on
merging soon. The patch has been originally developed by Stuart, then re-wrote
by Steven and now updated by me ;)
Bootstrapped/regtested i686-pc-gnu-linux with no measurable changes in
bootstrap nor GCC modules test times. OK?
Honza
2005-04-09 Steven Bosscher <stevenb@suse.de>
Stuart Hastings <stuart@apple.com>
Jan Hubicka <jh@suse.cz>
* Makefile.in: Add function.h to BASIC_BLOCK_H. Remove all
references to gt-tree-cfg.h.
* basic-block.h (struct basic_block_def): Don't skip rbi
for garbage collection.
(struct reorder_block_def): Make GTY-able.
(struct control_flow_graph): New structure.
(n_edges, n_basic_blocks, last_basic_block, basic_block_info,
BASIC_BLOCK, EXIT_BLOCK_PTR, ENTRY_BLOCK_PTR): No longer vars,
but instead defines to the control_flow_graph for cfun.
(label_to_block_map): New define, points to the label map of
the control_flow_graph for cfun.
(n_edges_for_function, n_basic_blocks_for_function,
last_basic_block_for_function, basic_block_info_for_function,
EXIT_BLOCK_PTR_FOR_FUNCTION, ENTRY_BLOCK_PTR_FOR_FUNCTION,
basic_block_info_for_function, label_to_block_map_for_function):
Counterparts for the above, taking a struct function as an extra
argument.
(alloc_rbi_pool, free_rbi_pool): Remove prototypes.
* cfg.c: (n_edges, n_basic_blocks, last_basic_block,
basic_block_info, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Remove.
(alloc_rbi_pool, free_rbi_pool): Remove.
(initialize_bb_rbi): Use ggc_alloc_cleared instead of pool_alloc.
* cfglayout.c: (cfg_layout_initialize): Don't allocate the rbi pool here...
(cfg_layout_finalize) ...and don't free it here.
* cfgrtl.c (cfg_layout_delete_block): Zero out rbi so it gets
garbage collected.
* flow.c (free_basic_block_vars): Set label_to_block_map and
n_edges to zero too.
* function.h (struct function): Add cfg field.
* function.c (allocate_struct_function): Allocate the cfg.
* tree-cfg.c (label_to_block_map): Remove.
(build_tree_cfg): Don't allocate the rbi pool here...
(delete_tree_cfg_annotations): ...and don't free it here.
Also don't nullify label_to_block_map for cfun.
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1466
diff -c -3 -p -r1.1466 Makefile.in
*** Makefile.in 9 Apr 2005 01:37:16 -0000 1.1466
--- Makefile.in 9 Apr 2005 16:29:23 -0000
*************** tree-vrp.o : tree-vrp.c $(CONFIG_H) $(SY
*** 1699,1705 ****
tree-cfg.o : tree-cfg.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \
diagnostic.h errors.h function.h $(TIMEVAR_H) $(TM_H) coretypes.h \
! $(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) gt-tree-cfg.h tree-pass.h \
$(CFGLAYOUT_H)
tree-tailcall.o : tree-tailcall.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) function.h $(TM_H) coretypes.h \
--- 1699,1705 ----
tree-cfg.o : tree-cfg.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \
diagnostic.h errors.h function.h $(TIMEVAR_H) $(TM_H) coretypes.h \
! $(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) tree-pass.h \
$(CFGLAYOUT_H)
tree-tailcall.o : tree-tailcall.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) function.h $(TM_H) coretypes.h \
*************** gt-c-pragma.h gtype-c.h gt-cfglayout.h \
*** 2489,2495 ****
gt-tree-mudflap.h gt-tree-complex.h \
gt-tree-eh.h \
gt-tree-ssanames.h gt-tree-iterator.h gt-gimplify.h \
! gt-tree-phinodes.h gt-tree-cfg.h gt-tree-nested.h \
gt-tree-ssa-operands.h gt-tree-ssa-propagate.h \
gt-stringpool.h : s-gtype ; @true
--- 2489,2495 ----
gt-tree-mudflap.h gt-tree-complex.h \
gt-tree-eh.h \
gt-tree-ssanames.h gt-tree-iterator.h gt-gimplify.h \
! gt-tree-phinodes.h gt-tree-nested.h \
gt-tree-ssa-operands.h gt-tree-ssa-propagate.h \
gt-stringpool.h : s-gtype ; @true
Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.247
diff -c -3 -p -r1.247 basic-block.h
*** basic-block.h 9 Apr 2005 01:37:21 -0000 1.247
--- basic-block.h 9 Apr 2005 16:29:23 -0000
*************** Software Foundation, 59 Temple Place - S
*** 30,35 ****
--- 30,36 ----
#include "predict.h"
#include "vec.h"
#include "errors.h"
+ #include "function.h"
/* Head of register set linked list. */
typedef bitmap_head regset_head;
*************** struct basic_block_def GTY((chain_next (
*** 242,248 ****
struct basic_block_def *next_bb;
/* The data used by basic block copying and reordering functions. */
! struct reorder_block_def * GTY ((skip (""))) rbi;
/* Annotations used at the tree level. */
struct bb_ann_d *tree_annotations;
--- 243,249 ----
struct basic_block_def *next_bb;
/* The data used by basic block copying and reordering functions. */
! struct reorder_block_def * rbi;
/* Annotations used at the tree level. */
struct bb_ann_d *tree_annotations;
*************** struct basic_block_def GTY((chain_next (
*** 261,287 ****
/* Various flags. See BB_* below. */
int flags;
};
typedef struct basic_block_def *basic_block;
/* Structure to hold information about the blocks during reordering and
! copying. */
! typedef struct reorder_block_def
{
rtx header;
rtx footer;
basic_block next;
! basic_block original;
! /* Used by loop copying. */
! basic_block copy;
int duplicated;
int copy_number;
! /* These fields are used by bb-reorder pass. */
int visited;
! } *reorder_block_def_p;
#define BB_FREQ_MAX 10000
--- 262,299 ----
/* Various flags. See BB_* below. */
int flags;
+
+ /* Which section block belongs in, when partitioning basic blocks. */
+ int partition;
};
typedef struct basic_block_def *basic_block;
/* Structure to hold information about the blocks during reordering and
! copying. Needs to be put on a diet. */
! struct reorder_block_def GTY(())
{
rtx header;
rtx footer;
+
basic_block next;
!
! /* These pointers may be unreliable as the first is only used for
! debugging (and should probably be removed, and the second is only
! used by copying. The basic blocks pointed to may be removed and
! that leaves these pointers pointing to garbage. */
! basic_block GTY ((skip (""))) original;
! basic_block GTY ((skip (""))) copy;
!
int duplicated;
int copy_number;
! /* This field is used by the bb-reorder and tracer passes. */
int visited;
! };
!
! typedef struct reorder_block_def *reorder_block_def;
#define BB_FREQ_MAX 10000
*************** enum
*** 338,382 ****
#define BB_COPY_PARTITION(dstbb, srcbb) \
BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb))
! /* Number of basic blocks in the current function. */
!
! extern int n_basic_blocks;
!
! /* First free basic block number. */
!
! extern int last_basic_block;
! /* Number of edges in the current function. */
! extern int n_edges;
/* TRUE if we should re-run loop discovery after threading jumps, FALSE
otherwise. */
extern bool rediscover_loops_after_threading;
- /* Signalize the status of profile information in the CFG. */
- extern enum profile_status
- {
- PROFILE_ABSENT,
- PROFILE_GUESSED,
- PROFILE_READ
- } profile_status;
-
- /* Index by basic block number, get basic block struct info. */
-
- extern GTY(()) varray_type basic_block_info;
-
- #define BASIC_BLOCK(N) (VARRAY_BB (basic_block_info, (N)))
-
/* For iterating over basic blocks. */
#define FOR_BB_BETWEEN(BB, FROM, TO, DIR) \
for (BB = FROM; BB != TO; BB = BB->DIR)
! #define FOR_EACH_BB(BB) \
! FOR_BB_BETWEEN (BB, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR, next_bb)
! #define FOR_EACH_BB_REVERSE(BB) \
! FOR_BB_BETWEEN (BB, EXIT_BLOCK_PTR->prev_bb, ENTRY_BLOCK_PTR, prev_bb)
/* For iterating over insns in basic block. */
#define FOR_BB_INSNS(BB, INSN) \
--- 350,430 ----
#define BB_COPY_PARTITION(dstbb, srcbb) \
BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb))
! /* A structure to group all the per-function control flow graph data.
! The x_* prefixing is necessary because otherwise references to the
! fields of this struct are interpreted as the defines for backward
! source compatibility following the definition of this struct. */
! struct control_flow_graph GTY(())
! {
! /* Block pointers for the exit and entry of a function.
! These are always the head and tail of the basic block list. */
! basic_block x_entry_block_ptr;
! basic_block x_exit_block_ptr;
!
! /* Index by basic block number, get basic block struct info. */
! varray_type x_basic_block_info;
!
! /* Number of basic blocks in this flow graph. */
! int x_n_basic_blocks;
!
! /* Number of edges in this flow graph. */
! int x_n_edges;
!
! /* The first free basic block number. */
! int x_last_basic_block;
!
! /* Mapping of labels to their associated blocks. At present
! only used for the tree CFG. */
! varray_type x_label_to_block_map;
!
! enum profile_status {
! PROFILE_ABSENT,
! PROFILE_GUESSED,
! PROFILE_READ
! } x_profile_status;
! };
! /* Defines for accessing the fields of the CFG structure for function FN. */
! #define ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_entry_block_ptr)
! #define EXIT_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_exit_block_ptr)
! #define basic_block_info_for_function(FN) ((FN)->cfg->x_basic_block_info)
! #define n_basic_blocks_for_function(FN) ((FN)->cfg->x_n_basic_blocks)
! #define n_edges_for_function(FN) ((FN)->cfg->x_n_edges)
! #define last_basic_block_for_function(FN) ((FN)->cfg->x_last_basic_block)
! #define label_to_block_map_for_function(FN) ((FN)->cfg->x_label_to_block_map)
!
! #define BASIC_BLOCK_FOR_FUNCTION(FN,N) \
! (VARRAY_BB (basic_block_info_for_function(FN), (N)))
!
! /* Defines for texual backward source compatibility. */
! #define ENTRY_BLOCK_PTR (cfun->cfg->x_entry_block_ptr)
! #define EXIT_BLOCK_PTR (cfun->cfg->x_exit_block_ptr)
! #define basic_block_info (cfun->cfg->x_basic_block_info)
! #define n_basic_blocks (cfun->cfg->x_n_basic_blocks)
! #define n_edges (cfun->cfg->x_n_edges)
! #define last_basic_block (cfun->cfg->x_last_basic_block)
! #define label_to_block_map (cfun->cfg->x_label_to_block_map)
! #define profile_status (cfun->cfg->x_profile_status)
! #define BASIC_BLOCK(N) (VARRAY_BB (basic_block_info, (N)))
/* TRUE if we should re-run loop discovery after threading jumps, FALSE
otherwise. */
extern bool rediscover_loops_after_threading;
/* For iterating over basic blocks. */
#define FOR_BB_BETWEEN(BB, FROM, TO, DIR) \
for (BB = FROM; BB != TO; BB = BB->DIR)
! #define FOR_EACH_BB_FN(BB, FN) \
! FOR_BB_BETWEEN (BB, (FN)->cfg->x_entry_block_ptr->next_bb, (FN)->cfg->x_exit_block_ptr, next_bb)
!
! #define FOR_EACH_BB(BB) FOR_EACH_BB_FN (BB, cfun)
! #define FOR_EACH_BB_REVERSE_FN(BB, FN) \
! FOR_BB_BETWEEN (BB, (FN)->cfg->x_exit_block_ptr->prev_bb, (FN)->cfg->x_entry_block_ptr, prev_bb)
!
! #define FOR_EACH_BB_REVERSE(BB) FOR_EACH_BB_REVERSE_FN(BB, cfun)
/* For iterating over insns in basic block. */
#define FOR_BB_INSNS(BB, INSN) \
*************** extern bitmap_obstack reg_obstack;
*** 425,434 ****
/* Special block number not valid for any block. */
#define INVALID_BLOCK (-3)
- /* Similarly, block pointers for the edge list. */
- extern GTY(()) basic_block ENTRY_BLOCK_PTR;
- extern GTY(()) basic_block EXIT_BLOCK_PTR;
-
#define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0)
#define set_block_for_insn(INSN, BB) (BLOCK_FOR_INSN (INSN) = BB)
--- 473,478 ----
*************** extern void duplicate_computed_gotos (vo
*** 870,878 ****
extern void partition_hot_cold_basic_blocks (void);
/* In cfg.c */
- extern void alloc_rbi_pool (void);
extern void initialize_bb_rbi (basic_block bb);
- extern void free_rbi_pool (void);
/* In dominance.c */
--- 914,920 ----
Index: cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfg.c,v
retrieving revision 1.87
diff -c -3 -p -r1.87 cfg.c
*** cfg.c 3 Apr 2005 09:27:06 -0000 1.87
--- cfg.c 9 Apr 2005 16:29:23 -0000
*************** Software Foundation, 59 Temple Place - S
*** 60,66 ****
#include "except.h"
#include "toplev.h"
#include "tm_p.h"
! #include "alloc-pool.h"
#include "timevar.h"
#include "ggc.h"
--- 60,66 ----
#include "except.h"
#include "toplev.h"
#include "tm_p.h"
! #include "obstack.h"
#include "timevar.h"
#include "ggc.h"
*************** Software Foundation, 59 Temple Place - S
*** 68,100 ****
struct bitmap_obstack reg_obstack;
- /* Number of basic blocks in the current function. */
-
- int n_basic_blocks;
-
- /* First free basic block number. */
-
- int last_basic_block;
-
- /* Number of edges in the current function. */
-
- int n_edges;
-
- /* The basic block array. */
-
- varray_type basic_block_info;
-
- /* The special entry and exit blocks. */
- basic_block ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR;
-
- /* Memory alloc pool for bb member rbi. */
- static alloc_pool rbi_pool;
-
void debug_flow_info (void);
static void free_edge (edge);
-
- /* Indicate the presence of the profile. */
- enum profile_status profile_status;
#define RDIV(X,Y) (((X) + (Y) / 2) / (Y))
--- 68,75 ----
*************** enum profile_status profile_status;
*** 103,113 ****
void
init_flow (void)
{
- n_edges = 0;
! ENTRY_BLOCK_PTR = ggc_alloc_cleared (sizeof (*ENTRY_BLOCK_PTR));
ENTRY_BLOCK_PTR->index = ENTRY_BLOCK;
! EXIT_BLOCK_PTR = ggc_alloc_cleared (sizeof (*EXIT_BLOCK_PTR));
EXIT_BLOCK_PTR->index = EXIT_BLOCK;
ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR;
EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR;
--- 78,87 ----
void
init_flow (void)
{
! ENTRY_BLOCK_PTR = ggc_alloc_cleared (sizeof (struct basic_block_def));
ENTRY_BLOCK_PTR->index = ENTRY_BLOCK;
! EXIT_BLOCK_PTR = ggc_alloc_cleared (sizeof (struct basic_block_def));
EXIT_BLOCK_PTR->index = EXIT_BLOCK;
ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR;
EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR;
*************** alloc_block (void)
*** 158,181 ****
return bb;
}
- /* Create memory pool for rbi_pool. */
-
- void
- alloc_rbi_pool (void)
- {
- rbi_pool = create_alloc_pool ("rbi pool",
- sizeof (struct reorder_block_def),
- n_basic_blocks + 2);
- }
-
- /* Free rbi_pool. */
-
- void
- free_rbi_pool (void)
- {
- free_alloc_pool (rbi_pool);
- }
-
/* Initialize rbi (the structure containing data used by basic block
duplication and reordering) for the given basic block. */
--- 132,137 ----
*************** void
*** 183,190 ****
initialize_bb_rbi (basic_block bb)
{
gcc_assert (!bb->rbi);
! bb->rbi = pool_alloc (rbi_pool);
! memset (bb->rbi, 0, sizeof (struct reorder_block_def));
}
/* Link block B to chain after AFTER. */
--- 139,145 ----
initialize_bb_rbi (basic_block bb)
{
gcc_assert (!bb->rbi);
! bb->rbi = ggc_alloc_cleared (sizeof (struct reorder_block_def));
}
/* Link block B to chain after AFTER. */
Index: cfgcleanup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
retrieving revision 1.143
diff -c -3 -p -r1.143 cfgcleanup.c
*** cfgcleanup.c 31 Mar 2005 14:59:47 -0000 1.143
--- cfgcleanup.c 9 Apr 2005 16:29:23 -0000
*************** try_forward_edges (int mode, basic_block
*** 536,542 ****
For fallthru forwarders, the LOOP_BEG note must appear between
the header of block and CODE_LABEL of the loop, for non forwarders
it must appear before the JUMP_INSN. */
! if ((mode & CLEANUP_PRE_LOOP) && optimize)
{
rtx insn = (EDGE_SUCC (target, 0)->flags & EDGE_FALLTHRU
? BB_HEAD (target) : prev_nonnote_insn (BB_END (target)));
--- 536,542 ----
For fallthru forwarders, the LOOP_BEG note must appear between
the header of block and CODE_LABEL of the loop, for non forwarders
it must appear before the JUMP_INSN. */
! if ((mode & CLEANUP_PRE_LOOP) && optimize && flag_loop_optimize)
{
rtx insn = (EDGE_SUCC (target, 0)->flags & EDGE_FALLTHRU
? BB_HEAD (target) : prev_nonnote_insn (BB_END (target)));
Index: cfglayout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfglayout.c,v
retrieving revision 1.85
diff -c -3 -p -r1.85 cfglayout.c
*** cfglayout.c 9 Apr 2005 16:09:09 -0000 1.85
--- cfglayout.c 9 Apr 2005 16:29:24 -0000
*************** cfg_layout_initialize (unsigned int flag
*** 1097,1106 ****
{
basic_block bb;
- /* Our algorithm depends on fact that there are no dead jumptables
- around the code. */
- alloc_rbi_pool ();
-
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
initialize_bb_rbi (bb);
--- 1097,1102 ----
*************** cfg_layout_finalize (void)
*** 1162,1169 ****
#ifdef ENABLE_CHECKING
verify_insn_chain ();
#endif
-
- free_rbi_pool ();
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
bb->rbi = NULL;
--- 1158,1163 ----
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.166
diff -c -3 -p -r1.166 cfgrtl.c
*** cfgrtl.c 3 Apr 2005 14:09:55 -0000 1.166
--- cfgrtl.c 9 Apr 2005 16:29:25 -0000
*************** cfg_layout_delete_block (basic_block bb)
*** 2652,2657 ****
--- 2652,2660 ----
to = &bb->next_bb->rbi->header;
else
to = &cfg_layout_function_footer;
+
+ bb->rbi = NULL;
+
rtl_delete_block (bb);
if (prev)
Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.624
diff -c -3 -p -r1.624 flow.c
*** flow.c 8 Apr 2005 23:21:07 -0000 1.624
--- flow.c 9 Apr 2005 16:29:25 -0000
*************** free_basic_block_vars (void)
*** 760,765 ****
--- 760,768 ----
}
n_basic_blocks = 0;
last_basic_block = 0;
+ n_edges = 0;
+
+ label_to_block_map = NULL;
ENTRY_BLOCK_PTR->aux = NULL;
ENTRY_BLOCK_PTR->global_live_at_end = NULL;
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.609
diff -c -3 -p -r1.609 function.c
*** function.c 8 Apr 2005 17:09:17 -0000 1.609
--- function.c 9 Apr 2005 16:29:26 -0000
*************** free_after_compilation (struct function
*** 317,322 ****
--- 317,323 ----
f->emit = NULL;
f->varasm = NULL;
f->machine = NULL;
+ f->cfg = NULL;
f->x_avail_temp_slots = NULL;
f->x_used_temp_slots = NULL;
*************** allocate_struct_function (tree fndecl)
*** 3908,3913 ****
--- 3909,3915 ----
tree fntype = fndecl ? TREE_TYPE (fndecl) : NULL_TREE;
cfun = ggc_alloc_cleared (sizeof (struct function));
+ cfun->cfg = ggc_alloc_cleared (sizeof (struct control_flow_graph));
cfun->stack_alignment_needed = STACK_BOUNDARY;
cfun->preferred_stack_boundary = STACK_BOUNDARY;
Index: function.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.h,v
retrieving revision 1.144
diff -c -3 -p -r1.144 function.h
*** function.h 8 Apr 2005 17:12:03 -0000 1.144
--- function.h 9 Apr 2005 16:29:26 -0000
*************** struct function GTY(())
*** 166,171 ****
--- 166,174 ----
struct emit_status *emit;
struct varasm_status *varasm;
+ /* The control flow graph for this function. */
+ struct control_flow_graph *cfg;
+
/* For tree-optimize.c. */
/* Saved tree and arguments during tree optimization. Used later for
Index: passes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/passes.c,v
retrieving revision 2.82
diff -c -3 -p -r2.82 passes.c
*** passes.c 4 Apr 2005 11:53:15 -0000 2.82
--- passes.c 9 Apr 2005 16:29:26 -0000
*************** Software Foundation, 59 Temple Place - S
*** 78,84 ****
#include "opts.h"
#include "coverage.h"
#include "value-prof.h"
- #include "alloc-pool.h"
#include "tree-pass.h"
#include "tree-dump.h"
--- 78,83 ----
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.169
diff -c -3 -p -r2.169 tree-cfg.c
*** tree-cfg.c 9 Apr 2005 16:09:11 -0000 2.169
--- tree-cfg.c 9 Apr 2005 16:29:26 -0000
*************** Boston, MA 02111-1307, USA. */
*** 54,63 ****
/* Initial capacity for the basic block array. */
static const int initial_cfg_capacity = 20;
- /* Mapping of labels to their associated blocks. This can greatly speed up
- building of the CFG in code with lots of gotos. */
- static GTY(()) varray_type label_to_block_map;
-
/* This hash table allows us to efficiently lookup all CASE_LABEL_EXPRs
which use a particular edge. The CASE_LABEL_EXPRs are chained together
via their TREE_CHAIN field, which we clear after we're done with the
--- 54,59 ----
*************** build_tree_cfg (tree *tp)
*** 150,158 ****
/* Register specific tree functions. */
tree_register_cfg_hooks ();
- /* Initialize rbi_pool. */
- alloc_rbi_pool ();
-
/* Initialize the basic block array. */
init_flow ();
profile_status = PROFILE_ABSENT;
--- 146,151 ----
*************** make_switch_expr_edges (basic_block bb)
*** 812,818 ****
/* Return the basic block holding label DEST. */
basic_block
! label_to_block (tree dest)
{
int uid = LABEL_DECL_UID (dest);
--- 805,811 ----
/* Return the basic block holding label DEST. */
basic_block
! label_to_block_fn (struct function *ifun, tree dest)
{
int uid = LABEL_DECL_UID (dest);
*************** label_to_block (tree dest)
*** 828,836 ****
bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
uid = LABEL_DECL_UID (dest);
}
! return VARRAY_BB (label_to_block_map, uid);
}
/* Create edges for a goto statement at block BB. */
static void
--- 821,829 ----
bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
uid = LABEL_DECL_UID (dest);
}
! return VARRAY_BB (ifun->cfg->x_label_to_block_map, uid);
}
/* Create edges for a goto statement at block BB. */
static void
*************** delete_tree_cfg_annotations (void)
*** 2898,2904 ****
free_blocks_annotations ();
label_to_block_map = NULL;
- free_rbi_pool ();
FOR_EACH_BB (bb)
bb->rbi = NULL;
}
--- 2890,2895 ----
*************** struct tree_opt_pass pass_warn_function_
*** 6052,6056 ****
0, /* todo_flags_finish */
0 /* letter */
};
-
- #include "gt-tree-cfg.h"
--- 6043,6045 ----
Index: tree-flow.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-flow.h,v
retrieving revision 2.93
diff -c -3 -p -r2.93 tree-flow.h
*** tree-flow.h 9 Apr 2005 01:37:23 -0000 2.93
--- tree-flow.h 9 Apr 2005 16:29:26 -0000
*************** extern tree *last_stmt_ptr (basic_block)
*** 523,529 ****
extern tree last_and_only_stmt (basic_block);
extern edge find_taken_edge (basic_block, tree);
extern void cfg_remove_useless_stmts (void);
! extern basic_block label_to_block (tree);
extern void bsi_insert_on_edge (edge, tree);
extern basic_block bsi_insert_on_edge_immediate (edge, tree);
extern void bsi_commit_one_edge_insert (edge, basic_block *);
--- 523,530 ----
extern tree last_and_only_stmt (basic_block);
extern edge find_taken_edge (basic_block, tree);
extern void cfg_remove_useless_stmts (void);
! extern basic_block label_to_block_fn (struct function *, tree);
! #define label_to_block(t) (label_to_block_fn (cfun, t))
extern void bsi_insert_on_edge (edge, tree);
extern basic_block bsi_insert_on_edge_immediate (edge, tree);
extern void bsi_commit_one_edge_insert (edge, basic_block *);