This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: remove bb_ann_d's num_preds field
- From: "Ben Elliston" <bje at au1 dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: law at redhat dot com
- Date: 29 Sep 2004 23:54:30 +1000
- Subject: PATCH: remove bb_ann_d's num_preds field
As Jeff Law suggested, this patch removes the num_preds field from the
bb_ann_d structure, saving one integer (about a 16% saving) per
annotation instance.
Tested with a bootstrap and regression testsuite run. Okay for
mainline?
Ben
2004-09-29 Ben Elliston <bje@au.ibm.com>
* tree-flow.h (struct bb_ann_d): Remove num_preds member.
* tree-into-ssa.c (rewrite_into_ssa): Don't set it.
(rewrite_ssa_into_ssa): Likewise.
* tree-phinodes.c (create_phi_node): Access the number of
predecessor edges using EDGE_COUNT() and not num_preds.
Index: tree-flow.h
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/tree-flow.h,v
retrieving revision 2.49
diff -u -p -r2.49 tree-flow.h
--- tree-flow.h 29 Sep 2004 02:50:45 -0000 2.49
+++ tree-flow.h 29 Sep 2004 13:14:42 -0000
@@ -342,10 +342,6 @@ struct bb_ann_d GTY(())
/* Chain of PHI nodes for this block. */
tree phi_nodes;
- /* Number of predecessors for this block. This is only valid during
- SSA rewriting. It is not maintained after conversion into SSA form. */
- int num_preds;
-
/* Nonzero if this block is forwardable during cfg cleanups. This is also
used to detect loops during cfg cleanups. */
unsigned forwardable: 1;
Index: tree-into-ssa.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/tree-into-ssa.c,v
retrieving revision 2.23
diff -u -p -r2.23 tree-into-ssa.c
--- tree-into-ssa.c 28 Sep 2004 07:59:51 -0000 2.23
+++ tree-into-ssa.c 29 Sep 2004 13:14:43 -0000
@@ -1450,10 +1450,7 @@ rewrite_into_ssa (bool all)
can save significant time during PHI insertion for large graphs. */
dfs = (bitmap *) xmalloc (last_basic_block * sizeof (bitmap *));
FOR_EACH_BB (bb)
- {
- bb_ann (bb)->num_preds = EDGE_COUNT (bb->preds);
- dfs[bb->index] = BITMAP_XMALLOC ();
- }
+ dfs[bb->index] = BITMAP_XMALLOC ();
for (i = 0; i < num_referenced_vars; i++)
set_current_def (referenced_var (i), NULL_TREE);
@@ -1579,10 +1576,7 @@ rewrite_ssa_into_ssa (void)
can save significant time during PHI insertion for large graphs. */
dfs = (bitmap *) xmalloc (last_basic_block * sizeof (bitmap *));
FOR_EACH_BB (bb)
- {
- bb_ann (bb)->num_preds = EDGE_COUNT (bb->preds);
- dfs[bb->index] = BITMAP_XMALLOC ();
- }
+ dfs[bb->index] = BITMAP_XMALLOC ();
/* Ensure that the dominance information is OK. */
calculate_dominance_info (CDI_DOMINATORS);
Index: tree-phinodes.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/tree-phinodes.c,v
retrieving revision 2.8
diff -u -p -r2.8 tree-phinodes.c
--- tree-phinodes.c 9 Sep 2004 07:54:08 -0000 2.8
+++ tree-phinodes.c 29 Sep 2004 13:14:43 -0000
@@ -291,7 +291,7 @@ create_phi_node (tree var, basic_block b
{
tree phi;
- phi = make_phi_node (var, bb_ann (bb)->num_preds);
+ phi = make_phi_node (var, EDGE_COUNT (bb->preds));
/* This is a new phi node, so note that is has not yet been
rewritten. */