#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
-#include "ggc.h"
-#include "tree.h"
-#include "rtl.h"
-#include "basic-block.h"
-#include "diagnostic.h"
#include "tree-flow.h"
-#include "toplev.h"
#include "tree-dump.h"
-#include "timevar.h"
#include "cfgloop.h"
#include "tree-chrec.h"
#include "tree-data-ref.h"
#include "tree-scalar-evolution.h"
-#include "tree-pass.h"
-#include "domwalk.h"
-#include "pointer-set.h"
-#include "gimple.h"
+#include "sese.h"
#ifdef HAVE_cloog
#include "ppl_c.h"
-#include "sese.h"
#include "graphite-ppl.h"
-#include "graphite.h"
#include "graphite-poly.h"
#include "graphite-dependences.h"
PDDR_DDP (pddr) = ddp;
PDDR_ORIGINAL_SCATTERING_P (pddr) = original_scattering_p;
- if (!ddp || ppl_Pointset_Powerset_C_Polyhedron_is_empty (ddp))
+ if (!ddp
+ || ppl_powerset_is_empty (ddp,
+ scop_nb_params (PBB_SCOP (PDR_PBB (source)))))
PDDR_KIND (pddr) = no_dependence;
else
PDDR_KIND (pddr) = has_dependence;
fprintf (file, "\n dependence polyhedron (\n");
print_dependence_polyhedron_layout (file, pddr);
ppl_print_powerset_matrix (file, PDDR_DDP (pddr));
+ ppl_io_fprint_Pointset_Powerset_C_Polyhedron (file, PDDR_DDP (pddr));
fprintf (file, ")\n");
}
/* Builds scheduling inequality constraints: when DIRECTION is
1 builds a GE constraint,
0 builds an EQ constraint,
- -1 builds a LE constraint. */
+ -1 builds a LE constraint.
+ DIM is the dimension of the scheduling space.
+ POS and POS + OFFSET are the dimensions that are related. */
static ppl_Pointset_Powerset_C_Polyhedron_t
build_pairwise_scheduling (graphite_dim_t dim,
ppl_Pointset_Powerset_C_Polyhedron_t res;
ppl_Polyhedron_t equalities;
ppl_Constraint_t cstr;
+ graphite_dim_t a = pos;
+ graphite_dim_t b = pos + offset;
ppl_new_C_Polyhedron_from_space_dimension (&equalities, dim, 0);
switch (direction)
{
- case -1:
- cstr = ppl_build_relation (dim, pos, pos + offset, 1,
+ case 1:
+ /* Builds "a + 1 <= b. */
+ cstr = ppl_build_relation (dim, a, b, 1,
PPL_CONSTRAINT_TYPE_LESS_OR_EQUAL);
break;
case 0:
- cstr = ppl_build_relation (dim, pos, pos + offset, 0,
+ /* Builds "a = b. */
+ cstr = ppl_build_relation (dim, a, b, 0,
PPL_CONSTRAINT_TYPE_EQUAL);
break;
- case 1:
- cstr = ppl_build_relation (dim, pos, pos + offset, -1,
+ case -1:
+ /* Builds "a >= b + 1. */
+ cstr = ppl_build_relation (dim, a, b, -1,
PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
break;
the BAG polyhedron: T1|I1|T2|I2|S1|S2|G. When DIRECTION is set to
1, compute the direct dependence from PDR1 to PDR2, and when
DIRECTION is -1, compute the reversed dependence relation, from
- PDR2 to PDR1. */
+ PDR2 to PDR1. GDIM is the number of parameters in the scop. */
static ppl_Pointset_Powerset_C_Polyhedron_t
build_lexicographical_constraint (ppl_Pointset_Powerset_C_Polyhedron_t bag,
graphite_dim_t dim,
graphite_dim_t tdim,
graphite_dim_t offset,
+ graphite_dim_t gdim,
int direction)
{
graphite_dim_t i;
lex = build_pairwise_scheduling (dim, 0, offset, direction);
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (lex, bag);
- if (!ppl_Pointset_Powerset_C_Polyhedron_is_empty (lex))
+ if (!ppl_powerset_is_empty (lex, gdim))
ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign (res, lex);
ppl_delete_Pointset_Powerset_C_Polyhedron (lex);
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (bag, sceq);
ppl_delete_Pointset_Powerset_C_Polyhedron (sceq);
+ if (ppl_powerset_is_empty (bag, gdim))
+ break;
+
lex = build_pairwise_scheduling (dim, i + 1, offset, direction);
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (lex, bag);
- if (!ppl_Pointset_Powerset_C_Polyhedron_is_empty (lex))
+ if (!ppl_powerset_is_empty (lex, gdim))
ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign (res, lex);
ppl_delete_Pointset_Powerset_C_Polyhedron (lex);
ppl_delete_Pointset_Powerset_C_Polyhedron (idr2);
ppl_delete_Pointset_Powerset_C_Polyhedron (dreq);
- if (!ppl_Pointset_Powerset_C_Polyhedron_is_empty (res))
+ if (!ppl_powerset_is_empty (res, gdim))
{
ppl_Pointset_Powerset_C_Polyhedron_t lex =
build_lexicographical_constraint (res, dim, MIN (tdim1, tdim2),
- tdim1 + ddim1, direction);
+ tdim1 + ddim1, gdim, direction);
ppl_delete_Pointset_Powerset_C_Polyhedron (res);
res = lex;
}
ppl_insert_dimensions_pointset (pt, otdim1 + ttdim1 + ddim1, otdim2);
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (po_temp, pt);
- is_empty_p = ppl_Pointset_Powerset_C_Polyhedron_is_empty (po_temp);
+ is_empty_p = ppl_powerset_is_empty (po_temp,
+ scop_nb_params (PBB_SCOP (pbb1)));
ppl_delete_Pointset_Powerset_C_Polyhedron (po_temp);
free_poly_ddr (tpddr);
eqpp = build_pairwise_scheduling (dim, level, tdim1 + ddim1, 1);
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (eqpp, po);
- empty_p = ppl_Pointset_Powerset_C_Polyhedron_is_empty (eqpp);
+ empty_p = ppl_powerset_is_empty
+ (eqpp, scop_nb_params (PBB_SCOP (PDR_PBB (pdr1))));
ppl_delete_Pointset_Powerset_C_Polyhedron (eqpp);
free_poly_ddr (pddr);
/* When debugging, enable the following code. This cannot be used
in production compilers because it calls "system". */
#if 0
- int x;
FILE *stream = fopen ("/tmp/scopdeps.dot", "w");
gcc_assert (stream);
dot_deps_1 (stream, scop);
fclose (stream);
- x = system ("dotty /tmp/scopdeps.dot &");
+ system ("dotty /tmp/scopdeps.dot &");
#else
dot_deps_1 (stderr, scop);
#endif
/* When debugging, enable the following code. This cannot be used
in production compilers because it calls "system". */
#if 0
- int x;
FILE *stream = fopen ("/tmp/scopdeps.dot", "w");
gcc_assert (stream);
dot_deps_stmt_1 (stream, scop);
fclose (stream);
- x = system ("dotty /tmp/scopdeps.dot &");
+ system ("dotty /tmp/scopdeps.dot &");
#else
dot_deps_stmt_1 (stderr, scop);
#endif