commit cf0c5a1db33d8822438ef8fc56f8534356ce86d8 Author: Jakub Bogusz <qbo...@pld-linux.org> Date: Fri Apr 6 19:36:37 2018 +0200
- updated to 0.19.0 release; already includes update patch cloog-isl-update.patch | 527 ------------------------------------------------- cloog-isl.spec | 7 +- 2 files changed, 2 insertions(+), 532 deletions(-) --- diff --git a/cloog-isl.spec b/cloog-isl.spec index 536bb2f..dbeba38 100644 --- a/cloog-isl.spec +++ b/cloog-isl.spec @@ -6,7 +6,7 @@ Summary: The Chunky Loop Generator Summary(pl.UTF-8): Chunky Loop Generator - generator pętli cząstkowych Name: cloog-isl -Version: 0.18.5 +Version: 0.19.0 Release: 1 License: LGPL v2.1+ Group: Development/Tools @@ -14,9 +14,7 @@ Group: Development/Tools #Source0: http://www.bastoul.net/cloog/pages/download/cloog-%{version}.tar.gz #Source0Download: https://github.com/periscop/cloog/releases Source0: https://github.com/periscop/cloog/releases/download/cloog-%{version}/cloog-%{version}.tar.gz -# Source0-md5: 7e9058076193d8f53aae40cab94ad017 -# git diff HEAD..origin/update-isl -Patch0: cloog-isl-update.patch +# Source0-md5: e3a6f4dcc25d88cb0bfff1a477ee7f43 URL: http://www.cloog.org/ BuildRequires: autoconf >= 2.53 BuildRequires: automake @@ -95,7 +93,6 @@ Statyczna biblioteka opartej na isl wersji Chunky Loop Generatora. %prep %setup -q -n cloog-%{version} -%patch0 -p1 %build %{__libtoolize} diff --git a/cloog-isl-update.patch b/cloog-isl-update.patch deleted file mode 100644 index 51209da..0000000 --- a/cloog-isl-update.patch +++ /dev/null @@ -1,527 +0,0 @@ -#diff --git a/.gitmodules b/.gitmodules -#index 5180bb6..26afac3 100644 -#--- a/.gitmodules -#+++ b/.gitmodules -#@@ -1,6 +1,8 @@ -# [submodule "isl"] -# path = isl -# url = git://repo.or.cz/isl.git -#+ ignore = dirty -# [submodule "osl"] -# path = osl -# url = https://github.com/periscop/openscop.git -#+ ignore = dirty -#diff --git a/isl b/isl -#index 362c91b..0ce949a 160000 -#--- a/isl -#+++ b/isl -#@@ -1 +1 @@ -#-Subproject commit 362c91b6daeb3fd3c9d6f921fd04f55db64f7763 -#+Subproject commit 0ce949a1277de2e3121ed5715bdde639d6f4ba0f -#diff --git a/osl b/osl -#index 403e15a..f32f625 160000 -#--- a/osl -#+++ b/osl -#@@ -1 +1 @@ -#-Subproject commit 403e15a962e98330bc263a379d5629cae3393a68 -#+Subproject commit f32f625e26eff3290577b00053a56b98c4960104 -diff --git a/source/isl/constraints.c b/source/isl/constraints.c -index 84d2156..0020367 100644 ---- a/source/isl/constraints.c -+++ b/source/isl/constraints.c -@@ -513,7 +513,9 @@ static struct cloog_isl_dim constraint_cloog_dim_to_isl_dim( - } - pos -= dim; - } -- assert(0); -+ -+ ci_dim.pos = -1; -+ return ci_dim; - } - - static struct clast_expr *div_expr(CloogConstraint *constraint, int pos, -@@ -534,6 +536,9 @@ static struct clast_expr *div_expr(CloogConstraint *constraint, int pos, - struct cloog_isl_dim dim; - - dim = constraint_cloog_dim_to_isl_dim(constraint, i); -+ if (dim.pos <= -1) -+ continue; -+ - if (dim.type == isl_dim_set) - dim.type = isl_dim_in; - c = isl_aff_get_coefficient_val(div, dim.type, dim.pos); -@@ -553,6 +558,9 @@ static struct clast_expr *div_expr(CloogConstraint *constraint, int pos, - struct cloog_isl_dim dim; - - dim = constraint_cloog_dim_to_isl_dim(constraint, i); -+ if (dim.pos <= -1) -+ continue; -+ - if (dim.type == isl_dim_set) - dim.type = isl_dim_in; - c = isl_aff_get_coefficient_val(div, dim.type, dim.pos); -@@ -620,35 +628,44 @@ struct clast_expr *cloog_constraint_variable_expr(CloogConstraint *constraint, - */ - int cloog_constraint_involves(CloogConstraint *constraint, int v) - { -- isl_val *c; -- int res; -+ int res = 0; - -- c = cloog_constraint_coefficient_get_val(constraint, v); -- res = !isl_val_is_zero(c); -- isl_val_free(c); -- return res; -+ isl_val* const val = cloog_constraint_coefficient_get_val(constraint, v); -+ if (val) -+ { -+ res = !isl_val_is_zero(val); -+ isl_val_free(val); -+ } -+ -+ return res; - } - - int cloog_constraint_is_lower_bound(CloogConstraint *constraint, int v) - { -- isl_val *c; -- int res; -+ int res = 0; - -- c = cloog_constraint_coefficient_get_val(constraint, v); -- res = isl_val_is_pos(c); -- isl_val_free(c); -- return res; -+ isl_val* const val = cloog_constraint_coefficient_get_val(constraint, v); -+ if (val) -+ { -+ res = isl_val_is_pos(val); -+ isl_val_free(val); -+ } -+ -+ return res; - } - - int cloog_constraint_is_upper_bound(CloogConstraint *constraint, int v) - { -- isl_val *c; -- int res; -+ int res = 0; - -- c = cloog_constraint_coefficient_get_val(constraint, v); -- res = isl_val_is_neg(c); -- isl_val_free(c); -- return res; -+ isl_val* const val = cloog_constraint_coefficient_get_val(constraint, v); -+ if (val) -+ { -+ res = isl_val_is_neg(val); -+ isl_val_free(val); -+ } -+ -+ return res; - } - - int cloog_constraint_is_equality(CloogConstraint *constraint) -@@ -656,16 +673,51 @@ int cloog_constraint_is_equality(CloogConstraint *constraint) - return isl_constraint_is_equality(cloog_constraint_to_isl(constraint)); - } - -+typedef struct cloog_drop_constraint_data -+{ -+ isl_constraint* constraint; -+ isl_basic_set* basic_set; -+} cloog_drop_constraint_data; -+ -+static inline isl_stat cloog_basic_set_ignore_constraint( -+ __isl_take isl_constraint* const c, void* const user) -+{ -+ cloog_drop_constraint_data* const data = user; -+ isl_constraint* const ignore = data->constraint; -+ -+ isl_aff* a1 = isl_constraint_get_aff(c); -+ isl_aff* a2 = isl_constraint_get_aff(ignore); -+ isl_pw_aff* pw1 = isl_pw_aff_from_aff(a1); -+ isl_pw_aff* pw2 = isl_pw_aff_from_aff(a2); -+ -+ if (!isl_pw_aff_is_equal(pw1, pw2)) -+ data->basic_set = isl_basic_set_add_constraint(data->basic_set, c); -+ else -+ isl_constraint_free(c); -+ -+ isl_pw_aff_free(pw1); -+ isl_pw_aff_free(pw2); -+ -+ return isl_stat_ok; -+} -+ - CloogConstraintSet *cloog_constraint_set_drop_constraint( - CloogConstraintSet *constraints, CloogConstraint *constraint) - { -- isl_basic_set *bset; -- isl_constraint *c; -+ isl_basic_set* bset = cloog_constraints_set_to_isl(constraints); -+ isl_constraint* c = cloog_constraint_to_isl(cloog_constraint_copy(constraint)); - -- bset = cloog_constraints_set_to_isl(constraints); -- c = cloog_constraint_to_isl(cloog_constraint_copy(constraint)); -- bset = isl_basic_set_drop_constraint(bset, c); -- return cloog_constraint_set_from_isl_basic_set(bset); -+ isl_space* space = isl_basic_set_get_space(bset); -+ isl_basic_set* result = isl_basic_set_universe(space); -+ cloog_drop_constraint_data data = { .basic_set = result, .constraint = c, }; -+ isl_basic_set_foreach_constraint( -+ bset, cloog_basic_set_ignore_constraint, &data); -+ -+ isl_basic_set_free(bset); -+ isl_constraint_free(c); -+ -+ result = data.basic_set; -+ return cloog_constraint_set_from_isl_basic_set(result); - } - - void cloog_constraint_coefficient_get(CloogConstraint *constraint, -@@ -689,17 +741,17 @@ void cloog_constraint_coefficient_get(CloogConstraint *constraint, - isl_val *cloog_constraint_coefficient_get_val(CloogConstraint *constraint, - int var) - { -- struct cloog_isl_dim dim; -- isl_constraint *c; -- isl_val *val; -+ if (!constraint) -+ return NULL; - -- if (!constraint) -- return NULL; -+ struct cloog_isl_dim dim = constraint_cloog_dim_to_isl_dim(constraint, var); -+ isl_constraint* const c = cloog_constraint_to_isl(constraint); - -- dim = constraint_cloog_dim_to_isl_dim(constraint, var); -- c = cloog_constraint_to_isl(constraint); -- val = isl_constraint_get_coefficient_val(c, dim.type, dim.pos); -- return val; -+ isl_val *val = NULL; -+ if (dim.pos > -1) -+ val = isl_constraint_get_coefficient_val(c, dim.type, dim.pos); -+ -+ return val; - } - - -@@ -707,15 +759,18 @@ isl_val *cloog_constraint_coefficient_get_val(CloogConstraint *constraint, - void cloog_constraint_coefficient_set(CloogConstraint *constraint, - int var, cloog_int_t val) - { -- struct cloog_isl_dim dim; -- isl_constraint *c; -+ struct cloog_isl_dim dim; -+ isl_constraint *c; - -- assert(constraint); -+ assert(constraint); - -- dim = constraint_cloog_dim_to_isl_dim(constraint, var); -- c = cloog_constraint_to_isl(constraint); -- isl_constraint_set_coefficient_val(c, dim.type, dim.pos, -- cloog_int_to_isl_val(isl_constraint_get_ctx(c), val)); -+ dim = constraint_cloog_dim_to_isl_dim(constraint, var); -+ if (dim.pos <= -1) -+ return; -+ -+ c = cloog_constraint_to_isl(constraint); -+ isl_constraint_set_coefficient_val(c, dim.type, dim.pos, -+ cloog_int_to_isl_val(isl_constraint_get_ctx(c), val)); - } - - void cloog_constraint_constant_get(CloogConstraint *constraint, cloog_int_t *val) -diff --git a/source/isl/domain.c b/source/isl/domain.c -index eb3a962..06d77b0 100644 ---- a/source/isl/domain.c -+++ b/source/isl/domain.c -@@ -58,8 +58,12 @@ CloogConstraintSet *cloog_domain_constraints(CloogDomain *domain) - { - isl_basic_set *bset; - isl_set *set = isl_set_from_cloog_domain(domain); -+ isl_basic_set_list *list; - assert(isl_set_n_basic_set(set) == 1); -- bset = isl_set_copy_basic_set(set); -+ -+ list = isl_set_get_basic_set_list(set); -+ bset = isl_basic_set_list_get_basic_set(list, 0); -+ isl_basic_set_list_free(list); - return cloog_constraint_set_from_isl_basic_set(bset); - } - -@@ -70,6 +74,7 @@ void cloog_domain_print_constraints(FILE *foo, CloogDomain *domain, - isl_printer *p; - isl_basic_set *bset; - isl_set *set = isl_set_from_cloog_domain(domain); -+ isl_basic_set_list *list; - - p = isl_printer_to_file(isl_set_get_ctx(set), foo); - if (print_number) { -@@ -77,7 +82,9 @@ void cloog_domain_print_constraints(FILE *foo, CloogDomain *domain, - p = isl_printer_print_set(p, set); - } else { - assert(isl_set_n_basic_set(set) == 1); -- bset = isl_set_copy_basic_set(set); -+ list = isl_set_get_basic_set_list(set); -+ bset = isl_basic_set_list_get_basic_set(list, 0); -+ isl_basic_set_list_free(list); - p = isl_printer_set_output_format(p, ISL_FORMAT_POLYLIB); - p = isl_printer_print_basic_set(p, bset); - isl_basic_set_free(bset); -@@ -230,6 +237,7 @@ void cloog_domain_sort(CloogDomain **doms, unsigned nb_doms, unsigned level, - unsigned char **follows; - isl_set *set_i, *set_j; - isl_basic_set *bset_i, *bset_j; -+ isl_basic_set_list *list_i, *list_j; - - if (!nb_doms) - return; -@@ -255,8 +263,12 @@ void cloog_domain_sort(CloogDomain **doms, unsigned nb_doms, unsigned level, - continue; - set_i = isl_set_from_cloog_domain(doms[i]); - set_j = isl_set_from_cloog_domain(doms[j]); -- bset_i = isl_set_copy_basic_set(set_i); -- bset_j = isl_set_copy_basic_set(set_j); -+ list_i = isl_set_get_basic_set_list(set_i); -+ list_j = isl_set_get_basic_set_list(set_j); -+ bset_i = isl_basic_set_list_get_basic_set(list_i, 0); -+ bset_j = isl_basic_set_list_get_basic_set(list_j, 0); -+ isl_basic_set_list_free(list_i); -+ isl_basic_set_list_free(list_j); - cmp = isl_basic_set_compare_at(bset_i, bset_j, level-1); - isl_basic_set_free(bset_i); - isl_basic_set_free(bset_j); -@@ -574,6 +586,39 @@ static struct isl_basic_set *isl_basic_set_read_from_matrix(struct isl_ctx *ctx, - return bset; - } - -+/** -+ * isl_basic_map_read_from_matrix: -+ * Convert matrix to basic_map. The matrix contains nparam parameter columns. -+ * Returns a pointer to the basic_map if successful; NULL otherwise. -+ */ -+static isl_basic_map *isl_basic_map_read_from_matrix(isl_ctx *ctx, -+ CloogMatrix* matrix, int nparam, int n_in) -+{ -+ struct isl_space *dim; -+ struct isl_basic_map *bmap; -+ int i; -+ unsigned nrows, ncolumns; -+ -+ nrows = matrix->NbRows; -+ ncolumns = matrix->NbColumns; -+ int nvariables = ncolumns - 2 - nparam; -+ -+ dim = isl_space_alloc(ctx, nparam, n_in, nvariables - n_in); -+ -+ bmap = isl_basic_map_universe(isl_space_copy(dim)); -+ -+ for (i = 0; i < nrows; ++i) { -+ cloog_int_t *row = matrix->p[i]; -+ struct isl_constraint *constraint = -+ isl_constraint_read_from_matrix(isl_space_copy(dim), row); -+ bmap = isl_basic_map_add_constraint(bmap, constraint); -+ } -+ -+ isl_space_free(dim); -+ -+ return bmap; -+} -+ - /** - * cloog_domain_from_cloog_matrix: - * Create a CloogDomain containing the constraints described in matrix. -@@ -601,16 +646,9 @@ CloogScattering *cloog_scattering_from_cloog_matrix(CloogState *state, - CloogMatrix *matrix, int nb_scat, int nb_par) - { - struct isl_ctx *ctx = state->backend->ctx; -- struct isl_basic_set *bset; - struct isl_basic_map *scat; -- struct isl_space *dims; -- unsigned dim; - -- bset = isl_basic_set_read_from_matrix(ctx, matrix, nb_par); -- dim = isl_basic_set_n_dim(bset) - nb_scat; -- dims = isl_space_alloc(ctx, nb_par, nb_scat, dim); -- -- scat = isl_basic_map_from_basic_set(bset, dims); -+ scat = isl_basic_map_read_from_matrix(ctx, matrix, nb_par, nb_scat); - scat = isl_basic_map_reverse(scat); - return cloog_scattering_from_isl_map(isl_map_from_basic_map(scat)); - } -@@ -1351,10 +1389,22 @@ int cloog_domain_isconvex(CloogDomain * domain) - CloogDomain *cloog_domain_cut_first(CloogDomain *domain, CloogDomain **rest) - { - isl_set *set = isl_set_from_cloog_domain(domain); -- struct isl_basic_set *first; -+ isl_basic_set *first; -+ isl_basic_set_list *list; -+ int i, n; - -- first = isl_set_copy_basic_set(set); -- set = isl_set_drop_basic_set(set, first); -+ list = isl_set_get_basic_set_list(set); -+ isl_set_free(set); -+ n = isl_basic_set_list_n_basic_set(list); -+ assert(n > 0); -+ -+ first = isl_basic_set_list_get_basic_set(list, 0); -+ set = isl_set_empty(isl_basic_set_get_space(first)); -+ for (i = 1; i < n; ++i) { -+ set = isl_set_union(set, isl_set_from_basic_set( -+ isl_basic_set_list_get_basic_set(list, i))); -+ } -+ isl_basic_set_list_free(list); - *rest = cloog_domain_from_isl_set(set); - - return cloog_domain_from_isl_set(isl_set_from_basic_set(first)); -diff --git a/test/checker.sh b/test/checker.sh -index f94ff37..07d18b1 100755 ---- a/test/checker.sh -+++ b/test/checker.sh -@@ -319,7 +319,7 @@ for x in $TEST_FILES; do - - print_step "$input" "$STEP_GENERATING_HYBRID" "$input_log" - $cloog $options -q -callable 1 "$input" -o test_test_$$.c; -- $generate_test "$input" test_main_$$.c >/dev/null 2>>$input_log -+ $generate_test "$input" test_main_$$.c $options >/dev/null 2>>$input_log - - print_step "$input" "$STEP_COMPILING_HYBRID" "$input_log" - fix_env_compile -diff --git a/test/dartef.f b/test/dartef.f -index 6786bab..10d02f8 100644 ---- a/test/dartef.f -+++ b/test/dartef.f -@@ -1,4 +1,4 @@ --! Generated from ../test/dartef.cloog by CLooG 0.18.4-dac762f gmp bits in 0.06s. -+! Generated from test/dartef.cloog by CLooG 0.18.5-2439d87 gmp bits in 0.05s. - IF (n >= 1) THEN - DO t3=n+3, 3*n+1 - IF (MOD(t3+n+1, 2) == 0) THEN -@@ -46,11 +46,6 @@ IF (n >= 1) THEN - END IF - END DO - END DO -- IF (t1 <= -1) THEN -- DO t3=1, n -- S2((t1+n-1),n,t3) -- END DO -- END IF - DO t2=-t1+2*n+1, MIN(-t1+2*n+3,t1+2*n+1) - DO t3=1, n - IF (MOD(t1+t2+1, 2) == 0) THEN -@@ -58,6 +53,11 @@ IF (n >= 1) THEN - END IF - END DO - END DO -+ IF (t1 <= -1) THEN -+ DO t3=1, n -+ S2((t1+n-1),n,t3) -+ END DO -+ END IF - END DO - DO t3=1, n - S2(n,1,t3) -diff --git a/test/generate_test_advanced.c b/test/generate_test_advanced.c -index d0708b0..81ea3b7 100644 ---- a/test/generate_test_advanced.c -+++ b/test/generate_test_advanced.c -@@ -55,6 +55,7 @@ struct bounds { - } lowerbound; - }; - -+#ifdef DEBUG - static void print_bounds(FILE *out, struct bounds *bounds) { - unsigned end = bounds->names.nb_names; - unsigned i; -@@ -68,6 +69,7 @@ static void print_bounds(FILE *out, struct bounds *bounds) { - fprintf(out, "\n"); - } - } -+#endif - - - #define get_lowerbound(bounds,where) ( (bounds)->lowerbound.value->p[(where)] ) -@@ -232,7 +234,7 @@ static bool get_expression_reduction_bound(struct clast_reduction *reduc, - char which_bound, - cloog_int_t *bound) { - -- bool valid; -+ bool valid = false; - switch (reduc->type) { - case clast_red_sum: - valid = get_expression_reduction_sum_bound(reduc, bounds, -@@ -255,7 +257,7 @@ static bool get_expression_bin_bound(struct clast_binary *bin, - char which_bound, - cloog_int_t *bound) { - -- bool valid; -+ bool valid = false; - - switch (bin->type) { - case clast_bin_div: -@@ -287,7 +289,7 @@ static bool get_expression_bound(struct clast_expr *expr, - char which_bound, - cloog_int_t *bound) { - -- bool valid; -+ bool valid = false; - switch (expr->type) { - case clast_expr_name : - valid = get_expression_name_bound((struct clast_name*) expr, -@@ -599,7 +601,7 @@ static bool update_expr_red_bound(struct clast_reduction *reduction, - cloog_int_t value, struct bounds *bounds, char which_bound, - cloog_int_t div) { - -- bool retval; -+ bool retval = false; - - switch (reduction->type) { - case clast_red_sum: -@@ -902,7 +904,7 @@ static inline void print_help(FILE *out) { - fprintf(out, "\x1b[1m%s\x1b[0m", help); - } - --static const char getopt_flags[] = "ohl:u:m:"; -+static const char getopt_flags[] = "+ohl:u:m:"; - - int main(int argc, char **argv) { - -@@ -943,12 +945,14 @@ int main(int argc, char **argv) { - break; - } - } -- if ((argc - optind) != 2) { -+ -+ if ((argc - optind) < 2) { - fprintf(stderr, - "\x1b[1m\x1b[31mError: Bad arguments\x1b[0m\n\n"); - print_help(stderr); - return EXIT_FAILURE; - } -+ - input_name = argv[optind]; - output_name = argv[optind + 1]; - -@@ -979,7 +983,17 @@ int main(int argc, char **argv) { - } - - state = cloog_state_malloc(); -- options = cloog_options_malloc(state); -+ FILE *input = NULL, *output = NULL; -+ cloog_options_read(state, argc-1, argv+1, &input, &output, &options); -+ if (input != NULL && input != stdin) -+ fclose(input); -+ if (output != NULL && output != stdout) -+ fclose(output); -+ options->name = NULL; // No need to free because it is pointing to argv ... -+#ifdef DEBUG -+ cloog_options_print(stderr, options); -+#endif -+ - if (set_openscop_option) - options->openscop = 1; - program = cloog_program_read(input_file, options); ================================================================ ---- gitweb: http://git.pld-linux.org/gitweb.cgi/packages/cloog-isl.git/commitdiff/cf0c5a1db33d8822438ef8fc56f8534356ce86d8 _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit