OSDN Git Service

* basic-block.h: Give the BB flags enum a name, bb_flags.
[pf3gnuchains/gcc-fork.git] / gcc / basic-block.h
index baca9d7..790b27b 100644 (file)
@@ -16,8 +16,8 @@ for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 #ifndef GCC_BASIC_BLOCK_H
 #define GCC_BASIC_BLOCK_H
@@ -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,8 @@ struct loop;
 struct loops;
 
 /* Declared in tree-flow.h.  */
-struct bb_ann_d;
+struct edge_prediction;
+struct rtl_bb_info;
 
 /* A basic block is a sequence of instructions with only entry and
    only one exit.  If any one of the instructions are executed, they
@@ -213,10 +213,6 @@ struct bb_ann_d;
 /* Basic block information indexed by block number.  */
 struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")))
 {
-  /* The first and last insns of the block.  */
-  rtx head_;
-  rtx end_;
-
   /* Pointers to the first and last trees of the block.  */
   tree stmt_list;
 
@@ -224,12 +220,6 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")
   VEC(edge,gc) *preds;
   VEC(edge,gc) *succs;
 
-  /* The registers that are live on entry to this block.  */
-  bitmap GTY ((skip (""))) global_live_at_start;
-
-  /* The registers that are live on exit from this block.  */
-  bitmap GTY ((skip (""))) global_live_at_end;
-
   /* Auxiliary info specific to a pass.  */
   PTR GTY ((skip (""))) aux;
 
@@ -243,11 +233,15 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")
   struct basic_block_def *prev_bb;
   struct basic_block_def *next_bb;
 
-  /* The data used by basic block copying and reordering functions.  */
-  struct reorder_block_def * rbi;
+  union basic_block_il_dependent {
+      struct rtl_bb_info * GTY ((tag ("1"))) rtl;
+    } GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il;
+
+  /* Chain of PHI nodes for this block.  */
+  tree phi_nodes;
 
-  /* Annotations used at the tree level.  */
-  struct bb_ann_d *tree_annotations;
+  /* A list of predictions.  */
+  struct edge_prediction *predictions;
 
   /* Expected number of executions: calculated in profile.c.  */
   gcov_type count;
@@ -263,38 +257,30 @@ 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;
-
-/* Structure to hold information about the blocks during reordering and
-   copying.  Needs to be put on a diet.  */
-
-struct reorder_block_def GTY(())
+struct rtl_bb_info GTY(())
 {
-  rtx header;
-  rtx footer;
+  /* The first and last insns of the block.  */
+  rtx head_;
+  rtx end_;
 
-  basic_block next;
+  /* The registers that are live on entry to this block.  */
+  bitmap GTY ((skip (""))) global_live_at_start;
 
-  /* 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;
+  /* The registers that are live on exit from this block.  */
+  bitmap GTY ((skip (""))) global_live_at_end;
 
-  int duplicated;
-  int copy_number;
+  /* In CFGlayout mode points to insn notes/jumptables to be placed just before
+     and after the block.   */
+  rtx header;
+  rtx footer;
 
   /* This field is used by the bb-reorder and tracer passes.  */
   int visited;
 };
 
-typedef struct reorder_block_def *reorder_block_def;
+typedef struct basic_block_def *basic_block;
 
 #define BB_FREQ_MAX 10000
 
@@ -306,7 +292,7 @@ typedef struct reorder_block_def *reorder_block_def;
    All other flags may be cleared by clear_bb_flags().  It is generally
    a bad idea to rely on any flags being up-to-date.  */
 
-enum
+enum bb_flags
 {
 
   /* Set if insns in BB have are modified.  Used for updating liveness info.  */
@@ -333,7 +319,21 @@ enum
   BB_HOT_PARTITION = 64,
 
   /* Set on blocks that should be put in a cold section.  */
-  BB_COLD_PARTITION = 128
+  BB_COLD_PARTITION = 128,
+
+  /* Set on block that was duplicated.  */
+  BB_DUPLICATED = 256,
+
+  /* Set on blocks that are in RTL format.  */
+  BB_RTL = 1024,
+
+  /* Set on blocks that are forwarder blocks.
+     Only used in cfgcleanup.c.  */
+  BB_FORWARDER_BLOCK = 2048,
+
+  /* Set on blocks that cannot be threaded through.
+     Only used in cfgcleanup.c.  */
+  BB_NONTHREADABLE_BLOCK = 4096
 };
 
 /* Dummy flag for convenience in the hot/cold partitioning code.  */
@@ -444,9 +444,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;
 
@@ -464,8 +463,8 @@ extern bitmap_obstack reg_obstack;
 \f
 /* Stuff for recording basic block info.  */
 
-#define BB_HEAD(B)      (B)->head_
-#define BB_END(B)       (B)->end_
+#define BB_HEAD(B)      (B)->il.rtl->head_
+#define BB_END(B)       (B)->il.rtl->end_
 
 /* Special block numbers [markers] for entry and exit.  */
 #define ENTRY_BLOCK (-1)
@@ -552,6 +551,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
 
@@ -803,6 +805,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 \
@@ -862,6 +866,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);
@@ -929,12 +934,8 @@ extern bool control_flow_insn_p (rtx);
 
 /* In bb-reorder.c */
 extern void reorder_basic_blocks (unsigned int);
-extern void duplicate_computed_gotos (void);
 extern void partition_hot_cold_basic_blocks (void);
 
-/* In cfg.c */
-extern void initialize_bb_rbi (basic_block bb);
-
 /* In dominance.c */
 
 enum cdi_direction
@@ -979,6 +980,14 @@ extern edge try_redirect_by_replacing_jump (edge, basic_block, bool);
 extern void break_superblocks (void);
 extern void check_bb_profile (basic_block, FILE *);
 extern void update_bb_profile_for_threading (basic_block, int, gcov_type, edge);
+extern void init_rtl_bb_info (basic_block);
+
+extern void initialize_original_copy_tables (void);
+extern void free_original_copy_tables (void);
+extern void set_bb_original (basic_block, basic_block);
+extern basic_block get_bb_original (basic_block);
+extern void set_bb_copy (basic_block, basic_block);
+extern basic_block get_bb_copy (basic_block);
 
 #include "cfghooks.h"