#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
-#include "ggc.h"
-#include "tree.h"
-#include "rtl.h"
-#include "output.h"
-#include "basic-block.h"
-#include "diagnostic.h"
-#include "tree-pretty-print.h"
-#include "gimple-pretty-print.h"
+#include "diagnostic-core.h"
#include "tree-flow.h"
-#include "toplev.h"
#include "tree-dump.h"
-#include "timevar.h"
+#include "gimple-pretty-print.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 "value-prof.h"
-#include "pointer-set.h"
-#include "gimple.h"
-#include "params.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"
#include "graphite-cloog-util.h"
if (strcmp (tmp, "SCoP 1"))
{
- error ("The file is not in OpenScop format.\n");
+ error ("the file is not in OpenScop format");
return false;
}
if (strcmp (language, "Gimple"))
{
- error ("The language is not recognized\n");
+ error ("the language is not recognized");
return false;
}
if ((size_t) params != scop->nb_params)
{
- error ("Parameters number in the scop file is different from the"
- " internal scop parameter number.");
+ error ("parameters number in the scop file is different from the"
+ " internal scop parameter number");
return false;
}
if (nb_statements != VEC_length (poly_bb_p, SCOP_BBS (scop)))
{
- error ("Number of statements in the OpenScop file does not match"
- " the graphite internal statements number.");
+ error ("number of statements in the OpenScop file does not match"
+ " the graphite internal statements number");
return false;
}
else
{
if (flag_loop_strip_mine)
- transform_done |= scop_do_strip_mine (scop);
+ transform_done |= scop_do_strip_mine (scop, 0);
if (flag_loop_interchange)
transform_done |= scop_do_interchange (scop);
{
int i, j;
poly_dr_p pdr1, pdr2;
- unsigned n = VEC_length (poly_dr_p, PBB_DRS (pbb));
- VEC (poly_dr_p, heap) *collapsed = VEC_alloc (poly_dr_p, heap, n);
FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb), i, pdr1)
- FOR_EACH_VEC_ELT (poly_dr_p, collapsed, j, pdr2)
- if (!can_collapse_pdrs (pdr1, pdr2))
- VEC_quick_push (poly_dr_p, collapsed, pdr1);
+ for (j = i + 1; VEC_iterate (poly_dr_p, PBB_DRS (pbb), j, pdr2); j++)
+ if (can_collapse_pdrs (pdr1, pdr2))
+ {
+ PDR_NB_REFS (pdr1) += PDR_NB_REFS (pdr2);
+ free_poly_dr (pdr2);
+ VEC_ordered_remove (poly_dr_p, PBB_DRS (pbb), j);
+ }
- VEC_free (poly_dr_p, heap, collapsed);
PBB_PDR_DUPLICATES_REMOVED (pbb) = true;
}
/* Create a new polyhedral black box. */
-void
-new_poly_bb (scop_p scop, void *black_box, bool reduction)
+poly_bb_p
+new_poly_bb (scop_p scop, void *black_box)
{
poly_bb_p pbb = XNEW (struct poly_bb);
PBB_SAVED (pbb) = NULL;
PBB_ORIGINAL (pbb) = NULL;
PBB_DRS (pbb) = VEC_alloc (poly_dr_p, heap, 3);
- PBB_IS_REDUCTION (pbb) = reduction;
+ PBB_IS_REDUCTION (pbb) = false;
PBB_PDR_DUPLICATES_REMOVED (pbb) = false;
- VEC_safe_push (poly_bb_p, heap, SCOP_BBS (scop), pbb);
+ GBB_PBB ((gimple_bb_p) black_box) = pbb;
+
+ return pbb;
}
/* Free polyhedral black box. */
{
ppl_Pointset_Powerset_C_Polyhedron_t domain, sctr_lb, sctr_ub;
ppl_dimension_type domain_dim, sctr_dim;
+ graphite_dim_t dim_iter_domain = pbb_dim_iter_domain (pbb);
ppl_Linear_Expression_t le;
mpz_t lb, ub, diff, one;
int i;
(&domain, PBB_DOMAIN (pbb));
ppl_Pointset_Powerset_C_Polyhedron_space_dimension (domain, &domain_dim);
+
mpz_init (diff);
mpz_init (lb);
mpz_init (ub);
that upper bound to the scattering. */
ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
(&sctr_ub, PBB_TRANSFORMED_SCATTERING (pbb));
- for (i = 0; i < (int) domain_dim; i++)
+ for (i = 0; i < (int) dim_iter_domain; i++)
{
ppl_Linear_Expression_t eq;
ppl_Constraint_t pc;
it to the scattering. */
ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
(&sctr_lb, PBB_TRANSFORMED_SCATTERING (pbb));
- for (i = 0; i < (int) domain_dim; i++)
+ for (i = 0; i < (int) dim_iter_domain; i++)
{
ppl_Linear_Expression_t eq;
ppl_Constraint_t pc;
mpz_clear (diff);
mpz_clear (lb);
mpz_clear (ub);
+ ppl_delete_Linear_Expression (le);
ppl_delete_Pointset_Powerset_C_Polyhedron (sctr_ub);
ppl_delete_Pointset_Powerset_C_Polyhedron (sctr_lb);
+ ppl_delete_Pointset_Powerset_C_Polyhedron (domain);
}
/* Translates LOOP to LST. */