Update to isl-0.18-812-g565da6e
authorTobias Grosser <tobias@grosser.es>
Sun, 6 Aug 2017 15:51:16 +0000 (15:51 +0000)
committerTobias Grosser <tobias@grosser.es>
Sun, 6 Aug 2017 15:51:16 +0000 (15:51 +0000)
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
polly/lib/External/isl/doc/user.pod
polly/lib/External/isl/include/isl/aff.h
polly/lib/External/isl/isl_aff.c
polly/lib/External/isl/schedule_cmp.c [new file with mode: 0644]
polly/lib/External/isl/schedule_test.sh.in [new file with mode: 0644]
polly/lib/External/isl/test_inputs/schedule/feautrier_compressed.sc [new file with mode: 0644]
polly/lib/External/isl/test_inputs/schedule/feautrier_compressed.st [new file with mode: 0644]

index 760fcbf..1bb0da4 100644 (file)
@@ -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);
index dc67819..b032ab1 100644 (file)
@@ -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);
 
index 61ef61e..8b3f82b 100644 (file)
@@ -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 (file)
index 0000000..8bf02ea
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2017      Sven Verdoolaege
+ *
+ * Use of this software is governed by the MIT license
+ *
+ * Written by Sven Verdoolaege.
+ */
+
+#include <stdlib.h>
+
+#include <isl/arg.h>
+#include <isl/options.h>
+#include <isl/schedule.h>
+
+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 (file)
index 0000000..afba802
--- /dev/null
@@ -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 (file)
index 0000000..f90bd88
--- /dev/null
@@ -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 (file)
index 0000000..8d6c654
--- /dev/null
@@ -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[] }"