OSDN Git Service

* config/mn10300/mn10300.h (CONSTANT_ADDRESS_P): Do not allow
[pf3gnuchains/gcc-fork.git] / gcc / graphite-poly.h
index 081e186..7fe1113 100644 (file)
@@ -42,11 +42,11 @@ static inline graphite_dim_t scop_nb_params (scop_p);
 
 /* A data reference can write or read some memory or we
    just know it may write some memory.  */
-enum POLY_DR_TYPE
+enum poly_dr_type
 {
   PDR_READ,
-  /* PDR_MAY_READs are represented using PDR_READS. This does not limit the
-     expressiveness.  */
+  /* PDR_MAY_READs are represented using PDR_READS.  This does not
+     limit the expressiveness.  */
   PDR_WRITE,
   PDR_MAY_WRITE
 };
@@ -56,13 +56,16 @@ struct poly_dr
   /* An identifier for this PDR.  */
   int id;
 
+  /* The number of data refs identical to this one in the PBB.  */
+  int nb_refs;
+
   /* A pointer to compiler's data reference description.  */
   void *compiler_dr;
 
   /* A pointer to the PBB that contains this data reference.  */
   poly_bb_p pbb;
 
-  enum POLY_DR_TYPE type;
+  enum poly_dr_type type;
 
   /* The access polyhedron contains the polyhedral space this data
      reference will access.
@@ -137,6 +140,7 @@ struct poly_dr
 };
 
 #define PDR_ID(PDR) (PDR->id)
+#define PDR_NB_REFS(PDR) (PDR->nb_refs)
 #define PDR_CDR(PDR) (PDR->compiler_dr)
 #define PDR_PBB(PDR) (PDR->pbb)
 #define PDR_TYPE(PDR) (PDR->type)
@@ -144,7 +148,7 @@ struct poly_dr
 #define PDR_NB_SUBSCRIPTS(PDR) (PDR->nb_subscripts)
 
 void new_poly_dr (poly_bb_p, ppl_Pointset_Powerset_C_Polyhedron_t,
-                 enum POLY_DR_TYPE, void *, int);
+                 enum poly_dr_type, void *, graphite_dim_t);
 void free_poly_dr (poly_dr_p);
 void debug_pdr (poly_dr_p);
 void print_pdr (FILE *, poly_dr_p);
@@ -215,6 +219,30 @@ pdr_parameter_dim (poly_dr_p pdr, graphite_dim_t param)
   return pbb_dim_iter_domain (pbb) + param;
 }
 
+/* Returns true when PDR is a "read".  */
+
+static inline bool
+pdr_read_p (poly_dr_p pdr)
+{
+  return PDR_TYPE (pdr) == PDR_READ;
+}
+
+/* Returns true when PDR is a "write".  */
+
+static inline bool
+pdr_write_p (poly_dr_p pdr)
+{
+  return PDR_TYPE (pdr) == PDR_WRITE;
+}
+
+/* Returns true when PDR is a "may write".  */
+
+static inline bool
+pdr_may_write_p (poly_dr_p pdr)
+{
+  return PDR_TYPE (pdr) == PDR_MAY_WRITE;
+}
+
 typedef struct poly_scattering *poly_scattering_p;
 
 struct poly_scattering
@@ -270,6 +298,9 @@ 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;
 };
 
 #define PBB_BLACK_BOX(PBB) ((gimple_bb_p) PBB->black_box)
@@ -283,6 +314,7 @@ 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)
 
 extern void new_poly_bb (scop_p, void *);
 extern void free_poly_bb (poly_bb_p);
@@ -308,6 +340,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.  */