OSDN Git Service

Minor reformatting.
[pf3gnuchains/gcc-fork.git] / gcc / ira-int.h
index 0b2e928..6e66cc4 100644 (file)
@@ -1,5 +1,5 @@
 /* Integrated Register Allocator (IRA) intercommunication header file.
-   Copyright (C) 2006, 2007, 2008
+   Copyright (C) 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
    Contributed by Vladimir Makarov <vmakarov@redhat.com>.
 
@@ -33,7 +33,9 @@ along with GCC; see the file COPYING3.  If not see
 #ifdef ENABLE_IRA_CHECKING
 #define ira_assert(c) gcc_assert (c)
 #else
-#define ira_assert(c)
+/* Always define and include C, so that warnings for empty body in an
+  ‘if’ statement and unused variable do not occur.  */
+#define ira_assert(c) ((void)(0 && (c)))
 #endif
 
 /* Compute register frequency from edge frequency FREQ.  It is
@@ -98,6 +100,10 @@ struct ira_loop_tree_node
   /* All the following members are defined only for nodes representing
      loops.  */
 
+  /* True if the loop was marked for removal from the register
+     allocation.  */
+  bool to_remove_p;
+
   /* Allocnos in the loop corresponding to their regnos.  If it is
      NULL the loop does not form a separate register allocation region
      (e.g. because it has abnormal enter/exit edges and we can not put
@@ -107,6 +113,11 @@ struct ira_loop_tree_node
      one cap with the same regno in a region).  */
   ira_allocno_t *regno_allocno_map;
 
+  /* True if there is an entry to given loop not from its parent (or
+     grandparent) basic block.  For example, it is possible for two
+     adjacent loops inside another loop.  */
+  bool entered_from_non_parent_p;
+
   /* Maximal register pressure inside loop for given register class
      (defined only for the cover classes).  */
   int reg_pressure[N_REG_CLASSES];
@@ -229,8 +240,6 @@ struct ira_allocno
   /* Mode of the allocno which is the mode of the corresponding
      pseudo-register.  */
   enum machine_mode mode;
-  /* Final rtx representation of the allocno.  */
-  rtx reg;
   /* Hard register assigned to given allocno.  Negative value means
      that memory was allocated to the allocno.  During the reload,
      spilled allocno has value equal to the corresponding stack slot
@@ -238,6 +247,8 @@ struct ira_allocno
      reload (at this point pseudo-register has only one allocno) which
      did not get stack slot yet.  */
   int hard_regno;
+  /* Final rtx representation of the allocno.  */
+  rtx reg;
   /* Allocnos with the same regno are linked by the following member.
      Allocnos corresponding to inner loops are first in the list (it
      corresponds to depth-first traverse of the loops).  */
@@ -301,33 +312,29 @@ struct ira_allocno
      correspondingly minimal and maximal conflict ids of allocnos with
      which given allocno can conflict.  */
   int min, max;
-  /* The unique member value represents given allocno in conflict bit
-     vectors.  */
-  int conflict_id;
   /* Vector of accumulated conflicting allocnos with NULL end marker
      (if CONFLICT_VEC_P is true) or conflict bit vector otherwise.
      Only allocnos with the same cover class are in the vector or in
      the bit vector.  */
   void *conflict_allocno_array;
+  /* The unique member value represents given allocno in conflict bit
+     vectors.  */
+  int conflict_id;
   /* Allocated size of the previous array.  */
   unsigned int conflict_allocno_array_size;
-  /* Number of accumulated conflicts in the vector of conflicting
-     allocnos.  */
-  int conflict_allocnos_num;
   /* Initial and accumulated hard registers conflicting with this
      allocno and as a consequences can not be assigned to the allocno.
      All non-allocatable hard regs and hard regs of cover classes
      different from given allocno one are included in the sets.  */
   HARD_REG_SET conflict_hard_regs, total_conflict_hard_regs;
+  /* Number of accumulated conflicts in the vector of conflicting
+     allocnos.  */
+  int conflict_allocnos_num;
   /* Accumulated frequency of calls which given allocno
      intersects.  */
   int call_freq;
-  /* Length of the previous array (number of the intersected calls).  */
+  /* Accumulated number of the intersected calls.  */
   int calls_crossed_num;
-  /* Non NULL if we remove restoring value from given allocno to
-     MEM_OPTIMIZED_DEST at loop exit (see ira-emit.c) because the
-     allocno value is not changed inside the loop.  */
-  ira_allocno_t mem_optimized_dest;
   /* TRUE if the allocno assigned to memory was a destination of
      removed move (see ira-emit.c) at loop exit because the value of
      the corresponding pseudo-register is not changed inside the
@@ -372,6 +379,10 @@ struct ira_allocno
      vector where a bit with given index represents allocno with the
      same number.  */
   unsigned int conflict_vec_p : 1;
+  /* Non NULL if we remove restoring value from given allocno to
+     MEM_OPTIMIZED_DEST at loop exit (see ira-emit.c) because the
+     allocno value is not changed inside the loop.  */
+  ira_allocno_t mem_optimized_dest;
   /* Array of usage costs (accumulated and the one updated during
      coloring) for each hard register of the allocno cover class.  The
      member value can be NULL if all costs are the same and equal to
@@ -394,10 +405,10 @@ struct ira_allocno
      preferences of other allocnos not assigned yet during assigning
      to given allocno.  */
   int *conflict_hard_reg_costs, *updated_conflict_hard_reg_costs;
-  /* Number of the same cover class allocnos with TRUE in_graph_p
-     value and conflicting with given allocno during each point of
-     graph coloring.  */
-  int left_conflicts_num;
+  /* Size (in hard registers) of the same cover class allocnos with
+     TRUE in_graph_p value and conflicting with given allocno during
+     each point of graph coloring.  */
+  int left_conflicts_size;
   /* Number of hard registers of the allocno cover class really
      available for the allocno allocation.  */
   int available_regs_num;
@@ -453,7 +464,7 @@ struct ira_allocno
   ((A)->conflict_hard_reg_costs)
 #define ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS(A) \
   ((A)->updated_conflict_hard_reg_costs)
-#define ALLOCNO_LEFT_CONFLICTS_NUM(A) ((A)->left_conflicts_num)
+#define ALLOCNO_LEFT_CONFLICTS_SIZE(A) ((A)->left_conflicts_size)
 #define ALLOCNO_COVER_CLASS(A) ((A)->cover_class)
 #define ALLOCNO_COVER_CLASS_COST(A) ((A)->cover_class_cost)
 #define ALLOCNO_UPDATED_COVER_CLASS_COST(A) ((A)->updated_cover_class_cost)
@@ -810,6 +821,16 @@ extern enum reg_class ira_class_translate[N_REG_CLASSES];
    taking all hard-registers including fixed ones into account.  */
 extern enum reg_class ira_reg_class_intersect[N_REG_CLASSES][N_REG_CLASSES];
 
+/* True if the two classes (that is calculated taking only hard
+   registers available for allocation into account) are
+   intersected.  */
+extern bool ira_reg_classes_intersect_p[N_REG_CLASSES][N_REG_CLASSES];
+
+/* Classes with end marker LIM_REG_CLASSES which are intersected with
+   given class (the first index).  That includes given class itself.
+   This is calculated taking only hard registers available for
+   allocation into account.  */
+extern enum reg_class ira_reg_class_super_classes[N_REG_CLASSES][N_REG_CLASSES];
 /* The biggest important class inside of union of the two classes
    (that is calculated taking only hard registers available for
    allocation into account).  If the both classes contain no hard
@@ -862,7 +883,14 @@ extern void ira_add_allocno_conflict (ira_allocno_t, ira_allocno_t);
 extern void ira_print_expanded_allocno (ira_allocno_t);
 extern allocno_live_range_t ira_create_allocno_live_range
                            (ira_allocno_t, int, int, allocno_live_range_t);
+extern allocno_live_range_t ira_copy_allocno_live_range_list
+                            (allocno_live_range_t);
+extern allocno_live_range_t ira_merge_allocno_live_ranges
+                            (allocno_live_range_t, allocno_live_range_t);
+extern bool ira_allocno_live_ranges_intersect_p (allocno_live_range_t,
+                                                allocno_live_range_t);
 extern void ira_finish_allocno_live_range (allocno_live_range_t);
+extern void ira_finish_allocno_live_range_list (allocno_live_range_t);
 extern void ira_free_allocno_updated_costs (ira_allocno_t);
 extern ira_copy_t ira_create_copy (ira_allocno_t, ira_allocno_t,
                                   int, bool, rtx, ira_loop_tree_node_t);
@@ -898,8 +926,6 @@ extern void ira_compress_allocno_live_ranges (void);
 extern void ira_finish_allocno_live_ranges (void);
 
 /* ira-conflicts.c */
-extern bool ira_allocno_live_ranges_intersect_p (ira_allocno_t, ira_allocno_t);
-extern bool ira_pseudo_live_ranges_intersect_p (int, int);
 extern void ira_debug_conflicts (bool);
 extern void ira_build_conflicts (void);