From 8b40f8c6c7d48de36acfd6870bb7c837a8acf358 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Sun, 6 Aug 2017 15:51:16 +0000 Subject: [PATCH] Update to isl-0.18-812-g565da6e This update is mostly a maintenance update, but also exposes a couple of new functions that will be needed for the next version of the isl++ bindings. llvm-svn: 310205 --- polly/lib/External/isl/GIT_HEAD_ID | 2 +- polly/lib/External/isl/doc/user.pod | 6 ++ polly/lib/External/isl/include/isl/aff.h | 16 ++++ polly/lib/External/isl/isl_aff.c | 29 ++++++++ polly/lib/External/isl/schedule_cmp.c | 85 ++++++++++++++++++++++ polly/lib/External/isl/schedule_test.sh.in | 21 ++++++ .../test_inputs/schedule/feautrier_compressed.sc | 5 ++ .../test_inputs/schedule/feautrier_compressed.st | 11 +++ 8 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 polly/lib/External/isl/schedule_cmp.c create mode 100644 polly/lib/External/isl/schedule_test.sh.in create mode 100644 polly/lib/External/isl/test_inputs/schedule/feautrier_compressed.sc create mode 100644 polly/lib/External/isl/test_inputs/schedule/feautrier_compressed.st diff --git a/polly/lib/External/isl/GIT_HEAD_ID b/polly/lib/External/isl/GIT_HEAD_ID index 0594cbd..a2665ce 100644 --- a/polly/lib/External/isl/GIT_HEAD_ID +++ b/polly/lib/External/isl/GIT_HEAD_ID @@ -1 +1 @@ -isl-0.18-809-gd5b4535 +isl-0.18-812-g565da6e diff --git a/polly/lib/External/isl/doc/user.pod b/polly/lib/External/isl/doc/user.pod index 760fcbf..1bb0da4 100644 --- a/polly/lib/External/isl/doc/user.pod +++ b/polly/lib/External/isl/doc/user.pod @@ -6330,6 +6330,9 @@ into the first expression. __isl_give isl_set *isl_aff_eq_set( __isl_take isl_aff *aff1, __isl_take isl_aff *aff2); + __isl_give isl_set *isl_aff_ne_set( + __isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); __isl_give isl_basic_set *isl_aff_le_basic_set( __isl_take isl_aff *aff1, __isl_take isl_aff *aff2); @@ -6351,6 +6354,9 @@ into the first expression. __isl_give isl_basic_set *isl_aff_gt_basic_set( __isl_take isl_aff *aff1, __isl_take isl_aff *aff2); + __isl_give isl_set *isl_aff_gt_set( + __isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); __isl_give isl_set *isl_pw_aff_eq_set( __isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2); diff --git a/polly/lib/External/isl/include/isl/aff.h b/polly/lib/External/isl/include/isl/aff.h index dc67819..b032ab1 100644 --- a/polly/lib/External/isl/include/isl/aff.h +++ b/polly/lib/External/isl/include/isl/aff.h @@ -141,22 +141,32 @@ __isl_give isl_basic_set *isl_aff_neg_basic_set(__isl_take isl_aff *aff); __isl_give isl_basic_set *isl_aff_eq_basic_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2); +__isl_export __isl_give isl_set *isl_aff_eq_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2); +__isl_export +__isl_give isl_set *isl_aff_ne_set(__isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); __isl_give isl_basic_set *isl_aff_le_basic_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2); +__isl_export __isl_give isl_set *isl_aff_le_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2); __isl_give isl_basic_set *isl_aff_lt_basic_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2); +__isl_export __isl_give isl_set *isl_aff_lt_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2); __isl_give isl_basic_set *isl_aff_ge_basic_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2); +__isl_export __isl_give isl_set *isl_aff_ge_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2); __isl_give isl_basic_set *isl_aff_gt_basic_set(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2); +__isl_export +__isl_give isl_set *isl_aff_gt_set(__isl_take isl_aff *aff1, + __isl_take isl_aff *aff2); __isl_constructor __isl_give isl_aff *isl_aff_read_from_str(isl_ctx *ctx, const char *str); @@ -334,16 +344,22 @@ __isl_give isl_set *isl_pw_aff_nonneg_set(__isl_take isl_pw_aff *pwaff); __isl_give isl_set *isl_pw_aff_zero_set(__isl_take isl_pw_aff *pwaff); __isl_give isl_set *isl_pw_aff_non_zero_set(__isl_take isl_pw_aff *pwaff); +__isl_export __isl_give isl_set *isl_pw_aff_eq_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2); +__isl_export __isl_give isl_set *isl_pw_aff_ne_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2); +__isl_export __isl_give isl_set *isl_pw_aff_le_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2); +__isl_export __isl_give isl_set *isl_pw_aff_lt_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2); +__isl_export __isl_give isl_set *isl_pw_aff_ge_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2); +__isl_export __isl_give isl_set *isl_pw_aff_gt_set(__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2); diff --git a/polly/lib/External/isl/isl_aff.c b/polly/lib/External/isl/isl_aff.c index 61ef61e..8b3f82b 100644 --- a/polly/lib/External/isl/isl_aff.c +++ b/polly/lib/External/isl/isl_aff.c @@ -2284,6 +2284,18 @@ __isl_give isl_set *isl_aff_ge_set(__isl_take isl_aff *aff1, return isl_set_from_basic_set(isl_aff_ge_basic_set(aff1, aff2)); } +/* Return a set containing those elements in the shared domain space + * of aff1 and aff2 where aff1 is greater than aff2. + * + * If either of the two inputs is NaN, then the result is empty, + * as comparisons with NaN always return false. + */ +__isl_give isl_set *isl_aff_gt_set(__isl_take isl_aff *aff1, + __isl_take isl_aff *aff2) +{ + return isl_set_from_basic_set(isl_aff_gt_basic_set(aff1, aff2)); +} + /* Return a basic set containing those elements in the shared space * of aff1 and aff2 where aff1 is smaller than or equal to aff2. */ @@ -2340,6 +2352,23 @@ __isl_give isl_set *isl_aff_eq_set(__isl_take isl_aff *aff1, return isl_set_from_basic_set(isl_aff_eq_basic_set(aff1, aff2)); } +/* Return a set containing those elements in the shared domain space + * of aff1 and aff2 where aff1 and aff2 are not equal. + * + * If either of the two inputs is NaN, then the result is empty, + * as comparisons with NaN always return false. + */ +__isl_give isl_set *isl_aff_ne_set(__isl_take isl_aff *aff1, + __isl_take isl_aff *aff2) +{ + isl_set *set_lt, *set_gt; + + set_lt = isl_aff_lt_set(isl_aff_copy(aff1), + isl_aff_copy(aff2)); + set_gt = isl_aff_gt_set(aff1, aff2); + return isl_set_union_disjoint(set_lt, set_gt); +} + __isl_give isl_aff *isl_aff_add_on_domain(__isl_keep isl_set *dom, __isl_take isl_aff *aff1, __isl_take isl_aff *aff2) { diff --git a/polly/lib/External/isl/schedule_cmp.c b/polly/lib/External/isl/schedule_cmp.c new file mode 100644 index 0000000..8bf02ea --- /dev/null +++ b/polly/lib/External/isl/schedule_cmp.c @@ -0,0 +1,85 @@ +/* + * Copyright 2017 Sven Verdoolaege + * + * Use of this software is governed by the MIT license + * + * Written by Sven Verdoolaege. + */ + +#include + +#include +#include +#include + +struct options { + struct isl_options *isl; + char *schedule1; + char *schedule2; +}; + +ISL_ARGS_START(struct options, options_args) +ISL_ARG_CHILD(struct options, isl, "isl", &isl_options_args, "isl options") +ISL_ARG_ARG(struct options, schedule1, "schedule1", NULL) +ISL_ARG_ARG(struct options, schedule2, "schedule2", NULL) +ISL_ARGS_END + +ISL_ARG_DEF(options, struct options, options_args) + +static void die(const char *msg) +{ + fprintf(stderr, "%s\n", msg); + exit(EXIT_FAILURE); +} + +static FILE *open_or_die(const char *filename) +{ + FILE *file; + + file = fopen(filename, "r"); + if (!file) { + fprintf(stderr, "Unable to open %s\n", filename); + exit(EXIT_FAILURE); + } + return file; +} + +/* Given two YAML descriptions of isl_schedule objects, check whether + * they are equivalent. + * Return EXIT_SUCCESS if they are and EXIT_FAILURE if they are not + * or if anything else went wrong. + */ +int main(int argc, char **argv) +{ + isl_ctx *ctx; + struct options *options; + FILE *input1, *input2; + isl_bool equal; + isl_schedule *s1, *s2; + + options = options_new_with_defaults(); + if (!options) + return EXIT_FAILURE; + + ctx = isl_ctx_alloc_with_options(&options_args, options); + argc = options_parse(options, argc, argv, ISL_ARG_ALL); + + input1 = open_or_die(options->schedule1); + input2 = open_or_die(options->schedule2); + s1 = isl_schedule_read_from_file(ctx, input1); + s2 = isl_schedule_read_from_file(ctx, input2); + + equal = isl_schedule_plain_is_equal(s1, s2); + if (equal < 0) + return EXIT_FAILURE; + if (!equal) + die("schedules differ"); + + isl_schedule_free(s1); + isl_schedule_free(s2); + fclose(input1); + fclose(input2); + isl_ctx_free(ctx); + + return EXIT_SUCCESS; +} diff --git a/polly/lib/External/isl/schedule_test.sh.in b/polly/lib/External/isl/schedule_test.sh.in new file mode 100644 index 0000000..afba802 --- /dev/null +++ b/polly/lib/External/isl/schedule_test.sh.in @@ -0,0 +1,21 @@ +#!/bin/sh + +EXEEXT=@EXEEXT@ +GREP=@GREP@ +SED=@SED@ +srcdir=@srcdir@ + +failed=0 + +for i in $srcdir/test_inputs/schedule/*.sc; do + echo $i; + base=`basename $i .sc` + test=test-$base.st + dir=`dirname $i` + ref=$dir/$base.st + options=`$GREP 'OPTIONS:' $i | $SED 's/.*://'` + (./isl_schedule$EXEEXT $options < $i > $test && + ./isl_schedule_cmp$EXEEXT $ref $test && rm $test) || failed=1 +done + +test $failed -eq 0 || exit diff --git a/polly/lib/External/isl/test_inputs/schedule/feautrier_compressed.sc b/polly/lib/External/isl/test_inputs/schedule/feautrier_compressed.sc new file mode 100644 index 0000000..f90bd88 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/schedule/feautrier_compressed.sc @@ -0,0 +1,5 @@ +# Check that the Feautrier schedule is not confused by +# compressed nodes in a subgraph of the original dependence graph. +# OPTIONS: --schedule-algorithm=feautrier +domain: { A[]; B[0]; C[] } +validity: { A[] -> B[0] } diff --git a/polly/lib/External/isl/test_inputs/schedule/feautrier_compressed.st b/polly/lib/External/isl/test_inputs/schedule/feautrier_compressed.st new file mode 100644 index 0000000..8d6c654 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/schedule/feautrier_compressed.st @@ -0,0 +1,11 @@ +domain: "{ B[0]; C[]; A[] }" +child: + set: + - filter: "{ B[i0]; A[] }" + child: + schedule: "[{ B[i0] -> [(1)]; A[] -> [(0)] }]" + child: + set: + - filter: "{ A[] }" + - filter: "{ B[i0] }" + - filter: "{ C[] }" -- 2.7.4