OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / df.h
index be37fa4..01a4d10 100644 (file)
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -1,7 +1,7 @@
 /* Form lists of pseudo register references for autoinc optimization
    for GNU compiler.  This is part of flow optimization.
-   Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008,
+   2009, 2010  Free Software Foundation, Inc.
    Originally contributed by Michael P. Hayes
              (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
    Major rewrite contributed by Danny Berlin (dberlin@dberlin.org)
@@ -27,12 +27,14 @@ along with GCC; see the file COPYING3.  If not see
 #define GCC_DF_H
 
 #include "bitmap.h"
+#include "regset.h"
+#include "sbitmap.h"
 #include "basic-block.h"
 #include "alloc-pool.h"
 #include "timevar.h"
 
 struct dataflow;
-struct df;
+struct df_d;
 struct df_problem;
 struct df_link;
 struct df_insn_info;
@@ -220,10 +222,12 @@ typedef void (*df_dataflow_function) (struct dataflow *, bitmap, int *, int);
 /* Confluence operator for blocks with 0 out (or in) edges.  */
 typedef void (*df_confluence_function_0) (basic_block);
 
-/* Confluence operator for blocks with 1 or more out (or in) edges.  */
-typedef void (*df_confluence_function_n) (edge);
+/* Confluence operator for blocks with 1 or more out (or in) edges.
+   Return true if BB input data has changed.  */
+typedef bool (*df_confluence_function_n) (edge);
 
-/* Transfer function for blocks.  */
+/* Transfer function for blocks. 
+   Return true if BB output data has changed.  */
 typedef bool (*df_transfer_function) (int);
 
 /* Function to massage the information after the problem solving.  */
@@ -275,6 +279,7 @@ struct df_problem {
   df_verify_solution_start verify_start_fun;
   df_verify_solution_end verify_end_fun;
   struct df_problem *dependent_problem;
+  unsigned int block_info_elt_size;
 
   /* The timevar id associated with this pass.  */
   timevar_id_t tv_id;
@@ -292,7 +297,7 @@ struct dataflow
 
   /* Array indexed by bb->index, that contains basic block problem and
      solution specific information.  */
-  void **block_info;
+  void *block_info;
   unsigned int block_info_size;
 
   /* The pool to allocate the block_info from. */
@@ -362,6 +367,7 @@ struct df_base_ref
   ENUM_BITFIELD(df_ref_type) type : 8;
                                /* Type of ref.  */
   int flags : 16;              /* Various df_ref_flags.  */
+  unsigned int regno;          /* The register number referenced.  */
   rtx reg;                     /* The register referenced.  */
   struct df_link *chain;       /* Head of def-use, use-def.  */
   /* Pointer to the insn info of the containing instruction.  FIXME!
@@ -373,7 +379,6 @@ struct df_base_ref
      themselves rather than using an external structure.  */
   union df_ref_d *next_reg;     /* Next ref with same regno and type.  */
   union df_ref_d *prev_reg;     /* Prev ref with same regno and type.  */
-  unsigned int regno;          /* The register number referenced.  */
   /* Location in the ref table.  This is only valid after a call to
      df_maybe_reorganize_[use,def]_refs which is an expensive operation.  */
   int id;
@@ -522,7 +527,7 @@ struct df_reg_info
    used by owners of the problem.
 ----------------------------------------------------------------------------*/
 
-struct df
+struct df_d
 {
 
   /* The set of problems to be solved is stored in two arrays.  In
@@ -562,22 +567,22 @@ struct df
 
   int num_problems_defined;
 
-  bitmap hardware_regs_used;     /* The set of hardware registers used.  */
+  bitmap_head hardware_regs_used;     /* The set of hardware registers used.  */
   /* The set of hard regs that are in the artificial uses at the end
      of a regular basic block.  */
-  bitmap regular_block_artificial_uses;
+  bitmap_head regular_block_artificial_uses;
   /* The set of hard regs that are in the artificial uses at the end
      of a basic block that has an EH pred.  */
-  bitmap eh_block_artificial_uses;
+  bitmap_head eh_block_artificial_uses;
   /* The set of hardware registers live on entry to the function.  */
   bitmap entry_block_defs;
   bitmap exit_block_uses;        /* The set of hardware registers used in exit block.  */
 
   /* Insns to delete, rescan or reprocess the notes at next
      df_rescan_all or df_process_deferred_rescans. */
-  bitmap insns_to_delete;
-  bitmap insns_to_rescan;
-  bitmap insns_to_notes_rescan;
+  bitmap_head insns_to_delete;
+  bitmap_head insns_to_rescan;
+  bitmap_head insns_to_notes_rescan;
   int *postorder;                /* The current set of basic blocks
                                     in reverse postorder.  */
   int *postorder_inverted;       /* The current set of basic blocks
@@ -624,20 +629,20 @@ struct df
 
 /* Most transformations that wish to use live register analysis will
    use these macros.  This info is the and of the lr and live sets.  */
-#define DF_LIVE_IN(BB) (DF_LIVE_BB_INFO(BB)->in)
-#define DF_LIVE_OUT(BB) (DF_LIVE_BB_INFO(BB)->out)
+#define DF_LIVE_IN(BB) (&DF_LIVE_BB_INFO(BB)->in)
+#define DF_LIVE_OUT(BB) (&DF_LIVE_BB_INFO(BB)->out)
 
 /* These macros are used by passes that are not tolerant of
    uninitialized variables.  This intolerance should eventually
    be fixed.  */
-#define DF_LR_IN(BB) (DF_LR_BB_INFO(BB)->in)
-#define DF_LR_OUT(BB) (DF_LR_BB_INFO(BB)->out)
+#define DF_LR_IN(BB) (&DF_LR_BB_INFO(BB)->in)
+#define DF_LR_OUT(BB) (&DF_LR_BB_INFO(BB)->out)
 
 /* These macros are used by passes that are not tolerant of
    uninitialized variables.  This intolerance should eventually
    be fixed.  */
-#define DF_BYTE_LR_IN(BB) (DF_BYTE_LR_BB_INFO(BB)->in)
-#define DF_BYTE_LR_OUT(BB) (DF_BYTE_LR_BB_INFO(BB)->out)
+#define DF_BYTE_LR_IN(BB) (&DF_BYTE_LR_BB_INFO(BB)->in)
+#define DF_BYTE_LR_OUT(BB) (&DF_BYTE_LR_BB_INFO(BB)->out)
 
 /* Macros to access the elements within the ref structure.  */
 
@@ -794,13 +799,13 @@ struct df_scan_bb_info
 struct df_rd_bb_info
 {
   /* Local sets to describe the basic blocks.   */
-  bitmap kill;
-  bitmap sparse_kill;
-  bitmap gen;   /* The set of defs generated in this block.  */
+  bitmap_head kill;
+  bitmap_head sparse_kill;
+  bitmap_head gen;   /* The set of defs generated in this block.  */
 
   /* The results of the dataflow problem.  */
-  bitmap in;    /* At the top of the block.  */
-  bitmap out;   /* At the bottom of the block.  */
+  bitmap_head in;    /* At the top of the block.  */
+  bitmap_head out;   /* At the bottom of the block.  */
 };
 
 
@@ -810,13 +815,13 @@ struct df_rd_bb_info
 struct df_md_bb_info
 {
   /* Local sets to describe the basic blocks.  */
-  bitmap gen;    /* Partial/conditional definitions live at BB out.  */
-  bitmap kill;   /* Other definitions that are live at BB out.  */
-  bitmap init;   /* Definitions coming from dominance frontier edges. */
+  bitmap_head gen;    /* Partial/conditional definitions live at BB out.  */
+  bitmap_head kill;   /* Other definitions that are live at BB out.  */
+  bitmap_head init;   /* Definitions coming from dominance frontier edges. */
 
   /* The results of the dataflow problem.  */
-  bitmap in;    /* Just before the block itself. */
-  bitmap out;   /* At the bottom of the block.  */
+  bitmap_head in;    /* Just before the block itself. */
+  bitmap_head out;   /* At the bottom of the block.  */
 };
 
 
@@ -826,13 +831,13 @@ struct df_md_bb_info
 struct df_lr_bb_info
 {
   /* Local sets to describe the basic blocks.  */
-  bitmap def;   /* The set of registers set in this block
-                   - except artificial defs at the top.  */
-  bitmap use;   /* The set of registers used in this block.  */
+  bitmap_head def;   /* The set of registers set in this block
+                        - except artificial defs at the top.  */
+  bitmap_head use;   /* The set of registers used in this block.  */
 
   /* The results of the dataflow problem.  */
-  bitmap in;    /* Just before the block itself. */
-  bitmap out;   /* At the bottom of the block.  */
+  bitmap_head in;    /* Just before the block itself. */
+  bitmap_head out;   /* At the bottom of the block.  */
 };
 
 
@@ -843,13 +848,13 @@ struct df_lr_bb_info
 struct df_live_bb_info
 {
   /* Local sets to describe the basic blocks.  */
-  bitmap kill;  /* The set of registers unset in this block.  Calls,
-                  for instance, unset registers.  */
-  bitmap gen;   /* The set of registers set in this block.  */
+  bitmap_head kill;  /* The set of registers unset in this block.  Calls,
+                       for instance, unset registers.  */
+  bitmap_head gen;   /* The set of registers set in this block.  */
 
   /* The results of the dataflow problem.  */
-  bitmap in;    /* At the top of the block.  */
-  bitmap out;   /* At the bottom of the block.  */
+  bitmap_head in;    /* At the top of the block.  */
+  bitmap_head out;   /* At the bottom of the block.  */
 };
 
 
@@ -859,20 +864,20 @@ indexed by the df_byte_lr_offset array which is indexed by pseudo.  */
 struct df_byte_lr_bb_info
 {
   /* Local sets to describe the basic blocks.  */
-  bitmap def;   /* The set of registers set in this block
-                   - except artificial defs at the top.  */
-  bitmap use;   /* The set of registers used in this block.  */
+  bitmap_head def;   /* The set of registers set in this block
+                        - except artificial defs at the top.  */
+  bitmap_head use;   /* The set of registers used in this block.  */
 
   /* The results of the dataflow problem.  */
-  bitmap in;    /* Just before the block itself. */
-  bitmap out;   /* At the bottom of the block.  */
+  bitmap_head in;    /* Just before the block itself. */
+  bitmap_head out;   /* At the bottom of the block.  */
 };
 
 
 /* This is used for debugging and for the dumpers to find the latest
    instance so that the df info can be added to the dumps.  This
    should not be used by regular code.  */
-extern struct df *df;
+extern struct df_d *df;
 #define df_scan    (df->problems_by_index[DF_SCAN])
 #define df_rd      (df->problems_by_index[DF_RD])
 #define df_lr      (df->problems_by_index[DF_LR])
@@ -912,6 +917,7 @@ extern void df_simple_dataflow (enum df_flow_dir, df_init_function,
 extern void df_mark_solutions_dirty (void);
 extern bool df_get_bb_dirty (basic_block);
 extern void df_set_bb_dirty (basic_block);
+extern void df_set_bb_dirty_nonlr (basic_block);
 extern void df_compact_blocks (void);
 extern void df_bb_replace (int, basic_block);
 extern void df_bb_delete (int);
@@ -977,6 +983,7 @@ extern void df_note_add_problem (void);
 extern void df_md_add_problem (void);
 extern void df_md_simulate_artificial_defs_at_top (basic_block, bitmap);
 extern void df_md_simulate_one_insn (basic_block, rtx, bitmap);
+extern void df_simulate_find_noclobber_defs (rtx, bitmap);
 extern void df_simulate_find_defs (rtx, bitmap);
 extern void df_simulate_defs (rtx, bitmap);
 extern void df_simulate_uses (rtx, bitmap);
@@ -1033,7 +1040,7 @@ static inline struct df_scan_bb_info *
 df_scan_get_bb_info (unsigned int index)
 {
   if (index < df_scan->block_info_size)
-    return (struct df_scan_bb_info *) df_scan->block_info[index];
+    return &((struct df_scan_bb_info *) df_scan->block_info)[index];
   else
     return NULL;
 }
@@ -1042,7 +1049,7 @@ static inline struct df_rd_bb_info *
 df_rd_get_bb_info (unsigned int index)
 {
   if (index < df_rd->block_info_size)
-    return (struct df_rd_bb_info *) df_rd->block_info[index];
+    return &((struct df_rd_bb_info *) df_rd->block_info)[index];
   else
     return NULL;
 }
@@ -1051,7 +1058,7 @@ static inline struct df_lr_bb_info *
 df_lr_get_bb_info (unsigned int index)
 {
   if (index < df_lr->block_info_size)
-    return (struct df_lr_bb_info *) df_lr->block_info[index];
+    return &((struct df_lr_bb_info *) df_lr->block_info)[index];
   else
     return NULL;
 }
@@ -1060,7 +1067,7 @@ static inline struct df_md_bb_info *
 df_md_get_bb_info (unsigned int index)
 {
   if (index < df_md->block_info_size)
-    return (struct df_md_bb_info *) df_md->block_info[index];
+    return &((struct df_md_bb_info *) df_md->block_info)[index];
   else
     return NULL;
 }
@@ -1069,7 +1076,7 @@ static inline struct df_live_bb_info *
 df_live_get_bb_info (unsigned int index)
 {
   if (index < df_live->block_info_size)
-    return (struct df_live_bb_info *) df_live->block_info[index];
+    return &((struct df_live_bb_info *) df_live->block_info)[index];
   else
     return NULL;
 }
@@ -1078,7 +1085,7 @@ static inline struct df_byte_lr_bb_info *
 df_byte_lr_get_bb_info (unsigned int index)
 {
   if (index < df_byte_lr->block_info_size)
-    return (struct df_byte_lr_bb_info *) df_byte_lr->block_info[index];
+    return &((struct df_byte_lr_bb_info *) df_byte_lr->block_info)[index];
   else
     return NULL;
 }
@@ -1115,8 +1122,8 @@ struct web_entry
 
 extern struct web_entry *unionfind_root (struct web_entry *);
 extern bool unionfind_union (struct web_entry *, struct web_entry *);
-extern void union_defs (df_ref,
-                        struct web_entry *, struct web_entry *,
+extern void union_defs (df_ref, struct web_entry *,
+                       unsigned int *used, struct web_entry *,
                        bool (*fun) (struct web_entry *, struct web_entry *));
 
 #endif /* GCC_DF_H */