[polly] r333118 - Update isl to isl-0.19-152-g437e6ab0

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Wed May 23 13:36:06 PDT 2018


Thank you.

Michael

2018-05-23 15:18 GMT-05:00 Tobias Grosser via llvm-commits
<llvm-commits at lists.llvm.org>:
> Author: grosser
> Date: Wed May 23 13:18:50 2018
> New Revision: 333118
>
> URL: http://llvm.org/viewvc/llvm-project?rev=333118&view=rev
> Log:
> Update isl to isl-0.19-152-g437e6ab0
>
> Besides normal updates this change also contains a bug-fix to in
> isl_coalesce which broke the AOSP buildbot. Thanks to Michael Kruse for
> reporting this bug and Sven Verdoolage for fixing this bug.
>
> Added:
>     polly/trunk/lib/External/isl/include/isl/id_type.h
>     polly/trunk/lib/External/isl/include/isl/space_type.h
>     polly/trunk/lib/External/isl/include/isl/val_type.h
> Modified:
>     polly/trunk/lib/External/isl/GIT_HEAD_ID
>     polly/trunk/lib/External/isl/Makefile.am
>     polly/trunk/lib/External/isl/Makefile.in
>     polly/trunk/lib/External/isl/doc/user.pod
>     polly/trunk/lib/External/isl/include/isl/aff.h
>     polly/trunk/lib/External/isl/include/isl/ast.h
>     polly/trunk/lib/External/isl/include/isl/constraint.h
>     polly/trunk/lib/External/isl/include/isl/id.h
>     polly/trunk/lib/External/isl/include/isl/id_to_ast_expr.h
>     polly/trunk/lib/External/isl/include/isl/id_to_id.h
>     polly/trunk/lib/External/isl/include/isl/id_to_pw_aff.h
>     polly/trunk/lib/External/isl/include/isl/ilp.h
>     polly/trunk/lib/External/isl/include/isl/local_space.h
>     polly/trunk/lib/External/isl/include/isl/lp.h
>     polly/trunk/lib/External/isl/include/isl/map.h
>     polly/trunk/lib/External/isl/include/isl/mat.h
>     polly/trunk/lib/External/isl/include/isl/multi.h
>     polly/trunk/lib/External/isl/include/isl/point.h
>     polly/trunk/lib/External/isl/include/isl/polynomial.h
>     polly/trunk/lib/External/isl/include/isl/printer.h
>     polly/trunk/lib/External/isl/include/isl/schedule.h
>     polly/trunk/lib/External/isl/include/isl/schedule_node.h
>     polly/trunk/lib/External/isl/include/isl/set.h
>     polly/trunk/lib/External/isl/include/isl/space.h
>     polly/trunk/lib/External/isl/include/isl/stream.h
>     polly/trunk/lib/External/isl/include/isl/union_map.h
>     polly/trunk/lib/External/isl/include/isl/val.h
>     polly/trunk/lib/External/isl/include/isl/val_gmp.h
>     polly/trunk/lib/External/isl/include/isl/vec.h
>     polly/trunk/lib/External/isl/isl_aff.c
>     polly/trunk/lib/External/isl/isl_coalesce.c
>     polly/trunk/lib/External/isl/isl_constraint.c
>     polly/trunk/lib/External/isl/isl_constraint_private.h
>     polly/trunk/lib/External/isl/isl_dim_map.c
>     polly/trunk/lib/External/isl/isl_fold.c
>     polly/trunk/lib/External/isl/isl_list_templ.c
>     polly/trunk/lib/External/isl/isl_local.c
>     polly/trunk/lib/External/isl/isl_local.h
>     polly/trunk/lib/External/isl/isl_local_space.c
>     polly/trunk/lib/External/isl/isl_local_space_private.h
>     polly/trunk/lib/External/isl/isl_map.c
>     polly/trunk/lib/External/isl/isl_multi_explicit_domain.c
>     polly/trunk/lib/External/isl/isl_multi_templ.c
>     polly/trunk/lib/External/isl/isl_polynomial.c
>     polly/trunk/lib/External/isl/isl_pw_templ.c
>     polly/trunk/lib/External/isl/isl_reordering.c
>     polly/trunk/lib/External/isl/isl_reordering.h
>     polly/trunk/lib/External/isl/isl_space.c
>     polly/trunk/lib/External/isl/isl_space_private.h
>     polly/trunk/lib/External/isl/isl_test.c
>     polly/trunk/lib/External/isl/isl_union_map.c
>     polly/trunk/lib/External/isl/isl_union_templ.c
>
> Modified: polly/trunk/lib/External/isl/GIT_HEAD_ID
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/GIT_HEAD_ID?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/GIT_HEAD_ID (original)
> +++ polly/trunk/lib/External/isl/GIT_HEAD_ID Wed May 23 13:18:50 2018
> @@ -1 +1 @@
> -isl-0.19-114-g385262af
> +isl-0.19-152-g437e6ab0
>
> Modified: polly/trunk/lib/External/isl/Makefile.am
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/Makefile.am?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/Makefile.am (original)
> +++ polly/trunk/lib/External/isl/Makefile.am Wed May 23 13:18:50 2018
> @@ -276,6 +276,7 @@ pkginclude_HEADERS = \
>         include/isl/ctx.h \
>         include/isl/flow.h \
>         include/isl/id.h \
> +       include/isl/id_type.h \
>         include/isl/id_to_ast_expr.h \
>         include/isl/id_to_id.h \
>         include/isl/id_to_pw_aff.h \
> @@ -310,6 +311,7 @@ pkginclude_HEADERS = \
>         include/isl/set.h \
>         include/isl/set_type.h \
>         include/isl/space.h \
> +       include/isl/space_type.h \
>         include/isl/stream.h \
>         include/isl/stride_info.h \
>         include/isl/union_map.h \
> @@ -317,6 +319,7 @@ pkginclude_HEADERS = \
>         include/isl/union_set.h \
>         include/isl/union_set_type.h \
>         include/isl/val.h \
> +       include/isl/val_type.h \
>         include/isl/vec.h \
>         include/isl/version.h \
>         include/isl/vertices.h
>
> Modified: polly/trunk/lib/External/isl/Makefile.in
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/Makefile.in?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/Makefile.in (original)
> +++ polly/trunk/lib/External/isl/Makefile.in Wed May 23 13:18:50 2018
> @@ -417,26 +417,27 @@ am__pkginclude_HEADERS_DIST = include/is
>         include/isl/aff_type.h include/isl/arg.h include/isl/ast.h \
>         include/isl/ast_type.h include/isl/ast_build.h \
>         include/isl/constraint.h include/isl/ctx.h include/isl/flow.h \
> -       include/isl/id.h include/isl/id_to_ast_expr.h \
> -       include/isl/id_to_id.h include/isl/id_to_pw_aff.h \
> -       include/isl/ilp.h include/isl/hash.h include/isl/hmap.h \
> -       include/isl/hmap_templ.c include/isl/list.h \
> -       include/isl/local_space.h include/isl/lp.h include/isl/mat.h \
> -       include/isl/map.h include/isl/map_to_basic_set.h \
> -       include/isl/map_type.h include/isl/maybe.h \
> -       include/isl/maybe_ast_expr.h include/isl/maybe_basic_set.h \
> -       include/isl/maybe_id.h include/isl/maybe_pw_aff.h \
> -       include/isl/maybe_templ.h include/isl/multi.h \
> -       include/isl/obj.h include/isl/options.h include/isl/point.h \
> -       include/isl/polynomial.h include/isl/polynomial_type.h \
> -       include/isl/printer.h include/isl/printer_type.h \
> -       include/isl/schedule.h include/isl/schedule_node.h \
> -       include/isl/schedule_type.h include/isl/set.h \
> -       include/isl/set_type.h include/isl/space.h \
> -       include/isl/stream.h include/isl/stride_info.h \
> -       include/isl/union_map.h include/isl/union_map_type.h \
> -       include/isl/union_set.h include/isl/union_set_type.h \
> -       include/isl/val.h include/isl/vec.h include/isl/version.h \
> +       include/isl/id.h include/isl/id_type.h \
> +       include/isl/id_to_ast_expr.h include/isl/id_to_id.h \
> +       include/isl/id_to_pw_aff.h include/isl/ilp.h \
> +       include/isl/hash.h include/isl/hmap.h include/isl/hmap_templ.c \
> +       include/isl/list.h include/isl/local_space.h include/isl/lp.h \
> +       include/isl/mat.h include/isl/map.h \
> +       include/isl/map_to_basic_set.h include/isl/map_type.h \
> +       include/isl/maybe.h include/isl/maybe_ast_expr.h \
> +       include/isl/maybe_basic_set.h include/isl/maybe_id.h \
> +       include/isl/maybe_pw_aff.h include/isl/maybe_templ.h \
> +       include/isl/multi.h include/isl/obj.h include/isl/options.h \
> +       include/isl/point.h include/isl/polynomial.h \
> +       include/isl/polynomial_type.h include/isl/printer.h \
> +       include/isl/printer_type.h include/isl/schedule.h \
> +       include/isl/schedule_node.h include/isl/schedule_type.h \
> +       include/isl/set.h include/isl/set_type.h include/isl/space.h \
> +       include/isl/space_type.h include/isl/stream.h \
> +       include/isl/stride_info.h include/isl/union_map.h \
> +       include/isl/union_map_type.h include/isl/union_set.h \
> +       include/isl/union_set_type.h include/isl/val.h \
> +       include/isl/val_type.h include/isl/vec.h include/isl/version.h \
>         include/isl/vertices.h
>  HEADERS = $(nodist_pkginclude_HEADERS) $(pkginclude_HEADERS)
>  RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
> @@ -1076,6 +1077,7 @@ pkginclude_HEADERS = \
>         include/isl/ctx.h \
>         include/isl/flow.h \
>         include/isl/id.h \
> +       include/isl/id_type.h \
>         include/isl/id_to_ast_expr.h \
>         include/isl/id_to_id.h \
>         include/isl/id_to_pw_aff.h \
> @@ -1110,6 +1112,7 @@ pkginclude_HEADERS = \
>         include/isl/set.h \
>         include/isl/set_type.h \
>         include/isl/space.h \
> +       include/isl/space_type.h \
>         include/isl/stream.h \
>         include/isl/stride_info.h \
>         include/isl/union_map.h \
> @@ -1117,6 +1120,7 @@ pkginclude_HEADERS = \
>         include/isl/union_set.h \
>         include/isl/union_set_type.h \
>         include/isl/val.h \
> +       include/isl/val_type.h \
>         include/isl/vec.h \
>         include/isl/version.h \
>         include/isl/vertices.h
>
> Modified: polly/trunk/lib/External/isl/doc/user.pod
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/doc/user.pod?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/doc/user.pod (original)
> +++ polly/trunk/lib/External/isl/doc/user.pod Wed May 23 13:18:50 2018
> @@ -10364,6 +10364,10 @@ A block will always be printed by settin
>                 isl_ctx *ctx, int val);
>         int isl_options_get_ast_build_group_coscheduled(
>                 isl_ctx *ctx);
> +       isl_stat isl_options_set_ast_build_separation_bounds(
> +               isl_ctx *ctx, int val);
> +       int isl_options_get_ast_build_separation_bounds(
> +               isl_ctx *ctx);
>         isl_stat isl_options_set_ast_build_scale_strides(
>                 isl_ctx *ctx, int val);
>         int isl_options_get_ast_build_scale_strides(
>
> Modified: polly/trunk/lib/External/isl/include/isl/aff.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/aff.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/aff.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/aff.h Wed May 23 13:18:50 2018
> @@ -1,6 +1,7 @@
>  #ifndef ISL_AFF_H
>  #define ISL_AFF_H
>
> +#include <isl/stdint.h>
>  #include <isl/local_space.h>
>  #include <isl/printer.h>
>  #include <isl/set_type.h>
> @@ -8,7 +9,7 @@
>  #include <isl/list.h>
>  #include <isl/multi.h>
>  #include <isl/union_set_type.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>  #include <isl/point.h>
>
>  #if defined(__cplusplus)
>
> Modified: polly/trunk/lib/External/isl/include/isl/ast.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/ast.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/ast.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/ast.h Wed May 23 13:18:50 2018
> @@ -3,9 +3,9 @@
>
>  #include <isl/ctx.h>
>  #include <isl/ast_type.h>
> -#include <isl/id.h>
> +#include <isl/id_type.h>
>  #include <isl/id_to_ast_expr.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>  #include <isl/list.h>
>  #include <isl/printer.h>
>
>
> Modified: polly/trunk/lib/External/isl/include/isl/constraint.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/constraint.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/constraint.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/constraint.h Wed May 23 13:18:50 2018
> @@ -11,11 +11,11 @@
>  #define ISL_CONSTRAINT_H
>
>  #include <isl/local_space.h>
> -#include <isl/space.h>
> +#include <isl/space_type.h>
>  #include <isl/aff_type.h>
>  #include <isl/set_type.h>
>  #include <isl/list.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>  #include <isl/printer.h>
>
>  #if defined(__cplusplus)
>
> Modified: polly/trunk/lib/External/isl/include/isl/id.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/id.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/id.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/id.h Wed May 23 13:18:50 2018
> @@ -2,6 +2,7 @@
>  #define ISL_ID_H
>
>  #include <isl/ctx.h>
> +#include <isl/id_type.h>
>  #include <isl/list.h>
>  #include <isl/printer_type.h>
>  #include <isl/stdint.h>
> @@ -10,10 +11,7 @@
>  extern "C" {
>  #endif
>
> -struct isl_id;
> -typedef struct isl_id isl_id;
> -
> -ISL_DECLARE_LIST(id)
> +ISL_DECLARE_LIST_FN(id)
>
>  isl_ctx *isl_id_get_ctx(__isl_keep isl_id *id);
>  uint32_t isl_id_get_hash(__isl_keep isl_id *id);
>
> Modified: polly/trunk/lib/External/isl/include/isl/id_to_ast_expr.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/id_to_ast_expr.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/id_to_ast_expr.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/id_to_ast_expr.h Wed May 23 13:18:50 2018
> @@ -1,7 +1,7 @@
>  #ifndef ISL_ID_TO_AST_EXPR_H
>  #define ISL_ID_TO_AST_EXPR_H
>
> -#include <isl/id.h>
> +#include <isl/id_type.h>
>  #include <isl/ast_type.h>
>  #include <isl/maybe_ast_expr.h>
>
>
> Modified: polly/trunk/lib/External/isl/include/isl/id_to_id.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/id_to_id.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/id_to_id.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/id_to_id.h Wed May 23 13:18:50 2018
> @@ -1,7 +1,7 @@
>  #ifndef ISL_ID_TO_ID_H
>  #define ISL_ID_TO_ID_H
>
> -#include <isl/id.h>
> +#include <isl/id_type.h>
>  #include <isl/maybe_id.h>
>
>  #define ISL_KEY                isl_id
>
> Modified: polly/trunk/lib/External/isl/include/isl/id_to_pw_aff.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/id_to_pw_aff.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/id_to_pw_aff.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/id_to_pw_aff.h Wed May 23 13:18:50 2018
> @@ -1,7 +1,7 @@
>  #ifndef ISL_ID_TO_PW_AFF_H
>  #define ISL_ID_TO_PW_AFF_H
>
> -#include <isl/id.h>
> +#include <isl/id_type.h>
>  #include <isl/aff_type.h>
>  #include <isl/maybe_pw_aff.h>
>
>
> Added: polly/trunk/lib/External/isl/include/isl/id_type.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/id_type.h?rev=333118&view=auto
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/id_type.h (added)
> +++ polly/trunk/lib/External/isl/include/isl/id_type.h Wed May 23 13:18:50 2018
> @@ -0,0 +1,19 @@
> +#ifndef ISL_ID_TYPE_H
> +#define ISL_ID_TYPE_H
> +
> +#include <isl/list.h>
> +
> +#if defined(__cplusplus)
> +extern "C" {
> +#endif
> +
> +struct isl_id;
> +typedef struct isl_id isl_id;
> +
> +ISL_DECLARE_LIST_TYPE(id)
> +
> +#if defined(__cplusplus)
> +}
> +#endif
> +
> +#endif
>
> Modified: polly/trunk/lib/External/isl/include/isl/ilp.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/ilp.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/ilp.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/ilp.h Wed May 23 13:18:50 2018
> @@ -13,7 +13,7 @@
>  #include <isl/aff_type.h>
>  #include <isl/set_type.h>
>  #include <isl/union_set_type.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>  #include <isl/vec.h>
>
>  #if defined(__cplusplus)
>
> Modified: polly/trunk/lib/External/isl/include/isl/local_space.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/local_space.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/local_space.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/local_space.h Wed May 23 13:18:50 2018
> @@ -2,7 +2,7 @@
>  #define ISL_LOCAL_SPACE_H
>
>  #include <isl/aff_type.h>
> -#include <isl/space.h>
> +#include <isl/space_type.h>
>  #include <isl/printer.h>
>  #include <isl/map_type.h>
>
>
> Modified: polly/trunk/lib/External/isl/include/isl/lp.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/lp.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/lp.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/lp.h Wed May 23 13:18:50 2018
> @@ -11,7 +11,7 @@
>  #define ISL_LP_H
>
>  #include <isl/aff.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>  #include <isl/set_type.h>
>
>  enum isl_lp_result {
>
> Modified: polly/trunk/lib/External/isl/include/isl/map.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/map.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/map.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/map.h Wed May 23 13:18:50 2018
> @@ -13,7 +13,7 @@
>  #include <stdio.h>
>
>  #include <isl/ctx.h>
> -#include <isl/space.h>
> +#include <isl/space_type.h>
>  #include <isl/vec.h>
>  #include <isl/mat.h>
>  #include <isl/printer.h>
> @@ -21,7 +21,7 @@
>  #include <isl/aff_type.h>
>  #include <isl/list.h>
>  #include <isl/map_type.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>  #include <isl/stdint.h>
>  #include <isl/stride_info.h>
>
>
> Modified: polly/trunk/lib/External/isl/include/isl/mat.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/mat.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/mat.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/mat.h Wed May 23 13:18:50 2018
> @@ -14,7 +14,7 @@
>
>  #include <isl/ctx.h>
>  #include <isl/vec.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>
>  #if defined(__cplusplus)
>  extern "C" {
>
> Modified: polly/trunk/lib/External/isl/include/isl/multi.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/multi.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/multi.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/multi.h Wed May 23 13:18:50 2018
> @@ -1,7 +1,8 @@
>  #ifndef ISL_MULTI_H
>  #define ISL_MULTI_H
>
> -#include <isl/space.h>
> +#include <isl/val_type.h>
> +#include <isl/space_type.h>
>  #include <isl/list.h>
>  #include <isl/set_type.h>
>
>
> Modified: polly/trunk/lib/External/isl/include/isl/point.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/point.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/point.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/point.h Wed May 23 13:18:50 2018
> @@ -2,8 +2,8 @@
>  #define ISL_POINT_H
>
>  #include <stdio.h>
> -#include <isl/space.h>
> -#include <isl/val.h>
> +#include <isl/space_type.h>
> +#include <isl/val_type.h>
>
>  #if defined(__cplusplus)
>  extern "C" {
>
> Modified: polly/trunk/lib/External/isl/include/isl/polynomial.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/polynomial.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/polynomial.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/polynomial.h Wed May 23 13:18:50 2018
> @@ -3,14 +3,14 @@
>
>  #include <isl/ctx.h>
>  #include <isl/constraint.h>
> -#include <isl/space.h>
> +#include <isl/space_type.h>
>  #include <isl/set_type.h>
>  #include <isl/point.h>
>  #include <isl/printer.h>
>  #include <isl/union_set_type.h>
>  #include <isl/aff_type.h>
>  #include <isl/polynomial_type.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>
>  #if defined(__cplusplus)
>  extern "C" {
>
> Modified: polly/trunk/lib/External/isl/include/isl/printer.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/printer.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/printer.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/printer.h Wed May 23 13:18:50 2018
> @@ -4,7 +4,7 @@
>  #include <stdio.h>
>  #include <isl/ctx.h>
>  #include <isl/printer_type.h>
> -#include <isl/id.h>
> +#include <isl/id_type.h>
>
>  #if defined(__cplusplus)
>  extern "C" {
>
> Modified: polly/trunk/lib/External/isl/include/isl/schedule.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/schedule.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/schedule.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/schedule.h Wed May 23 13:18:50 2018
> @@ -5,7 +5,7 @@
>  #include <isl/union_map_type.h>
>  #include <isl/schedule_type.h>
>  #include <isl/aff_type.h>
> -#include <isl/space.h>
> +#include <isl/space_type.h>
>  #include <isl/set_type.h>
>  #include <isl/list.h>
>  #include <isl/printer_type.h>
>
> Modified: polly/trunk/lib/External/isl/include/isl/schedule_node.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/schedule_node.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/schedule_node.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/schedule_node.h Wed May 23 13:18:50 2018
> @@ -5,8 +5,8 @@
>  #include <isl/union_set_type.h>
>  #include <isl/aff_type.h>
>  #include <isl/ast_type.h>
> -#include <isl/val.h>
> -#include <isl/space.h>
> +#include <isl/val_type.h>
> +#include <isl/space_type.h>
>
>  #if defined(__cplusplus)
>  extern "C" {
>
> Modified: polly/trunk/lib/External/isl/include/isl/set.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/set.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/set.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/set.h Wed May 23 13:18:50 2018
> @@ -10,13 +10,14 @@
>  #ifndef ISL_SET_H
>  #define ISL_SET_H
>
> +#include <isl/id_type.h>
>  #include <isl/map_type.h>
>  #include <isl/aff_type.h>
>  #include <isl/list.h>
>  #include <isl/mat.h>
>  #include <isl/point.h>
>  #include <isl/local_space.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>  #include <isl/stdint.h>
>  #include <isl/stride_info.h>
>
>
> Modified: polly/trunk/lib/External/isl/include/isl/space.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/space.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/space.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/space.h Wed May 23 13:18:50 2018
> @@ -11,26 +11,14 @@
>  #define ISL_SPACE_H
>
>  #include <isl/ctx.h>
> -#include <isl/id.h>
> +#include <isl/space_type.h>
> +#include <isl/id_type.h>
>  #include <isl/printer.h>
>
>  #if defined(__cplusplus)
>  extern "C" {
>  #endif
>
> -struct isl_space;
> -typedef struct isl_space isl_space;
> -
> -enum isl_dim_type {
> -       isl_dim_cst,
> -       isl_dim_param,
> -       isl_dim_in,
> -       isl_dim_out,
> -       isl_dim_set = isl_dim_out,
> -       isl_dim_div,
> -       isl_dim_all
> -};
> -
>  isl_ctx *isl_space_get_ctx(__isl_keep isl_space *dim);
>  __isl_give isl_space *isl_space_alloc(isl_ctx *ctx,
>                         unsigned nparam, unsigned n_in, unsigned n_out);
>
> Added: polly/trunk/lib/External/isl/include/isl/space_type.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/space_type.h?rev=333118&view=auto
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/space_type.h (added)
> +++ polly/trunk/lib/External/isl/include/isl/space_type.h Wed May 23 13:18:50 2018
> @@ -0,0 +1,25 @@
> +#ifndef ISL_SPACE_TYPE_H
> +#define ISL_SPACE_TYPE_H
> +
> +#if defined(__cplusplus)
> +extern "C" {
> +#endif
> +
> +struct isl_space;
> +typedef struct isl_space isl_space;
> +
> +enum isl_dim_type {
> +       isl_dim_cst,
> +       isl_dim_param,
> +       isl_dim_in,
> +       isl_dim_out,
> +       isl_dim_set = isl_dim_out,
> +       isl_dim_div,
> +       isl_dim_all
> +};
> +
> +#if defined(__cplusplus)
> +}
> +#endif
> +
> +#endif
>
> Modified: polly/trunk/lib/External/isl/include/isl/stream.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/stream.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/stream.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/stream.h Wed May 23 13:18:50 2018
> @@ -14,7 +14,7 @@
>  #include <isl/hash.h>
>  #include <isl/aff_type.h>
>  #include <isl/obj.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>  #include <isl/schedule_type.h>
>
>  #if defined(__cplusplus)
>
> Modified: polly/trunk/lib/External/isl/include/isl/union_map.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/union_map.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/union_map.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/union_map.h Wed May 23 13:18:50 2018
> @@ -1,12 +1,13 @@
>  #ifndef ISL_UNION_MAP_H
>  #define ISL_UNION_MAP_H
>
> -#include <isl/space.h>
> +#include <isl/stdint.h>
> +#include <isl/space_type.h>
>  #include <isl/aff_type.h>
>  #include <isl/map_type.h>
>  #include <isl/union_map_type.h>
>  #include <isl/printer.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>
>  #if defined(__cplusplus)
>  extern "C" {
>
> Modified: polly/trunk/lib/External/isl/include/isl/val.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/val.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/val.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/val.h Wed May 23 13:18:50 2018
> @@ -1,23 +1,17 @@
>  #ifndef ISL_VAL_H
>  #define ISL_VAL_H
>
> +#include <isl/stdint.h>
>  #include <isl/ctx.h>
>  #include <isl/list.h>
>  #include <isl/multi.h>
>  #include <isl/printer.h>
> +#include <isl/val_type.h>
>
>  #if defined(__cplusplus)
>  extern "C" {
>  #endif
>
> -struct __isl_export isl_val;
> -typedef struct isl_val isl_val;
> -
> -ISL_DECLARE_LIST(val)
> -
> -struct __isl_export isl_multi_val;
> -typedef struct isl_multi_val isl_multi_val;
> -
>  ISL_DECLARE_MULTI(val)
>  ISL_DECLARE_MULTI_NEG(val)
>  ISL_DECLARE_MULTI_DIMS(val)
> @@ -161,6 +155,8 @@ __isl_give isl_printer *isl_printer_prin
>  void isl_multi_val_dump(__isl_keep isl_multi_val *mv);
>  __isl_give char *isl_multi_val_to_str(__isl_keep isl_multi_val *mv);
>
> +ISL_DECLARE_LIST_FN(val)
> +
>  #if defined(__cplusplus)
>  }
>  #endif
>
> Modified: polly/trunk/lib/External/isl/include/isl/val_gmp.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/val_gmp.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/val_gmp.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/val_gmp.h Wed May 23 13:18:50 2018
> @@ -2,7 +2,7 @@
>  #define ISL_VAL_GMP_H
>
>  #include <gmp.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>
>  #if defined(__cplusplus)
>  extern "C" {
>
> Added: polly/trunk/lib/External/isl/include/isl/val_type.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/val_type.h?rev=333118&view=auto
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/val_type.h (added)
> +++ polly/trunk/lib/External/isl/include/isl/val_type.h Wed May 23 13:18:50 2018
> @@ -0,0 +1,22 @@
> +#ifndef ISL_VAL_TYPE_H
> +#define ISL_VAL_TYPE_H
> +
> +#include <isl/list.h>
> +
> +#if defined(__cplusplus)
> +extern "C" {
> +#endif
> +
> +struct __isl_export isl_val;
> +typedef struct isl_val isl_val;
> +
> +ISL_DECLARE_LIST_TYPE(val)
> +
> +struct __isl_export isl_multi_val;
> +typedef struct isl_multi_val isl_multi_val;
> +
> +#if defined(__cplusplus)
> +}
> +#endif
> +
> +#endif
>
> Modified: polly/trunk/lib/External/isl/include/isl/vec.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/vec.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/include/isl/vec.h (original)
> +++ polly/trunk/lib/External/isl/include/isl/vec.h Wed May 23 13:18:50 2018
> @@ -13,7 +13,7 @@
>  #include <stdio.h>
>
>  #include <isl/ctx.h>
> -#include <isl/val.h>
> +#include <isl/val_type.h>
>  #include <isl/printer.h>
>
>  #if defined(__cplusplus)
>
> Modified: polly/trunk/lib/External/isl/isl_aff.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_aff.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_aff.c (original)
> +++ polly/trunk/lib/External/isl/isl_aff.c Wed May 23 13:18:50 2018
> @@ -492,14 +492,16 @@ __isl_give isl_aff *isl_aff_reset_space_
>  static __isl_give isl_vec *vec_reorder(__isl_take isl_vec *vec,
>         __isl_take isl_reordering *r, int n_div)
>  {
> +       isl_space *space;
>         isl_vec *res;
>         int i;
>
>         if (!vec || !r)
>                 goto error;
>
> +       space = isl_reordering_peek_space(r);
>         res = isl_vec_alloc(vec->ctx,
> -                           2 + isl_space_dim(r->dim, isl_dim_all) + n_div);
> +                           2 + isl_space_dim(space, isl_dim_all) + n_div);
>         if (!res)
>                 goto error;
>         isl_seq_cpy(res->el, vec->el, 2);
> @@ -1998,7 +2000,7 @@ __isl_give isl_aff *isl_aff_set_tuple_id
>         aff = isl_aff_cow(aff);
>         if (!aff)
>                 goto error;
> -       if (type != isl_dim_out)
> +       if (type != isl_dim_in)
>                 isl_die(aff->v->ctx, isl_error_invalid,
>                         "cannot only set id of input tuple", goto error);
>         aff->ls = isl_local_space_set_tuple_id(aff->ls, isl_dim_set, id);
> @@ -8194,7 +8196,6 @@ error:
>  #define NO_SPLICE
>  #define NO_ZERO
>  #define NO_IDENTITY
> -#define NO_GIST
>
>  #include <isl_multi_explicit_domain.c>
>  #include <isl_multi_union_pw_aff_explicit_domain.c>
> @@ -8499,6 +8500,10 @@ __isl_give isl_multi_union_pw_aff *isl_m
>  /* Return a multiple union piecewise affine expression
>   * that is equal to "mv" on "domain", assuming "domain" and "mv"
>   * have been aligned.
> + *
> + * If the resulting multi union piecewise affine expression has
> + * an explicit domain, then assign it the input domain.
> + * In other cases, the domain is stored in the individual elements.
>   */
>  static __isl_give isl_multi_union_pw_aff *
>  isl_multi_union_pw_aff_multi_val_on_domain_aligned(
> @@ -8523,6 +8528,9 @@ isl_multi_union_pw_aff_multi_val_on_doma
>                                                         v);
>                 mupa = isl_multi_union_pw_aff_set_union_pw_aff(mupa, i, upa);
>         }
> +       if (isl_multi_union_pw_aff_has_explicit_domain(mupa))
> +               mupa = isl_multi_union_pw_aff_intersect_domain(mupa,
> +                                                   isl_union_set_copy(domain));
>
>         isl_union_set_free(domain);
>         isl_multi_val_free(mv);
>
> Modified: polly/trunk/lib/External/isl/isl_coalesce.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_coalesce.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_coalesce.c (original)
> +++ polly/trunk/lib/External/isl/isl_coalesce.c Wed May 23 13:18:50 2018
> @@ -2393,7 +2393,7 @@ static isl_stat shift_div(struct isl_coa
>   *
>   *     c + f + m a = 0
>   *
> - * The integer division expression is then of the form
> + * The integer division expression is then typically of the form
>   *
>   *     a = floor((-f - c')/m)
>   *
> @@ -2411,11 +2411,12 @@ static isl_stat shift_div(struct isl_coa
>   *     a' = (-f - (c mod m))/m = floor((-f)/m)
>   *
>   * because a' is an integer and 0 <= (c mod m) < m.
> - * The constant term of a' can therefore be zeroed out.
> + * The constant term of a' can therefore be zeroed out,
> + * but only if the integer division expression is of the expected form.
>   */
>  static isl_stat normalize_stride_div(struct isl_coalesce_info *info, int div)
>  {
> -       isl_bool defined;
> +       isl_bool defined, valid;
>         isl_stat r;
>         isl_constraint *c;
>         isl_int shift, stride;
> @@ -2428,6 +2429,7 @@ static isl_stat normalize_stride_div(str
>                 return isl_stat_ok;
>         if (!c)
>                 return isl_stat_error;
> +       valid = isl_constraint_is_div_equality(c, div);
>         isl_int_init(shift);
>         isl_int_init(stride);
>         isl_constraint_get_constant(c, &shift);
> @@ -2437,8 +2439,10 @@ static isl_stat normalize_stride_div(str
>         isl_int_clear(stride);
>         isl_int_clear(shift);
>         isl_constraint_free(c);
> -       if (r < 0)
> +       if (r < 0 || valid < 0)
>                 return isl_stat_error;
> +       if (!valid)
> +               return isl_stat_ok;
>         info->bmap = isl_basic_map_set_div_expr_constant_num_si_inplace(
>                                                             info->bmap, div, 0);
>         if (!info->bmap)
>
> Modified: polly/trunk/lib/External/isl/isl_constraint.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_constraint.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_constraint.c (original)
> +++ polly/trunk/lib/External/isl/isl_constraint.c Wed May 23 13:18:50 2018
> @@ -717,6 +717,32 @@ int isl_constraint_is_div_constraint(__i
>         return 0;
>  }
>
> +/* Is "constraint" an equality that corresponds to integer division "div"?
> + *
> + * That is, given an integer division of the form
> + *
> + *     a = floor((f + c)/m)
> + *
> + * is the equality of the form
> + *
> + *             -f + m d + c' = 0
> + * ?
> + * Note that the constant term is not checked explicitly, but given
> + * that this is a valid equality constraint, the constant c' necessarily
> + * has a value close to -c.
> + */
> +isl_bool isl_constraint_is_div_equality(__isl_keep isl_constraint *constraint,
> +       unsigned div)
> +{
> +       isl_bool equality;
> +
> +       equality = isl_constraint_is_equality(constraint);
> +       if (equality < 0 || !equality)
> +               return equality;
> +       return isl_local_space_is_div_equality(constraint->ls,
> +                                               constraint->v->el, div);
> +}
> +
>  /* We manually set ISL_BASIC_SET_FINAL instead of calling
>   * isl_basic_map_finalize because we want to keep the position
>   * of the divs and we therefore do not want to throw away redundant divs.
>
> Modified: polly/trunk/lib/External/isl/isl_constraint_private.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_constraint_private.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_constraint_private.h (original)
> +++ polly/trunk/lib/External/isl/isl_constraint_private.h Wed May 23 13:18:50 2018
> @@ -26,4 +26,7 @@ void isl_constraint_get_constant(__isl_k
>  void isl_constraint_get_coefficient(__isl_keep isl_constraint *constraint,
>         enum isl_dim_type type, int pos, isl_int *v);
>
> +isl_bool isl_constraint_is_div_equality(__isl_keep isl_constraint *constraint,
> +       unsigned div);
> +
>  #endif
>
> Modified: polly/trunk/lib/External/isl/isl_dim_map.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_dim_map.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_dim_map.c (original)
> +++ polly/trunk/lib/External/isl/isl_dim_map.c Wed May 23 13:18:50 2018
> @@ -216,13 +216,15 @@ __isl_give isl_dim_map *isl_dim_map_from
>  {
>         int i;
>         isl_ctx *ctx;
> +       isl_space *space;
>         struct isl_dim_map *dim_map;
>
>         if (!exp)
>                 return NULL;
>
> -       ctx = isl_space_get_ctx(exp->dim);
> -       dim_map = isl_dim_map_alloc(ctx, isl_space_dim(exp->dim, isl_dim_all));
> +       ctx = isl_reordering_get_ctx(exp);
> +       space = isl_reordering_peek_space(exp);
> +       dim_map = isl_dim_map_alloc(ctx, isl_space_dim(space, isl_dim_all));
>         if (!dim_map)
>                 return NULL;
>
>
> Modified: polly/trunk/lib/External/isl/isl_fold.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_fold.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_fold.c (original)
> +++ polly/trunk/lib/External/isl/isl_fold.c Wed May 23 13:18:50 2018
> @@ -1657,6 +1657,7 @@ __isl_give isl_qpolynomial_fold *isl_qpo
>         __isl_take isl_qpolynomial_fold *fold, __isl_take isl_reordering *r)
>  {
>         int i;
> +       isl_space *space;
>
>         fold = isl_qpolynomial_fold_cow(fold);
>         if (!fold || !r)
> @@ -1669,8 +1670,8 @@ __isl_give isl_qpolynomial_fold *isl_qpo
>                         goto error;
>         }
>
> -       fold = isl_qpolynomial_fold_reset_domain_space(fold,
> -                                                   isl_space_copy(r->dim));
> +       space = isl_reordering_get_space(r);
> +       fold = isl_qpolynomial_fold_reset_domain_space(fold, space);
>
>         isl_reordering_free(r);
>
>
> Modified: polly/trunk/lib/External/isl/isl_list_templ.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_list_templ.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_list_templ.c (original)
> +++ polly/trunk/lib/External/isl/isl_list_templ.c Wed May 23 13:18:50 2018
> @@ -251,11 +251,20 @@ int FN(FN(LIST(EL),n),BASE)(__isl_keep L
>         return list ? list->n : 0;
>  }
>
> -__isl_give EL *FN(FN(LIST(EL),get),BASE)(__isl_keep LIST(EL) *list, int index)
> +/* Return the element at position "index" in "list".
> + */
> +static __isl_keep EL *FN(LIST(EL),peek)(__isl_keep LIST(EL) *list, int index)
>  {
>         if (FN(LIST(EL),check_index)(list, index) < 0)
>                 return NULL;
> -       return FN(EL,copy)(list->p[index]);
> +       return list->p[index];
> +}
> +
> +/* Return a copy of the element at position "index" in "list".
> + */
> +__isl_give EL *FN(FN(LIST(EL),get),BASE)(__isl_keep LIST(EL) *list, int index)
> +{
> +       return FN(EL,copy)(FN(LIST(EL),peek)(list, index));
>  }
>
>  /* Replace the element at position "index" in "list" by "el".
>
> Modified: polly/trunk/lib/External/isl/isl_local.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_local.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_local.c (original)
> +++ polly/trunk/lib/External/isl/isl_local.c Wed May 23 13:18:50 2018
> @@ -13,6 +13,7 @@
>  #include <isl/space.h>
>  #include <isl_vec_private.h>
>  #include <isl_mat_private.h>
> +#include <isl_reordering.h>
>  #include <isl_seq.h>
>  #include <isl_local.h>
>
> @@ -26,6 +27,25 @@ isl_ctx *isl_local_get_ctx(__isl_keep is
>         return isl_mat_get_ctx(local);
>  }
>
> +/* Create an isl_local object from a matrix describing
> + * integer divisions.
> + *
> + * An isl_local object is current defined as exactly such a matrix,
> + * so simply return the input.
> + */
> +__isl_give isl_local *isl_local_alloc_from_mat(__isl_take isl_mat *mat)
> +{
> +       return mat;
> +}
> +
> +/* Free "local" and return NULL.
> + */
> +__isl_null isl_local *isl_local_free(__isl_take isl_local *local)
> +{
> +       isl_mat_free(local);
> +       return NULL;
> +}
> +
>  /* Return the number of local variables (isl_dim_div),
>   * the number of other variables (isl_dim_set) or
>   * the total number of variables (isl_dim_all) in "local".
> @@ -185,6 +205,45 @@ int isl_local_cmp(__isl_keep isl_local *
>         return 0;
>  }
>
> +/* Reorder the columns of the given local variables according to the
> + * given reordering.
> + * The order of the local variables themselves is assumed not to change.
> + */
> +__isl_give isl_local *isl_local_reorder(__isl_take isl_local *local,
> +       __isl_take isl_reordering *r)
> +{
> +       isl_mat *div = local;
> +       int i, j;
> +       isl_space *space;
> +       isl_mat *mat;
> +       int extra;
> +
> +       if (!local || !r)
> +               goto error;
> +
> +       space = isl_reordering_peek_space(r);
> +       extra = isl_space_dim(space, isl_dim_all) + div->n_row - r->len;
> +       mat = isl_mat_alloc(div->ctx, div->n_row, div->n_col + extra);
> +       if (!mat)
> +               goto error;
> +
> +       for (i = 0; i < div->n_row; ++i) {
> +               isl_seq_cpy(mat->row[i], div->row[i], 2);
> +               isl_seq_clr(mat->row[i] + 2, mat->n_col - 2);
> +               for (j = 0; j < r->len; ++j)
> +                       isl_int_set(mat->row[i][2 + r->pos[j]],
> +                                   div->row[i][2 + j]);
> +       }
> +
> +       isl_reordering_free(r);
> +       isl_local_free(local);
> +       return isl_local_alloc_from_mat(mat);
> +error:
> +       isl_reordering_free(r);
> +       isl_local_free(local);
> +       return NULL;
> +}
> +
>  /* Extend a vector "v" representing an integer point
>   * in the domain space of "local"
>   * to one that also includes values for the local variables.
>
> Modified: polly/trunk/lib/External/isl/isl_local.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_local.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_local.h (original)
> +++ polly/trunk/lib/External/isl/isl_local.h Wed May 23 13:18:50 2018
> @@ -2,6 +2,7 @@
>  #define ISL_LOCAL_H
>
>  #include <isl/mat.h>
> +#include <isl_reordering.h>
>
>  typedef isl_mat isl_local;
>
> @@ -11,6 +12,9 @@ isl_bool isl_local_divs_known(__isl_keep
>
>  int isl_local_cmp(__isl_keep isl_local *local1, __isl_keep isl_local *local2);
>
> +__isl_give isl_local *isl_local_reorder(__isl_take isl_local *local,
> +       __isl_take isl_reordering *r);
> +
>  __isl_give isl_vec *isl_local_extend_point_vec(__isl_keep isl_local *local,
>         __isl_take isl_vec *v);
>
>
> Modified: polly/trunk/lib/External/isl/isl_local_space.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_local_space.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_local_space.c (original)
> +++ polly/trunk/lib/External/isl/isl_local_space.c Wed May 23 13:18:50 2018
> @@ -542,42 +542,6 @@ error:
>         return NULL;
>  }
>
> -/* Reorder the columns of the given div definitions according to the
> - * given reordering.
> - * The order of the divs themselves is assumed not to change.
> - */
> -static __isl_give isl_mat *reorder_divs(__isl_take isl_mat *div,
> -       __isl_take isl_reordering *r)
> -{
> -       int i, j;
> -       isl_mat *mat;
> -       int extra;
> -
> -       if (!div || !r)
> -               goto error;
> -
> -       extra = isl_space_dim(r->dim, isl_dim_all) + div->n_row - r->len;
> -       mat = isl_mat_alloc(div->ctx, div->n_row, div->n_col + extra);
> -       if (!mat)
> -               goto error;
> -
> -       for (i = 0; i < div->n_row; ++i) {
> -               isl_seq_cpy(mat->row[i], div->row[i], 2);
> -               isl_seq_clr(mat->row[i] + 2, mat->n_col - 2);
> -               for (j = 0; j < r->len; ++j)
> -                       isl_int_set(mat->row[i][2 + r->pos[j]],
> -                                   div->row[i][2 + j]);
> -       }
> -
> -       isl_reordering_free(r);
> -       isl_mat_free(div);
> -       return mat;
> -error:
> -       isl_reordering_free(r);
> -       isl_mat_free(div);
> -       return NULL;
> -}
> -
>  /* Reorder the dimensions of "ls" according to the given reordering.
>   * The reordering r is assumed to have been extended with the local
>   * variables, leaving them in the same order.
> @@ -589,11 +553,11 @@ __isl_give isl_local_space *isl_local_sp
>         if (!ls || !r)
>                 goto error;
>
> -       ls->div = reorder_divs(ls->div, isl_reordering_copy(r));
> +       ls->div = isl_local_reorder(ls->div, isl_reordering_copy(r));
>         if (!ls->div)
>                 goto error;
>
> -       ls = isl_local_space_reset_space(ls, isl_space_copy(r->dim));
> +       ls = isl_local_space_reset_space(ls, isl_reordering_get_space(r));
>
>         isl_reordering_free(r);
>         return ls;
> @@ -1213,6 +1177,49 @@ __isl_give isl_local_space *isl_local_sp
>         return ls;
>  }
>
> +/* Does the linear part of "constraint" correspond to
> + * integer division "div" in "ls"?
> + *
> + * That is, given div = floor((c + f)/m), is the constraint of the form
> + *
> + *             f - m d + c' >= 0               [sign = 1]
> + * or
> + *             -f + m d + c'' >= 0             [sign = -1]
> + * ?
> + * If so, set *sign to the corresponding value.
> + */
> +static isl_bool is_linear_div_constraint(__isl_keep isl_local_space *ls,
> +       isl_int *constraint, unsigned div, int *sign)
> +{
> +       isl_bool unknown;
> +       unsigned pos;
> +
> +       unknown = isl_local_space_div_is_marked_unknown(ls, div);
> +       if (unknown < 0)
> +               return isl_bool_error;
> +       if (unknown)
> +               return isl_bool_false;
> +
> +       pos = isl_local_space_offset(ls, isl_dim_div) + div;
> +
> +       if (isl_int_eq(constraint[pos], ls->div->row[div][0])) {
> +               *sign = -1;
> +               if (!isl_seq_is_neg(constraint + 1,
> +                                   ls->div->row[div] + 2, pos - 1))
> +                       return isl_bool_false;
> +       } else if (isl_int_abs_eq(constraint[pos], ls->div->row[div][0])) {
> +               *sign = 1;
> +               if (!isl_seq_eq(constraint + 1, ls->div->row[div] + 2, pos - 1))
> +                       return isl_bool_false;
> +       } else {
> +               return isl_bool_false;
> +       }
> +       if (isl_seq_first_non_zero(constraint + pos + 1,
> +                                   ls->div->n_row - div - 1) != -1)
> +               return isl_bool_false;
> +       return isl_bool_true;
> +}
> +
>  /* Check if the constraints pointed to by "constraint" is a div
>   * constraint corresponding to div "div" in "ls".
>   *
> @@ -1221,46 +1228,67 @@ __isl_give isl_local_space *isl_local_sp
>   *             f - m d >= 0
>   * or
>   *             -(f-(m-1)) + m d >= 0
> + *
> + * First check if the linear part is of the right form and
> + * then check the constant term.
>   */
>  isl_bool isl_local_space_is_div_constraint(__isl_keep isl_local_space *ls,
>         isl_int *constraint, unsigned div)
>  {
> -       unsigned pos;
> +       int sign;
> +       isl_bool linear;
>
> -       if (!ls)
> -               return isl_bool_error;
> -
> -       if (isl_int_is_zero(ls->div->row[div][0]))
> -               return isl_bool_false;
> +       linear = is_linear_div_constraint(ls, constraint, div, &sign);
> +       if (linear < 0 || !linear)
> +               return linear;
>
> -       pos = isl_local_space_offset(ls, isl_dim_div) + div;
> -
> -       if (isl_int_eq(constraint[pos], ls->div->row[div][0])) {
> +       if (sign < 0) {
>                 int neg;
>                 isl_int_sub(ls->div->row[div][1],
>                                 ls->div->row[div][1], ls->div->row[div][0]);
>                 isl_int_add_ui(ls->div->row[div][1], ls->div->row[div][1], 1);
> -               neg = isl_seq_is_neg(constraint, ls->div->row[div]+1, pos);
> +               neg = isl_seq_is_neg(constraint, ls->div->row[div] + 1, 1);
>                 isl_int_sub_ui(ls->div->row[div][1], ls->div->row[div][1], 1);
>                 isl_int_add(ls->div->row[div][1],
>                                 ls->div->row[div][1], ls->div->row[div][0]);
>                 if (!neg)
>                         return isl_bool_false;
> -               if (isl_seq_first_non_zero(constraint+pos+1,
> -                                           ls->div->n_row-div-1) != -1)
> -                       return isl_bool_false;
> -       } else if (isl_int_abs_eq(constraint[pos], ls->div->row[div][0])) {
> -               if (!isl_seq_eq(constraint, ls->div->row[div]+1, pos))
> -                       return isl_bool_false;
> -               if (isl_seq_first_non_zero(constraint+pos+1,
> -                                           ls->div->n_row-div-1) != -1)
> +       } else {
> +               if (!isl_int_eq(constraint[0], ls->div->row[div][1]))
>                         return isl_bool_false;
> -       } else
> -               return isl_bool_false;
> +       }
>
>         return isl_bool_true;
>  }
>
> +/* Is the constraint pointed to by "constraint" one
> + * of an equality that corresponds to integer division "div" in "ls"?
> + *
> + * That is, given an integer division of the form
> + *
> + *     a = floor((f + c)/m)
> + *
> + * is the equality of the form
> + *
> + *             -f + m d + c' = 0
> + * ?
> + * Note that the constant term is not checked explicitly, but given
> + * that this is a valid equality constraint, the constant c' necessarily
> + * has a value close to -c.
> + */
> +isl_bool isl_local_space_is_div_equality(__isl_keep isl_local_space *ls,
> +       isl_int *constraint, unsigned div)
> +{
> +       int sign;
> +       isl_bool linear;
> +
> +       linear = is_linear_div_constraint(ls, constraint, div, &sign);
> +       if (linear < 0 || !linear)
> +               return linear;
> +
> +       return sign < 0;
> +}
> +
>  /*
>   * Set active[i] to 1 if the dimension at position i is involved
>   * in the linear expression l.
>
> Modified: polly/trunk/lib/External/isl/isl_local_space_private.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_local_space_private.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_local_space_private.h (original)
> +++ polly/trunk/lib/External/isl/isl_local_space_private.h Wed May 23 13:18:50 2018
> @@ -57,6 +57,8 @@ __isl_give isl_local_space *isl_local_sp
>
>  isl_bool isl_local_space_is_div_constraint(__isl_keep isl_local_space *ls,
>         isl_int *constraint, unsigned div);
> +isl_bool isl_local_space_is_div_equality(__isl_keep isl_local_space *ls,
> +       isl_int *constraint, unsigned div);
>
>  int *isl_local_space_get_active(__isl_keep isl_local_space *ls, isl_int *l);
>
>
> Modified: polly/trunk/lib/External/isl/isl_map.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_map.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_map.c (original)
> +++ polly/trunk/lib/External/isl/isl_map.c Wed May 23 13:18:50 2018
> @@ -2293,6 +2293,16 @@ __isl_give isl_basic_set *isl_basic_set_
>                                                         type, first, n));
>  }
>
> +/* No longer consider "map" to be normalized.
> + */
> +static __isl_give isl_map *isl_map_unmark_normalized(__isl_take isl_map *map)
> +{
> +       if (!map)
> +               return NULL;
> +       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       return map;
> +}
> +
>  __isl_give isl_map *isl_map_drop(__isl_take isl_map *map,
>         enum isl_dim_type type, unsigned first, unsigned n)
>  {
> @@ -2315,7 +2325,7 @@ __isl_give isl_map *isl_map_drop(__isl_t
>                 if (!map->p[i])
>                         goto error;
>         }
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>
>         return map;
>  error:
> @@ -4776,12 +4786,12 @@ __isl_give isl_map *isl_map_floordiv(__i
>                 return NULL;
>
>         ISL_F_CLR(map, ISL_MAP_DISJOINT);
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
>         for (i = 0; i < map->n; ++i) {
>                 map->p[i] = isl_basic_map_floordiv(map->p[i], d);
>                 if (!map->p[i])
>                         goto error;
>         }
> +       map = isl_map_unmark_normalized(map);
>
>         return map;
>  error:
> @@ -5852,7 +5862,7 @@ __isl_give isl_map *isl_map_domain_map(_
>                         goto error;
>         }
>         ISL_F_CLR(map, ISL_MAP_DISJOINT);
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>         return map;
>  error:
>         isl_map_free(map);
> @@ -5880,7 +5890,7 @@ __isl_give isl_map *isl_map_range_map(__
>                         goto error;
>         }
>         ISL_F_CLR(map, ISL_MAP_DISJOINT);
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>         return map;
>  error:
>         isl_map_free(map);
> @@ -6113,7 +6123,7 @@ __isl_give isl_map *isl_map_add_basic_ma
>         isl_assert(map->ctx, map->n < map->size, goto error);
>         map->p[map->n] = bmap;
>         map->n++;
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>         return map;
>  error:
>         if (map)
> @@ -6260,23 +6270,31 @@ struct isl_basic_set *isl_basic_set_fix_
>                                         isl_dim_set, dim, value));
>  }
>
> -static int remove_if_empty(__isl_keep isl_map *map, int i)
> +/* Remove the basic map at position "i" from "map" if this basic map
> + * is (obviously) empty.
> + */
> +static __isl_give isl_map *remove_if_empty(__isl_take isl_map *map, int i)
>  {
> -       int empty = isl_basic_map_plain_is_empty(map->p[i]);
> +       isl_bool empty;
> +
> +       if (!map)
> +               return NULL;
>
> +       empty = isl_basic_map_plain_is_empty(map->p[i]);
>         if (empty < 0)
> -               return -1;
> +               return isl_map_free(map);
>         if (!empty)
> -               return 0;
> +               return map;
>
>         isl_basic_map_free(map->p[i]);
> -       if (i != map->n - 1) {
> -               ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> -               map->p[i] = map->p[map->n - 1];
> -       }
>         map->n--;
> +       if (i != map->n) {
> +               map->p[i] = map->p[map->n];
> +               map = isl_map_unmark_normalized(map);
>
> -       return 0;
> +       }
> +
> +       return map;
>  }
>
>  /* Perform "fn" on each basic map of "map", where we may not be holding
> @@ -6302,8 +6320,9 @@ __isl_give isl_map *isl_map_inline_forea
>                         goto error;
>                 isl_basic_map_free(map->p[i]);
>                 map->p[i] = bmap;
> -               if (remove_if_empty(map, i) < 0)
> -                       goto error;
> +               map = remove_if_empty(map, i);
> +               if (!map)
> +                       return NULL;
>         }
>
>         return map;
> @@ -6324,10 +6343,11 @@ __isl_give isl_map *isl_map_fix_si(__isl
>         isl_assert(map->ctx, pos < isl_map_dim(map, type), goto error);
>         for (i = map->n - 1; i >= 0; --i) {
>                 map->p[i] = isl_basic_map_fix_si(map->p[i], type, pos, value);
> -               if (remove_if_empty(map, i) < 0)
> -                       goto error;
> +               map = remove_if_empty(map, i);
> +               if (!map)
> +                       return NULL;
>         }
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>         return map;
>  error:
>         isl_map_free(map);
> @@ -6355,7 +6375,7 @@ __isl_give isl_map *isl_map_fix(__isl_ta
>                 if (!map->p[i])
>                         goto error;
>         }
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>         return map;
>  error:
>         isl_map_free(map);
> @@ -6389,10 +6409,11 @@ __isl_give isl_map *isl_map_fix_val(__is
>         for (i = map->n - 1; i >= 0; --i) {
>                 map->p[i] = isl_basic_map_fix_val(map->p[i], type, pos,
>                                                         isl_val_copy(v));
> -               if (remove_if_empty(map, i) < 0)
> +               map = remove_if_empty(map, i);
> +               if (!map)
>                         goto error;
>         }
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>         isl_val_free(v);
>         return map;
>  error:
> @@ -6483,7 +6504,7 @@ static __isl_give isl_map *map_bound_si(
>                 if (!map->p[i])
>                         goto error;
>         }
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>         return map;
>  error:
>         isl_map_free(map);
> @@ -6564,10 +6585,11 @@ static __isl_give isl_map *map_bound(__i
>                         "index out of bounds", goto error);
>         for (i = map->n - 1; i >= 0; --i) {
>                 map->p[i] = basic_map_bound(map->p[i], type, pos, value, upper);
> -               if (remove_if_empty(map, i) < 0)
> -                       goto error;
> +               map = remove_if_empty(map, i);
> +               if (!map)
> +                       return NULL;
>         }
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>         return map;
>  error:
>         isl_map_free(map);
> @@ -6704,7 +6726,7 @@ __isl_give isl_map *isl_map_reverse(__is
>                 if (!map->p[i])
>                         goto error;
>         }
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>         return map;
>  error:
>         isl_map_free(map);
> @@ -8177,7 +8199,7 @@ __isl_give isl_map *isl_map_deltas_map(_
>                 if (!map->p[i])
>                         goto error;
>         }
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>         return map;
>  error:
>         isl_map_free(map);
> @@ -9013,7 +9035,7 @@ __isl_give isl_map *isl_map_align_divs_i
>                         return isl_map_free(map);
>         }
>
> -       ISL_F_CLR(map, ISL_MAP_NORMALIZED);
> +       map = isl_map_unmark_normalized(map);
>         return map;
>  }
>
> @@ -9117,7 +9139,7 @@ __isl_give isl_map *isl_map_remove_empty
>                 return NULL;
>
>         for (i = map->n - 1; i >= 0; --i)
> -               remove_if_empty(map, i);
> +               map = remove_if_empty(map, i);
>
>         return map;
>  }
> @@ -11633,25 +11655,25 @@ __isl_give isl_map *isl_map_flatten_rang
>  }
>
>  /* Reorder the dimensions of "bmap" according to the given dim_map
> - * and set the dimension specification to "dim" and
> + * and set the dimension specification to "space" and
>   * perform Gaussian elimination on the result.
>   */
>  __isl_give isl_basic_map *isl_basic_map_realign(__isl_take isl_basic_map *bmap,
> -       __isl_take isl_space *dim, __isl_take struct isl_dim_map *dim_map)
> +       __isl_take isl_space *space, __isl_take struct isl_dim_map *dim_map)
>  {
>         isl_basic_map *res;
>         unsigned flags;
> +       unsigned n_div;
>
> -       bmap = isl_basic_map_cow(bmap);
> -       if (!bmap || !dim || !dim_map)
> +       if (!bmap || !space || !dim_map)
>                 goto error;
>
>         flags = bmap->flags;
>         ISL_FL_CLR(flags, ISL_BASIC_MAP_FINAL);
>         ISL_FL_CLR(flags, ISL_BASIC_MAP_NORMALIZED);
>         ISL_FL_CLR(flags, ISL_BASIC_MAP_NORMALIZED_DIVS);
> -       res = isl_basic_map_alloc_space(dim,
> -                       bmap->n_div, bmap->n_eq, bmap->n_ineq);
> +       n_div = isl_basic_map_dim(bmap, isl_dim_div);
> +       res = isl_basic_map_alloc_space(space, n_div, bmap->n_eq, bmap->n_ineq);
>         res = isl_basic_map_add_constraints_dim_map(res, bmap, dim_map);
>         if (res)
>                 res->flags = flags;
> @@ -11661,7 +11683,7 @@ __isl_give isl_basic_map *isl_basic_map_
>  error:
>         free(dim_map);
>         isl_basic_map_free(bmap);
> -       isl_space_free(dim);
> +       isl_space_free(space);
>         return NULL;
>  }
>
> @@ -11680,17 +11702,19 @@ __isl_give isl_map *isl_map_realign(__is
>
>         for (i = 0; i < map->n; ++i) {
>                 struct isl_dim_map *dim_map_i;
> +               isl_space *space;
>
>                 dim_map_i = isl_dim_map_extend(dim_map, map->p[i]);
>
> -               map->p[i] = isl_basic_map_realign(map->p[i],
> -                                           isl_space_copy(r->dim), dim_map_i);
> +               space = isl_reordering_get_space(r);
> +               map->p[i] = isl_basic_map_realign(map->p[i], space, dim_map_i);
>
>                 if (!map->p[i])
>                         goto error;
>         }
>
> -       map = isl_map_reset_space(map, isl_space_copy(r->dim));
> +       map = isl_map_reset_space(map, isl_reordering_get_space(r));
> +       map = isl_map_unmark_normalized(map);
>
>         isl_reordering_free(r);
>         free(dim_map);
> @@ -11786,7 +11810,7 @@ __isl_give isl_basic_map *isl_basic_map_
>                                         isl_basic_map_get_space(bmap));
>                 dim_map = isl_dim_map_from_reordering(exp);
>                 bmap = isl_basic_map_realign(bmap,
> -                                   exp ? isl_space_copy(exp->dim) : NULL,
> +                                   isl_reordering_get_space(exp),
>                                     isl_dim_map_extend(dim_map, bmap));
>                 isl_reordering_free(exp);
>                 free(dim_map);
> @@ -12850,8 +12874,9 @@ __isl_give isl_set *isl_set_substitute(_
>
>         for (i = set->n - 1; i >= 0; --i) {
>                 set->p[i] = isl_basic_set_substitute(set->p[i], type, pos, subs);
> -               if (remove_if_empty(set, i) < 0)
> -                       goto error;
> +               set = set_from_map(remove_if_empty(set_to_map(set), i));
> +               if (!set)
> +                       return NULL;
>         }
>
>         return set;
>
> Modified: polly/trunk/lib/External/isl/isl_multi_explicit_domain.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_multi_explicit_domain.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_multi_explicit_domain.c (original)
> +++ polly/trunk/lib/External/isl/isl_multi_explicit_domain.c Wed May 23 13:18:50 2018
> @@ -39,12 +39,20 @@ static isl_stat FN(MULTI(BASE),check_has
>
>  /* Return the explicit domain of "multi", assuming it has one.
>   */
> -static __isl_give DOM *FN(MULTI(BASE),get_explicit_domain)(
> +static __isl_keep DOM *FN(MULTI(BASE),peek_explicit_domain)(
>         __isl_keep MULTI(BASE) *multi)
>  {
>         if (FN(MULTI(BASE),check_has_explicit_domain)(multi) < 0)
>                 return NULL;
> -       return FN(DOM,copy)(multi->u.dom);
> +       return multi->u.dom;
> +}
> +
> +/* Return a copy of the explicit domain of "multi", assuming it has one.
> + */
> +static __isl_give DOM *FN(MULTI(BASE),get_explicit_domain)(
> +       __isl_keep MULTI(BASE) *multi)
> +{
> +       return FN(DOM,copy)(FN(MULTI(BASE),peek_explicit_domain)(multi));
>  }
>
>  /* Replace the explicit domain of "multi" by "dom", assuming it has one.
> @@ -69,14 +77,32 @@ error:
>  }
>
>  /* Intersect the domain of "dst" with the explicit domain of "src".
> + *
> + * In the case of isl_multi_union_pw_aff objects, the explicit domain
> + * of "src" is allowed to have only constraints on the parameters, even
> + * if the domain of "dst" contains actual domain elements.  In this case,
> + * the domain of "dst" is intersected with those parameter constraints.
>   */
>  static __isl_give MULTI(BASE) *FN(MULTI(BASE),intersect_explicit_domain)(
>         __isl_take MULTI(BASE) *dst, __isl_keep MULTI(BASE) *src)
>  {
> +       isl_bool is_params;
>         DOM *dom;
>
> -       dom = FN(MULTI(BASE),get_explicit_domain)(src);
> -       dst = FN(MULTI(BASE),intersect_domain)(dst, dom);
> +       dom = FN(MULTI(BASE),peek_explicit_domain)(src);
> +       is_params = FN(DOM,is_params)(dom);
> +       if (is_params < 0)
> +               return FN(MULTI(BASE),free)(dst);
> +
> +       dom = FN(DOM,copy)(dom);
> +       if (!is_params) {
> +               dst = FN(MULTI(BASE),intersect_domain)(dst, dom);
> +       } else {
> +               isl_set *params;
> +
> +               params = FN(DOM,params)(dom);
> +               dst = FN(MULTI(BASE),intersect_params)(dst, params);
> +       }
>
>         return dst;
>  }
>
> Modified: polly/trunk/lib/External/isl/isl_multi_templ.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_multi_templ.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_multi_templ.c (original)
> +++ polly/trunk/lib/External/isl/isl_multi_templ.c Wed May 23 13:18:50 2018
> @@ -235,6 +235,30 @@ __isl_give EL *FN(FN(MULTI(BASE),get),BA
>         return FN(EL,copy)(multi->u.p[pos]);
>  }
>
> +/* Set the element at position "pos" of "multi" to "el",
> + * where the position may be empty if "multi" has only a single reference.
> + */
> +static __isl_give MULTI(BASE) *FN(MULTI(BASE),restore)(
> +       __isl_take MULTI(BASE) *multi, int pos, __isl_take EL *el)
> +{
> +       multi = FN(MULTI(BASE),cow)(multi);
> +       if (!multi || !el)
> +               goto error;
> +
> +       if (pos < 0 || pos >= multi->n)
> +               isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
> +                       "index out of bounds", goto error);
> +
> +       FN(EL,free)(multi->u.p[pos]);
> +       multi->u.p[pos] = el;
> +
> +       return multi;
> +error:
> +       FN(MULTI(BASE),free)(multi);
> +       FN(EL,free)(el);
> +       return NULL;
> +}
> +
>  __isl_give MULTI(BASE) *FN(FN(MULTI(BASE),set),BASE)(
>         __isl_take MULTI(BASE) *multi, int pos, __isl_take EL *el)
>  {
> @@ -242,10 +266,6 @@ __isl_give MULTI(BASE) *FN(FN(MULTI(BASE
>         isl_space *el_space = NULL;
>         isl_bool match;
>
> -       multi = FN(MULTI(BASE),cow)(multi);
> -       if (!multi || !el)
> -               goto error;
> -
>         multi_space = FN(MULTI(BASE),get_space)(multi);
>         match = FN(EL,matching_params)(el, multi_space);
>         if (match < 0)
> @@ -260,12 +280,7 @@ __isl_give MULTI(BASE) *FN(FN(MULTI(BASE
>         if (FN(EL,check_match_domain_space)(el, multi_space) < 0)
>                 goto error;
>
> -       if (pos < 0 || pos >= multi->n)
> -               isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
> -                       "index out of bounds", goto error);
> -
> -       FN(EL,free)(multi->u.p[pos]);
> -       multi->u.p[pos] = el;
> +       multi = FN(MULTI(BASE),restore)(multi, pos, el);
>
>         isl_space_free(multi_space);
>         isl_space_free(el_space);
> @@ -439,6 +454,7 @@ __isl_give MULTI(BASE) *FN(MULTI(BASE),r
>         __isl_take MULTI(BASE) *multi, __isl_take isl_reordering *exp)
>  {
>         int i;
> +       isl_space *space;
>
>         multi = FN(MULTI(BASE),cow)(multi);
>         if (!multi || !exp)
> @@ -451,8 +467,8 @@ __isl_give MULTI(BASE) *FN(MULTI(BASE),r
>                         goto error;
>         }
>
> -       multi = FN(MULTI(BASE),reset_domain_space)(multi,
> -                                                   isl_space_copy(exp->dim));
> +       space = isl_reordering_get_space(exp);
> +       multi = FN(MULTI(BASE),reset_domain_space)(multi, space);
>
>         isl_reordering_free(exp);
>         return multi;
> @@ -513,6 +529,13 @@ error:
>         return NULL;
>  }
>
> +/* Create a multi expression in the given space with the elements of "list"
> + * as base expressions.
> + *
> + * Since isl_multi_*_restore_* assumes that the element and
> + * the multi expression have matching spaces, the alignment
> + * (if any) needs to be performed beforehand.
> + */
>  __isl_give MULTI(BASE) *FN(FN(MULTI(BASE),from),LIST(BASE))(
>         __isl_take isl_space *space, __isl_take LIST(EL) *list)
>  {
> @@ -530,10 +553,15 @@ __isl_give MULTI(BASE) *FN(FN(MULTI(BASE
>                 isl_die(ctx, isl_error_invalid,
>                         "invalid number of elements in list", goto error);
>
> +       for (i = 0; i < n; ++i) {
> +               EL *el = FN(LIST(EL),peek)(list, i);
> +               space = isl_space_align_params(space, FN(EL,get_space)(el));
> +       }
>         multi = FN(MULTI(BASE),alloc)(isl_space_copy(space));
>         for (i = 0; i < n; ++i) {
> -               multi = FN(FN(MULTI(BASE),set),BASE)(multi, i,
> -                                       FN(FN(LIST(EL),get),BASE)(list, i));
> +               EL *el = FN(FN(LIST(EL),get),BASE)(list, i);
> +               el = FN(EL,align_params)(el, isl_space_copy(space));
> +               multi = FN(MULTI(BASE),restore)(multi, i, el);
>         }
>
>         isl_space_free(space);
>
> Modified: polly/trunk/lib/External/isl/isl_polynomial.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_polynomial.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_polynomial.c (original)
> +++ polly/trunk/lib/External/isl/isl_polynomial.c Wed May 23 13:18:50 2018
> @@ -4225,46 +4225,13 @@ __isl_give isl_union_pw_qpolynomial *isl
>                                                 &isl_pw_qpolynomial_mul);
>  }
>
> -/* Reorder the columns of the given div definitions according to the
> - * given reordering.
> - */
> -static __isl_give isl_mat *reorder_divs(__isl_take isl_mat *div,
> -       __isl_take isl_reordering *r)
> -{
> -       int i, j;
> -       isl_mat *mat;
> -       int extra;
> -
> -       if (!div || !r)
> -               goto error;
> -
> -       extra = isl_space_dim(r->dim, isl_dim_all) + div->n_row - r->len;
> -       mat = isl_mat_alloc(div->ctx, div->n_row, div->n_col + extra);
> -       if (!mat)
> -               goto error;
> -
> -       for (i = 0; i < div->n_row; ++i) {
> -               isl_seq_cpy(mat->row[i], div->row[i], 2);
> -               isl_seq_clr(mat->row[i] + 2, mat->n_col - 2);
> -               for (j = 0; j < r->len; ++j)
> -                       isl_int_set(mat->row[i][2 + r->pos[j]],
> -                                   div->row[i][2 + j]);
> -       }
> -
> -       isl_reordering_free(r);
> -       isl_mat_free(div);
> -       return mat;
> -error:
> -       isl_reordering_free(r);
> -       isl_mat_free(div);
> -       return NULL;
> -}
> -
>  /* Reorder the dimension of "qp" according to the given reordering.
>   */
>  __isl_give isl_qpolynomial *isl_qpolynomial_realign_domain(
>         __isl_take isl_qpolynomial *qp, __isl_take isl_reordering *r)
>  {
> +       isl_space *space;
> +
>         qp = isl_qpolynomial_cow(qp);
>         if (!qp)
>                 goto error;
> @@ -4273,7 +4240,7 @@ __isl_give isl_qpolynomial *isl_qpolynom
>         if (!r)
>                 goto error;
>
> -       qp->div = reorder_divs(qp->div, isl_reordering_copy(r));
> +       qp->div = isl_local_reorder(qp->div, isl_reordering_copy(r));
>         if (!qp->div)
>                 goto error;
>
> @@ -4281,7 +4248,8 @@ __isl_give isl_qpolynomial *isl_qpolynom
>         if (!qp->upoly)
>                 goto error;
>
> -       qp = isl_qpolynomial_reset_domain_space(qp, isl_space_copy(r->dim));
> +       space = isl_reordering_get_space(r);
> +       qp = isl_qpolynomial_reset_domain_space(qp, space);
>
>         isl_reordering_free(r);
>         return qp;
>
> Modified: polly/trunk/lib/External/isl/isl_pw_templ.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_pw_templ.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_pw_templ.c (original)
> +++ polly/trunk/lib/External/isl/isl_pw_templ.c Wed May 23 13:18:50 2018
> @@ -290,7 +290,7 @@ __isl_give PW *FN(PW,realign_domain)(__i
>                         goto error;
>         }
>
> -       pw = FN(PW,reset_domain_space)(pw, isl_space_copy(exp->dim));
> +       pw = FN(PW,reset_domain_space)(pw, isl_reordering_get_space(exp));
>
>         isl_reordering_free(exp);
>         return pw;
> @@ -352,7 +352,6 @@ static __isl_give PW *FN(PW,align_params
>         __isl_take PW *pw2,
>         __isl_give PW *(*fn)(__isl_take PW *pw1, __isl_take PW *pw2))
>  {
> -       isl_ctx *ctx;
>         isl_bool equal_params;
>
>         if (!pw1 || !pw2)
> @@ -362,7 +361,6 @@ static __isl_give PW *FN(PW,align_params
>                 goto error;
>         if (equal_params)
>                 return fn(pw1, pw2);
> -       ctx = FN(PW,get_ctx)(pw1);
>         if (FN(PW,check_named_params)(pw1) < 0 ||
>             FN(PW,check_named_params)(pw2) < 0)
>                 goto error;
> @@ -2118,7 +2116,6 @@ static __isl_give PW *FN(PW,align_params
>         __isl_give PW *(*fn)(__isl_take PW *pw,
>                 __isl_take isl_pw_multi_aff *ma))
>  {
> -       isl_ctx *ctx;
>         isl_bool equal_params;
>         isl_space *pma_space;
>
> @@ -2132,7 +2129,6 @@ static __isl_give PW *FN(PW,align_params
>                 isl_space_free(pma_space);
>                 return fn(pw, pma);
>         }
> -       ctx = FN(PW,get_ctx)(pw);
>         if (FN(PW,check_named_params)(pw) < 0 ||
>             isl_pw_multi_aff_check_named_params(pma) < 0)
>                 goto error;
>
> Modified: polly/trunk/lib/External/isl/isl_reordering.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_reordering.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_reordering.c (original)
> +++ polly/trunk/lib/External/isl/isl_reordering.c Wed May 23 13:18:50 2018
> @@ -24,7 +24,7 @@ __isl_give isl_reordering *isl_reorderin
>
>         exp->ref = 1;
>         exp->len = len;
> -       exp->dim = NULL;
> +       exp->space = NULL;
>
>         return exp;
>  }
> @@ -46,12 +46,12 @@ __isl_give isl_reordering *isl_reorderin
>         if (!r)
>                 return NULL;
>
> -       dup = isl_reordering_alloc(r->dim->ctx, r->len);
> +       dup = isl_reordering_alloc(isl_reordering_get_ctx(r), r->len);
>         if (!dup)
>                 return NULL;
>
> -       dup->dim = isl_space_copy(r->dim);
> -       if (!dup->dim)
> +       dup->space = isl_reordering_get_space(r);
> +       if (!dup->space)
>                 return isl_reordering_free(dup);
>         for (i = 0; i < dup->len; ++i)
>                 dup->pos[i] = r->pos[i];
> @@ -78,11 +78,34 @@ void *isl_reordering_free(__isl_take isl
>         if (--exp->ref > 0)
>                 return NULL;
>
> -       isl_space_free(exp->dim);
> +       isl_space_free(exp->space);
>         free(exp);
>         return NULL;
>  }
>
> +/* Return the isl_ctx to which "r" belongs.
> + */
> +isl_ctx *isl_reordering_get_ctx(__isl_keep isl_reordering *r)
> +{
> +       return isl_space_get_ctx(isl_reordering_peek_space(r));
> +}
> +
> +/* Return the space of "r".
> + */
> +__isl_keep isl_space *isl_reordering_peek_space(__isl_keep isl_reordering *r)
> +{
> +       if (!r)
> +               return NULL;
> +       return r->space;
> +}
> +
> +/* Return a copy of the space of "r".
> + */
> +__isl_give isl_space *isl_reordering_get_space(__isl_keep isl_reordering *r)
> +{
> +       return isl_space_copy(isl_reordering_peek_space(r));
> +}
> +
>  /* Construct a reordering that maps the parameters of "alignee"
>   * to the corresponding parameters in a new dimension specification
>   * that has the parameters of "aligner" first, followed by
> @@ -101,7 +124,7 @@ __isl_give isl_reordering *isl_parameter
>         if (!exp)
>                 return NULL;
>
> -       exp->dim = isl_space_copy(aligner);
> +       exp->space = isl_space_copy(aligner);
>
>         for (i = 0; i < alignee->nparam; ++i) {
>                 isl_id *id_i;
> @@ -121,15 +144,16 @@ __isl_give isl_reordering *isl_parameter
>                         isl_id_free(id_i);
>                 } else {
>                         int pos;
> -                       pos = isl_space_dim(exp->dim, isl_dim_param);
> -                       exp->dim = isl_space_add_dims(exp->dim, isl_dim_param, 1);
> -                       exp->dim = isl_space_set_dim_id(exp->dim,
> +                       pos = isl_space_dim(exp->space, isl_dim_param);
> +                       exp->space = isl_space_add_dims(exp->space,
> +                                               isl_dim_param, 1);
> +                       exp->space = isl_space_set_dim_id(exp->space,
>                                                 isl_dim_param, pos, id_i);
>                         exp->pos[i] = pos;
>                 }
>         }
>
> -       if (!exp->dim)
> +       if (!exp->space)
>                 return isl_reordering_free(exp);
>         return exp;
>  error:
> @@ -141,6 +165,8 @@ __isl_give isl_reordering *isl_reorderin
>         unsigned extra)
>  {
>         int i;
> +       isl_ctx *ctx;
> +       isl_space *space;
>         isl_reordering *res;
>         int offset;
>
> @@ -149,11 +175,13 @@ __isl_give isl_reordering *isl_reorderin
>         if (extra == 0)
>                 return exp;
>
> -       offset = isl_space_dim(exp->dim, isl_dim_all) - exp->len;
> -       res = isl_reordering_alloc(exp->dim->ctx, exp->len + extra);
> +       ctx = isl_reordering_get_ctx(exp);
> +       space = isl_reordering_peek_space(exp);
> +       offset = isl_space_dim(space, isl_dim_all) - exp->len;
> +       res = isl_reordering_alloc(ctx, exp->len + extra);
>         if (!res)
>                 goto error;
> -       res->dim = isl_space_copy(exp->dim);
> +       res->space = isl_reordering_get_space(exp);
>         for (i = 0; i < exp->len; ++i)
>                 res->pos[i] = exp->pos[i];
>         for (i = exp->len; i < res->len; ++i)
> @@ -170,6 +198,7 @@ error:
>  __isl_give isl_reordering *isl_reordering_extend_space(
>         __isl_take isl_reordering *exp, __isl_take isl_space *space)
>  {
> +       isl_space *exp_space;
>         isl_reordering *res;
>
>         if (!exp || !space)
> @@ -180,12 +209,13 @@ __isl_give isl_reordering *isl_reorderin
>         res = isl_reordering_cow(res);
>         if (!res)
>                 goto error;
> -       isl_space_free(res->dim);
> -       res->dim = isl_space_replace_params(space, exp->dim);
> +       isl_space_free(res->space);
> +       exp_space = isl_reordering_peek_space(exp);
> +       res->space = isl_space_replace_params(space, exp_space);
>
>         isl_reordering_free(exp);
>
> -       if (!res->dim)
> +       if (!res->space)
>                 return isl_reordering_free(res);
>
>         return res;
> @@ -199,7 +229,7 @@ void isl_reordering_dump(__isl_keep isl_
>  {
>         int i;
>
> -       isl_space_dump(exp->dim);
> +       isl_space_dump(exp->space);
>         for (i = 0; i < exp->len; ++i)
>                 fprintf(stderr, "%d -> %d; ", i, exp->pos[i]);
>         fprintf(stderr, "\n");
>
> Modified: polly/trunk/lib/External/isl/isl_reordering.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_reordering.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_reordering.h (original)
> +++ polly/trunk/lib/External/isl/isl_reordering.h Wed May 23 13:18:50 2018
> @@ -4,7 +4,7 @@
>  #include <isl/space.h>
>
>  /* pos maps original dimensions to new dimensions.
> - * The final dimension is given by dim.
> + * The final space is given by "space".
>   * The number of dimensions (i.e., the range of values) in the result
>   * may be larger than the number of dimensions in the input.
>   * In particular, the possible values of the entries in pos ranges from 0 to
> @@ -13,12 +13,15 @@
>   */
>  struct isl_reordering {
>         int ref;
> -       isl_space *dim;
> +       isl_space *space;
>         unsigned len;
>         int pos[1];
>  };
>  typedef struct isl_reordering isl_reordering;
>
> +isl_ctx *isl_reordering_get_ctx(__isl_keep isl_reordering *r);
> +__isl_keep isl_space *isl_reordering_peek_space(__isl_keep isl_reordering *r);
> +__isl_give isl_space *isl_reordering_get_space(__isl_keep isl_reordering *r);
>  __isl_give isl_reordering *isl_parameter_alignment_reordering(
>         __isl_keep isl_space *alignee, __isl_keep isl_space *aligner);
>  __isl_give isl_reordering *isl_reordering_copy(__isl_keep isl_reordering *exp);
>
> Modified: polly/trunk/lib/External/isl/isl_space.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_space.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_space.c (original)
> +++ polly/trunk/lib/External/isl/isl_space.c Wed May 23 13:18:50 2018
> @@ -2551,30 +2551,27 @@ isl_stat isl_space_check_named_params(__
>         return isl_stat_ok;
>  }
>
> -/* Align the initial parameters of dim1 to match the order in dim2.
> +/* Align the initial parameters of space1 to match the order in space2.
>   */
> -__isl_give isl_space *isl_space_align_params(__isl_take isl_space *dim1,
> -       __isl_take isl_space *dim2)
> +__isl_give isl_space *isl_space_align_params(__isl_take isl_space *space1,
> +       __isl_take isl_space *space2)
>  {
>         isl_reordering *exp;
>
> -       if (!isl_space_has_named_params(dim1) || !isl_space_has_named_params(dim2))
> -               isl_die(isl_space_get_ctx(dim1), isl_error_invalid,
> -                       "parameter alignment requires named parameters",
> -                       goto error);
> +       if (isl_space_check_named_params(space1) < 0 ||
> +           isl_space_check_named_params(space2) < 0)
> +               goto error;
>
> -       dim2 = isl_space_params(dim2);
> -       exp = isl_parameter_alignment_reordering(dim1, dim2);
> -       exp = isl_reordering_extend_space(exp, dim1);
> -       isl_space_free(dim2);
> -       if (!exp)
> -               return NULL;
> -       dim1 = isl_space_copy(exp->dim);
> +       space2 = isl_space_params(space2);
> +       exp = isl_parameter_alignment_reordering(space1, space2);
> +       exp = isl_reordering_extend_space(exp, space1);
> +       isl_space_free(space2);
> +       space1 = isl_reordering_get_space(exp);
>         isl_reordering_free(exp);
> -       return dim1;
> +       return space1;
>  error:
> -       isl_space_free(dim1);
> -       isl_space_free(dim2);
> +       isl_space_free(space1);
> +       isl_space_free(space2);
>         return NULL;
>  }
>
>
> Modified: polly/trunk/lib/External/isl/isl_space_private.h
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_space_private.h?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_space_private.h (original)
> +++ polly/trunk/lib/External/isl/isl_space_private.h Wed May 23 13:18:50 2018
> @@ -3,7 +3,7 @@
>
>  #include <isl/space.h>
>  #include <isl/hash.h>
> -#include <isl/id.h>
> +#include <isl/id_type.h>
>
>  struct isl_name;
>  struct isl_space {
>
> Modified: polly/trunk/lib/External/isl/isl_test.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_test.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_test.c (original)
> +++ polly/trunk/lib/External/isl/isl_test.c Wed May 23 13:18:50 2018
> @@ -2108,6 +2108,10 @@ struct {
>         { 0, "{ [a, b] : a >= 0 and 0 <= b <= 1 - a; [-1, 3] }" },
>         { 1, "{ [a, b] : a, b >= 0 and a + 2b <= 2; [1, 1] }" },
>         { 0, "{ [a, b] : a, b >= 0 and a + 2b <= 2; [2, 1] }" },
> +       { 0, "{ [a, c] : (2 + a) mod 4 = 0 or "
> +               "(c = 4 + a and 4 * floor((a)/4) = a and a >= 0 and a <= 4) or "
> +               "(c = 3 + a and 4 * floor((-1 + a)/4) = -1 + a and "
> +                   "a > 0 and a <= 5) }" },
>  };
>
>  /* A specialized coalescing test case that would result
> @@ -5421,6 +5425,14 @@ struct {
>           "B[{ A[] -> [1]; D[] -> [3] }]",
>           "C[{ A[] -> [2] }]",
>           "[B[{ A[] -> [1]; D[] -> [3] }] -> C[{ A[] -> [2] }]]" },
> +       { &isl_multi_union_pw_aff_range_product,
> +         "B[] }]",
> +         "(C[] : { A[x] })",
> +         "([B[] -> C[]] : { A[x] })" },
> +       { &isl_multi_union_pw_aff_range_product,
> +         "(B[] : { A[x] })",
> +         "C[] }]",
> +         "([B[] -> C[]] : { A[x] })" },
>  };
>
>  /* Perform some basic tests of binary operations on
> @@ -6008,6 +6020,25 @@ static int test_mupa_upma(isl_ctx *ctx)
>         return 0;
>  }
>
> +/* Check that the input tuple of an isl_aff can be set properly.
> + */
> +static isl_stat test_aff_set_tuple_id(isl_ctx *ctx)
> +{
> +       isl_id *id;
> +       isl_aff *aff;
> +       int equal;
> +
> +       aff = isl_aff_read_from_str(ctx, "{ [x] -> [x + 1] }");
> +       id = isl_id_alloc(ctx, "A", NULL);
> +       aff = isl_aff_set_tuple_id(aff, isl_dim_in, id);
> +       equal = aff_check_plain_equal(aff, "{ A[x] -> [x + 1] }");
> +       isl_aff_free(aff);
> +       if (equal < 0)
> +               return isl_stat_error;
> +
> +       return isl_stat_ok;
> +}
> +
>  int test_aff(isl_ctx *ctx)
>  {
>         const char *str;
> @@ -6081,6 +6112,9 @@ int test_aff(isl_ctx *ctx)
>         if (equal < 0)
>                 return -1;
>
> +       if (test_aff_set_tuple_id(ctx) < 0)
> +               return -1;
> +
>         return 0;
>  }
>
> @@ -7137,7 +7171,7 @@ static int test_residue_class(isl_ctx *c
>         return res;
>  }
>
> -int test_align_parameters(isl_ctx *ctx)
> +static int test_align_parameters_1(isl_ctx *ctx)
>  {
>         const char *str;
>         isl_space *space;
> @@ -7168,6 +7202,43 @@ int test_align_parameters(isl_ctx *ctx)
>         return 0;
>  }
>
> +/* Check the isl_multi_*_from_*_list operation in case inputs
> + * have unaligned parameters.
> + * In particular, older versions of isl would simply fail
> + * (without printing any error message).
> + */
> +static isl_stat test_align_parameters_2(isl_ctx *ctx)
> +{
> +       isl_space *space;
> +       isl_map *map;
> +       isl_aff *aff;
> +       isl_multi_aff *ma;
> +
> +       map = isl_map_read_from_str(ctx, "{ A[] -> M[x] }");
> +       space = isl_map_get_space(map);
> +       isl_map_free(map);
> +
> +       aff = isl_aff_read_from_str(ctx, "[N] -> { A[] -> [N] }");
> +       ma = isl_multi_aff_from_aff_list(space, isl_aff_list_from_aff(aff));
> +       isl_multi_aff_free(ma);
> +
> +       if (!ma)
> +               return isl_stat_error;
> +       return isl_stat_ok;
> +}
> +
> +/* Perform basic parameter alignment tests.
> + */
> +static int test_align_parameters(isl_ctx *ctx)
> +{
> +       if (test_align_parameters_1(ctx) < 0)
> +               return -1;
> +       if (test_align_parameters_2(ctx) < 0)
> +               return -1;
> +
> +       return 0;
> +}
> +
>  /* Check that isl_*_drop_unused_params actually drops the unused parameters
>   * by comparing the result using isl_*_plain_is_equal.
>   * Note that this assumes that isl_*_plain_is_equal does not consider
> @@ -8272,6 +8343,30 @@ static int test_multi_pw_aff_2(isl_ctx *
>         return 0;
>  }
>
> +/* Check that isl_multi_union_pw_aff_multi_val_on_domain
> + * sets the explicit domain of a zero-dimensional result,
> + * such that it can be converted to an isl_union_map.
> + */
> +static isl_stat test_multi_pw_aff_3(isl_ctx *ctx)
> +{
> +       isl_space *space;
> +       isl_union_set *dom;
> +       isl_multi_val *mv;
> +       isl_multi_union_pw_aff *mupa;
> +       isl_union_map *umap;
> +
> +       dom = isl_union_set_read_from_str(ctx, "{ A[]; B[] }");
> +       space = isl_union_set_get_space(dom);
> +       mv = isl_multi_val_zero(isl_space_set_from_params(space));
> +       mupa = isl_multi_union_pw_aff_multi_val_on_domain(dom, mv);
> +       umap = isl_union_map_from_multi_union_pw_aff(mupa);
> +       isl_union_map_free(umap);
> +       if (!umap)
> +               return isl_stat_error;
> +
> +       return isl_stat_ok;
> +}
> +
>  /* Perform some tests on multi piecewise affine expressions.
>   */
>  static int test_multi_pw_aff(isl_ctx *ctx)
> @@ -8280,6 +8375,8 @@ static int test_multi_pw_aff(isl_ctx *ct
>                 return -1;
>         if (test_multi_pw_aff_2(ctx) < 0)
>                 return -1;
> +       if (test_multi_pw_aff_3(ctx) < 0)
> +               return -1;
>         return 0;
>  }
>
>
> Modified: polly/trunk/lib/External/isl/isl_union_map.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_union_map.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_union_map.c (original)
> +++ polly/trunk/lib/External/isl/isl_union_map.c Wed May 23 13:18:50 2018
> @@ -259,7 +259,7 @@ __isl_give isl_union_map *isl_union_map_
>         if (!data.exp)
>                 goto error;
>
> -       data.res = isl_union_map_alloc(isl_space_copy(data.exp->dim),
> +       data.res = isl_union_map_alloc(isl_reordering_get_space(data.exp),
>                                         umap->table.n);
>         if (isl_hash_table_foreach(umap->dim->ctx, &umap->table,
>                                         &align_entry, &data) < 0)
>
> Modified: polly/trunk/lib/External/isl/isl_union_templ.c
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/isl_union_templ.c?rev=333118&r1=333117&r2=333118&view=diff
> ==============================================================================
> --- polly/trunk/lib/External/isl/isl_union_templ.c (original)
> +++ polly/trunk/lib/External/isl/isl_union_templ.c Wed May 23 13:18:50 2018
> @@ -398,7 +398,7 @@ static __isl_give UNION *FN(UNION,realig
>         if (!u || !r)
>                 goto error;
>
> -       space = isl_space_copy(r->dim);
> +       space = isl_reordering_get_space(r);
>         u = FN(UNION,transform_space)(u, space, &FN(UNION,align_entry), r);
>         isl_reordering_free(r);
>         return u;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list