OSDN Git Service

2005-06-10 Daniel Berlin <dberlin@dberlin.org>
[pf3gnuchains/gcc-fork.git] / gcc / basic-block.h
index 6f29513..2979e01 100644 (file)
@@ -29,7 +29,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "hard-reg-set.h"
 #include "predict.h"
 #include "vec.h"
-#include "errors.h"
 #include "function.h"
 
 /* Head of register set linked list.  */
@@ -183,7 +182,7 @@ struct loop;
 struct loops;
 
 /* Declared in tree-flow.h.  */
-struct bb_ann_d;
+struct edge_prediction;
 
 /* A basic block is a sequence of instructions with only entry and
    only one exit.  If any one of the instructions are executed, they
@@ -246,8 +245,11 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_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;
+  /* Chain of PHI nodes for this block.  */
+  tree phi_nodes;
+
+  /* A list of predictions.  */
+  struct edge_prediction *predictions;
 
   /* Expected number of executions: calculated in profile.c.  */
   gcov_type count;
@@ -263,9 +265,6 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")
 
   /* 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;
@@ -444,9 +443,8 @@ extern bool rediscover_loops_after_threading;
 #define FOR_ALL_BB(BB) \
   for (BB = ENTRY_BLOCK_PTR; BB; BB = BB->next_bb)
 
-/* Special labels found during CFG build.  */
-
-extern GTY(()) rtx label_value_list;
+#define FOR_ALL_BB_FN(BB, FN) \
+  for (BB = ENTRY_BLOCK_PTR_FOR_FUNCTION (FN); BB; BB = BB->next_bb)
 
 extern bitmap_obstack reg_obstack;
 
@@ -552,6 +550,9 @@ struct edge_list
   edge *index_to_edge;
 };
 
+/* The base value for branch probability notes and edge probabilities.  */
+#define REG_BR_PROB_BASE  10000
+
 /* This is the value which indicates no edge is present.  */
 #define EDGE_INDEX_NO_EDGE     -1
 
@@ -736,6 +737,25 @@ ei_safe_edge (edge_iterator i)
   return !ei_end_p (i) ? ei_edge (i) : NULL;
 }
 
+/* Return 1 if we should continue to iterate.  Return 0 otherwise.
+   *Edge P is set to the next edge if we are to continue to iterate
+   and NULL otherwise.  */
+
+static inline bool
+ei_cond (edge_iterator ei, edge *p)
+{
+  if (!ei_end_p (ei))
+    {
+      *p = ei_edge (ei);
+      return 1;
+    }
+  else
+    {
+      *p = NULL;
+      return 0;
+    }
+}
+
 /* This macro serves as a convenient way to iterate each edge in a
    vector of predecessor or successor edges.  It must not be used when
    an element might be removed during the traversal, otherwise
@@ -751,9 +771,9 @@ ei_safe_edge (edge_iterator i)
      }
 */
 
-#define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC) \
-  for ((EDGE) = NULL, (ITER) = ei_start ((EDGE_VEC)); \
-       ((EDGE) = ei_safe_edge ((ITER))); \
+#define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC)      \
+  for ((ITER) = ei_start ((EDGE_VEC));         \
+       ei_cond ((ITER), &(EDGE));              \
        ei_next (&(ITER)))
 
 struct edge_list * create_edge_list (void);
@@ -784,6 +804,8 @@ enum update_life_extent
 #define PROP_SCAN_DEAD_STORES  128     /* Scan for dead code.  */
 #define PROP_ASM_SCAN          256     /* Internal flag used within flow.c
                                           to flag analysis of asms.  */
+#define PROP_DEAD_INSN         1024    /* Internal flag used within flow.c
+                                          to flag analysis of dead insn.  */
 #define PROP_FINAL             (PROP_DEATH_NOTES | PROP_LOG_LINKS  \
                                 | PROP_REG_INFO | PROP_KILL_DEAD_CODE  \
                                 | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \
@@ -843,6 +865,7 @@ extern void tree_predict_edge (edge, enum br_predictor, int);
 extern void rtl_predict_edge (edge, enum br_predictor, int);
 extern void predict_edge_def (edge, enum br_predictor, enum prediction);
 extern void guess_outgoing_edge_probabilities (basic_block);
+extern void remove_predictions_associated_with_edge (edge);
 
 /* In flow.c */
 extern void init_flow (void);