OSDN Git Service

2009-10-05 Sebastian Pop <sebastian.pop@amd.com>
[pf3gnuchains/gcc-fork.git] / gcc / graphite-poly.h
index 8f7352a..c397f6a 100644 (file)
@@ -72,13 +72,13 @@ struct poly_dr
 
      The polyhedron contains these dimensions:
 
-      - The alias set (a):
-      Every memory access is classified in at least one alias set.
+     - The alias set (a):
+     Every memory access is classified in at least one alias set.
 
-      - The subscripts (s_0, ..., s_n):
-      The memory is accessed using zero or more subscript dimensions.
+     - The subscripts (s_0, ..., s_n):
+     The memory is accessed using zero or more subscript dimensions.
 
-      - The iteration domain (variables and parameters)
+     - The iteration domain (variables and parameters)
 
      Do not hardcode the dimensions.  Use the following accessor functions:
      - pdr_alias_set_dim
@@ -135,6 +135,10 @@ struct poly_dr
      | 0   0   0  -1   15  = 0 */
   ppl_Pointset_Powerset_C_Polyhedron_t accesses;
 
+  /* Data reference's base object set number, we must assure 2 pdrs are in the
+     same base object set before dependency checking.  */
+  int dr_base_object_set;
+
   /* The number of subscripts.  */
   graphite_dim_t nb_subscripts;
 };
@@ -145,9 +149,10 @@ struct poly_dr
 #define PDR_PBB(PDR) (PDR->pbb)
 #define PDR_TYPE(PDR) (PDR->type)
 #define PDR_ACCESSES(PDR) (PDR->accesses)
+#define PDR_BASE_OBJECT_SET(PDR) (PDR->dr_base_object_set)
 #define PDR_NB_SUBSCRIPTS(PDR) (PDR->nb_subscripts)
 
-void new_poly_dr (poly_bb_p, ppl_Pointset_Powerset_C_Polyhedron_t,
+void new_poly_dr (poly_bb_p, int, ppl_Pointset_Powerset_C_Polyhedron_t,
                  enum poly_dr_type, void *, graphite_dim_t);
 void free_poly_dr (poly_dr_p);
 void debug_pdr (poly_dr_p);
@@ -298,6 +303,12 @@ struct poly_bb
 
   /* A copy of the transformed scattering.  */
   poly_scattering_p saved;
+
+  /* True when the PDR duplicates have already been removed.  */
+  bool pdr_duplicates_removed;
+
+  /* True when this PBB contains only a reduction statement.  */
+  bool is_reduction;
 };
 
 #define PBB_BLACK_BOX(PBB) ((gimple_bb_p) PBB->black_box)
@@ -311,8 +322,10 @@ struct poly_bb
 #define PBB_SAVED(PBB) (PBB->saved)
 #define PBB_NB_LOCAL_VARIABLES(PBB) (PBB->transformed->nb_local_variables)
 #define PBB_NB_SCATTERING_TRANSFORM(PBB) (PBB->transformed->nb_scattering)
+#define PBB_PDR_DUPLICATES_REMOVED(PBB) (PBB->pdr_duplicates_removed)
+#define PBB_IS_REDUCTION(PBB) (PBB->is_reduction)
 
-extern void new_poly_bb (scop_p, void *);
+extern void new_poly_bb (scop_p, void *, bool);
 extern void free_poly_bb (poly_bb_p);
 extern void debug_loop_vec (poly_bb_p);
 extern void schedule_to_scattering (poly_bb_p, int);
@@ -336,6 +349,7 @@ extern bool scop_do_interchange (scop_p);
 extern bool scop_do_strip_mine (scop_p);
 extern void pbb_number_of_iterations (poly_bb_p, graphite_dim_t, Value);
 extern void pbb_number_of_iterations_at_time (poly_bb_p, graphite_dim_t, Value);
+extern void pbb_remove_duplicate_pdrs (poly_bb_p);
 
 /* The index of the PBB.  */
 
@@ -345,6 +359,14 @@ pbb_index (poly_bb_p pbb)
   return GBB_BB (PBB_BLACK_BOX (pbb))->index;
 }
 
+/* The loop of the PBB.  */
+
+static inline loop_p
+pbb_loop (poly_bb_p pbb)
+{
+  return gbb_loop (PBB_BLACK_BOX (pbb));
+}
+
 /* The scop that contains the PDR.  */
 
 static inline scop_p