basic-block.h (tree_node): Forward declare if needed.
authorDiego Novillo <dnovillo@redhat.com>
Tue, 10 Jul 2001 03:50:25 +0000 (03:50 +0000)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Tue, 10 Jul 2001 03:50:25 +0000 (23:50 -0400)
2001-07-09  Diego Novillo  <dnovillo@redhat.com>

* basic-block.h (tree_node): Forward declare if needed.
(struct basic_block_def): Add fields 'head_tree' and 'end_tree'.
(BLOCK_HEAD_TREE): Define.
(BLOCK_END_TREE): Define.
(struct loops): Rename field 'tree' to 'tree_root'.
* flow.c (entry_exit_blocks): Add initializers for 'head_tree' and
'end_tree'.
(flow_loops_tree_build): Rename reference to field 'tree' to
'tree_root'.
(flow_loops_level_compute): Ditto.
* predict.c (estimate_bb_frequencies): Ditto.
* tree.h (struct tree_common): Add field 'aux'.

From-SVN: r43886

gcc/ChangeLog
gcc/basic-block.h
gcc/flow.c
gcc/predict.c
gcc/tree.h

index ea2c7c6cba0f908facaea42618bffb6252f7dad7..f1379c1a876bb633f9e7d4096d1b633b491ed587 100644 (file)
@@ -1,3 +1,18 @@
+2001-07-09  Diego Novillo  <dnovillo@redhat.com>
+
+       * basic-block.h (tree_node): Forward declare if needed.
+       (struct basic_block_def): Add fields 'head_tree' and 'end_tree'.
+       (BLOCK_HEAD_TREE): Define.
+       (BLOCK_END_TREE): Define.
+       (struct loops): Rename field 'tree' to 'tree_root'.
+       * flow.c (entry_exit_blocks): Add initializers for 'head_tree' and 
+       'end_tree'.
+       (flow_loops_tree_build): Rename reference to field 'tree' to
+       'tree_root'.
+       (flow_loops_level_compute): Ditto.
+       * predict.c (estimate_bb_frequencies): Ditto.
+       * tree.h (struct tree_common): Add field 'aux'.
+
 2001-07-09  Stan Shebs  <shebs@apple.com>
 
        * config/darwin.c (darwin_encode_section_info): Don't mark any
index 256492ebfb2199c46b49aa70e1c15b3e7efe5606..5a2088ece5f59391f1029ad24a830fe500122338 100644 (file)
@@ -26,6 +26,11 @@ Boston, MA 02111-1307, USA.  */
 #include "varray.h"
 #include "partition.h"
 
+#ifndef TREE_CODE
+union tree_node;
+#define tree union tree_node *
+#endif
+
 /* Head of register set linked list.  */
 typedef bitmap_head regset_head;
 /* A pointer to a regset_head.  */
@@ -174,6 +179,10 @@ typedef struct basic_block_def {
   /* The first and last insns of the block.  */
   rtx head, end;
 
+  /* The first and last trees of the block.  */
+  tree head_tree;
+  tree end_tree;
+
   /* The edges into and out of the block.  */
   edge pred, succ;
 
@@ -247,6 +256,9 @@ extern regset regs_live_at_setjmp;
 #define BLOCK_HEAD(B)      (BASIC_BLOCK (B)->head)
 #define BLOCK_END(B)       (BASIC_BLOCK (B)->end)
 
+#define BLOCK_HEAD_TREE(B) (BASIC_BLOCK (B)->head_tree)
+#define BLOCK_END_TREE(B) (BASIC_BLOCK (B)->end_tree)
+
 /* Special block numbers [markers] for entry and exit.  */
 #define ENTRY_BLOCK (-1)
 #define EXIT_BLOCK (-2)
@@ -433,7 +445,7 @@ struct loops
   struct loop *array;
 
   /* Pointer to root of loop heirachy tree.  */
-  struct loop *tree;
+  struct loop *tree_root;
 
   /* Information derived from the CFG.  */
   struct cfg
index fba78dda8f13965fb69b2dc456ecacf6ed137c65..784d21dc7c536913779613121f7f26cabb56f524 100644 (file)
@@ -195,6 +195,8 @@ varray_type basic_block_info;
 struct basic_block_def entry_exit_blocks[2]
 = {{NULL,                      /* head */
     NULL,                      /* end */
+    NULL,                      /* head_tree */
+    NULL,                      /* end_tree */
     NULL,                      /* pred */
     NULL,                      /* succ */
     NULL,                      /* local_set */
@@ -210,6 +212,8 @@ struct basic_block_def entry_exit_blocks[2]
   {
     NULL,                      /* head */
     NULL,                      /* end */
+    NULL,                      /* head_tree */
+    NULL,                      /* end_tree */
     NULL,                      /* pred */
     NULL,                      /* succ */
     NULL,                      /* local_set */
@@ -8718,8 +8722,8 @@ flow_loops_tree_build (loops)
   /* Root the loop hierarchy tree with the first loop found.
      Since we used a depth first search this should be the
      outermost loop.  */
-  loops->tree = &loops->array[0];
-  loops->tree->outer = loops->tree->inner = loops->tree->next = NULL;
+  loops->tree_root = &loops->array[0];
+  loops->tree_root->outer = loops->tree_root->inner = loops->tree_root->next = NULL;
 
   /* Add the remaining loops to the tree.  */
   for (i = 1; i < num_loops; i++)
@@ -8773,7 +8777,7 @@ flow_loops_level_compute (loops)
   int levels = 0;
 
   /* Traverse all the outer level loops.  */
-  for (loop = loops->tree; loop; loop = loop->next)
+  for (loop = loops->tree_root; loop; loop = loop->next)
     {
       level = flow_loop_level_compute (loop, 1);
       if (level > levels)
index 8557313165f79a6bc59292f0fa08cd375a58374b..9fed0c9820c9c049388c373d4ff5fdac028099c4 100644 (file)
@@ -806,7 +806,7 @@ estimate_bb_frequencies (loops)
     }
   /* First compute probabilities locally for each loop from innermost
      to outermost to examine probabilities for back edges.  */
-  estimate_loops_at_level (loops->tree);
+  estimate_loops_at_level (loops->tree_root);
 
   /* Now fake loop around whole function to finalize probabilities.  */
   for (i = 0; i < n_basic_blocks; i++)
index ec7a28746670b0aac0434c591572bd6a6b2db9f2..4becd00ab82560a11207b4583d2f762037260bc0 100644 (file)
@@ -130,6 +130,7 @@ struct tree_common
 {
   union tree_node *chain;
   union tree_node *type;
+  void *aux;
   ENUM_BITFIELD(tree_code) code : 8;
   unsigned side_effects_flag : 1;
   unsigned constant_flag : 1;