aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-03-08 17:49:02 +0000
committerSebastian Pop <spop@gcc.gnu.org>2010-03-08 17:49:02 +0000
commitaa52513e04771f173336812c9ee92ffd33c6b653 (patch)
treea58d1e66eae3ae4128e2660d14f60f23ba294c48 /gcc
parent392c0ce1d7fbeb987a1ade0dcbe7b3fb28990101 (diff)
downloadgcc-aa52513e04771f173336812c9ee92ffd33c6b653.zip
gcc-aa52513e04771f173336812c9ee92ffd33c6b653.tar.gz
gcc-aa52513e04771f173336812c9ee92ffd33c6b653.tar.bz2
New function combine_context_id_scat.
2010-03-04 Sebastian Pop <sebastian.pop@amd.com> * graphite-poly.h (struct poly_scattering): Add layout documentation. (struct poly_bb): Same. (combine_context_id_scat): New. From-SVN: r157281
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog.graphite6
-rw-r--r--gcc/graphite-poly.h53
2 files changed, 57 insertions, 2 deletions
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 5406717..3665132 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,9 @@
+2010-03-04 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-poly.h (struct poly_scattering): Add layout documentation.
+ (struct poly_bb): Same.
+ (combine_context_id_scat): New.
+
2010-03-02 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/42326
diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h
index 0a8204e..b586699 100644
--- a/gcc/graphite-poly.h
+++ b/gcc/graphite-poly.h
@@ -263,7 +263,9 @@ typedef struct poly_scattering *poly_scattering_p;
struct poly_scattering
{
- /* The scattering function containing the transformations. */
+ /* The scattering function containing the transformations: the
+ layout of this polyhedron is: T|I|G with T the transform
+ scattering, I the iteration domain, G the context parameters. */
ppl_Polyhedron_t scattering;
/* The number of local variables. */
@@ -283,7 +285,9 @@ struct poly_bb
/* Pointer to the SCOP containing this PBB. */
scop_p scop;
- /* The iteration domain of this bb.
+ /* The iteration domain of this bb. The layout of this polyhedron
+ is I|G with I the iteration domain, G the context parameters.
+
Example:
for (i = a - 7*b + 8; i <= 3*a + 13*b + 20; i++)
@@ -1467,4 +1471,49 @@ restore_scattering (scop_p scop)
restore_lst_schedule (scop);
}
+/* For a given PBB, add to RES the scop context, the iteration domain,
+ the original scattering when ORIGINAL_P is true, otherwise add the
+ transformed scattering. */
+
+static inline void
+combine_context_id_scat (ppl_Pointset_Powerset_C_Polyhedron_t *res,
+ poly_bb_p pbb, bool original_p)
+{
+ ppl_Pointset_Powerset_C_Polyhedron_t context;
+ ppl_Pointset_Powerset_C_Polyhedron_t id;
+
+ ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
+ (res, original_p ?
+ PBB_ORIGINAL_SCATTERING (pbb) : PBB_TRANSFORMED_SCATTERING (pbb));
+
+ ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
+ (&context, SCOP_CONTEXT (PBB_SCOP (pbb)));
+
+ ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
+ (&id, PBB_DOMAIN (pbb));
+
+ /* Extend the context and the iteration domain to the dimension of
+ the scattering: T|I|G. */
+ {
+ ppl_dimension_type gdim, tdim, idim;
+
+ ppl_Pointset_Powerset_C_Polyhedron_space_dimension (*res, &tdim);
+ ppl_Pointset_Powerset_C_Polyhedron_space_dimension (context, &gdim);
+ ppl_Pointset_Powerset_C_Polyhedron_space_dimension (id, &idim);
+
+ if (tdim > gdim)
+ ppl_insert_dimensions_pointset (context, 0, tdim - gdim);
+
+ if (tdim > idim)
+ ppl_insert_dimensions_pointset (id, 0, tdim - idim);
+ }
+
+ /* Add the context and the iteration domain to the result. */
+ ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (*res, context);
+ ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (*res, id);
+
+ ppl_delete_Pointset_Powerset_C_Polyhedron (context);
+ ppl_delete_Pointset_Powerset_C_Polyhedron (id);
+}
+
#endif