[Polly] Update ISL to isl-0.22.1-87-gfee05a13.

The primary motivation is to fix an assertion failure in
isl_basic_map_alloc_equality:

    isl_assert(ctx, room_for_con(bmap, 1), return -1);

Although the assertion does not occur anymore, I could not identify
which of ISL's commits fixed it.

Compared to the previous ISL version, Polly requires some changes for this update

 * Since ISL commit
   20d3574 "perform parameter alignment by modifying both arguments to function"
   isl_*_gist_* and similar functions do not always align the paramter
   list anymore. This caused the parameter lists in JScop files to
   become out-of-sync. Since many regression tests use JScop files with
   a fixed parameter list and order, we explicitly call align_params to
   ensure a predictable parameter list.

 * ISL changed some return types to isl_size, a typedef of (signed) int.
   This caused some issues where the return type was unsigned int before:
   - No overload for std::max(unsigned,isl_size)
   - It cause additional 'mixed signed/unsigned comparison' warnings.
     Since they do not break compilation, and sizes larger than 2^31
     were never supported, I am going to fix it separately.

 * With the change to isl_size, commit
   57d547 "isl_*_list_size: return isl_size"
   also changed the return value in case of an error from 0 to -1. This
   caused undefined looping over isl_iterator since the 'end iterator'
   got index -1, never reached from the 'begin iterator' with index 0.

 * Some internal changes in ISL caused the number of operations to
   increase when determining access ranges to determine aliasing
   overlaps. In one test, this caused exceeding the default limit of
   800000. The operations-limit was disabled for this test.
This commit is contained in:
Michael Kruse 2020-02-10 14:51:33 -06:00
parent e79c3b4c2d
commit e8227804ac
266 changed files with 56325 additions and 15657 deletions

View File

@ -32,7 +32,7 @@ struct isl_iterator
using ElementT = list_element_type<ListT>;
explicit isl_iterator(const ListT &List)
: List(&List), Position(List.size()) {}
: List(&List), Position(std::max(List.size(), 0)) {}
isl_iterator(const ListT &List, int Position)
: List(&List), Position(Position) {}
isl_iterator &operator=(const isl_iterator &R) = default;

View File

@ -916,6 +916,12 @@ void MemoryAccess::realignParams() {
isl::set Ctx = Statement->getParent()->getContext();
InvalidDomain = InvalidDomain.gist_params(Ctx);
AccessRelation = AccessRelation.gist_params(Ctx);
// Predictable parameter order is required for JSON imports. Ensure alignment
// by explicitly calling align_params.
isl::space CtxSpace = Ctx.get_space();
InvalidDomain = InvalidDomain.align_params(CtxSpace);
AccessRelation = AccessRelation.align_params(CtxSpace);
}
const std::string MemoryAccess::getReductionOperatorStr() const {
@ -1174,6 +1180,12 @@ void ScopStmt::realignParams() {
isl::set Ctx = Parent.getContext();
InvalidDomain = InvalidDomain.gist_params(Ctx);
Domain = Domain.gist_params(Ctx);
// Predictable parameter order is required for JSON imports. Ensure alignment
// by explicitly calling align_params.
isl::space CtxSpace = Ctx.get_space();
InvalidDomain = InvalidDomain.align_params(CtxSpace);
Domain = Domain.align_params(CtxSpace);
}
ScopStmt::ScopStmt(Scop &parent, Region &R, StringRef Name,
@ -1595,6 +1607,8 @@ void Scop::realignParams() {
// Align the parameters of all data structures to the model.
Context = Context.align_params(Space);
AssumedContext = AssumedContext.align_params(Space);
InvalidContext = InvalidContext.align_params(Space);
// Bound the size of the fortran array dimensions.
Context = boundFortranArrayParams(Context, arrays());
@ -1606,6 +1620,10 @@ void Scop::realignParams() {
Stmt.realignParams();
// Simplify the schedule according to the context too.
Schedule = Schedule.gist_domain_params(getContext());
// Predictable parameter order is required for JSON imports. Ensure alignment
// by explicitly calling align_params.
Schedule = Schedule.align_params(Space);
}
static isl::set simplifyAssumptionContext(isl::set AssumptionContext,

View File

@ -37,6 +37,7 @@
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "isl/union_map.h"
#include <algorithm>
extern "C" {
#include "ppcg/cuda.h"
@ -1780,11 +1781,11 @@ void GPUNodeBuilder::createKernel(__isl_take isl_ast_node *KernelStmt) {
isl_ast_node_free(KernelStmt);
if (Kernel->n_grid > 1)
DeepestParallel =
std::max(DeepestParallel, isl_space_dim(Kernel->space, isl_dim_set));
DeepestParallel = std::max(
DeepestParallel, (unsigned)isl_space_dim(Kernel->space, isl_dim_set));
else
DeepestSequential =
std::max(DeepestSequential, isl_space_dim(Kernel->space, isl_dim_set));
DeepestSequential = std::max(
DeepestSequential, (unsigned)isl_space_dim(Kernel->space, isl_dim_set));
Value *BlockDimX, *BlockDimY, *BlockDimZ;
std::tie(BlockDimX, BlockDimY, BlockDimZ) = getBlockSizes(Kernel);

View File

@ -241,6 +241,7 @@ if (POLLY_BUNDLED_ISL)
isl/isl_scheduler.c
isl/isl_seq.c
isl/isl_set_list.c
isl/isl_set_to_ast_graft_list.c
isl/isl_sort.c
isl/isl_space.c
isl/isl_stride.c

View File

@ -23,7 +23,11 @@ isl was written by
Domaine de Voluceau - Rocquencourt, B.P. 105
78153 Le Chesnay
France
2015-2016 Polly Labs
2015-2019 Polly Labs
2018-2019 Cerebras Systems
175 S San Antonio Rd
Los Altos, CA
USA
Contributions by
@ -33,11 +37,15 @@ Serge Belyshev
Albert Cohen
Ray Donnelly
Johannes Doerfert
Andi Drebes
Clement Foyer
Armin Groesslinger
Tobias Grosser
Frederik Harwath
Alexandre Isoard
Andreas Kloeckner
Michael Kruse
Manjunath Kudlur
Alexander Matz
Sebastian Pop
Louis-Noel Pouchet
@ -45,6 +53,7 @@ Benoit Pradelle
Uday Bondhugula
Andreas Simbuerger
Malhar Thakkar
Sergei Trofimovich
Sven van Haastregt
Oleksandr Zinenko

View File

@ -1,3 +1,26 @@
version: 0.22.1
date: Sun Jan 12 10:48:18 CET 2020
changes:
- fix error handling
---
version: 0.22
date: Fri Nov 1 18:39:30 CET 2019
changes:
- improved bindings
- scheduler fix involving fixed dimensions
- accept ranges in tuples during parsing
- add some convenience functions
---
version: 0.21
date: Sat Mar 9 15:25:29 CET 2019
changes:
- preliminary C++ bindings
- use incremental scheduler by default
- introduce isl_size type
- rename isl_ast_op_type to isl_ast_expr_op_type
- fix coalescing bugs
- use isl_bool to return extra boolean argument
---
version: 0.20
date: Sat Jul 21 18:10:08 CEST 2018
changes:

View File

@ -1 +1 @@
isl-0.20-65-gb822a210
isl-0.22.1-87-gfee05a13

View File

@ -1,9 +1,11 @@
if HAVE_CLANG
if HAVE_CXX11
MAYBE_INTERFACE = interface
FORCE:
interface/extract_interface: FORCE
$(MAKE) $(AM_MAKEFLAGS) -C interface extract_interface
endif
endif
SUBDIRS = . $(MAYBE_INTERFACE) doc
DIST_SUBDIRS = $(MAYBE_INTERFACE) doc
@ -29,16 +31,18 @@ if HAVE_CLANG
if HAVE_CXX11
noinst_PROGRAMS += isl_test_cpp-checked isl_test_cpp-checked-conversion
TESTS += isl_test_cpp-checked isl_test_cpp-checked-conversion
endif
if HAVE_PYTHON
TESTS += isl_test_python.py
noinst_PYTHON = interface/isl.py
isl_test_python.py: interface/isl.py libisl.la
endif
endif
endif
TEST_EXTENSIONS = .py
AM_TESTS_ENVIRONMENT = \
export PYTHONPATH=interface; \
export LD_LIBRARY_PATH=.libs;
export ISL_DYLD_LIBRARY_PATH=.libs; \
export LD_LIBRARY_PATH=".libs:$(LD_LIBRARY_PATH)";
PY_LOG_COMPILER = $(PYTHON)
if IMATH_FOR_MP
@ -85,7 +89,7 @@ endif
includes = -I. -I$(srcdir) -I$(srcdir)/include -Iinclude/
AM_CPPFLAGS = $(includes) @MP_CPPFLAGS@
AM_CFLAGS = @WARNING_FLAGS@
AM_CFLAGS = @WARNING_FLAGS@ @MP_CFLAGS@
libisl_la_SOURCES = \
$(MP_SRC) \
@ -130,7 +134,6 @@ libisl_la_SOURCES = \
isl_flow.c \
isl_fold.c \
isl_hash.c \
isl_hash_private.h \
isl_id_to_ast_expr.c \
isl_id_to_id.c \
isl_id_to_pw_aff.c \
@ -138,6 +141,7 @@ libisl_la_SOURCES = \
isl_ilp_private.h \
isl_input.c \
isl_int.h \
isl_local_private.h \
isl_local.h \
isl_local.c \
isl_local_space_private.h \
@ -197,6 +201,8 @@ libisl_la_SOURCES = \
isl_stream_private.h \
isl_seq.c \
isl_seq.h \
isl_set_to_ast_graft_list.c \
isl_set_to_ast_graft_list.h \
isl_stride.c \
isl_tab.c \
isl_tab.h \
@ -290,21 +296,18 @@ isl_closure_LDADD = libisl.la
isl_closure_SOURCES = \
closure.c
isl_test_cpp_CXXFLAGS = @CXX11FLAGS@
isl_test_cpp_SOURCES = \
isl_test_cpp.cc \
include/isl/cpp.h
isl_test_cpp_LDFLAGS = @MP_LDFLAGS@
isl_test_cpp_LDADD = libisl.la @MP_LIBS@
isl_test_cpp_checked_CXXFLAGS = @CXX11FLAGS@
isl_test_cpp_checked_SOURCES = \
isl_test_cpp-checked.cc \
include/isl/cpp-checked.h
isl_test_cpp_checked_LDFLAGS = @MP_LDFLAGS@
isl_test_cpp_checked_LDADD = libisl.la @MP_LIBS@
isl_test_cpp_checked_conversion_CXXFLAGS = @CXX11FLAGS@
isl_test_cpp_checked_conversion_SOURCES = \
isl_test_cpp-checked-conversion.cc \
include/isl/cpp-checked-conversion.h
@ -314,11 +317,15 @@ isl_test_cpp_checked_conversion_LDADD = libisl.la @MP_LIBS@
# dummy library that captures the dependencies on all headers
# that are relevant for the bindings
noinst_LIBRARIES = libdep.a
libdep_a_SOURCES = all.c
libdep_a_SOURCES = dep.c
if HAVE_CLANG
interface/isl.py: interface/extract_interface libdep.a python/isl.py.top
(cat $(srcdir)/python/isl.py.top && \
if HAVE_CXX11
interface/isldlname.py: libisl.la
$(AM_V_GEN) $(GREP) dlname $< | $(SED) -e 's/dlname/isl_dlname/' > $@
interface/isl.py: interface/extract_interface libdep.a python/isl.py.top \
interface/isldlname.py
(cat interface/isldlname.py $(srcdir)/python/isl.py.top && \
interface/extract_interface$(EXEEXT) --language=python \
$(includes) $(srcdir)/all.h) \
> $@ || (rm $@ && false)
@ -354,6 +361,7 @@ include/isl/cpp-checked-conversion.h: interface/extract_interface libdep.a \
cat $(srcdir)/cpp/cpp-checked-conversion.h.bot) \
> $@ || (rm $@ && false)
endif
endif
nodist_pkginclude_HEADERS = \
include/isl/stdint.h
@ -420,13 +428,20 @@ pkginclude_HEADERS = \
include/isl/vertices.h
if HAVE_CLANG
if HAVE_CXX11
CPP_INTERFACES = \
include/isl/cpp.h \
include/isl/cpp-checked.h \
include/isl/cpp-checked-conversion.h
endif
endif
BUILT_SOURCES = gitversion.h $(CPP_INTERFACES)
CLEANFILES = gitversion.h interface/isl.py $(CPP_INTERFACES)
CLEANFILES = \
gitversion.h \
interface/isldlname.py \
interface/isl.py \
interface/isl.pyc \
$(CPP_INTERFACES)
DISTCLEANFILES = \
isl-uninstalled.sh \
@ -438,48 +453,98 @@ DISTCLEANFILES = \
EXTRA_DIST = \
LICENSE \
isl_config_post.h \
isl_align_params_templ.c \
isl_align_params_bin_templ.c \
basis_reduction_templ.c \
isl_bind_domain_templ.c \
bset_to_bmap.c \
bset_from_bmap.c \
isl_check_named_params_templ.c \
check_reparse_templ.c \
check_reparse_test_templ.c \
check_type_range_templ.c \
isl_domain_factor_templ.c \
extract_key.c \
has_single_reference_templ.c \
isl_list_macro.h \
isl_list_templ.c \
isl_list_templ.h \
isl_map_bound_templ.c \
isl_map_lexopt_templ.c \
isl_maybe_ast_graft_list.h \
isl_maybe_map.h \
isl_multi_macro.h \
isl_multi_bind_templ.c \
isl_multi_explicit_domain.c \
isl_multi_pw_aff_explicit_domain.c \
isl_multi_union_pw_aff_explicit_domain.c \
isl_multi_no_explicit_domain.c \
isl_multi_no_domain_templ.c \
isl_multi_templ.c \
isl_multi_templ.h \
isl_multi_add_constant_templ.c \
isl_multi_align_templ.c \
isl_multi_align_set.c \
isl_multi_align_union_set.c \
isl_multi_apply_templ.c \
isl_multi_apply_set.c \
isl_multi_apply_union_set.c \
isl_multi_arith_templ.c \
isl_multi_bind_domain_templ.c \
isl_multi_cmp.c \
isl_multi_coalesce.c \
isl_multi_dim_id_templ.c \
isl_multi_dims.c \
isl_multi_domain_templ.c \
isl_multi_floor.c \
isl_multi_from_base_templ.c \
isl_multi_gist.c \
isl_multi_hash.c \
isl_multi_intersect.c \
isl_multi_identity_templ.c \
isl_multi_locals_templ.c \
isl_multi_move_dims_templ.c \
isl_multi_nan_templ.c \
isl_multi_param_templ.c \
isl_multi_product_templ.c \
isl_multi_read_no_explicit_domain_templ.c \
isl_multi_splice_templ.c \
isl_multi_tuple_id_templ.c \
isl_multi_zero_templ.c \
opt_type.h \
print_templ.c \
print_templ_yaml.c \
print_yaml_field_templ.c \
isl_power_templ.c \
isl_project_out_all_params_templ.c \
isl_pw_macro.h \
isl_pw_templ.c \
isl_pw_templ.h \
isl_pw_add_constant_templ.c \
isl_pw_add_constant_multi_val_templ.c \
isl_pw_add_constant_val_templ.c \
isl_pw_bind_domain_templ.c \
isl_pw_eval.c \
isl_pw_hash.c \
isl_pw_insert_dims_templ.c \
isl_pw_lift_templ.c \
isl_pw_morph_templ.c \
isl_pw_move_dims_templ.c \
isl_pw_neg_templ.c \
isl_pw_opt_templ.c \
isl_pw_pullback_templ.c \
isl_pw_sub_templ.c \
isl_pw_union_opt.c \
read_in_string_templ.c \
set_to_map.c \
set_from_map.c \
set_list_from_map_list_inl.c \
isl_tab_lexopt_templ.c \
isl_test_list_templ.c \
isl_test_plain_equal_templ.c \
isl_type_check_equal_space_templ.c \
isl_type_has_equal_space_bin_templ.c \
isl_type_has_equal_space_templ.c \
uset_to_umap.c \
uset_from_umap.c \
isl_union_macro.h \
@ -510,12 +575,7 @@ EXTRA_DIST = \
isl_test_python.py \
test_inputs
if HAVE_CLANG
dist-hook: interface/isl.py
cp interface/isl.py $(distdir)/interface/
else
dist-hook:
endif
echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID
(cd doc; make manual.pdf)
cp doc/manual.pdf $(distdir)/doc/

View File

@ -108,7 +108,7 @@ TESTS = isl_test$(EXEEXT) codegen_test.sh pip_test.sh bound_test.sh \
@HAVE_CPP_ISL_H_TRUE@@HAVE_CXX11_TRUE@am__append_2 = isl_test_cpp
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@am__append_3 = isl_test_cpp-checked isl_test_cpp-checked-conversion
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@am__append_4 = isl_test_cpp-checked isl_test_cpp-checked-conversion
@HAVE_CLANG_TRUE@@HAVE_PYTHON_TRUE@am__append_5 = isl_test_python.py
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@@HAVE_PYTHON_TRUE@am__append_5 = isl_test_python.py
@IMATH_FOR_MP_TRUE@am__append_6 = isl_test_imath
@IMATH_FOR_MP_TRUE@am__append_7 = isl_test_imath
@IMATH_FOR_MP_TRUE@@SMALL_INT_OPT_TRUE@am__append_8 = isl_int_sioimath.h \
@ -126,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11_no_override.m4 \
$(top_srcdir)/m4/ax_detect_clang.m4 \
$(top_srcdir)/m4/ax_detect_git_head.m4 \
$(top_srcdir)/m4/ax_detect_gmp.m4 \
@ -141,8 +142,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__pkginclude_HEADERS_DIST) \
$(am__DIST_COMMON)
$(am__configure_deps) $(am__noinst_PYTHON_DIST) \
$(am__pkginclude_HEADERS_DIST) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@ -158,7 +159,7 @@ am__v_AR_0 = @echo " AR " $@;
am__v_AR_1 =
libdep_a_AR = $(AR) $(ARFLAGS)
libdep_a_LIBADD =
am_libdep_a_OBJECTS = all.$(OBJEXT)
am_libdep_a_OBJECTS = dep.$(OBJEXT)
libdep_a_OBJECTS = $(am_libdep_a_OBJECTS)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
@ -208,9 +209,9 @@ am__libisl_la_SOURCES_DIST = mp_get_memory_functions.c isl_int_gmp.h \
isl_convex_hull.c isl_ctx.c isl_ctx_private.h isl_deprecated.c \
isl_dim_map.h isl_dim_map.c isl_equalities.c isl_equalities.h \
isl_factorization.c isl_factorization.h isl_farkas.c isl_ffs.c \
isl_flow.c isl_fold.c isl_hash.c isl_hash_private.h \
isl_id_to_ast_expr.c isl_id_to_id.c isl_id_to_pw_aff.c \
isl_ilp.c isl_ilp_private.h isl_input.c isl_int.h isl_local.h \
isl_flow.c isl_fold.c isl_hash.c isl_id_to_ast_expr.c \
isl_id_to_id.c isl_id_to_pw_aff.c isl_ilp.c isl_ilp_private.h \
isl_input.c isl_int.h isl_local_private.h isl_local.h \
isl_local.c isl_local_space_private.h isl_local_space.c \
isl_lp.c isl_lp_private.h isl_map.c isl_map_list.c \
isl_map_simplify.c isl_map_subtract.c isl_map_private.h \
@ -227,9 +228,10 @@ am__libisl_la_SOURCES_DIST = mp_get_memory_functions.c isl_int_gmp.h \
isl_schedule_constraints.c isl_schedule_constraints.h \
isl_scheduler.c isl_set_list.c isl_sort.c isl_sort.h \
isl_space.c isl_space_private.h isl_stream.c \
isl_stream_private.h isl_seq.c isl_seq.h isl_stride.c \
isl_tab.c isl_tab.h isl_tab_pip.c isl_tarjan.c isl_tarjan.h \
isl_transitive_closure.c isl_union_map.c \
isl_stream_private.h isl_seq.c isl_seq.h \
isl_set_to_ast_graft_list.c isl_set_to_ast_graft_list.h \
isl_stride.c isl_tab.c isl_tab.h isl_tab_pip.c isl_tarjan.c \
isl_tarjan.h isl_transitive_closure.c isl_union_map.c \
isl_union_map_private.h isl_union_set_private.h isl_val.c \
isl_val_private.h isl_vec_private.h isl_vec.c isl_version.c \
isl_vertices_private.h isl_vertices.c isl_yaml.h
@ -267,9 +269,10 @@ am_libisl_la_OBJECTS = $(am__objects_4) isl_aff.lo isl_aff_map.lo \
isl_schedule_read.lo isl_schedule_tree.lo \
isl_schedule_constraints.lo isl_scheduler.lo isl_set_list.lo \
isl_sort.lo isl_space.lo isl_stream.lo isl_seq.lo \
isl_stride.lo isl_tab.lo isl_tab_pip.lo isl_tarjan.lo \
isl_transitive_closure.lo isl_union_map.lo isl_val.lo \
isl_vec.lo isl_version.lo isl_vertices.lo
isl_set_to_ast_graft_list.lo isl_stride.lo isl_tab.lo \
isl_tab_pip.lo isl_tarjan.lo isl_transitive_closure.lo \
isl_union_map.lo isl_val.lo isl_vec.lo isl_version.lo \
isl_vertices.lo
libisl_la_OBJECTS = $(am_libisl_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@ -358,27 +361,27 @@ isl_test_DEPENDENCIES = libisl.la
isl_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(isl_test_LDFLAGS) $(LDFLAGS) -o $@
am_isl_test_cpp_OBJECTS = isl_test_cpp-isl_test_cpp.$(OBJEXT)
am_isl_test_cpp_OBJECTS = isl_test_cpp.$(OBJEXT)
isl_test_cpp_OBJECTS = $(am_isl_test_cpp_OBJECTS)
isl_test_cpp_DEPENDENCIES = libisl.la
isl_test_cpp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(isl_test_cpp_CXXFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(isl_test_cpp_LDFLAGS) $(LDFLAGS) -o $@
am_isl_test_cpp_checked_OBJECTS = \
isl_test_cpp_checked-isl_test_cpp-checked.$(OBJEXT)
am_isl_test_cpp_checked_OBJECTS = isl_test_cpp-checked.$(OBJEXT)
isl_test_cpp_checked_OBJECTS = $(am_isl_test_cpp_checked_OBJECTS)
isl_test_cpp_checked_DEPENDENCIES = libisl.la
isl_test_cpp_checked_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
$(isl_test_cpp_checked_CXXFLAGS) $(CXXFLAGS) \
$(isl_test_cpp_checked_LDFLAGS) $(LDFLAGS) -o $@
am_isl_test_cpp_checked_conversion_OBJECTS = isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.$(OBJEXT)
$(AM_CXXFLAGS) $(CXXFLAGS) $(isl_test_cpp_checked_LDFLAGS) \
$(LDFLAGS) -o $@
am_isl_test_cpp_checked_conversion_OBJECTS = \
isl_test_cpp-checked-conversion.$(OBJEXT)
isl_test_cpp_checked_conversion_OBJECTS = \
$(am_isl_test_cpp_checked_conversion_OBJECTS)
isl_test_cpp_checked_conversion_DEPENDENCIES = libisl.la
isl_test_cpp_checked_conversion_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
$(isl_test_cpp_checked_conversion_CXXFLAGS) $(CXXFLAGS) \
$(AM_CXXFLAGS) $(CXXFLAGS) \
$(isl_test_cpp_checked_conversion_LDFLAGS) $(LDFLAGS) -o $@
isl_test_imath_SOURCES = isl_test_imath.c
isl_test_imath_OBJECTS = isl_test_imath.$(OBJEXT)
@ -480,6 +483,9 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__noinst_PYTHON_DIST = interface/isl.py
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
py_compile = $(top_srcdir)/py-compile
DATA = $(pkgconfig_DATA)
am__pkginclude_HEADERS_DIST = include/isl/cpp.h include/isl/val_gmp.h \
include/isl/aff.h include/isl/aff_type.h include/isl/arg.h \
@ -717,7 +723,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/bound_test.sh.in \
$(srcdir)/isl_config.h.in $(srcdir)/isl_srcdir.c.in \
$(srcdir)/pip_test.sh.in $(srcdir)/schedule_test.sh.in AUTHORS \
ChangeLog README compile config.guess config.sub depcomp \
install-sh ltmain.sh missing test-driver
install-sh ltmain.sh missing py-compile test-driver
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@ -774,13 +780,15 @@ CFLAGS = @CFLAGS@
CLANG_CXXFLAGS = @CLANG_CXXFLAGS@
CLANG_LDFLAGS = @CLANG_LDFLAGS@
CLANG_LIBS = @CLANG_LIBS@
CLANG_RFLAG = @CLANG_RFLAG@
CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXX11FLAGS = @CXX11FLAGS@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH = @CYGPATH@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
@ -810,12 +818,14 @@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_CLANG_EDIT = @LIB_CLANG_EDIT@
LIPO = @LIPO@
LLVM_CONFIG = @LLVM_CONFIG@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MP_CFLAGS = @MP_CFLAGS@
MP_CPPFLAGS = @MP_CPPFLAGS@
MP_LDFLAGS = @MP_LDFLAGS@
MP_LIBS = @MP_LIBS@
@ -823,6 +833,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_SRCDIR = @OS_SRCDIR@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
@ -885,7 +896,6 @@ infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
llvm_config_found = @llvm_config_found@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
@ -911,17 +921,19 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
versioninfo = @versioninfo@
@HAVE_CLANG_TRUE@MAYBE_INTERFACE = interface
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@MAYBE_INTERFACE = interface
SUBDIRS = . $(MAYBE_INTERFACE) doc
DIST_SUBDIRS = $(MAYBE_INTERFACE) doc
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = nostdinc subdir-objects
lib_LTLIBRARIES = libisl.la
@HAVE_CPP_ISL_H_TRUE@CPP_H = include/isl/cpp.h
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@@HAVE_PYTHON_TRUE@noinst_PYTHON = interface/isl.py
TEST_EXTENSIONS = .py
AM_TESTS_ENVIRONMENT = \
export PYTHONPATH=interface; \
export LD_LIBRARY_PATH=.libs;
export ISL_DYLD_LIBRARY_PATH=.libs; \
export LD_LIBRARY_PATH=".libs:$(LD_LIBRARY_PATH)";
PY_LOG_COMPILER = $(PYTHON)
@GMP_FOR_MP_TRUE@MP_SRC = \
@ -941,7 +953,7 @@ PY_LOG_COMPILER = $(PYTHON)
@GMP_FOR_MP_TRUE@@NEED_GET_MEMORY_FUNCTIONS_TRUE@GET_MEMORY_FUNCTIONS = mp_get_memory_functions.c
includes = -I. -I$(srcdir) -I$(srcdir)/include -Iinclude/
AM_CPPFLAGS = $(includes) @MP_CPPFLAGS@
AM_CFLAGS = @WARNING_FLAGS@
AM_CFLAGS = @WARNING_FLAGS@ @MP_CFLAGS@
libisl_la_SOURCES = \
$(MP_SRC) \
isl_aff.c \
@ -985,7 +997,6 @@ libisl_la_SOURCES = \
isl_flow.c \
isl_fold.c \
isl_hash.c \
isl_hash_private.h \
isl_id_to_ast_expr.c \
isl_id_to_id.c \
isl_id_to_pw_aff.c \
@ -993,6 +1004,7 @@ libisl_la_SOURCES = \
isl_ilp_private.h \
isl_input.c \
isl_int.h \
isl_local_private.h \
isl_local.h \
isl_local.c \
isl_local_space_private.h \
@ -1052,6 +1064,8 @@ libisl_la_SOURCES = \
isl_stream_private.h \
isl_seq.c \
isl_seq.h \
isl_set_to_ast_graft_list.c \
isl_set_to_ast_graft_list.h \
isl_stride.c \
isl_tab.c \
isl_tab.h \
@ -1141,21 +1155,18 @@ isl_closure_LDADD = libisl.la
isl_closure_SOURCES = \
closure.c
isl_test_cpp_CXXFLAGS = @CXX11FLAGS@
isl_test_cpp_SOURCES = \
isl_test_cpp.cc \
include/isl/cpp.h
isl_test_cpp_LDFLAGS = @MP_LDFLAGS@
isl_test_cpp_LDADD = libisl.la @MP_LIBS@
isl_test_cpp_checked_CXXFLAGS = @CXX11FLAGS@
isl_test_cpp_checked_SOURCES = \
isl_test_cpp-checked.cc \
include/isl/cpp-checked.h
isl_test_cpp_checked_LDFLAGS = @MP_LDFLAGS@
isl_test_cpp_checked_LDADD = libisl.la @MP_LIBS@
isl_test_cpp_checked_conversion_CXXFLAGS = @CXX11FLAGS@
isl_test_cpp_checked_conversion_SOURCES = \
isl_test_cpp-checked-conversion.cc \
include/isl/cpp-checked-conversion.h
@ -1166,7 +1177,7 @@ isl_test_cpp_checked_conversion_LDADD = libisl.la @MP_LIBS@
# dummy library that captures the dependencies on all headers
# that are relevant for the bindings
noinst_LIBRARIES = libdep.a
libdep_a_SOURCES = all.c
libdep_a_SOURCES = dep.c
nodist_pkginclude_HEADERS = \
include/isl/stdint.h
@ -1232,13 +1243,19 @@ pkginclude_HEADERS = \
include/isl/version.h \
include/isl/vertices.h
@HAVE_CLANG_TRUE@CPP_INTERFACES = \
@HAVE_CLANG_TRUE@ include/isl/cpp.h \
@HAVE_CLANG_TRUE@ include/isl/cpp-checked.h \
@HAVE_CLANG_TRUE@ include/isl/cpp-checked-conversion.h
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@CPP_INTERFACES = \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ include/isl/cpp.h \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ include/isl/cpp-checked.h \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ include/isl/cpp-checked-conversion.h
BUILT_SOURCES = gitversion.h $(CPP_INTERFACES)
CLEANFILES = gitversion.h interface/isl.py $(CPP_INTERFACES)
CLEANFILES = \
gitversion.h \
interface/isldlname.py \
interface/isl.py \
interface/isl.pyc \
$(CPP_INTERFACES)
DISTCLEANFILES = \
isl-uninstalled.sh \
isl-uninstalled.pc \
@ -1249,48 +1266,98 @@ DISTCLEANFILES = \
EXTRA_DIST = \
LICENSE \
isl_config_post.h \
isl_align_params_templ.c \
isl_align_params_bin_templ.c \
basis_reduction_templ.c \
isl_bind_domain_templ.c \
bset_to_bmap.c \
bset_from_bmap.c \
isl_check_named_params_templ.c \
check_reparse_templ.c \
check_reparse_test_templ.c \
check_type_range_templ.c \
isl_domain_factor_templ.c \
extract_key.c \
has_single_reference_templ.c \
isl_list_macro.h \
isl_list_templ.c \
isl_list_templ.h \
isl_map_bound_templ.c \
isl_map_lexopt_templ.c \
isl_maybe_ast_graft_list.h \
isl_maybe_map.h \
isl_multi_macro.h \
isl_multi_bind_templ.c \
isl_multi_explicit_domain.c \
isl_multi_pw_aff_explicit_domain.c \
isl_multi_union_pw_aff_explicit_domain.c \
isl_multi_no_explicit_domain.c \
isl_multi_no_domain_templ.c \
isl_multi_templ.c \
isl_multi_templ.h \
isl_multi_add_constant_templ.c \
isl_multi_align_templ.c \
isl_multi_align_set.c \
isl_multi_align_union_set.c \
isl_multi_apply_templ.c \
isl_multi_apply_set.c \
isl_multi_apply_union_set.c \
isl_multi_arith_templ.c \
isl_multi_bind_domain_templ.c \
isl_multi_cmp.c \
isl_multi_coalesce.c \
isl_multi_dim_id_templ.c \
isl_multi_dims.c \
isl_multi_domain_templ.c \
isl_multi_floor.c \
isl_multi_from_base_templ.c \
isl_multi_gist.c \
isl_multi_hash.c \
isl_multi_intersect.c \
isl_multi_identity_templ.c \
isl_multi_locals_templ.c \
isl_multi_move_dims_templ.c \
isl_multi_nan_templ.c \
isl_multi_param_templ.c \
isl_multi_product_templ.c \
isl_multi_read_no_explicit_domain_templ.c \
isl_multi_splice_templ.c \
isl_multi_tuple_id_templ.c \
isl_multi_zero_templ.c \
opt_type.h \
print_templ.c \
print_templ_yaml.c \
print_yaml_field_templ.c \
isl_power_templ.c \
isl_project_out_all_params_templ.c \
isl_pw_macro.h \
isl_pw_templ.c \
isl_pw_templ.h \
isl_pw_add_constant_templ.c \
isl_pw_add_constant_multi_val_templ.c \
isl_pw_add_constant_val_templ.c \
isl_pw_bind_domain_templ.c \
isl_pw_eval.c \
isl_pw_hash.c \
isl_pw_insert_dims_templ.c \
isl_pw_lift_templ.c \
isl_pw_morph_templ.c \
isl_pw_move_dims_templ.c \
isl_pw_neg_templ.c \
isl_pw_opt_templ.c \
isl_pw_pullback_templ.c \
isl_pw_sub_templ.c \
isl_pw_union_opt.c \
read_in_string_templ.c \
set_to_map.c \
set_from_map.c \
set_list_from_map_list_inl.c \
isl_tab_lexopt_templ.c \
isl_test_list_templ.c \
isl_test_plain_equal_templ.c \
isl_type_check_equal_space_templ.c \
isl_type_has_equal_space_bin_templ.c \
isl_type_has_equal_space_templ.c \
uset_to_umap.c \
uset_from_umap.c \
isl_union_macro.h \
@ -1540,12 +1607,12 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/all.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basis_reduction_tab.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bound.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closure.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codegen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dep.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flow.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flow_cmp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_aff.Plo@am__quote@
@ -1612,6 +1679,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_scheduler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_seq.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_set_list.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_set_to_ast_graft_list.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_sort.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_space.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_stream.Plo@am__quote@
@ -1620,9 +1688,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_tab_pip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_tarjan.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_test_cpp-isl_test_cpp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_test_cpp_checked-isl_test_cpp-checked.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_test_cpp-checked-conversion.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_test_cpp-checked.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_test_cpp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_test_imath.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_test_int.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isl_transitive_closure.Plo@am__quote@
@ -1695,48 +1763,6 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
isl_test_cpp-isl_test_cpp.o: isl_test_cpp.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_CXXFLAGS) $(CXXFLAGS) -MT isl_test_cpp-isl_test_cpp.o -MD -MP -MF $(DEPDIR)/isl_test_cpp-isl_test_cpp.Tpo -c -o isl_test_cpp-isl_test_cpp.o `test -f 'isl_test_cpp.cc' || echo '$(srcdir)/'`isl_test_cpp.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_test_cpp-isl_test_cpp.Tpo $(DEPDIR)/isl_test_cpp-isl_test_cpp.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='isl_test_cpp.cc' object='isl_test_cpp-isl_test_cpp.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_CXXFLAGS) $(CXXFLAGS) -c -o isl_test_cpp-isl_test_cpp.o `test -f 'isl_test_cpp.cc' || echo '$(srcdir)/'`isl_test_cpp.cc
isl_test_cpp-isl_test_cpp.obj: isl_test_cpp.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_CXXFLAGS) $(CXXFLAGS) -MT isl_test_cpp-isl_test_cpp.obj -MD -MP -MF $(DEPDIR)/isl_test_cpp-isl_test_cpp.Tpo -c -o isl_test_cpp-isl_test_cpp.obj `if test -f 'isl_test_cpp.cc'; then $(CYGPATH_W) 'isl_test_cpp.cc'; else $(CYGPATH_W) '$(srcdir)/isl_test_cpp.cc'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_test_cpp-isl_test_cpp.Tpo $(DEPDIR)/isl_test_cpp-isl_test_cpp.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='isl_test_cpp.cc' object='isl_test_cpp-isl_test_cpp.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_CXXFLAGS) $(CXXFLAGS) -c -o isl_test_cpp-isl_test_cpp.obj `if test -f 'isl_test_cpp.cc'; then $(CYGPATH_W) 'isl_test_cpp.cc'; else $(CYGPATH_W) '$(srcdir)/isl_test_cpp.cc'; fi`
isl_test_cpp_checked-isl_test_cpp-checked.o: isl_test_cpp-checked.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_checked_CXXFLAGS) $(CXXFLAGS) -MT isl_test_cpp_checked-isl_test_cpp-checked.o -MD -MP -MF $(DEPDIR)/isl_test_cpp_checked-isl_test_cpp-checked.Tpo -c -o isl_test_cpp_checked-isl_test_cpp-checked.o `test -f 'isl_test_cpp-checked.cc' || echo '$(srcdir)/'`isl_test_cpp-checked.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_test_cpp_checked-isl_test_cpp-checked.Tpo $(DEPDIR)/isl_test_cpp_checked-isl_test_cpp-checked.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='isl_test_cpp-checked.cc' object='isl_test_cpp_checked-isl_test_cpp-checked.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_checked_CXXFLAGS) $(CXXFLAGS) -c -o isl_test_cpp_checked-isl_test_cpp-checked.o `test -f 'isl_test_cpp-checked.cc' || echo '$(srcdir)/'`isl_test_cpp-checked.cc
isl_test_cpp_checked-isl_test_cpp-checked.obj: isl_test_cpp-checked.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_checked_CXXFLAGS) $(CXXFLAGS) -MT isl_test_cpp_checked-isl_test_cpp-checked.obj -MD -MP -MF $(DEPDIR)/isl_test_cpp_checked-isl_test_cpp-checked.Tpo -c -o isl_test_cpp_checked-isl_test_cpp-checked.obj `if test -f 'isl_test_cpp-checked.cc'; then $(CYGPATH_W) 'isl_test_cpp-checked.cc'; else $(CYGPATH_W) '$(srcdir)/isl_test_cpp-checked.cc'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_test_cpp_checked-isl_test_cpp-checked.Tpo $(DEPDIR)/isl_test_cpp_checked-isl_test_cpp-checked.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='isl_test_cpp-checked.cc' object='isl_test_cpp_checked-isl_test_cpp-checked.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_checked_CXXFLAGS) $(CXXFLAGS) -c -o isl_test_cpp_checked-isl_test_cpp-checked.obj `if test -f 'isl_test_cpp-checked.cc'; then $(CYGPATH_W) 'isl_test_cpp-checked.cc'; else $(CYGPATH_W) '$(srcdir)/isl_test_cpp-checked.cc'; fi`
isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.o: isl_test_cpp-checked-conversion.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_checked_conversion_CXXFLAGS) $(CXXFLAGS) -MT isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.o -MD -MP -MF $(DEPDIR)/isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.Tpo -c -o isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.o `test -f 'isl_test_cpp-checked-conversion.cc' || echo '$(srcdir)/'`isl_test_cpp-checked-conversion.cc
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.Tpo $(DEPDIR)/isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='isl_test_cpp-checked-conversion.cc' object='isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_checked_conversion_CXXFLAGS) $(CXXFLAGS) -c -o isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.o `test -f 'isl_test_cpp-checked-conversion.cc' || echo '$(srcdir)/'`isl_test_cpp-checked-conversion.cc
isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.obj: isl_test_cpp-checked-conversion.cc
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_checked_conversion_CXXFLAGS) $(CXXFLAGS) -MT isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.obj -MD -MP -MF $(DEPDIR)/isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.Tpo -c -o isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.obj `if test -f 'isl_test_cpp-checked-conversion.cc'; then $(CYGPATH_W) 'isl_test_cpp-checked-conversion.cc'; else $(CYGPATH_W) '$(srcdir)/isl_test_cpp-checked-conversion.cc'; fi`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.Tpo $(DEPDIR)/isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='isl_test_cpp-checked-conversion.cc' object='isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(isl_test_cpp_checked_conversion_CXXFLAGS) $(CXXFLAGS) -c -o isl_test_cpp_checked_conversion-isl_test_cpp-checked-conversion.obj `if test -f 'isl_test_cpp-checked-conversion.cc'; then $(CYGPATH_W) 'isl_test_cpp-checked-conversion.cc'; else $(CYGPATH_W) '$(srcdir)/isl_test_cpp-checked-conversion.cc'; fi`
mostlyclean-libtool:
-rm -f *.lo
@ -2497,51 +2523,52 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-local \
.PRECIOUS: Makefile
@HAVE_CLANG_TRUE@FORCE:
@HAVE_CLANG_TRUE@interface/extract_interface: FORCE
@HAVE_CLANG_TRUE@ $(MAKE) $(AM_MAKEFLAGS) -C interface extract_interface
@HAVE_CLANG_TRUE@@HAVE_PYTHON_TRUE@ isl_test_python.py: interface/isl.py libisl.la
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@FORCE:
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@interface/extract_interface: FORCE
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ $(MAKE) $(AM_MAKEFLAGS) -C interface extract_interface
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@@HAVE_PYTHON_TRUE@ isl_test_python.py: interface/isl.py libisl.la
@HAVE_CLANG_TRUE@interface/isl.py: interface/extract_interface libdep.a python/isl.py.top
@HAVE_CLANG_TRUE@ (cat $(srcdir)/python/isl.py.top && \
@HAVE_CLANG_TRUE@ interface/extract_interface$(EXEEXT) --language=python \
@HAVE_CLANG_TRUE@ $(includes) $(srcdir)/all.h) \
@HAVE_CLANG_TRUE@ > $@ || (rm $@ && false)
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@interface/isldlname.py: libisl.la
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ $(AM_V_GEN) $(GREP) dlname $< | $(SED) -e 's/dlname/isl_dlname/' > $@
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@interface/isl.py: interface/extract_interface libdep.a python/isl.py.top \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ interface/isldlname.py
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ (cat interface/isldlname.py $(srcdir)/python/isl.py.top && \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ interface/extract_interface$(EXEEXT) --language=python \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ $(includes) $(srcdir)/all.h) \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ > $@ || (rm $@ && false)
@HAVE_CLANG_TRUE@include/isl/cpp.h: interface/extract_interface libdep.a \
@HAVE_CLANG_TRUE@ cpp/cpp.h.top cpp/cpp.h.pre cpp/cpp.h.bot
@HAVE_CLANG_TRUE@ $(MKDIR_P) "include/isl/cpp" && \
@HAVE_CLANG_TRUE@ (cat $(srcdir)/cpp/cpp.h.top $(srcdir)/all.h \
@HAVE_CLANG_TRUE@ $(srcdir)/cpp/cpp.h.pre && \
@HAVE_CLANG_TRUE@ interface/extract_interface$(EXEEXT) --language=cpp \
@HAVE_CLANG_TRUE@ $(includes) $(srcdir)/all.h && \
@HAVE_CLANG_TRUE@ cat $(srcdir)/cpp/cpp.h.bot) \
@HAVE_CLANG_TRUE@ > $@ || (rm $@ && false)
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@include/isl/cpp.h: interface/extract_interface libdep.a \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ cpp/cpp.h.top cpp/cpp.h.pre cpp/cpp.h.bot
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ $(MKDIR_P) "include/isl/cpp" && \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ (cat $(srcdir)/cpp/cpp.h.top $(srcdir)/all.h \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ $(srcdir)/cpp/cpp.h.pre && \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ interface/extract_interface$(EXEEXT) --language=cpp \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ $(includes) $(srcdir)/all.h && \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ cat $(srcdir)/cpp/cpp.h.bot) \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ > $@ || (rm $@ && false)
@HAVE_CLANG_TRUE@include/isl/cpp-checked.h: interface/extract_interface libdep.a \
@HAVE_CLANG_TRUE@ cpp/cpp-checked.h.top \
@HAVE_CLANG_TRUE@ cpp/cpp-checked.h.pre cpp/cpp-checked.h.bot
@HAVE_CLANG_TRUE@ (cat $(srcdir)/cpp/cpp-checked.h.top $(srcdir)/all.h \
@HAVE_CLANG_TRUE@ $(srcdir)/cpp/cpp-checked.h.pre && \
@HAVE_CLANG_TRUE@ interface/extract_interface$(EXEEXT) \
@HAVE_CLANG_TRUE@ --language=cpp-checked \
@HAVE_CLANG_TRUE@ $(includes) $(srcdir)/all.h && \
@HAVE_CLANG_TRUE@ cat $(srcdir)/cpp/cpp-checked.h.bot) \
@HAVE_CLANG_TRUE@ > $@ || (rm $@ && false)
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@include/isl/cpp-checked.h: interface/extract_interface libdep.a \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ cpp/cpp-checked.h.top \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ cpp/cpp-checked.h.pre cpp/cpp-checked.h.bot
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ (cat $(srcdir)/cpp/cpp-checked.h.top $(srcdir)/all.h \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ $(srcdir)/cpp/cpp-checked.h.pre && \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ interface/extract_interface$(EXEEXT) \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ --language=cpp-checked \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ $(includes) $(srcdir)/all.h && \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ cat $(srcdir)/cpp/cpp-checked.h.bot) \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ > $@ || (rm $@ && false)
@HAVE_CLANG_TRUE@include/isl/cpp-checked-conversion.h: interface/extract_interface libdep.a \
@HAVE_CLANG_TRUE@ cpp/cpp-checked-conversion.h.top \
@HAVE_CLANG_TRUE@ cpp/cpp-checked-conversion.h.bot
@HAVE_CLANG_TRUE@ (cat $(srcdir)/cpp/cpp-checked-conversion.h.top && \
@HAVE_CLANG_TRUE@ interface/extract_interface$(EXEEXT) \
@HAVE_CLANG_TRUE@ --language=cpp-checked-conversion \
@HAVE_CLANG_TRUE@ $(includes) $(srcdir)/all.h && \
@HAVE_CLANG_TRUE@ cat $(srcdir)/cpp/cpp-checked-conversion.h.bot) \
@HAVE_CLANG_TRUE@ > $@ || (rm $@ && false)
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@include/isl/cpp-checked-conversion.h: interface/extract_interface libdep.a \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ cpp/cpp-checked-conversion.h.top \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ cpp/cpp-checked-conversion.h.bot
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ (cat $(srcdir)/cpp/cpp-checked-conversion.h.top && \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ interface/extract_interface$(EXEEXT) \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ --language=cpp-checked-conversion \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ $(includes) $(srcdir)/all.h && \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ cat $(srcdir)/cpp/cpp-checked-conversion.h.bot) \
@HAVE_CLANG_TRUE@@HAVE_CXX11_TRUE@ > $@ || (rm $@ && false)
@HAVE_CLANG_TRUE@dist-hook: interface/isl.py
@HAVE_CLANG_TRUE@ cp interface/isl.py $(distdir)/interface/
@HAVE_CLANG_FALSE@dist-hook:
dist-hook:
echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID
(cd doc; make manual.pdf)
cp doc/manual.pdf $(distdir)/doc/

View File

@ -21,10 +21,10 @@ need to do
For more information, see doc/user.pod or the generated documentation.
New releases are announced on http://freecode.com/projects/isl
New releases are announced on http://groups.google.com/group/isl-announce
If you use isl, you can let me know by stacking
https://www.ohloh.net/p/isl on ohloh.
https://www.openhub.net/p/isl on Open Hub.
For bug reports, feature requests and questions,
contact http://groups.google.com/group/isl-development

View File

@ -1394,6 +1394,7 @@ m4_include([m4/ax_create_pkgconfig_info.m4])
m4_include([m4/ax_create_stdint_h.m4])
m4_include([m4/ax_cxx_compile_stdcxx.m4])
m4_include([m4/ax_cxx_compile_stdcxx_11.m4])
m4_include([m4/ax_cxx_compile_stdcxx_11_no_override.m4])
m4_include([m4/ax_detect_clang.m4])
m4_include([m4/ax_detect_git_head.m4])
m4_include([m4/ax_detect_gmp.m4])

View File

@ -1,3 +1,5 @@
#include <isl/id.h>
#include <isl/space.h>
#include <isl/val.h>
#include <isl/aff.h>
#include <isl/set.h>
@ -9,3 +11,4 @@
#include <isl/schedule.h>
#include <isl/schedule_node.h>
#include <isl/ast_build.h>
#include <isl/fixed_box.h>

View File

@ -319,16 +319,10 @@ __isl_give isl_mat *isl_basic_set_reduced_basis(__isl_keep isl_basic_set *bset)
struct isl_mat *basis;
struct isl_tab *tab;
if (!bset)
if (isl_basic_set_check_no_locals(bset) < 0 ||
isl_basic_set_check_no_params(bset) < 0)
return NULL;
if (isl_basic_set_dim(bset, isl_dim_div) != 0)
isl_die(bset->ctx, isl_error_invalid,
"no integer division allowed", return NULL);
if (isl_basic_set_dim(bset, isl_dim_param) != 0)
isl_die(bset->ctx, isl_error_invalid,
"no parameters allowed", return NULL);
tab = isl_tab_from_basic_set(bset, 0);
if (!tab)
return NULL;
@ -337,7 +331,9 @@ __isl_give isl_mat *isl_basic_set_reduced_basis(__isl_keep isl_basic_set *bset)
tab->basis = isl_mat_identity(bset->ctx, 1 + tab->n_var);
else {
isl_mat *eq;
unsigned nvar = isl_basic_set_total_dim(bset);
isl_size nvar = isl_basic_set_dim(bset, isl_dim_all);
if (nvar < 0)
goto error;
eq = isl_mat_sub_alloc6(bset->ctx, bset->eq, 0, bset->n_eq,
1, nvar);
eq = isl_mat_left_hermite(eq, 0, NULL, &tab->basis);
@ -354,4 +350,7 @@ __isl_give isl_mat *isl_basic_set_reduced_basis(__isl_keep isl_basic_set *bset)
isl_tab_free(tab);
return basis;
error:
isl_tab_free(tab);
return NULL;
}

View File

@ -25,12 +25,14 @@ ISL_ARG_DEF(bound_options, struct bound_options, bound_options_args)
static __isl_give isl_set *set_bounds(__isl_take isl_set *set)
{
unsigned nparam;
isl_size nparam;
int i, r;
isl_point *pt, *pt2;
isl_set *box;
nparam = isl_set_dim(set, isl_dim_param);
if (nparam < 0)
return isl_set_free(set);
r = nparam >= 8 ? 5 : nparam >= 5 ? 15 : 50;
pt = isl_set_sample_point(isl_set_copy(set));
@ -60,7 +62,7 @@ struct verify_point_bound {
static isl_stat verify_point(__isl_take isl_point *pnt, void *user)
{
int i;
unsigned nparam;
isl_size nparam;
struct verify_point_bound *vpb = (struct verify_point_bound *) user;
isl_val *v;
isl_ctx *ctx;
@ -91,6 +93,8 @@ static isl_stat verify_point(__isl_take isl_point *pnt, void *user)
pwf = isl_pw_qpolynomial_fold_copy(vpb->pwf);
nparam = isl_pw_qpolynomial_fold_dim(pwf, isl_dim_param);
if (nparam < 0)
pwf = isl_pw_qpolynomial_fold_free(pwf);
for (i = 0; i < nparam; ++i) {
v = isl_point_get_coordinate_val(pnt, isl_dim_param, i);
pwf = isl_pw_qpolynomial_fold_fix_val(pwf, isl_dim_param, i, v);
@ -239,7 +243,7 @@ int main(int argc, char **argv)
isl_stream *s;
struct isl_obj obj;
struct bound_options *options;
int exact;
isl_bool exact;
int r = 0;
options = bound_options_new_with_defaults();

View File

@ -10,6 +10,7 @@ struct isl_arg_choice cat_format[] = {
{"polylib", ISL_FORMAT_POLYLIB},
{"ext-polylib", ISL_FORMAT_EXT_POLYLIB},
{"latex", ISL_FORMAT_LATEX},
{"C", ISL_FORMAT_C},
{0}
};

View File

@ -0,0 +1,32 @@
#define xCAT(A,B) A ## B
#define CAT(A,B) xCAT(A,B)
#undef TYPE
#define TYPE CAT(isl_,BASE)
#define xFN(TYPE,NAME) TYPE ## _ ## NAME
#define FN(TYPE,NAME) xFN(TYPE,NAME)
/* Check that printing "obj" and parsing the output results
* in the same expression.
*/
static isl_stat FN(check_reparse,BASE)(isl_ctx *ctx,
__isl_take TYPE *obj)
{
char *str;
isl_bool equal;
TYPE *obj2;
str = FN(TYPE,to_str)(obj);
obj2 = FN(TYPE,read_from_str)(ctx, str);
free(str);
equal = FN(TYPE,plain_is_equal)(obj, obj2);
FN(TYPE,free)(obj);
FN(TYPE,free)(obj2);
if (equal < 0)
return isl_stat_error;
if (!equal)
isl_die(ctx, isl_error_unknown,
"parsed function not equal to original",
return isl_stat_error);
return isl_stat_ok;
}

View File

@ -0,0 +1,28 @@
#define xCAT(A,B) A ## B
#define CAT(A,B) xCAT(A,B)
#undef TYPE
#define TYPE CAT(isl_,BASE)
#define xFN(TYPE,NAME) TYPE ## _ ## NAME
#define FN(TYPE,NAME) xFN(TYPE,NAME)
#define TESTS CAT(reparse_,CAT(BASE,_tests))
/* Test parsing of objects of type TYPE by printing
* the expressions and checking that parsing the output results
* in the same expression.
* Do this for a set of expressions parsed from strings.
*/
static isl_stat FN(check,TESTS)(isl_ctx *ctx)
{
int i;
for (i = 0; i < ARRAY_SIZE(TESTS); ++i) {
TYPE *obj;
obj = FN(TYPE,read_from_str)(ctx, TESTS[i]);
if (FN(check_reparse,BASE)(ctx, obj) < 0)
return isl_stat_error;
}
return isl_stat_ok;
}

View File

@ -0,0 +1,20 @@
#define xFN(TYPE,NAME) TYPE ## _ ## NAME
#define FN(TYPE,NAME) xFN(TYPE,NAME)
/* Check that there are "n" dimensions of type "type" starting at "first"
* in "obj".
*/
isl_stat FN(TYPE,check_range)(__isl_keep TYPE *obj,
enum isl_dim_type type, unsigned first, unsigned n)
{
isl_size dim;
dim = FN(TYPE,dim)(obj, type);
if (dim < 0)
return isl_stat_error;
if (first + n > dim || first + n < first)
isl_die(FN(TYPE,get_ctx)(obj), isl_error_invalid,
"position or range out of bounds",
return isl_stat_error);
return isl_stat_ok;
}

View File

@ -8,7 +8,7 @@ int main(int argc, char **argv)
struct isl_map *map;
struct isl_options *options;
isl_printer *p;
int exact;
isl_bool exact;
options = isl_options_new_with_defaults();
assert(options);

View File

@ -142,12 +142,15 @@ static __isl_give isl_schedule_node *node_set_options(
__isl_take isl_schedule_node *node, void *user)
{
enum isl_ast_loop_type *type = user;
int i, n;
int i;
isl_size n;
if (isl_schedule_node_get_type(node) != isl_schedule_node_band)
return node;
n = isl_schedule_node_band_n_member(node);
if (n < 0)
return isl_schedule_node_free(node);
for (i = 0; i < n; ++i)
node = isl_schedule_node_band_member_set_ast_loop_type(node,
i, *type);

View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for isl 0.20.
# Generated by GNU Autoconf 2.69 for isl 0.22.1.
#
# Report bugs to <isl-development@googlegroups.com>.
#
@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='isl'
PACKAGE_TARNAME='isl'
PACKAGE_VERSION='0.20'
PACKAGE_STRING='isl 0.20'
PACKAGE_VERSION='0.22.1'
PACKAGE_STRING='isl 0.22.1'
PACKAGE_BUGREPORT='isl-development@googlegroups.com'
PACKAGE_URL=''
@ -635,6 +635,7 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
CONFIG_STATUS_DEPENDENCIES
GIT_HEAD_VERSION
GIT_HEAD
GIT_HEAD_ID
@ -646,8 +647,9 @@ HAVE_CPP_ISL_H_TRUE
HAVE_CLANG_FALSE
HAVE_CLANG_TRUE
LIB_CLANG_EDIT
llvm_config_found
LLVM_CONFIG
CLANG_LIBS
CLANG_RFLAG
CLANG_LDFLAGS
CLANG_CXXFLAGS
SMALL_INT_OPT_FALSE
@ -662,12 +664,15 @@ NEED_GET_MEMORY_FUNCTIONS_FALSE
NEED_GET_MEMORY_FUNCTIONS_TRUE
MP_LIBS
MP_LDFLAGS
MP_CFLAGS
MP_CPPFLAGS
GENERATE_DOC_FALSE
GENERATE_DOC_TRUE
OS_SRCDIR
POD2HTML
PDFLATEX
PERL
CYGPATH
HAVE_PYTHON_FALSE
HAVE_PYTHON_TRUE
pkgpyexecdir
@ -702,9 +707,8 @@ FGREP
EGREP
SED
LIBTOOL
GREP
HAVE_CXX11
CXX11FLAGS
GREP
PRTDIAG
host_os
host_vendor
@ -1393,7 +1397,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures isl 0.20 to adapt to many kinds of systems.
\`configure' configures isl 0.22.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1464,7 +1468,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of isl 0.20:";;
short | recursive ) echo "Configuration of isl 0.22.1:";;
esac
cat <<\_ACEOF
@ -1595,7 +1599,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
isl configure 0.20
isl configure 0.22.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -2490,7 +2494,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by isl $as_me 0.20, which was
It was created by isl $as_me 0.22.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -3354,7 +3358,7 @@ fi
# Define the identity of the package.
PACKAGE='isl'
VERSION='0.20'
VERSION='0.22.1'
cat >>confdefs.h <<_ACEOF
@ -3487,7 +3491,7 @@ fi
AM_BACKSLASH='\'
versioninfo=20:0:1
versioninfo=22:1:0
if test "x$prefix" != "xNONE"; then
prefix_wd=`cd $prefix && pwd`
@ -5940,14 +5944,402 @@ $as_echo "#define HAVE___ATTRIBUTE__ 1" >>confdefs.h
fi
# CXX11FLAGS contains the flags (if any) added by AX_CXX_COMPILE_STDCXX_11
# Original state of CXX and CXXCPP is preserved because CXX11FLAGS
# is only needed for compiling interface/isl_test_cpp
ac_save_CXX="$CXX"
ac_save_CXXCPP="$CXXCPP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$GREP"; then
ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo 'GREP' >> "conftest.nl"
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_GREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP="$ac_path_GREP"
ac_path_GREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false
$ac_path_GREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_GREP"; then
as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
$as_echo "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
echo $CXX | $GREP -e "-std=" > /dev/null 2> /dev/null
if test $? -eq 0; then
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
ac_success=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5
$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; }
if ${ax_cv_cxx_compile_cxx11+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
// If the compiler admits that it is not ready for C++11, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#else
namespace cxx11
{
namespace test_static_assert
{
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
}
namespace test_final_override
{
struct Base
{
virtual void f() {}
};
struct Derived : public Base
{
virtual void f() override {}
};
}
namespace test_double_right_angle_brackets
{
template < typename T >
struct check {};
typedef check<void> single_type;
typedef check<check<void>> double_type;
typedef check<check<check<void>>> triple_type;
typedef check<check<check<check<void>>>> quadruple_type;
}
namespace test_decltype
{
int
f()
{
int a = 1;
decltype(a) b = 2;
return a + b;
}
}
namespace test_type_deduction
{
template < typename T1, typename T2 >
struct is_same
{
static const bool value = false;
};
template < typename T >
struct is_same<T, T>
{
static const bool value = true;
};
template < typename T1, typename T2 >
auto
add(T1 a1, T2 a2) -> decltype(a1 + a2)
{
return a1 + a2;
}
int
test(const int c, volatile int v)
{
static_assert(is_same<int, decltype(0)>::value == true, "");
static_assert(is_same<int, decltype(c)>::value == false, "");
static_assert(is_same<int, decltype(v)>::value == false, "");
auto ac = c;
auto av = v;
auto sumi = ac + av + 'x';
auto sumf = ac + av + 1.0;
static_assert(is_same<int, decltype(ac)>::value == true, "");
static_assert(is_same<int, decltype(av)>::value == true, "");
static_assert(is_same<int, decltype(sumi)>::value == true, "");
static_assert(is_same<int, decltype(sumf)>::value == false, "");
static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
return (sumf > 0.0) ? sumi : add(c, v);
}
}
namespace test_noexcept
{
int f() { return 0; }
int g() noexcept { return 0; }
static_assert(noexcept(f()) == false, "");
static_assert(noexcept(g()) == true, "");
}
namespace test_constexpr
{
template < typename CharT >
unsigned long constexpr
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
{
return *s ? strlen_c_r(s + 1, acc + 1) : acc;
}
template < typename CharT >
unsigned long constexpr
strlen_c(const CharT *const s) noexcept
{
return strlen_c_r(s, 0UL);
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("1") == 1UL, "");
static_assert(strlen_c("example") == 7UL, "");
static_assert(strlen_c("another\0example") == 7UL, "");
}
namespace test_rvalue_references
{
template < int N >
struct answer
{
static constexpr int value = N;
};
answer<1> f(int&) { return answer<1>(); }
answer<2> f(const int&) { return answer<2>(); }
answer<3> f(int&&) { return answer<3>(); }
void
test()
{
int i = 0;
const int c = 0;
static_assert(decltype(f(i))::value == 1, "");
static_assert(decltype(f(c))::value == 2, "");
static_assert(decltype(f(0))::value == 3, "");
}
}
namespace test_uniform_initialization
{
struct test
{
static const int zero {};
static const int one {1};
};
static_assert(test::zero == 0, "");
static_assert(test::one == 1, "");
}
namespace test_lambdas
{
void
test1()
{
auto lambda1 = [](){};
auto lambda2 = lambda1;
lambda1();
lambda2();
}
int
test2()
{
auto a = [](int i, int j){ return i + j; }(1, 2);
auto b = []() -> int { return '0'; }();
auto c = [=](){ return a + b; }();
auto d = [&](){ return c; }();
auto e = [a, &b](int x) mutable {
const auto identity = [](int y){ return y; };
for (auto i = 0; i < a; ++i)
a += b--;
return x + identity(a + b);
}(0);
return a + b + c + d + e;
}
int
test3()
{
const auto nullary = [](){ return 0; };
const auto unary = [](int x){ return x; };
using nullary_t = decltype(nullary);
using unary_t = decltype(unary);
const auto higher1st = [](nullary_t f){ return f(); };
const auto higher2nd = [unary](nullary_t f1){
return [unary, f1](unary_t f2){ return f2(unary(f1())); };
};
return higher1st(nullary) + higher2nd(nullary)(unary);
}
}
namespace test_variadic_templates
{
template <int...>
struct sum;
template <int N0, int... N1toN>
struct sum<N0, N1toN...>
{
static constexpr auto value = N0 + sum<N1toN...>::value;
};
template <>
struct sum<>
{
static constexpr auto value = 0;
};
static_assert(sum<>::value == 0, "");
static_assert(sum<1>::value == 1, "");
static_assert(sum<23>::value == 23, "");
static_assert(sum<1, 2>::value == 3, "");
static_assert(sum<5, 5, 11>::value == 21, "");
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
}
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
// because of this.
namespace test_template_alias_sfinae
{
struct foo {};
template<typename T>
using member = typename T::member_type;
template<typename T>
void func(...) {}
template<typename T>
void func(member<T>*) {}
void test();
void test() { func<foo>(0); }
}
} // namespace cxx11
#endif // __cplusplus >= 201103L
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ax_cv_cxx_compile_cxx11=yes
else
ax_cv_cxx_compile_cxx11=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5
$as_echo "$ax_cv_cxx_compile_cxx11" >&6; }
if test x$ax_cv_cxx_compile_cxx11 = xyes; then
ac_success=yes
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test x$ac_success = xno; then
HAVE_CXX11=0
else
HAVE_CXX11=1
$as_echo "#define HAVE_CXX11 1" >>confdefs.h
fi
else
ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@ -6612,9 +7004,8 @@ $as_echo "#define HAVE_CXX11 1" >>confdefs.h
CXX11FLAGS=${CXX#$ac_save_CXX}
CXX="$ac_save_CXX"
CXXCPP="$ac_save_CXXCPP"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
@ -18297,6 +18688,43 @@ else
fi
# Extract the first word of "cygpath", so it can be a program name with args.
set dummy cygpath; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CYGPATH+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CYGPATH"; then
ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CYGPATH="cygpath"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CYGPATH=$ac_cv_prog_CYGPATH
if test -n "$CYGPATH"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5
$as_echo "$CYGPATH" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@ -18409,6 +18837,13 @@ fi
if test "$host_os" = "mingw32" -a -n "$CYGPATH"; then
OS_SRCDIR=`$CYGPATH -m "$srcdir"`
else
OS_SRCDIR="$srcdir"
fi
if test -n "$PERL" -a -n "$PDFLATEX" -a -n "$POD2HTML"; then
GENERATE_DOC_TRUE=
GENERATE_DOC_FALSE='#'
@ -18899,6 +19334,7 @@ esac
case "$with_int" in
gmp)
@ -19168,7 +19604,7 @@ fi
;;
esac
if test "x$with_int" = "ximath-32" -a "x$GCC" = "xyes"; then
MP_CPPFLAGS="-std=gnu99 $MP_CPPFLAGS"
MP_CFLAGS="-std=gnu99 $MP_CFLAGS"
fi
if test x$with_int = ximath -o x$with_int = ximath-32; then
@ -19424,6 +19860,7 @@ system)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
@ -19556,25 +19993,29 @@ $as_echo "$ac_cv_path_SED" >&6; }
SED="$ac_cv_path_SED"
rm -f conftest.sed
llvm_config="llvm-config"
# Extract the first word of ""$llvm_config"", so it can be a program name with args.
set dummy "$llvm_config"; ac_word=$2
if test "x$with_clang_prefix" != "x"; then
LLVM_CONFIG="$with_clang_prefix/bin/llvm-config"
fi
# Extract the first word of ""llvm-config"", so it can be a program name with args.
set dummy "llvm-config"; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_llvm_config_found+:} false; then :
if ${ac_cv_path_LLVM_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$llvm_config_found"; then
ac_cv_prog_llvm_config_found="$llvm_config_found" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
case $LLVM_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_LLVM_CONFIG="$LLVM_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_llvm_config_found="yes"
ac_cv_path_LLVM_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@ -19582,42 +20023,40 @@ done
done
IFS=$as_save_IFS
;;
esac
fi
fi
llvm_config_found=$ac_cv_prog_llvm_config_found
if test -n "$llvm_config_found"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $llvm_config_found" >&5
$as_echo "$llvm_config_found" >&6; }
LLVM_CONFIG=$ac_cv_path_LLVM_CONFIG
if test -n "$LLVM_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5
$as_echo "$LLVM_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$with_clang_prefix" != "x"; then
llvm_config="$with_clang_prefix/bin/llvm-config"
if test -x "$llvm_config"; then
llvm_config_found=yes
fi
fi
if test "$llvm_config_found" != yes; then
if test -z "$LLVM_CONFIG" || test ! -x "$LLVM_CONFIG"; then
as_fn_error $? "llvm-config not found" "$LINENO" 5
fi
CLANG_CXXFLAGS=`$llvm_config --cxxflags | \
CLANG_CXXFLAGS=`$LLVM_CONFIG --cxxflags | \
$SED -e 's/-Wcovered-switch-default//;s/-gsplit-dwarf//'`
CLANG_LDFLAGS=`$llvm_config --ldflags`
targets=`$llvm_config --targets-built`
CLANG_LDFLAGS=`$LLVM_CONFIG --ldflags`
# Construct a -R argument for libtool.
# This is needed in case some of the clang libraries are shared libraries.
CLANG_RFLAG=`echo "$CLANG_LDFLAGS" | $SED -e 's/-L/-R/g'`
targets=`$LLVM_CONFIG --targets-built`
components="$targets asmparser bitreader support mc"
$llvm_config --components | $GREP option > /dev/null 2> /dev/null
$LLVM_CONFIG --components | $GREP option > /dev/null 2> /dev/null
if test $? -eq 0; then
components="$components option"
fi
CLANG_LIBS=`$llvm_config --libs $components`
systemlibs=`$llvm_config --system-libs 2> /dev/null | tail -1`
CLANG_LIBS=`$LLVM_CONFIG --libs $components`
systemlibs=`$LLVM_CONFIG --system-libs 2> /dev/null | tail -1`
if test $? -eq 0; then
CLANG_LIBS="$CLANG_LIBS $systemlibs"
fi
CLANG_PREFIX=`$llvm_config --prefix`
CLANG_PREFIX=`$LLVM_CONFIG --prefix`
cat >>confdefs.h <<_ACEOF
#define CLANG_PREFIX "$CLANG_PREFIX"
@ -19711,6 +20150,21 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$as_echo "#define USE_ARRAYREF /**/" >>confdefs.h
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <clang/Frontend/CompilerInvocation.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "ArrayRef.*CommandLineArgs" >/dev/null 2>&1; then :
$as_echo "#define CREATE_FROM_ARGS_TAKES_ARRAYREF /**/" >>confdefs.h
fi
rm -f conftest*
fi
rm -f conftest*
@ -19987,8 +20441,19 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "IK_C" >/dev/null 2>&1; then :
else
ac_fn_cxx_check_header_mongrel "$LINENO" "clang/Basic/LangStandard.h" "ac_cv_header_clang_Basic_LangStandard_h" "$ac_includes_default"
if test "x$ac_cv_header_clang_Basic_LangStandard_h" = xyes; then :
IK_C=Language::C
else
IK_C=InputKind::C
fi
cat >>confdefs.h <<_ACEOF
#define IK_C $IK_C
_ACEOF
$as_echo "#define IK_C InputKind::C" >>confdefs.h
fi
rm -f conftest*
@ -20047,6 +20512,14 @@ $as_echo "#define SETINVOCATION_TAKES_SHARED_PTR /**/" >>confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_fn_cxx_check_header_mongrel "$LINENO" "llvm/Option/Arg.h" "ac_cv_header_llvm_Option_Arg_h" "$ac_includes_default"
if test "x$ac_cv_header_llvm_Option_Arg_h" = xyes; then :
$as_echo "#define HAVE_LLVM_OPTION_ARG_H /**/" >>confdefs.h
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@ -20104,7 +20577,8 @@ else
HAVE_CLANG_FALSE=
fi
if test $with_clang = system -o -f $srcdir/include/isl/cpp.h; then
if (test $with_clang = system -a "x$HAVE_CXX11" = "x1") || \
test -f $srcdir/include/isl/cpp.h; then
HAVE_CPP_ISL_H_TRUE=
HAVE_CPP_ISL_H_FALSE='#'
else
@ -20379,6 +20853,8 @@ ac_config_commands="$ac_config_commands $ax_create_pkgconfig_generate"
fi
CONFIG_STATUS_DEPENDENCIES=$LLVM_CONFIG
ac_config_headers="$ac_config_headers isl_config.h"
@ -20977,7 +21453,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by isl $as_me 0.20, which was
This file was extended by isl $as_me 0.22.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -21043,7 +21519,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
isl config.status 0.20
isl config.status 0.22.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -1,10 +1,10 @@
AC_INIT([isl], [0.20], [isl-development@googlegroups.com])
AC_INIT([isl], [0.22.1], [isl-development@googlegroups.com])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_SUBST(versioninfo)
versioninfo=20:0:1
versioninfo=22:1:0
if test "x$prefix" != "xNONE"; then
prefix_wd=`cd $prefix && pwd`
@ -25,16 +25,7 @@ AX_CC_MAXOPT
AX_GCC_WARN_UNUSED_RESULT
AX_C___ATTRIBUTE__
# CXX11FLAGS contains the flags (if any) added by AX_CXX_COMPILE_STDCXX_11
# Original state of CXX and CXXCPP is preserved because CXX11FLAGS
# is only needed for compiling interface/isl_test_cpp
AC_SUBST(CXX11FLAGS)
ac_save_CXX="$CXX"
ac_save_CXXCPP="$CXXCPP"
AX_CXX_COMPILE_STDCXX_11([noext], [optional])
CXX11FLAGS=${CXX#$ac_save_CXX}
CXX="$ac_save_CXX"
CXXCPP="$ac_save_CXXCPP"
AX_CXX_COMPILE_STDCXX_11_NO_OVERRIDE
AC_PROG_GREP
AC_PROG_LIBTOOL
@ -42,10 +33,18 @@ AC_PROG_SED
AM_PATH_PYTHON([2.5], [], [:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
AC_CHECK_PROG(CYGPATH, cygpath, cygpath, [])
AC_CHECK_PROG(PERL, perl, perl, [])
AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex, [])
AC_CHECK_PROG(POD2HTML, pod2html, pod2html, [])
AC_SUBST(OS_SRCDIR)
if test "$host_os" = "mingw32" -a -n "$CYGPATH"; then
OS_SRCDIR=`$CYGPATH -m "$srcdir"`
else
OS_SRCDIR="$srcdir"
fi
AM_CONDITIONAL(GENERATE_DOC, test -n "$PERL" -a -n "$PDFLATEX" -a -n "$POD2HTML")
AX_CREATE_STDINT_H(include/isl/stdint.h)
@ -64,6 +63,7 @@ gmp|imath|imath-32)
esac
AC_SUBST(MP_CPPFLAGS)
AC_SUBST(MP_CFLAGS)
AC_SUBST(MP_LDFLAGS)
AC_SUBST(MP_LIBS)
case "$with_int" in
@ -75,7 +75,7 @@ imath|imath-32)
;;
esac
if test "x$with_int" = "ximath-32" -a "x$GCC" = "xyes"; then
MP_CPPFLAGS="-std=gnu99 $MP_CPPFLAGS"
MP_CFLAGS="-std=gnu99 $MP_CFLAGS"
fi
AM_CONDITIONAL(IMATH_FOR_MP, test x$with_int = ximath -o x$with_int = ximath-32)
@ -119,7 +119,8 @@ system)
esac
AM_CONDITIONAL(HAVE_CLANG, test $with_clang = system)
AM_CONDITIONAL(HAVE_CPP_ISL_H,
[test $with_clang = system -o -f $srcdir/include/isl/cpp.h])
[(test $with_clang = system -a "x$HAVE_CXX11" = "x1") || \
test -f $srcdir/include/isl/cpp.h])
AX_SET_WARNING_FLAGS
@ -132,6 +133,7 @@ AX_CREATE_PKGCONFIG_INFO
AX_DETECT_GIT_HEAD
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], [$LLVM_CONFIG])
AH_BOTTOM([#include <isl_config_post.h>])
AC_CONFIG_HEADERS(isl_config.h)
AC_CONFIG_FILES(isl_srcdir.c)

View File

@ -3,7 +3,10 @@
#include <stdlib.h>
#include <functional>
#include <memory>
#include <ostream>
#include <string>
#include <type_traits>
namespace isl {
namespace checked {
@ -21,37 +24,60 @@ namespace checked {
abort(); \
} while (0)
/* Class used to check that isl::checked::boolean,
* isl::checked::stat and isl::checked::size values are checked for errors.
*/
struct checker {
bool checked = false;
~checker() {
ISLPP_ASSERT(checked, "IMPLEMENTATION ERROR: Unchecked state");
}
};
class boolean {
private:
mutable bool checked = false;
mutable std::shared_ptr<checker> check = std::make_shared<checker>();
isl_bool val;
friend boolean manage(isl_bool val);
boolean(isl_bool val): val(val) {}
public:
static boolean error() {
return boolean(isl_bool_error);
}
boolean()
: val(isl_bool_error) {}
~boolean() {
ISLPP_ASSERT(checked, "IMPLEMENTATION ERROR: Unchecked state");
}
/* implicit */ boolean(bool val)
: val(val ? isl_bool_true : isl_bool_false) {}
bool is_error() const { checked = true; return val == isl_bool_error; }
bool is_false() const { checked = true; return val == isl_bool_false; }
bool is_true() const { checked = true; return val == isl_bool_true; }
isl_bool release() {
auto tmp = val;
val = isl_bool_error;
check->checked = true;
return tmp;
}
bool is_error() const { check->checked = true; return val == isl_bool_error; }
bool is_false() const { check->checked = true; return val == isl_bool_false; }
bool is_true() const { check->checked = true; return val == isl_bool_true; }
explicit operator bool() const {
ISLPP_ASSERT(checked, "IMPLEMENTATION ERROR: Unchecked error state");
ISLPP_ASSERT(check->checked, "IMPLEMENTATION ERROR: Unchecked error state");
ISLPP_ASSERT(!is_error(), "IMPLEMENTATION ERROR: Unhandled error state");
return is_true();
}
boolean negate() {
if (val == isl_bool_true)
val = isl_bool_false;
else if (val == isl_bool_false)
val = isl_bool_true;
return *this;
}
boolean operator!() const {
if (is_error())
return *this;
return !is_true();
return boolean(*this).negate();
}
};
@ -78,11 +104,11 @@ public:
*/
class stat {
private:
mutable bool checked = false;
mutable std::shared_ptr<checker> check = std::make_shared<checker>();
isl_stat val;
friend stat manage(isl_stat val);
constexpr stat(isl_stat val) : val(val) {}
stat(isl_stat val) : val(val) {}
public:
static stat ok() {
return stat(isl_stat_ok);
@ -91,21 +117,18 @@ public:
return stat(isl_stat_error);
}
stat() : val(isl_stat_error) {}
~stat() {
ISLPP_ASSERT(checked, "IMPLEMENTATION ERROR: Unchecked state");
}
isl_stat release() {
checked = true;
check->checked = true;
return val;
}
bool is_error() const {
checked = true;
check->checked = true;
return val == isl_stat_error;
}
bool is_ok() const {
checked = true;
check->checked = true;
return val == isl_stat_ok;
}
};
@ -115,5 +138,43 @@ inline stat manage(isl_stat val)
return stat(val);
}
/* Class encapsulating an isl_size value.
*/
class size {
private:
mutable std::shared_ptr<checker> check = std::make_shared<checker>();
isl_size val;
friend size manage(isl_size val);
size(isl_size val) : val(val) {}
public:
size() : val(isl_size_error) {}
isl_size release() {
auto tmp = val;
val = isl_size_error;
check->checked = true;
return tmp;
}
bool is_error() const {
check->checked = true;
return val == isl_size_error;
}
explicit operator unsigned() const {
ISLPP_ASSERT(check->checked,
"IMPLEMENTATION ERROR: Unchecked error state");
ISLPP_ASSERT(!is_error(),
"IMPLEMENTATION ERROR: Unhandled error state");
return val;
}
};
inline size manage(isl_size val)
{
return size(val);
}
}
} // namespace isl

View File

@ -4,16 +4,19 @@
#include <functional>
#include <memory>
#include <ostream>
#include <stdexcept>
#include <string>
#include <type_traits>
/* ISL_USE_EXCEPTIONS should be defined to 1 if exceptions are available.
* gcc and clang define __cpp_exceptions; MSVC and xlC define _CPPUNWIND.
* Older versions of gcc (e.g., 4.9) only define __EXCEPTIONS.
* If exceptions are not available, any error condition will result
* in an abort.
*/
#ifndef ISL_USE_EXCEPTIONS
#if defined(__cpp_exceptions) || defined(_CPPUNWIND)
#if defined(__cpp_exceptions) || defined(_CPPUNWIND) || defined(__EXCEPTIONS)
#define ISL_USE_EXCEPTIONS 1
#else
#define ISL_USE_EXCEPTIONS 0
@ -80,10 +83,10 @@ public:
* will be included in the exception thrown from inside the bindings.
*/
static constexpr auto on_error = ISL_ON_ERROR_CONTINUE;
/* Wrapper for throwing an exception on NULL input.
/* Wrapper for throwing an exception with the given message.
*/
static void throw_NULL_input(const char *file, int line) {
throw_error(isl_error_invalid, "NULL input", file, line);
static void throw_invalid(const char *msg, const char *file, int line) {
throw_error(isl_error_invalid, msg, file, line);
}
static inline void throw_last_error(ctx ctx);
};
@ -204,11 +207,11 @@ public:
* In the case exceptions are not available, isl should abort.
*/
static constexpr auto on_error = ISL_ON_ERROR_ABORT;
/* Wrapper for throwing an exception on NULL input.
/* Wrapper for throwing an exception with the given message.
* In the case exceptions are not available, print an error and abort.
*/
static void throw_NULL_input(const char *file, int line) {
fprintf(stderr, "%s:%d: NULL input\n", file, line);
static void throw_invalid(const char *msg, const char *file, int line) {
fprintf(stderr, "%s:%d: %s\n", file, line, msg);
abort();
}
/* Throw an exception corresponding to the last

View File

@ -97,6 +97,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11_no_override.m4 \
$(top_srcdir)/m4/ax_detect_clang.m4 \
$(top_srcdir)/m4/ax_detect_git_head.m4 \
$(top_srcdir)/m4/ax_detect_gmp.m4 \
@ -152,13 +153,15 @@ CFLAGS = @CFLAGS@
CLANG_CXXFLAGS = @CLANG_CXXFLAGS@
CLANG_LDFLAGS = @CLANG_LDFLAGS@
CLANG_LIBS = @CLANG_LIBS@
CLANG_RFLAG = @CLANG_RFLAG@
CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXX11FLAGS = @CXX11FLAGS@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH = @CYGPATH@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
@ -188,12 +191,14 @@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_CLANG_EDIT = @LIB_CLANG_EDIT@
LIPO = @LIPO@
LLVM_CONFIG = @LLVM_CONFIG@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MP_CFLAGS = @MP_CFLAGS@
MP_CPPFLAGS = @MP_CPPFLAGS@
MP_LDFLAGS = @MP_LDFLAGS@
MP_LIBS = @MP_LIBS@
@ -201,6 +206,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_SRCDIR = @OS_SRCDIR@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
@ -263,7 +269,6 @@ infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
llvm_config_found = @llvm_config_found@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
#define xFN(TYPE,NAME) TYPE ## _ ## NAME
#define FN(TYPE,NAME) xFN(TYPE,NAME)
/* Does "obj" have a single reference?
* That is, can "obj" be changed inplace?
*/
isl_bool FN(TYPE,has_single_reference)(__isl_keep TYPE *obj)
{
if (!obj)
return isl_bool_error;
return obj->ref == 1;
}

View File

@ -4,6 +4,7 @@
#include <isl/stdint.h>
#include <isl/local_space.h>
#include <isl/printer.h>
#include <isl/id_type.h>
#include <isl/set_type.h>
#include <isl/aff_type.h>
#include <isl/list.h>
@ -17,6 +18,8 @@ extern "C" {
#endif
__isl_give isl_aff *isl_aff_zero_on_domain(__isl_take isl_local_space *ls);
__isl_give isl_aff *isl_aff_val_on_domain_space(__isl_take isl_space *space,
__isl_take isl_val *val);
__isl_give isl_aff *isl_aff_val_on_domain(__isl_take isl_local_space *ls,
__isl_take isl_val *val);
__isl_give isl_aff *isl_aff_var_on_domain(__isl_take isl_local_space *ls,
@ -31,7 +34,9 @@ __isl_null isl_aff *isl_aff_free(__isl_take isl_aff *aff);
isl_ctx *isl_aff_get_ctx(__isl_keep isl_aff *aff);
uint32_t isl_aff_get_hash(__isl_keep isl_aff *aff);
int isl_aff_dim(__isl_keep isl_aff *aff, enum isl_dim_type type);
isl_bool isl_aff_involves_locals(__isl_keep isl_aff *aff);
isl_size isl_aff_dim(__isl_keep isl_aff *aff, enum isl_dim_type type);
isl_bool isl_aff_involves_dims(__isl_keep isl_aff *aff,
enum isl_dim_type type, unsigned first, unsigned n);
@ -57,6 +62,7 @@ __isl_give isl_aff *isl_aff_set_coefficient_si(__isl_take isl_aff *aff,
__isl_give isl_aff *isl_aff_set_coefficient_val(__isl_take isl_aff *aff,
enum isl_dim_type type, int pos, __isl_take isl_val *v);
__isl_give isl_aff *isl_aff_add_constant_si(__isl_take isl_aff *aff, int v);
__isl_overload
__isl_give isl_aff *isl_aff_add_constant_val(__isl_take isl_aff *aff,
__isl_take isl_val *v);
__isl_give isl_aff *isl_aff_add_constant_num_si(__isl_take isl_aff *aff, int v);
@ -127,15 +133,20 @@ __isl_give isl_aff *isl_aff_move_dims(__isl_take isl_aff *aff,
__isl_give isl_aff *isl_aff_drop_dims(__isl_take isl_aff *aff,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_give isl_aff *isl_aff_project_domain_on_params(__isl_take isl_aff *aff);
__isl_export
__isl_give isl_aff *isl_aff_unbind_params_insert_domain(
__isl_take isl_aff *aff, __isl_take isl_multi_id *domain);
__isl_give isl_aff *isl_aff_align_params(__isl_take isl_aff *aff,
__isl_take isl_space *model);
__isl_export
__isl_give isl_aff *isl_aff_gist(__isl_take isl_aff *aff,
__isl_take isl_set *context);
__isl_give isl_aff *isl_aff_gist_params(__isl_take isl_aff *aff,
__isl_take isl_set *context);
__isl_export
__isl_give isl_val *isl_aff_eval(__isl_take isl_aff *aff,
__isl_take isl_point *pnt);
@ -177,6 +188,10 @@ __isl_export
__isl_give isl_set *isl_aff_gt_set(__isl_take isl_aff *aff1,
__isl_take isl_aff *aff2);
__isl_overload
__isl_give isl_basic_set *isl_aff_bind_id(__isl_take isl_aff *aff,
__isl_take isl_id *id);
__isl_constructor
__isl_give isl_aff *isl_aff_read_from_str(isl_ctx *ctx, const char *str);
__isl_give char *isl_aff_to_str(__isl_keep isl_aff *aff);
@ -191,7 +206,7 @@ __isl_give isl_space *isl_pw_aff_get_space(__isl_keep isl_pw_aff *pwaff);
__isl_constructor
__isl_give isl_pw_aff *isl_pw_aff_from_aff(__isl_take isl_aff *aff);
__isl_give isl_pw_aff *isl_pw_aff_empty(__isl_take isl_space *dim);
__isl_give isl_pw_aff *isl_pw_aff_empty(__isl_take isl_space *space);
__isl_give isl_pw_aff *isl_pw_aff_alloc(__isl_take isl_set *set,
__isl_take isl_aff *aff);
__isl_give isl_pw_aff *isl_pw_aff_zero_on_domain(
@ -201,7 +216,11 @@ __isl_give isl_pw_aff *isl_pw_aff_var_on_domain(__isl_take isl_local_space *ls,
__isl_give isl_pw_aff *isl_pw_aff_nan_on_domain(__isl_take isl_local_space *ls);
__isl_give isl_pw_aff *isl_pw_aff_val_on_domain(__isl_take isl_set *domain,
__isl_take isl_val *v);
__isl_overload
__isl_give isl_pw_aff *isl_pw_aff_param_on_domain_id(
__isl_take isl_set *domain, __isl_take isl_id *id);
__isl_export
__isl_give isl_pw_aff *isl_set_indicator_function(__isl_take isl_set *set);
const char *isl_pw_aff_get_dim_name(__isl_keep isl_pw_aff *pa,
@ -236,7 +255,9 @@ __isl_give isl_pw_aff *isl_pw_aff_union_add(__isl_take isl_pw_aff *pwaff1,
__isl_give isl_pw_aff *isl_pw_aff_copy(__isl_keep isl_pw_aff *pwaff);
__isl_null isl_pw_aff *isl_pw_aff_free(__isl_take isl_pw_aff *pwaff);
unsigned isl_pw_aff_dim(__isl_keep isl_pw_aff *pwaff, enum isl_dim_type type);
isl_size isl_pw_aff_dim(__isl_keep isl_pw_aff *pwaff, enum isl_dim_type type);
isl_bool isl_pw_aff_involves_param_id(__isl_keep isl_pw_aff *pa,
__isl_keep isl_id *id);
isl_bool isl_pw_aff_involves_dims(__isl_keep isl_pw_aff *pwaff,
enum isl_dim_type type, unsigned first, unsigned n);
@ -261,6 +282,7 @@ __isl_give isl_pw_aff *isl_pw_aff_reset_tuple_id(__isl_take isl_pw_aff *pa,
__isl_give isl_pw_aff *isl_pw_aff_reset_user(__isl_take isl_pw_aff *pa);
__isl_give isl_set *isl_pw_aff_params(__isl_take isl_pw_aff *pwa);
__isl_export
__isl_give isl_set *isl_pw_aff_domain(__isl_take isl_pw_aff *pwaff);
__isl_give isl_pw_aff *isl_pw_aff_from_range(__isl_take isl_pw_aff *pwa);
@ -298,10 +320,17 @@ __isl_export
__isl_give isl_pw_aff *isl_pw_aff_tdiv_r(__isl_take isl_pw_aff *pa1,
__isl_take isl_pw_aff *pa2);
__isl_export
__isl_give isl_pw_aff *isl_pw_aff_intersect_params(__isl_take isl_pw_aff *pa,
__isl_take isl_set *set);
__isl_export
__isl_give isl_pw_aff *isl_pw_aff_intersect_domain(__isl_take isl_pw_aff *pa,
__isl_take isl_set *set);
__isl_give isl_pw_aff *isl_pw_aff_intersect_domain_wrapped_domain(
__isl_take isl_pw_aff *pa, __isl_take isl_set *set);
__isl_give isl_pw_aff *isl_pw_aff_intersect_domain_wrapped_range(
__isl_take isl_pw_aff *pa, __isl_take isl_set *set);
__isl_export
__isl_give isl_pw_aff *isl_pw_aff_subtract_domain(__isl_take isl_pw_aff *pa,
__isl_take isl_set *set);
@ -310,6 +339,9 @@ __isl_give isl_pw_aff *isl_pw_aff_cond(__isl_take isl_pw_aff *cond,
__isl_take isl_pw_aff *pwaff_true, __isl_take isl_pw_aff *pwaff_false);
__isl_overload
__isl_give isl_pw_aff *isl_pw_aff_add_constant_val(__isl_take isl_pw_aff *pa,
__isl_take isl_val *v);
__isl_overload
__isl_give isl_pw_aff *isl_pw_aff_scale_val(__isl_take isl_pw_aff *pa,
__isl_take isl_val *v);
__isl_overload
@ -326,12 +358,15 @@ __isl_give isl_pw_aff *isl_pw_aff_move_dims(__isl_take isl_pw_aff *pa,
__isl_give isl_pw_aff *isl_pw_aff_drop_dims(__isl_take isl_pw_aff *pwaff,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_give isl_pw_aff *isl_pw_aff_coalesce(__isl_take isl_pw_aff *pwqp);
__isl_export
__isl_give isl_pw_aff *isl_pw_aff_coalesce(__isl_take isl_pw_aff *pa);
__isl_export
__isl_give isl_pw_aff *isl_pw_aff_gist(__isl_take isl_pw_aff *pwaff,
__isl_take isl_set *context);
__isl_give isl_pw_aff *isl_pw_aff_gist_params(__isl_take isl_pw_aff *pwaff,
__isl_take isl_set *context);
__isl_export
__isl_give isl_val *isl_pw_aff_eval(__isl_take isl_pw_aff *pa,
__isl_take isl_point *pnt);
@ -345,10 +380,14 @@ __isl_overload
__isl_give isl_pw_aff *isl_pw_aff_pullback_multi_pw_aff(
__isl_take isl_pw_aff *pa, __isl_take isl_multi_pw_aff *mpa);
int isl_pw_aff_n_piece(__isl_keep isl_pw_aff *pwaff);
isl_size isl_pw_aff_n_piece(__isl_keep isl_pw_aff *pwaff);
isl_stat isl_pw_aff_foreach_piece(__isl_keep isl_pw_aff *pwaff,
isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_aff *aff,
void *user), void *user);
__isl_export
isl_bool isl_pw_aff_isa_aff(__isl_keep isl_pw_aff *pa);
__isl_export
__isl_give isl_aff *isl_pw_aff_as_aff(__isl_take isl_pw_aff *pa);
__isl_give isl_set *isl_set_from_pw_aff(__isl_take isl_pw_aff *pwaff);
__isl_give isl_map *isl_map_from_pw_aff(__isl_take isl_pw_aff *pwaff);
@ -379,11 +418,25 @@ __isl_give isl_set *isl_pw_aff_gt_set(__isl_take isl_pw_aff *pwaff1,
__isl_give isl_map *isl_pw_aff_eq_map(__isl_take isl_pw_aff *pa1,
__isl_take isl_pw_aff *pa2);
__isl_give isl_map *isl_pw_aff_le_map(__isl_take isl_pw_aff *pa1,
__isl_take isl_pw_aff *pa2);
__isl_give isl_map *isl_pw_aff_lt_map(__isl_take isl_pw_aff *pa1,
__isl_take isl_pw_aff *pa2);
__isl_give isl_map *isl_pw_aff_ge_map(__isl_take isl_pw_aff *pa1,
__isl_take isl_pw_aff *pa2);
__isl_give isl_map *isl_pw_aff_gt_map(__isl_take isl_pw_aff *pa1,
__isl_take isl_pw_aff *pa2);
__isl_export
__isl_give isl_pw_aff *isl_pw_aff_bind_domain(__isl_take isl_pw_aff *pa,
__isl_take isl_multi_id *tuple);
__isl_export
__isl_give isl_pw_aff *isl_pw_aff_bind_domain_wrapped_domain(
__isl_take isl_pw_aff *pa, __isl_take isl_multi_id *tuple);
__isl_overload
__isl_give isl_set *isl_pw_aff_bind_id(__isl_take isl_pw_aff *pa,
__isl_take isl_id *id);
__isl_constructor
__isl_give isl_pw_aff *isl_pw_aff_read_from_str(isl_ctx *ctx, const char *str);
__isl_give char *isl_pw_aff_to_str(__isl_keep isl_pw_aff *pa);
@ -408,15 +461,24 @@ __isl_give isl_set *isl_pw_aff_list_gt_set(__isl_take isl_pw_aff_list *list1,
__isl_take isl_pw_aff_list *list2);
ISL_DECLARE_MULTI(aff)
ISL_DECLARE_MULTI_IDENTITY(aff)
ISL_DECLARE_MULTI_CMP(aff)
ISL_DECLARE_MULTI_NEG(aff)
ISL_DECLARE_MULTI_ARITH(aff)
ISL_DECLARE_MULTI_ADD_CONSTANT(aff)
ISL_DECLARE_MULTI_ZERO(aff)
ISL_DECLARE_MULTI_NAN(aff)
ISL_DECLARE_MULTI_DIMS(aff)
ISL_DECLARE_MULTI_LOCALS(aff)
ISL_DECLARE_MULTI_DIM_ID(aff)
ISL_DECLARE_MULTI_TUPLE_ID(aff)
ISL_DECLARE_MULTI_WITH_DOMAIN(aff)
ISL_DECLARE_MULTI_BIND_DOMAIN(aff)
__isl_constructor
__isl_give isl_multi_aff *isl_multi_aff_from_aff(__isl_take isl_aff *aff);
__isl_give isl_multi_aff *isl_multi_aff_identity(__isl_take isl_space *space);
__isl_export
__isl_give isl_multi_aff *isl_multi_aff_domain_map(__isl_take isl_space *space);
__isl_export
__isl_give isl_multi_aff *isl_multi_aff_range_map(__isl_take isl_space *space);
__isl_give isl_multi_aff *isl_multi_aff_project_out_map(
__isl_take isl_space *space, enum isl_dim_type type,
@ -425,10 +487,16 @@ __isl_give isl_multi_aff *isl_multi_aff_project_out_map(
__isl_give isl_multi_aff *isl_multi_aff_multi_val_on_space(
__isl_take isl_space *space, __isl_take isl_multi_val *mv);
__isl_export
__isl_give isl_multi_val *isl_multi_aff_get_constant_multi_val(
__isl_keep isl_multi_aff *ma);
__isl_export
__isl_give isl_multi_aff *isl_multi_aff_floor(__isl_take isl_multi_aff *ma);
__isl_give isl_multi_aff *isl_multi_aff_gist_params(
__isl_take isl_multi_aff *maff, __isl_take isl_set *context);
__isl_export
__isl_give isl_multi_aff *isl_multi_aff_gist(__isl_take isl_multi_aff *maff,
__isl_take isl_set *context);
@ -452,6 +520,10 @@ __isl_give isl_set *isl_multi_aff_lex_gt_set(__isl_take isl_multi_aff *ma1,
__isl_give isl_set *isl_multi_aff_lex_ge_set(__isl_take isl_multi_aff *ma1,
__isl_take isl_multi_aff *ma2);
__isl_export
__isl_give isl_basic_set *isl_multi_aff_bind(__isl_take isl_multi_aff *ma,
__isl_take isl_multi_id *tuple);
__isl_give char *isl_multi_aff_to_str(__isl_keep isl_multi_aff *ma);
__isl_give isl_printer *isl_printer_print_multi_aff(__isl_take isl_printer *p,
__isl_keep isl_multi_aff *maff);
@ -462,10 +534,19 @@ __isl_give isl_multi_aff *isl_multi_aff_read_from_str(isl_ctx *ctx,
void isl_multi_aff_dump(__isl_keep isl_multi_aff *maff);
ISL_DECLARE_MULTI(pw_aff)
ISL_DECLARE_MULTI_NEG(pw_aff)
ISL_DECLARE_MULTI_IDENTITY(pw_aff)
ISL_DECLARE_MULTI_ARITH(pw_aff)
ISL_DECLARE_MULTI_ADD_CONSTANT(pw_aff)
ISL_DECLARE_MULTI_ZERO(pw_aff)
ISL_DECLARE_MULTI_NAN(pw_aff)
ISL_DECLARE_MULTI_DIMS(pw_aff)
ISL_DECLARE_MULTI_DIM_ID(pw_aff)
ISL_DECLARE_MULTI_TUPLE_ID(pw_aff)
ISL_DECLARE_MULTI_WITH_DOMAIN(pw_aff)
ISL_DECLARE_MULTI_BIND_DOMAIN(pw_aff)
ISL_DECLARE_MULTI_PARAM(pw_aff)
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_zero(__isl_take isl_space *space);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_identity(
__isl_take isl_space *space);
@ -487,8 +568,10 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_copy(
__isl_null isl_pw_multi_aff *isl_pw_multi_aff_free(
__isl_take isl_pw_multi_aff *pma);
unsigned isl_pw_multi_aff_dim(__isl_keep isl_pw_multi_aff *pma,
isl_size isl_pw_multi_aff_dim(__isl_keep isl_pw_multi_aff *pma,
enum isl_dim_type type);
isl_bool isl_pw_multi_aff_involves_param_id(__isl_keep isl_pw_multi_aff *pma,
__isl_keep isl_id *id);
isl_bool isl_pw_multi_aff_involves_dims(__isl_keep isl_pw_multi_aff *pma,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_give isl_pw_aff *isl_pw_multi_aff_get_pw_aff(
@ -500,6 +583,7 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_pw_aff(
isl_ctx *isl_pw_multi_aff_get_ctx(__isl_keep isl_pw_multi_aff *pma);
__isl_give isl_space *isl_pw_multi_aff_get_domain_space(
__isl_keep isl_pw_multi_aff *pma);
__isl_export
__isl_give isl_space *isl_pw_multi_aff_get_space(
__isl_keep isl_pw_multi_aff *pma);
isl_bool isl_pw_multi_aff_has_tuple_name(__isl_keep isl_pw_multi_aff *pma,
@ -525,6 +609,7 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_drop_dims(
__isl_take isl_pw_multi_aff *pma,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_export
__isl_give isl_set *isl_pw_multi_aff_domain(__isl_take isl_pw_multi_aff *pma);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_empty(__isl_take isl_space *space);
@ -563,11 +648,20 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_neg(
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_add(
__isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2);
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_sub(
__isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2);
__isl_overload
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_add_constant_val(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_val *v);
__isl_overload
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_add_constant_multi_val(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_multi_val *mv);
__isl_overload
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_val(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_val *v);
__isl_overload
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_down_val(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_val *v);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_scale_multi_val(
@ -592,11 +686,24 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_flat_range_product(
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_product(
__isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2);
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_factor_domain(
__isl_take isl_pw_multi_aff *pma);
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_range_factor_range(
__isl_take isl_pw_multi_aff *pma);
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_params(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_set *set);
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_domain(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_set *set);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_domain_wrapped_domain(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_set *set);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_intersect_domain_wrapped_range(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_set *set);
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_subtract_domain(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_set *set);
@ -608,10 +715,12 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_align_params(
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_drop_unused_params(
__isl_take isl_pw_multi_aff *pma);
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_coalesce(
__isl_take isl_pw_multi_aff *pma);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_gist_params(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_set *set);
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_gist(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_set *set);
@ -622,10 +731,17 @@ __isl_overload
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_pullback_pw_multi_aff(
__isl_take isl_pw_multi_aff *pma1, __isl_take isl_pw_multi_aff *pma2);
int isl_pw_multi_aff_n_piece(__isl_keep isl_pw_multi_aff *pma);
__isl_export
isl_size isl_pw_multi_aff_n_piece(__isl_keep isl_pw_multi_aff *pma);
__isl_export
isl_stat isl_pw_multi_aff_foreach_piece(__isl_keep isl_pw_multi_aff *pma,
isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_multi_aff *maff,
void *user), void *user);
__isl_export
isl_bool isl_pw_multi_aff_isa_multi_aff(__isl_keep isl_pw_multi_aff *pma);
__isl_export
__isl_give isl_multi_aff *isl_pw_multi_aff_as_multi_aff(
__isl_take isl_pw_multi_aff *pma);
__isl_give isl_map *isl_map_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma);
__isl_give isl_set *isl_set_from_pw_multi_aff(__isl_take isl_pw_multi_aff *pma);
@ -637,12 +753,24 @@ __isl_give isl_printer *isl_printer_print_pw_multi_aff(__isl_take isl_printer *p
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_set(__isl_take isl_set *set);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_map(__isl_take isl_map *map);
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_bind_domain(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_multi_id *tuple);
__isl_export
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_bind_domain_wrapped_domain(
__isl_take isl_pw_multi_aff *pma, __isl_take isl_multi_id *tuple);
__isl_constructor
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_read_from_str(isl_ctx *ctx,
const char *str);
void isl_pw_multi_aff_dump(__isl_keep isl_pw_multi_aff *pma);
__isl_overload
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_empty_ctx(
isl_ctx *ctx);
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_empty_space(
__isl_take isl_space *space);
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_empty(
__isl_take isl_space *space);
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_aff(
@ -673,12 +801,13 @@ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_add_pw_multi_aff(
isl_ctx *isl_union_pw_multi_aff_get_ctx(
__isl_keep isl_union_pw_multi_aff *upma);
__isl_export
__isl_give isl_space *isl_union_pw_multi_aff_get_space(
__isl_keep isl_union_pw_multi_aff *upma);
__isl_give isl_pw_multi_aff_list *isl_union_pw_multi_aff_get_pw_multi_aff_list(
__isl_keep isl_union_pw_multi_aff *upma);
unsigned isl_union_pw_multi_aff_dim(__isl_keep isl_union_pw_multi_aff *upma,
isl_size isl_union_pw_multi_aff_dim(__isl_keep isl_union_pw_multi_aff *upma,
enum isl_dim_type type);
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_set_dim_name(
__isl_take isl_union_pw_multi_aff *upma,
@ -694,10 +823,12 @@ __isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_drop_dims(
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_reset_user(
__isl_take isl_union_pw_multi_aff *upma);
__isl_export
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_coalesce(
__isl_take isl_union_pw_multi_aff *upma);
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_gist_params(
__isl_take isl_union_pw_multi_aff *upma, __isl_take isl_set *context);
__isl_export
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_gist(
__isl_take isl_union_pw_multi_aff *upma,
__isl_take isl_union_set *context);
@ -711,15 +842,22 @@ isl_union_pw_multi_aff_pullback_union_pw_multi_aff(
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_align_params(
__isl_take isl_union_pw_multi_aff *upma, __isl_take isl_space *model);
int isl_union_pw_multi_aff_n_pw_multi_aff(
isl_size isl_union_pw_multi_aff_n_pw_multi_aff(
__isl_keep isl_union_pw_multi_aff *upma);
isl_stat isl_union_pw_multi_aff_foreach_pw_multi_aff(
__isl_keep isl_union_pw_multi_aff *upma,
isl_stat (*fn)(__isl_take isl_pw_multi_aff *pma, void *user),
void *user);
__isl_export
__isl_give isl_pw_multi_aff *isl_union_pw_multi_aff_extract_pw_multi_aff(
__isl_keep isl_union_pw_multi_aff *upma, __isl_take isl_space *space);
__isl_export
isl_bool isl_union_pw_multi_aff_isa_pw_multi_aff(
__isl_keep isl_union_pw_multi_aff *upma);
__isl_export
__isl_give isl_pw_multi_aff *isl_union_pw_multi_aff_as_pw_multi_aff(
__isl_take isl_union_pw_multi_aff *upma);
isl_bool isl_union_pw_multi_aff_involves_nan(
__isl_keep isl_union_pw_multi_aff *upma);
@ -727,6 +865,7 @@ isl_bool isl_union_pw_multi_aff_plain_is_equal(
__isl_keep isl_union_pw_multi_aff *upma1,
__isl_keep isl_union_pw_multi_aff *upma2);
__isl_export
__isl_give isl_union_set *isl_union_pw_multi_aff_domain(
__isl_take isl_union_pw_multi_aff *upma);
@ -741,6 +880,7 @@ __isl_export
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_union_add(
__isl_take isl_union_pw_multi_aff *upma1,
__isl_take isl_union_pw_multi_aff *upma2);
__isl_export
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_sub(
__isl_take isl_union_pw_multi_aff *upma1,
__isl_take isl_union_pw_multi_aff *upma2);
@ -756,12 +896,31 @@ __isl_export
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_flat_range_product(
__isl_take isl_union_pw_multi_aff *upma1,
__isl_take isl_union_pw_multi_aff *upma2);
__isl_export
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_range_factor_domain(
__isl_take isl_union_pw_multi_aff *upma);
__isl_export
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_range_factor_range(
__isl_take isl_union_pw_multi_aff *upma);
__isl_export
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_intersect_params(
__isl_take isl_union_pw_multi_aff *upma, __isl_take isl_set *set);
__isl_export
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_intersect_domain(
__isl_take isl_union_pw_multi_aff *upma,
__isl_take isl_union_set *uset);
__isl_export
__isl_give isl_union_pw_multi_aff *
isl_union_pw_multi_aff_intersect_domain_wrapped_domain(
__isl_take isl_union_pw_multi_aff *upma,
__isl_take isl_union_set *uset);
__isl_export
__isl_give isl_union_pw_multi_aff *
isl_union_pw_multi_aff_intersect_domain_wrapped_range(
__isl_take isl_union_pw_multi_aff *upma,
__isl_take isl_union_set *uset);
__isl_export
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_subtract_domain(
__isl_take isl_union_pw_multi_aff *upma,
__isl_take isl_union_set *uset);
@ -787,22 +946,25 @@ __isl_give char *isl_union_pw_multi_aff_to_str(
uint32_t isl_multi_pw_aff_get_hash(__isl_keep isl_multi_pw_aff *mpa);
__isl_give isl_multi_pw_aff *isl_multi_pw_aff_identity(
__isl_take isl_space *space);
__isl_constructor
__isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_multi_aff(
__isl_take isl_multi_aff *ma);
__isl_constructor
__isl_give isl_multi_pw_aff *isl_multi_pw_aff_from_pw_aff(
__isl_take isl_pw_aff *pa);
__isl_export
__isl_give isl_set *isl_multi_pw_aff_domain(__isl_take isl_multi_pw_aff *mpa);
__isl_export
__isl_give isl_multi_pw_aff *isl_multi_pw_aff_intersect_params(
__isl_take isl_multi_pw_aff *mpa, __isl_take isl_set *set);
__isl_export
__isl_give isl_multi_pw_aff *isl_multi_pw_aff_intersect_domain(
__isl_take isl_multi_pw_aff *mpa, __isl_take isl_set *domain);
__isl_export
__isl_give isl_multi_pw_aff *isl_multi_pw_aff_coalesce(
__isl_take isl_multi_pw_aff *mpa);
__isl_export
__isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist(
__isl_take isl_multi_pw_aff *mpa, __isl_take isl_set *set);
__isl_give isl_multi_pw_aff *isl_multi_pw_aff_gist_params(
@ -842,6 +1004,10 @@ __isl_give isl_map *isl_multi_pw_aff_lex_lt_map(
__isl_give isl_map *isl_multi_pw_aff_lex_gt_map(
__isl_take isl_multi_pw_aff *mpa1, __isl_take isl_multi_pw_aff *mpa2);
__isl_export
__isl_give isl_set *isl_multi_pw_aff_bind(__isl_take isl_multi_pw_aff *mpa,
__isl_take isl_multi_id *tuple);
__isl_constructor
__isl_give isl_multi_pw_aff *isl_multi_pw_aff_read_from_str(isl_ctx *ctx,
const char *str);
@ -856,12 +1022,13 @@ __isl_null isl_union_pw_aff *isl_union_pw_aff_free(
__isl_take isl_union_pw_aff *upa);
isl_ctx *isl_union_pw_aff_get_ctx(__isl_keep isl_union_pw_aff *upa);
__isl_export
__isl_give isl_space *isl_union_pw_aff_get_space(
__isl_keep isl_union_pw_aff *upa);
__isl_give isl_pw_aff_list *isl_union_pw_aff_get_pw_aff_list(
__isl_keep isl_union_pw_aff *upa);
unsigned isl_union_pw_aff_dim(__isl_keep isl_union_pw_aff *upa,
isl_size isl_union_pw_aff_dim(__isl_keep isl_union_pw_aff *upa,
enum isl_dim_type type);
__isl_give isl_union_pw_aff *isl_union_pw_aff_set_dim_name(
__isl_take isl_union_pw_aff *upa, enum isl_dim_type type,
@ -876,6 +1043,9 @@ __isl_give isl_union_pw_aff *isl_union_pw_aff_drop_dims(
__isl_give isl_union_pw_aff *isl_union_pw_aff_reset_user(
__isl_take isl_union_pw_aff *upa);
__isl_give isl_union_pw_aff *isl_union_pw_aff_empty_ctx(isl_ctx *ctx);
__isl_give isl_union_pw_aff *isl_union_pw_aff_empty_space(
__isl_take isl_space *space);
__isl_give isl_union_pw_aff *isl_union_pw_aff_empty(
__isl_take isl_space *space);
__isl_constructor
@ -894,7 +1064,7 @@ __isl_constructor
__isl_give isl_union_pw_multi_aff *isl_union_pw_multi_aff_from_union_pw_aff(
__isl_take isl_union_pw_aff *upa);
int isl_union_pw_aff_n_pw_aff(__isl_keep isl_union_pw_aff *upa);
isl_size isl_union_pw_aff_n_pw_aff(__isl_keep isl_union_pw_aff *upa);
isl_stat isl_union_pw_aff_foreach_pw_aff(__isl_keep isl_union_pw_aff *upa,
isl_stat (*fn)(__isl_take isl_pw_aff *pa, void *user), void *user);
@ -905,6 +1075,7 @@ isl_bool isl_union_pw_aff_involves_nan(__isl_keep isl_union_pw_aff *upa);
isl_bool isl_union_pw_aff_plain_is_equal(__isl_keep isl_union_pw_aff *upa1,
__isl_keep isl_union_pw_aff *upa2);
__isl_export
__isl_give isl_union_set *isl_union_pw_aff_domain(
__isl_take isl_union_pw_aff *upa);
@ -917,11 +1088,14 @@ __isl_give isl_union_pw_aff *isl_union_pw_aff_add(
__isl_export
__isl_give isl_union_pw_aff *isl_union_pw_aff_union_add(
__isl_take isl_union_pw_aff *upa1, __isl_take isl_union_pw_aff *upa2);
__isl_export
__isl_give isl_union_pw_aff *isl_union_pw_aff_sub(
__isl_take isl_union_pw_aff *upa1, __isl_take isl_union_pw_aff *upa2);
__isl_export
__isl_give isl_union_pw_aff *isl_union_pw_aff_coalesce(
__isl_take isl_union_pw_aff *upa);
__isl_export
__isl_give isl_union_pw_aff *isl_union_pw_aff_gist(
__isl_take isl_union_pw_aff *upa, __isl_take isl_union_set *context);
__isl_give isl_union_pw_aff *isl_union_pw_aff_gist_params(
@ -945,10 +1119,19 @@ __isl_give isl_union_pw_aff *isl_union_pw_aff_mod_val(
__isl_give isl_union_pw_aff *isl_union_pw_aff_align_params(
__isl_take isl_union_pw_aff *upa, __isl_take isl_space *model);
__isl_export
__isl_give isl_union_pw_aff *isl_union_pw_aff_intersect_params(
__isl_take isl_union_pw_aff *upa, __isl_take isl_set *set);
__isl_export
__isl_give isl_union_pw_aff *isl_union_pw_aff_intersect_domain(
__isl_take isl_union_pw_aff *upa, __isl_take isl_union_set *uset);
__isl_export
__isl_give isl_union_pw_aff *isl_union_pw_aff_intersect_domain_wrapped_domain(
__isl_take isl_union_pw_aff *upa, __isl_take isl_union_set *uset);
__isl_export
__isl_give isl_union_pw_aff *isl_union_pw_aff_intersect_domain_wrapped_range(
__isl_take isl_union_pw_aff *upa, __isl_take isl_union_set *uset);
__isl_export
__isl_give isl_union_pw_aff *isl_union_pw_aff_subtract_domain(
__isl_take isl_union_pw_aff *upa, __isl_take isl_union_set *uset);
@ -962,6 +1145,10 @@ __isl_give isl_union_set *isl_union_pw_aff_zero_union_set(
__isl_give isl_union_map *isl_union_map_from_union_pw_aff(
__isl_take isl_union_pw_aff *upa);
__isl_overload
__isl_give isl_union_set *isl_union_pw_aff_bind_id(
__isl_take isl_union_pw_aff *upa, __isl_take isl_id *id);
__isl_constructor
__isl_give isl_union_pw_aff *isl_union_pw_aff_read_from_str(isl_ctx *ctx,
const char *str);
@ -971,7 +1158,12 @@ __isl_give isl_printer *isl_printer_print_union_pw_aff(
void isl_union_pw_aff_dump(__isl_keep isl_union_pw_aff *upa);
ISL_DECLARE_MULTI(union_pw_aff)
ISL_DECLARE_MULTI_NEG(union_pw_aff)
ISL_DECLARE_MULTI_ARITH(union_pw_aff)
ISL_DECLARE_MULTI_ZERO(union_pw_aff)
ISL_DECLARE_MULTI_NAN(union_pw_aff)
ISL_DECLARE_MULTI_DROP_DIMS(union_pw_aff)
ISL_DECLARE_MULTI_DIM_ID(union_pw_aff)
ISL_DECLARE_MULTI_TUPLE_ID(union_pw_aff)
__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_from_multi_aff(
__isl_take isl_multi_aff *ma);
@ -992,24 +1184,29 @@ isl_multi_union_pw_aff_pw_multi_aff_on_domain(__isl_take isl_union_set *domain,
__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_floor(
__isl_take isl_multi_union_pw_aff *mupa);
__isl_export
__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_intersect_domain(
__isl_take isl_multi_union_pw_aff *mupa,
__isl_take isl_union_set *uset);
__isl_export
__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_intersect_params(
__isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_set *params);
__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_intersect_range(
__isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_set *set);
__isl_export
__isl_give isl_union_set *isl_multi_union_pw_aff_domain(
__isl_take isl_multi_union_pw_aff *mupa);
__isl_export
__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_coalesce(
__isl_take isl_multi_union_pw_aff *aff);
__isl_take isl_multi_union_pw_aff *mupa);
__isl_export
__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_gist(
__isl_take isl_multi_union_pw_aff *aff,
__isl_take isl_multi_union_pw_aff *mupa,
__isl_take isl_union_set *context);
__isl_give isl_multi_union_pw_aff *isl_multi_union_pw_aff_gist_params(
__isl_take isl_multi_union_pw_aff *aff, __isl_take isl_set *context);
__isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_set *context);
__isl_give isl_union_pw_aff *isl_multi_union_pw_aff_apply_aff(
__isl_take isl_multi_union_pw_aff *mupa, __isl_take isl_aff *aff);
@ -1048,6 +1245,10 @@ __isl_give isl_union_map *isl_union_map_from_multi_union_pw_aff(
__isl_give isl_union_set *isl_multi_union_pw_aff_zero_union_set(
__isl_take isl_multi_union_pw_aff *mupa);
__isl_export
__isl_give isl_union_set *isl_multi_union_pw_aff_bind(
__isl_take isl_multi_union_pw_aff *mupa,
__isl_take isl_multi_id *tuple);
__isl_give isl_multi_pw_aff *isl_multi_union_pw_aff_extract_multi_pw_aff(
__isl_keep isl_multi_union_pw_aff *mupa, __isl_take isl_space *space);
@ -1061,8 +1262,10 @@ __isl_give isl_printer *isl_printer_print_multi_union_pw_aff(
__isl_take isl_printer *p, __isl_keep isl_multi_union_pw_aff *mupa);
void isl_multi_union_pw_aff_dump(__isl_keep isl_multi_union_pw_aff *mupa);
ISL_DECLARE_LIST_FN(pw_multi_aff)
ISL_DECLARE_LIST_FN(union_pw_aff)
ISL_DECLARE_EXPORTED_LIST_FN(aff)
ISL_DECLARE_EXPORTED_LIST_FN(pw_aff)
ISL_DECLARE_EXPORTED_LIST_FN(pw_multi_aff)
ISL_DECLARE_EXPORTED_LIST_FN(union_pw_aff)
ISL_DECLARE_LIST_FN(union_pw_multi_aff)
#if defined(__cplusplus)

View File

@ -10,19 +10,19 @@ extern "C" {
struct __isl_subclass(isl_multi_aff) __isl_subclass(isl_pw_aff) isl_aff;
typedef struct isl_aff isl_aff;
ISL_DECLARE_LIST(aff)
ISL_DECLARE_EXPORTED_LIST_TYPE(aff)
struct __isl_subclass(isl_multi_pw_aff) __isl_subclass(isl_pw_multi_aff)
__isl_subclass(isl_union_pw_aff) isl_pw_aff;
typedef struct isl_pw_aff isl_pw_aff;
ISL_DECLARE_LIST(pw_aff)
ISL_DECLARE_EXPORTED_LIST_TYPE(pw_aff)
struct __isl_subclass(isl_multi_union_pw_aff)
__isl_subclass(isl_union_pw_multi_aff) isl_union_pw_aff;
typedef struct isl_union_pw_aff isl_union_pw_aff;
ISL_DECLARE_LIST_TYPE(union_pw_aff)
ISL_DECLARE_EXPORTED_LIST_TYPE(union_pw_aff)
struct __isl_subclass(isl_multi_pw_aff) __isl_subclass(isl_pw_multi_aff)
isl_multi_aff;
@ -32,7 +32,7 @@ struct __isl_subclass(isl_multi_pw_aff) __isl_subclass(isl_union_pw_multi_aff)
isl_pw_multi_aff;
typedef struct isl_pw_multi_aff isl_pw_multi_aff;
ISL_DECLARE_LIST_TYPE(pw_multi_aff)
ISL_DECLARE_EXPORTED_LIST_TYPE(pw_multi_aff)
struct __isl_export isl_union_pw_multi_aff;
typedef struct isl_union_pw_multi_aff isl_union_pw_multi_aff;

View File

@ -53,6 +53,7 @@ struct isl_arg {
char short_name;
const char *long_name;
const char *argument_name;
#define ISL_ARG_OFFSET_NONE ((size_t) -1)
size_t offset;
const char *help_msg;
#define ISL_ARG_SINGLE_DASH (1 << 0)
@ -152,7 +153,7 @@ struct isl_args {
.type = isl_arg_choice, \
.short_name = s, \
.long_name = l, \
.offset = -1, \
.offset = ISL_ARG_OFFSET_NONE, \
.help_msg = h, \
.flags = fl, \
.u = { .choice = { .choice = c, .default_value = d, \
@ -181,7 +182,7 @@ struct isl_args {
#define ISL_ARG_BOOL(st,f,s,l,d,h) \
ISL_ARG_BOOL_F(st,f,s,l,d,h,0)
#define ISL_ARG_PHANTOM_BOOL_F(s,l,setter,h,fl) \
_ISL_ARG_BOOL_F(-1,s,l,setter,0,h,fl)
_ISL_ARG_BOOL_F(ISL_ARG_OFFSET_NONE,s,l,setter,0,h,fl)
#define ISL_ARG_PHANTOM_BOOL(s,l,setter,h) \
ISL_ARG_PHANTOM_BOOL_F(s,l,setter,h,0)
#define ISL_ARG_INT_F(st,f,s,l,a,d,h,fl) { \
@ -263,7 +264,7 @@ struct isl_args {
#define ISL_ARG_CHILD(st,f,l,c,h) \
_ISL_ARG_CHILD(offsetof(st, f),l,c,h,0)
#define ISL_ARG_GROUP_F(l,c,h,fl) \
_ISL_ARG_CHILD(-1,l,c,h,fl)
_ISL_ARG_CHILD(ISL_ARG_OFFSET_NONE,l,c,h,fl)
#define ISL_ARG_GROUP(l,c,h) \
ISL_ARG_GROUP_F(l,c,h,0)
#define ISL_ARG_FLAGS(st,f,s,l,c,d,h) { \

View File

@ -62,12 +62,26 @@ __isl_give isl_ast_expr *isl_ast_expr_copy(__isl_keep isl_ast_expr *expr);
__isl_null isl_ast_expr *isl_ast_expr_free(__isl_take isl_ast_expr *expr);
isl_ctx *isl_ast_expr_get_ctx(__isl_keep isl_ast_expr *expr);
__isl_subclass(isl_ast_expr)
enum isl_ast_expr_type isl_ast_expr_get_type(__isl_keep isl_ast_expr *expr);
__isl_export
__isl_give isl_val *isl_ast_expr_int_get_val(__isl_keep isl_ast_expr *expr);
__isl_give isl_val *isl_ast_expr_get_val(__isl_keep isl_ast_expr *expr);
__isl_export
__isl_give isl_id *isl_ast_expr_id_get_id(__isl_keep isl_ast_expr *expr);
__isl_give isl_id *isl_ast_expr_get_id(__isl_keep isl_ast_expr *expr);
enum isl_ast_op_type isl_ast_expr_get_op_type(__isl_keep isl_ast_expr *expr);
int isl_ast_expr_get_op_n_arg(__isl_keep isl_ast_expr *expr);
__isl_subclass(isl_ast_expr_op)
enum isl_ast_expr_op_type isl_ast_expr_op_get_type(
__isl_keep isl_ast_expr *expr);
enum isl_ast_expr_op_type isl_ast_expr_get_op_type(
__isl_keep isl_ast_expr *expr);
__isl_export
isl_size isl_ast_expr_op_get_n_arg(__isl_keep isl_ast_expr *expr);
isl_size isl_ast_expr_get_op_n_arg(__isl_keep isl_ast_expr *expr);
__isl_export
__isl_give isl_ast_expr *isl_ast_expr_op_get_arg(__isl_keep isl_ast_expr *expr,
int pos);
__isl_give isl_ast_expr *isl_ast_expr_get_op_arg(__isl_keep isl_ast_expr *expr,
int pos);
__isl_give isl_ast_expr *isl_ast_expr_set_op_arg(__isl_take isl_ast_expr *expr,
@ -91,39 +105,59 @@ __isl_give isl_ast_node *isl_ast_node_copy(__isl_keep isl_ast_node *node);
__isl_null isl_ast_node *isl_ast_node_free(__isl_take isl_ast_node *node);
isl_ctx *isl_ast_node_get_ctx(__isl_keep isl_ast_node *node);
__isl_subclass(isl_ast_node)
enum isl_ast_node_type isl_ast_node_get_type(__isl_keep isl_ast_node *node);
__isl_give isl_ast_node *isl_ast_node_set_annotation(
__isl_take isl_ast_node *node, __isl_take isl_id *annotation);
__isl_give isl_id *isl_ast_node_get_annotation(__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_ast_expr *isl_ast_node_for_get_iterator(
__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_ast_expr *isl_ast_node_for_get_init(
__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_ast_expr *isl_ast_node_for_get_cond(
__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_ast_expr *isl_ast_node_for_get_inc(
__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_ast_node *isl_ast_node_for_get_body(
__isl_keep isl_ast_node *node);
__isl_export
isl_bool isl_ast_node_for_is_degenerate(__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_ast_expr *isl_ast_node_if_get_cond(
__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_ast_node *isl_ast_node_if_get_then_node(
__isl_keep isl_ast_node *node);
__isl_give isl_ast_node *isl_ast_node_if_get_then(
__isl_keep isl_ast_node *node);
__isl_export
isl_bool isl_ast_node_if_has_else_node(__isl_keep isl_ast_node *node);
isl_bool isl_ast_node_if_has_else(__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_ast_node *isl_ast_node_if_get_else_node(
__isl_keep isl_ast_node *node);
__isl_give isl_ast_node *isl_ast_node_if_get_else(
__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_ast_node_list *isl_ast_node_block_get_children(
__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_id *isl_ast_node_mark_get_id(__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_ast_node *isl_ast_node_mark_get_node(
__isl_keep isl_ast_node *node);
__isl_export
__isl_give isl_ast_expr *isl_ast_node_user_get_expr(
__isl_keep isl_ast_node *node);
@ -160,15 +194,24 @@ __isl_give isl_ast_print_options *isl_ast_print_options_set_print_for(
isl_stat isl_options_set_ast_print_macro_once(isl_ctx *ctx, int val);
int isl_options_get_ast_print_macro_once(isl_ctx *ctx);
isl_stat isl_ast_expr_foreach_ast_expr_op_type(__isl_keep isl_ast_expr *expr,
isl_stat (*fn)(enum isl_ast_expr_op_type type, void *user), void *user);
isl_stat isl_ast_expr_foreach_ast_op_type(__isl_keep isl_ast_expr *expr,
isl_stat (*fn)(enum isl_ast_op_type type, void *user), void *user);
isl_stat (*fn)(enum isl_ast_expr_op_type type, void *user), void *user);
isl_stat isl_ast_node_foreach_ast_expr_op_type(__isl_keep isl_ast_node *node,
isl_stat (*fn)(enum isl_ast_expr_op_type type, void *user), void *user);
isl_stat isl_ast_node_foreach_ast_op_type(__isl_keep isl_ast_node *node,
isl_stat (*fn)(enum isl_ast_op_type type, void *user), void *user);
__isl_give isl_printer *isl_ast_op_type_set_print_name(
__isl_take isl_printer *p, enum isl_ast_op_type type,
isl_stat (*fn)(enum isl_ast_expr_op_type type, void *user), void *user);
__isl_give isl_printer *isl_ast_expr_op_type_set_print_name(
__isl_take isl_printer *p, enum isl_ast_expr_op_type type,
__isl_keep const char *name);
__isl_give isl_printer *isl_ast_op_type_set_print_name(
__isl_take isl_printer *p, enum isl_ast_expr_op_type type,
__isl_keep const char *name);
__isl_give isl_printer *isl_ast_expr_op_type_print_macro(
enum isl_ast_expr_op_type type, __isl_take isl_printer *p);
__isl_give isl_printer *isl_ast_op_type_print_macro(
enum isl_ast_op_type type, __isl_take isl_printer *p);
enum isl_ast_expr_op_type type, __isl_take isl_printer *p);
__isl_give isl_printer *isl_ast_expr_print_macros(
__isl_keep isl_ast_expr *expr, __isl_take isl_printer *p);
__isl_give isl_printer *isl_ast_node_print_macros(
@ -186,6 +229,9 @@ __isl_give isl_printer *isl_ast_node_if_print(__isl_keep isl_ast_node *node,
__isl_export
__isl_give char *isl_ast_node_to_C_str(__isl_keep isl_ast_node *node);
ISL_DECLARE_LIST_FN(ast_expr)
ISL_DECLARE_EXPORTED_LIST_FN(ast_node)
#if defined(__cplusplus)
}
#endif

View File

@ -1,5 +1,5 @@
#ifndef ISL_AST_CONTEXT_H
#define ISL_AST_CONTEXT_H
#ifndef ISL_AST_BUILD_H
#define ISL_AST_BUILD_H
#include <isl/ctx.h>
#include <isl/set.h>
@ -52,6 +52,7 @@ __isl_give isl_ast_build *isl_ast_build_from_context(__isl_take isl_set *set);
__isl_give isl_space *isl_ast_build_get_schedule_space(
__isl_keep isl_ast_build *build);
__isl_export
__isl_give isl_union_map *isl_ast_build_get_schedule(
__isl_keep isl_ast_build *build);
@ -69,6 +70,7 @@ __isl_give isl_ast_build *isl_ast_build_set_options(
__isl_give isl_ast_build *isl_ast_build_set_iterators(
__isl_take isl_ast_build *build,
__isl_take isl_id_list *iterators);
__isl_export
__isl_give isl_ast_build *isl_ast_build_set_at_each_domain(
__isl_take isl_ast_build *build,
__isl_give isl_ast_node *(*fn)(__isl_take isl_ast_node *node,
@ -113,6 +115,7 @@ __isl_overload
__isl_give isl_ast_expr *isl_ast_build_call_from_multi_pw_aff(
__isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa);
__isl_overload
__isl_give isl_ast_node *isl_ast_build_node_from_schedule(
__isl_keep isl_ast_build *build, __isl_take isl_schedule *schedule);
__isl_export

View File

@ -13,36 +13,65 @@ typedef struct isl_ast_expr isl_ast_expr;
struct __isl_export isl_ast_node;
typedef struct isl_ast_node isl_ast_node;
enum isl_ast_op_type {
isl_ast_op_error = -1,
isl_ast_op_and,
isl_ast_op_and_then,
isl_ast_op_or,
isl_ast_op_or_else,
isl_ast_op_max,
isl_ast_op_min,
isl_ast_op_minus,
isl_ast_op_add,
isl_ast_op_sub,
isl_ast_op_mul,
isl_ast_op_div,
isl_ast_op_fdiv_q, /* Round towards -infty */
isl_ast_op_pdiv_q, /* Dividend is non-negative */
isl_ast_op_pdiv_r, /* Dividend is non-negative */
isl_ast_op_zdiv_r, /* Result only compared against zero */
isl_ast_op_cond,
isl_ast_op_select,
isl_ast_op_eq,
isl_ast_op_le,
isl_ast_op_lt,
isl_ast_op_ge,
isl_ast_op_gt,
isl_ast_op_call,
isl_ast_op_access,
isl_ast_op_member,
isl_ast_op_address_of
enum isl_ast_expr_op_type {
isl_ast_expr_op_error = -1,
isl_ast_expr_op_and,
isl_ast_expr_op_and_then,
isl_ast_expr_op_or,
isl_ast_expr_op_or_else,
isl_ast_expr_op_max,
isl_ast_expr_op_min,
isl_ast_expr_op_minus,
isl_ast_expr_op_add,
isl_ast_expr_op_sub,
isl_ast_expr_op_mul,
isl_ast_expr_op_div,
isl_ast_expr_op_fdiv_q, /* Round towards -infty */
isl_ast_expr_op_pdiv_q, /* Dividend is non-negative */
isl_ast_expr_op_pdiv_r, /* Dividend is non-negative */
isl_ast_expr_op_zdiv_r, /* Result only compared against zero */
isl_ast_expr_op_cond,
isl_ast_expr_op_select,
isl_ast_expr_op_eq,
isl_ast_expr_op_le,
isl_ast_expr_op_lt,
isl_ast_expr_op_ge,
isl_ast_expr_op_gt,
isl_ast_expr_op_call,
isl_ast_expr_op_access,
isl_ast_expr_op_member,
isl_ast_expr_op_address_of
};
#define isl_ast_op_type isl_ast_expr_op_type
#define isl_ast_op_error isl_ast_expr_op_error
#define isl_ast_op_and isl_ast_expr_op_and
#define isl_ast_op_and_then isl_ast_expr_op_and_then
#define isl_ast_op_or isl_ast_expr_op_or
#define isl_ast_op_or_else isl_ast_expr_op_or_else
#define isl_ast_op_max isl_ast_expr_op_max
#define isl_ast_op_min isl_ast_expr_op_min
#define isl_ast_op_minus isl_ast_expr_op_minus
#define isl_ast_op_add isl_ast_expr_op_add
#define isl_ast_op_sub isl_ast_expr_op_sub
#define isl_ast_op_mul isl_ast_expr_op_mul
#define isl_ast_op_div isl_ast_expr_op_div
#define isl_ast_op_fdiv_q isl_ast_expr_op_fdiv_q
#define isl_ast_op_pdiv_q isl_ast_expr_op_pdiv_q
#define isl_ast_op_pdiv_r isl_ast_expr_op_pdiv_r
#define isl_ast_op_zdiv_r isl_ast_expr_op_zdiv_r
#define isl_ast_op_cond isl_ast_expr_op_cond
#define isl_ast_op_select isl_ast_expr_op_select
#define isl_ast_op_eq isl_ast_expr_op_eq
#define isl_ast_op_le isl_ast_expr_op_le
#define isl_ast_op_lt isl_ast_expr_op_lt
#define isl_ast_op_ge isl_ast_expr_op_ge
#define isl_ast_op_gt isl_ast_expr_op_gt
#define isl_ast_op_call isl_ast_expr_op_call
#define isl_ast_op_access isl_ast_expr_op_access
#define isl_ast_op_member isl_ast_expr_op_member
#define isl_ast_op_address_of isl_ast_expr_op_address_of
enum isl_ast_expr_type {
isl_ast_expr_error = -1,
isl_ast_expr_op,
@ -70,8 +99,8 @@ enum isl_ast_loop_type {
struct isl_ast_print_options;
typedef struct isl_ast_print_options isl_ast_print_options;
ISL_DECLARE_LIST(ast_expr)
ISL_DECLARE_LIST(ast_node)
ISL_DECLARE_LIST_TYPE(ast_expr)
ISL_DECLARE_EXPORTED_LIST_TYPE(ast_node)
#if defined(__cplusplus)
}

View File

@ -39,8 +39,8 @@ __isl_give isl_constraint *isl_inequality_alloc(__isl_take isl_local_space *ls);
struct isl_constraint *isl_constraint_copy(struct isl_constraint *c);
__isl_null isl_constraint *isl_constraint_free(__isl_take isl_constraint *c);
int isl_basic_map_n_constraint(__isl_keep isl_basic_map *bmap);
int isl_basic_set_n_constraint(__isl_keep isl_basic_set *bset);
isl_size isl_basic_map_n_constraint(__isl_keep isl_basic_map *bmap);
isl_size isl_basic_set_n_constraint(__isl_keep isl_basic_set *bset);
isl_stat isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap,
isl_stat (*fn)(__isl_take isl_constraint *c, void *user), void *user);
isl_stat isl_basic_set_foreach_constraint(__isl_keep isl_basic_set *bset,
@ -82,7 +82,7 @@ __isl_give isl_space *isl_constraint_get_space(
__isl_keep isl_constraint *constraint);
__isl_give isl_local_space *isl_constraint_get_local_space(
__isl_keep isl_constraint *constraint);
int isl_constraint_dim(struct isl_constraint *constraint,
isl_size isl_constraint_dim(__isl_keep isl_constraint *constraint,
enum isl_dim_type type);
isl_bool isl_constraint_involves_dims(__isl_keep isl_constraint *constraint,
@ -111,7 +111,8 @@ __isl_give isl_aff *isl_constraint_get_div(__isl_keep isl_constraint *constraint
struct isl_constraint *isl_constraint_negate(struct isl_constraint *constraint);
isl_bool isl_constraint_is_equality(__isl_keep isl_constraint *constraint);
int isl_constraint_is_div_constraint(__isl_keep isl_constraint *constraint);
isl_bool isl_constraint_is_div_constraint(
__isl_keep isl_constraint *constraint);
isl_bool isl_constraint_is_lower_bound(__isl_keep isl_constraint *constraint,
enum isl_dim_type type, unsigned pos);

View File

@ -22,6 +22,14 @@ aff uncheck(checked::aff obj) {
return manage(obj.copy());
}
checked::aff_list check(aff_list obj) {
return checked::manage(obj.copy());
}
aff_list uncheck(checked::aff_list obj) {
return manage(obj.copy());
}
checked::ast_build check(ast_build obj) {
return checked::manage(obj.copy());
}
@ -38,6 +46,238 @@ ast_expr uncheck(checked::ast_expr obj) {
return manage(obj.copy());
}
checked::ast_expr_id check(ast_expr_id obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_id>();
}
ast_expr_id uncheck(checked::ast_expr_id obj) {
return manage(obj.copy()).as<ast_expr_id>();
}
checked::ast_expr_int check(ast_expr_int obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_int>();
}
ast_expr_int uncheck(checked::ast_expr_int obj) {
return manage(obj.copy()).as<ast_expr_int>();
}
checked::ast_expr_op check(ast_expr_op obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>();
}
ast_expr_op uncheck(checked::ast_expr_op obj) {
return manage(obj.copy()).as<ast_expr_op>();
}
checked::ast_expr_op_access check(ast_expr_op_access obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_access>();
}
ast_expr_op_access uncheck(checked::ast_expr_op_access obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_access>();
}
checked::ast_expr_op_add check(ast_expr_op_add obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_add>();
}
ast_expr_op_add uncheck(checked::ast_expr_op_add obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_add>();
}
checked::ast_expr_op_address_of check(ast_expr_op_address_of obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_address_of>();
}
ast_expr_op_address_of uncheck(checked::ast_expr_op_address_of obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_address_of>();
}
checked::ast_expr_op_and check(ast_expr_op_and obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_and>();
}
ast_expr_op_and uncheck(checked::ast_expr_op_and obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_and>();
}
checked::ast_expr_op_and_then check(ast_expr_op_and_then obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_and_then>();
}
ast_expr_op_and_then uncheck(checked::ast_expr_op_and_then obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_and_then>();
}
checked::ast_expr_op_call check(ast_expr_op_call obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_call>();
}
ast_expr_op_call uncheck(checked::ast_expr_op_call obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_call>();
}
checked::ast_expr_op_cond check(ast_expr_op_cond obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_cond>();
}
ast_expr_op_cond uncheck(checked::ast_expr_op_cond obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_cond>();
}
checked::ast_expr_op_div check(ast_expr_op_div obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_div>();
}
ast_expr_op_div uncheck(checked::ast_expr_op_div obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_div>();
}
checked::ast_expr_op_eq check(ast_expr_op_eq obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_eq>();
}
ast_expr_op_eq uncheck(checked::ast_expr_op_eq obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_eq>();
}
checked::ast_expr_op_fdiv_q check(ast_expr_op_fdiv_q obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_fdiv_q>();
}
ast_expr_op_fdiv_q uncheck(checked::ast_expr_op_fdiv_q obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_fdiv_q>();
}
checked::ast_expr_op_ge check(ast_expr_op_ge obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_ge>();
}
ast_expr_op_ge uncheck(checked::ast_expr_op_ge obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_ge>();
}
checked::ast_expr_op_gt check(ast_expr_op_gt obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_gt>();
}
ast_expr_op_gt uncheck(checked::ast_expr_op_gt obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_gt>();
}
checked::ast_expr_op_le check(ast_expr_op_le obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_le>();
}
ast_expr_op_le uncheck(checked::ast_expr_op_le obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_le>();
}
checked::ast_expr_op_lt check(ast_expr_op_lt obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_lt>();
}
ast_expr_op_lt uncheck(checked::ast_expr_op_lt obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_lt>();
}
checked::ast_expr_op_max check(ast_expr_op_max obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_max>();
}
ast_expr_op_max uncheck(checked::ast_expr_op_max obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_max>();
}
checked::ast_expr_op_member check(ast_expr_op_member obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_member>();
}
ast_expr_op_member uncheck(checked::ast_expr_op_member obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_member>();
}
checked::ast_expr_op_min check(ast_expr_op_min obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_min>();
}
ast_expr_op_min uncheck(checked::ast_expr_op_min obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_min>();
}
checked::ast_expr_op_minus check(ast_expr_op_minus obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_minus>();
}
ast_expr_op_minus uncheck(checked::ast_expr_op_minus obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_minus>();
}
checked::ast_expr_op_mul check(ast_expr_op_mul obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_mul>();
}
ast_expr_op_mul uncheck(checked::ast_expr_op_mul obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_mul>();
}
checked::ast_expr_op_or check(ast_expr_op_or obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_or>();
}
ast_expr_op_or uncheck(checked::ast_expr_op_or obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_or>();
}
checked::ast_expr_op_or_else check(ast_expr_op_or_else obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_or_else>();
}
ast_expr_op_or_else uncheck(checked::ast_expr_op_or_else obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_or_else>();
}
checked::ast_expr_op_pdiv_q check(ast_expr_op_pdiv_q obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_pdiv_q>();
}
ast_expr_op_pdiv_q uncheck(checked::ast_expr_op_pdiv_q obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_pdiv_q>();
}
checked::ast_expr_op_pdiv_r check(ast_expr_op_pdiv_r obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_pdiv_r>();
}
ast_expr_op_pdiv_r uncheck(checked::ast_expr_op_pdiv_r obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_pdiv_r>();
}
checked::ast_expr_op_select check(ast_expr_op_select obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_select>();
}
ast_expr_op_select uncheck(checked::ast_expr_op_select obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_select>();
}
checked::ast_expr_op_sub check(ast_expr_op_sub obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_sub>();
}
ast_expr_op_sub uncheck(checked::ast_expr_op_sub obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_sub>();
}
checked::ast_expr_op_zdiv_r check(ast_expr_op_zdiv_r obj) {
return checked::manage(obj.copy()).as<checked::ast_expr_op>().as<checked::ast_expr_op_zdiv_r>();
}
ast_expr_op_zdiv_r uncheck(checked::ast_expr_op_zdiv_r obj) {
return manage(obj.copy()).as<ast_expr_op>().as<ast_expr_op_zdiv_r>();
}
checked::ast_node check(ast_node obj) {
return checked::manage(obj.copy());
}
@ -46,6 +286,54 @@ ast_node uncheck(checked::ast_node obj) {
return manage(obj.copy());
}
checked::ast_node_block check(ast_node_block obj) {
return checked::manage(obj.copy()).as<checked::ast_node_block>();
}
ast_node_block uncheck(checked::ast_node_block obj) {
return manage(obj.copy()).as<ast_node_block>();
}
checked::ast_node_for check(ast_node_for obj) {
return checked::manage(obj.copy()).as<checked::ast_node_for>();
}
ast_node_for uncheck(checked::ast_node_for obj) {
return manage(obj.copy()).as<ast_node_for>();
}
checked::ast_node_if check(ast_node_if obj) {
return checked::manage(obj.copy()).as<checked::ast_node_if>();
}
ast_node_if uncheck(checked::ast_node_if obj) {
return manage(obj.copy()).as<ast_node_if>();
}
checked::ast_node_list check(ast_node_list obj) {
return checked::manage(obj.copy());
}
ast_node_list uncheck(checked::ast_node_list obj) {
return manage(obj.copy());
}
checked::ast_node_mark check(ast_node_mark obj) {
return checked::manage(obj.copy()).as<checked::ast_node_mark>();
}
ast_node_mark uncheck(checked::ast_node_mark obj) {
return manage(obj.copy()).as<ast_node_mark>();
}
checked::ast_node_user check(ast_node_user obj) {
return checked::manage(obj.copy()).as<checked::ast_node_user>();
}
ast_node_user uncheck(checked::ast_node_user obj) {
return manage(obj.copy()).as<ast_node_user>();
}
checked::basic_map check(basic_map obj) {
return checked::manage(obj.copy());
}
@ -62,6 +350,30 @@ basic_set uncheck(checked::basic_set obj) {
return manage(obj.copy());
}
checked::fixed_box check(fixed_box obj) {
return checked::manage(obj.copy());
}
fixed_box uncheck(checked::fixed_box obj) {
return manage(obj.copy());
}
checked::id check(id obj) {
return checked::manage(obj.copy());
}
id uncheck(checked::id obj) {
return manage(obj.copy());
}
checked::id_list check(id_list obj) {
return checked::manage(obj.copy());
}
id_list uncheck(checked::id_list obj) {
return manage(obj.copy());
}
checked::map check(map obj) {
return checked::manage(obj.copy());
}
@ -78,6 +390,14 @@ multi_aff uncheck(checked::multi_aff obj) {
return manage(obj.copy());
}
checked::multi_id check(multi_id obj) {
return checked::manage(obj.copy());
}
multi_id uncheck(checked::multi_id obj) {
return manage(obj.copy());
}
checked::multi_pw_aff check(multi_pw_aff obj) {
return checked::manage(obj.copy());
}
@ -118,6 +438,14 @@ pw_aff uncheck(checked::pw_aff obj) {
return manage(obj.copy());
}
checked::pw_aff_list check(pw_aff_list obj) {
return checked::manage(obj.copy());
}
pw_aff_list uncheck(checked::pw_aff_list obj) {
return manage(obj.copy());
}
checked::pw_multi_aff check(pw_multi_aff obj) {
return checked::manage(obj.copy());
}
@ -126,6 +454,14 @@ pw_multi_aff uncheck(checked::pw_multi_aff obj) {
return manage(obj.copy());
}
checked::pw_multi_aff_list check(pw_multi_aff_list obj) {
return checked::manage(obj.copy());
}
pw_multi_aff_list uncheck(checked::pw_multi_aff_list obj) {
return manage(obj.copy());
}
checked::schedule check(schedule obj) {
return checked::manage(obj.copy());
}
@ -150,6 +486,94 @@ schedule_node uncheck(checked::schedule_node obj) {
return manage(obj.copy());
}
checked::schedule_node_band check(schedule_node_band obj) {
return checked::manage(obj.copy()).as<checked::schedule_node_band>();
}
schedule_node_band uncheck(checked::schedule_node_band obj) {
return manage(obj.copy()).as<schedule_node_band>();
}
checked::schedule_node_context check(schedule_node_context obj) {
return checked::manage(obj.copy()).as<checked::schedule_node_context>();
}
schedule_node_context uncheck(checked::schedule_node_context obj) {
return manage(obj.copy()).as<schedule_node_context>();
}
checked::schedule_node_domain check(schedule_node_domain obj) {
return checked::manage(obj.copy()).as<checked::schedule_node_domain>();
}
schedule_node_domain uncheck(checked::schedule_node_domain obj) {
return manage(obj.copy()).as<schedule_node_domain>();
}
checked::schedule_node_expansion check(schedule_node_expansion obj) {
return checked::manage(obj.copy()).as<checked::schedule_node_expansion>();
}
schedule_node_expansion uncheck(checked::schedule_node_expansion obj) {
return manage(obj.copy()).as<schedule_node_expansion>();
}
checked::schedule_node_extension check(schedule_node_extension obj) {
return checked::manage(obj.copy()).as<checked::schedule_node_extension>();
}
schedule_node_extension uncheck(checked::schedule_node_extension obj) {
return manage(obj.copy()).as<schedule_node_extension>();
}
checked::schedule_node_filter check(schedule_node_filter obj) {
return checked::manage(obj.copy()).as<checked::schedule_node_filter>();
}
schedule_node_filter uncheck(checked::schedule_node_filter obj) {
return manage(obj.copy()).as<schedule_node_filter>();
}
checked::schedule_node_guard check(schedule_node_guard obj) {
return checked::manage(obj.copy()).as<checked::schedule_node_guard>();
}
schedule_node_guard uncheck(checked::schedule_node_guard obj) {
return manage(obj.copy()).as<schedule_node_guard>();
}
checked::schedule_node_leaf check(schedule_node_leaf obj) {
return checked::manage(obj.copy()).as<checked::schedule_node_leaf>();
}
schedule_node_leaf uncheck(checked::schedule_node_leaf obj) {
return manage(obj.copy()).as<schedule_node_leaf>();
}
checked::schedule_node_mark check(schedule_node_mark obj) {
return checked::manage(obj.copy()).as<checked::schedule_node_mark>();
}
schedule_node_mark uncheck(checked::schedule_node_mark obj) {
return manage(obj.copy()).as<schedule_node_mark>();
}
checked::schedule_node_sequence check(schedule_node_sequence obj) {
return checked::manage(obj.copy()).as<checked::schedule_node_sequence>();
}
schedule_node_sequence uncheck(checked::schedule_node_sequence obj) {
return manage(obj.copy()).as<schedule_node_sequence>();
}
checked::schedule_node_set check(schedule_node_set obj) {
return checked::manage(obj.copy()).as<checked::schedule_node_set>();
}
schedule_node_set uncheck(checked::schedule_node_set obj) {
return manage(obj.copy()).as<schedule_node_set>();
}
checked::set check(set obj) {
return checked::manage(obj.copy());
}
@ -158,6 +582,14 @@ set uncheck(checked::set obj) {
return manage(obj.copy());
}
checked::space check(space obj) {
return checked::manage(obj.copy());
}
space uncheck(checked::space obj) {
return manage(obj.copy());
}
checked::union_access_info check(union_access_info obj) {
return checked::manage(obj.copy());
}
@ -190,6 +622,14 @@ union_pw_aff uncheck(checked::union_pw_aff obj) {
return manage(obj.copy());
}
checked::union_pw_aff_list check(union_pw_aff_list obj) {
return checked::manage(obj.copy());
}
union_pw_aff_list uncheck(checked::union_pw_aff_list obj) {
return manage(obj.copy());
}
checked::union_pw_multi_aff check(union_pw_multi_aff obj) {
return checked::manage(obj.copy());
}
@ -206,6 +646,14 @@ union_set uncheck(checked::union_set obj) {
return manage(obj.copy());
}
checked::union_set_list check(union_set_list obj) {
return checked::manage(obj.copy());
}
union_set_list uncheck(checked::union_set_list obj) {
return manage(obj.copy());
}
checked::val check(val obj) {
return checked::manage(obj.copy());
}
@ -214,6 +662,14 @@ val uncheck(checked::val obj) {
return manage(obj.copy());
}
checked::val_list check(val_list obj) {
return checked::manage(obj.copy());
}
val_list uncheck(checked::val_list obj) {
return manage(obj.copy());
}
} // namespace isl
#endif /* ISL_CPP_CHECKED_CONVERSION */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -85,12 +85,16 @@ typedef enum {
isl_stat_error = -1,
isl_stat_ok = 0
} isl_stat;
isl_stat isl_stat_non_null(void *obj);
typedef enum {
isl_bool_error = -1,
isl_bool_false = 0,
isl_bool_true = 1
} isl_bool;
isl_bool isl_bool_not(isl_bool b);
isl_bool isl_bool_ok(int b);
typedef int isl_size;
#define isl_size_error ((int) -1)
struct isl_ctx;
typedef struct isl_ctx isl_ctx;

View File

@ -14,19 +14,28 @@
extern "C" {
#endif
struct isl_fixed_box;
struct __isl_export isl_fixed_box;
typedef struct isl_fixed_box isl_fixed_box;
isl_ctx *isl_fixed_box_get_ctx(__isl_keep isl_fixed_box *box);
__isl_export
__isl_give isl_space *isl_fixed_box_get_space(__isl_keep isl_fixed_box *box);
__isl_export
isl_bool isl_fixed_box_is_valid(__isl_keep isl_fixed_box *box);
__isl_export
__isl_give isl_multi_aff *isl_fixed_box_get_offset(
__isl_keep isl_fixed_box *box);
__isl_export
__isl_give isl_multi_val *isl_fixed_box_get_size(__isl_keep isl_fixed_box *box);
__isl_give isl_fixed_box *isl_fixed_box_copy(__isl_keep isl_fixed_box *box);
__isl_null isl_fixed_box *isl_fixed_box_free(__isl_take isl_fixed_box *box);
__isl_give isl_printer *isl_printer_print_fixed_box(
__isl_take isl_printer *p, __isl_keep isl_fixed_box *box);
__isl_give char *isl_fixed_box_to_str(__isl_keep isl_fixed_box *box);
void isl_fixed_box_dump(__isl_keep isl_fixed_box *box);
#if defined(__cplusplus)
}
#endif

View File

@ -63,7 +63,7 @@ isl_stat isl_flow_foreach(__isl_keep isl_flow *deps,
void *user),
void *user);
__isl_give isl_map *isl_flow_get_no_source(__isl_keep isl_flow *deps, int must);
void isl_flow_free(__isl_take isl_flow *deps);
__isl_null isl_flow *isl_flow_free(__isl_take isl_flow *deps);
isl_ctx *isl_flow_get_ctx(__isl_keep isl_flow *deps);

View File

@ -59,11 +59,12 @@ void isl_hash_table_free(struct isl_ctx *ctx, struct isl_hash_table *table);
int isl_hash_table_init(struct isl_ctx *ctx, struct isl_hash_table *table,
int min_size);
void isl_hash_table_clear(struct isl_hash_table *table);
extern struct isl_hash_table_entry *isl_hash_table_entry_none;
struct isl_hash_table_entry *isl_hash_table_find(struct isl_ctx *ctx,
struct isl_hash_table *table,
uint32_t key_hash,
int (*eq)(const void *entry, const void *val),
const void *val, int reserve);
struct isl_hash_table *table,
uint32_t key_hash,
isl_bool (*eq)(const void *entry, const void *val),
const void *val, int reserve);
isl_stat isl_hash_table_foreach(isl_ctx *ctx, struct isl_hash_table *table,
isl_stat (*fn)(void **entry, void *user), void *user);
void isl_hash_table_remove(struct isl_ctx *ctx,

View File

@ -128,7 +128,7 @@ __isl_give ISL_HMAP *ISL_FN(ISL_HMAP,copy)(__isl_keep ISL_HMAP *hmap)
return hmap;
}
static int has_key(const void *entry, const void *c_key)
static isl_bool has_key(const void *entry, const void *c_key)
{
const ISL_S(pair) *pair = entry;
ISL_KEY *key = (ISL_KEY *) c_key;
@ -159,6 +159,8 @@ __isl_give ISL_MAYBE(ISL_VAL) ISL_FN(ISL_HMAP,try_get)(
&has_key, key, 0);
if (!entry)
goto error;
if (entry == isl_hash_table_entry_none)
return res;
pair = entry->data;
@ -221,7 +223,9 @@ __isl_give ISL_HMAP *ISL_FN(ISL_HMAP,drop)(__isl_take ISL_HMAP *hmap,
hash = ISL_FN(ISL_KEY,get_hash)(key);
entry = isl_hash_table_find(hmap->ctx, &hmap->table, hash,
&has_key, key, 0);
if (!entry) {
if (!entry)
goto error;
if (entry == isl_hash_table_entry_none) {
ISL_FN(ISL_KEY,free)(key);
return hmap;
}
@ -234,8 +238,10 @@ __isl_give ISL_HMAP *ISL_FN(ISL_HMAP,drop)(__isl_take ISL_HMAP *hmap,
ISL_FN(ISL_KEY,free)(key);
if (!entry)
return ISL_FN(ISL_HMAP,free)(hmap);
if (entry == isl_hash_table_entry_none)
isl_die(hmap->ctx, isl_error_internal,
"missing entry" , goto error);
"missing entry" , return ISL_FN(ISL_HMAP,free)(hmap));
pair = entry->data;
isl_hash_table_remove(hmap->ctx, &hmap->table, entry);
@ -269,8 +275,10 @@ __isl_give ISL_HMAP *ISL_FN(ISL_HMAP,set)(__isl_take ISL_HMAP *hmap,
hash = ISL_FN(ISL_KEY,get_hash)(key);
entry = isl_hash_table_find(hmap->ctx, &hmap->table, hash,
&has_key, key, 0);
if (entry) {
int equal;
if (!entry)
goto error;
if (entry != isl_hash_table_entry_none) {
isl_bool equal;
pair = entry->data;
equal = ISL_VAL_IS_EQUAL(pair->val, val);
if (equal < 0)

View File

@ -4,6 +4,7 @@
#include <isl/ctx.h>
#include <isl/id_type.h>
#include <isl/list.h>
#include <isl/multi.h>
#include <isl/printer_type.h>
#include <isl/stdint.h>
@ -11,7 +12,9 @@
extern "C" {
#endif
ISL_DECLARE_LIST_FN(id)
ISL_DECLARE_EXPORTED_LIST_FN(id)
ISL_DECLARE_MULTI(id)
isl_ctx *isl_id_get_ctx(__isl_keep isl_id *id);
uint32_t isl_id_get_hash(__isl_keep isl_id *id);
@ -22,16 +25,27 @@ __isl_give isl_id *isl_id_copy(isl_id *id);
__isl_null isl_id *isl_id_free(__isl_take isl_id *id);
void *isl_id_get_user(__isl_keep isl_id *id);
__isl_export
__isl_keep const char *isl_id_get_name(__isl_keep isl_id *id);
__isl_give isl_id *isl_id_set_free_user(__isl_take isl_id *id,
void (*free_user)(void *user));
__isl_constructor
__isl_give isl_id *isl_id_read_from_str(isl_ctx *ctx, const char *str);
__isl_give char *isl_id_to_str(__isl_keep isl_id *id);
__isl_give isl_printer *isl_printer_print_id(__isl_take isl_printer *p,
__isl_keep isl_id *id);
void isl_id_dump(__isl_keep isl_id *id);
__isl_constructor
__isl_give isl_multi_id *isl_multi_id_read_from_str(isl_ctx *ctx,
const char *str);
__isl_give isl_printer *isl_printer_print_multi_id(__isl_take isl_printer *p,
__isl_keep isl_multi_id *mi);
void isl_multi_id_dump(__isl_keep isl_multi_id *mi);
__isl_give char *isl_multi_id_to_str(__isl_keep isl_multi_id *mi);
#if defined(__cplusplus)
}
#endif

View File

@ -7,10 +7,13 @@
extern "C" {
#endif
struct isl_id;
struct __isl_export isl_id;
typedef struct isl_id isl_id;
ISL_DECLARE_LIST_TYPE(id)
ISL_DECLARE_EXPORTED_LIST_TYPE(id)
struct __isl_export isl_multi_id;
typedef struct isl_multi_id isl_multi_id;
#if defined(__cplusplus)
}

View File

@ -17,37 +17,50 @@
extern "C" {
#endif
#define ISL_DECLARE_LIST_TYPE(EL) \
#define ISL_DECLARE_LIST_TYPE2(EL,EXPORT) \
struct isl_##EL; \
struct isl_##EL##_list; \
struct EXPORT isl_##EL##_list; \
typedef struct isl_##EL##_list isl_##EL##_list;
#define ISL_DECLARE_LIST_FN(EL) \
#define ISL_DECLARE_LIST_TYPE(EL) \
ISL_DECLARE_LIST_TYPE2(EL,)
#define ISL_DECLARE_EXPORTED_LIST_TYPE(EL) \
ISL_DECLARE_LIST_TYPE2(EL,__isl_export)
#define ISL_DECLARE_LIST_FN3(EL,CONSTRUCTOR,EXPORT) \
isl_ctx *isl_##EL##_list_get_ctx(__isl_keep isl_##EL##_list *list); \
CONSTRUCTOR \
__isl_give isl_##EL##_list *isl_##EL##_list_from_##EL( \
__isl_take struct isl_##EL *el); \
__isl_take isl_##EL *el); \
CONSTRUCTOR \
__isl_give isl_##EL##_list *isl_##EL##_list_alloc(isl_ctx *ctx, int n); \
__isl_give isl_##EL##_list *isl_##EL##_list_copy( \
__isl_keep isl_##EL##_list *list); \
__isl_null isl_##EL##_list *isl_##EL##_list_free( \
__isl_take isl_##EL##_list *list); \
EXPORT \
__isl_give isl_##EL##_list *isl_##EL##_list_add( \
__isl_take isl_##EL##_list *list, \
__isl_take struct isl_##EL *el); \
__isl_take isl_##EL *el); \
__isl_give isl_##EL##_list *isl_##EL##_list_insert( \
__isl_take isl_##EL##_list *list, unsigned pos, \
__isl_take struct isl_##EL *el); \
__isl_give isl_##EL##_list *isl_##EL##_list_drop( \
__isl_take isl_##EL##_list *list, unsigned first, unsigned n); \
EXPORT \
__isl_give isl_##EL##_list *isl_##EL##_list_clear( \
__isl_take isl_##EL##_list *list); \
__isl_give isl_##EL##_list *isl_##EL##_list_swap( \
__isl_take isl_##EL##_list *list, unsigned pos1, \
unsigned pos2); \
__isl_give isl_##EL##_list *isl_##EL##_list_reverse( \
__isl_take isl_##EL##_list *list); \
EXPORT \
__isl_give isl_##EL##_list *isl_##EL##_list_concat( \
__isl_take isl_##EL##_list *list1, \
__isl_take isl_##EL##_list *list2); \
int isl_##EL##_list_size(__isl_keep isl_##EL##_list *list); \
int isl_##EL##_list_n_##EL(__isl_keep isl_##EL##_list *list); \
EXPORT \
isl_size isl_##EL##_list_size(__isl_keep isl_##EL##_list *list); \
isl_size isl_##EL##_list_n_##EL(__isl_keep isl_##EL##_list *list); \
EXPORT \
__isl_give isl_##EL *isl_##EL##_list_get_at( \
__isl_keep isl_##EL##_list *list, int index); \
__isl_give struct isl_##EL *isl_##EL##_list_get_##EL( \
@ -55,8 +68,9 @@ __isl_give struct isl_##EL *isl_##EL##_list_get_##EL( \
__isl_give struct isl_##EL##_list *isl_##EL##_list_set_##EL( \
__isl_take struct isl_##EL##_list *list, int index, \
__isl_take struct isl_##EL *el); \
EXPORT \
isl_stat isl_##EL##_list_foreach(__isl_keep isl_##EL##_list *list, \
isl_stat (*fn)(__isl_take struct isl_##EL *el, void *user), \
isl_stat (*fn)(__isl_take isl_##EL *el, void *user), \
void *user); \
__isl_give isl_##EL##_list *isl_##EL##_list_map( \
__isl_take isl_##EL##_list *list, \
@ -74,13 +88,22 @@ isl_stat isl_##EL##_list_foreach_scc(__isl_keep isl_##EL##_list *list, \
void *follows_user, \
isl_stat (*fn)(__isl_take isl_##EL##_list *scc, void *user), \
void *fn_user); \
__isl_give char *isl_##EL##_list_to_str( \
__isl_keep isl_##EL##_list *list); \
__isl_give isl_printer *isl_printer_print_##EL##_list( \
__isl_take isl_printer *p, __isl_keep isl_##EL##_list *list); \
void isl_##EL##_list_dump(__isl_keep isl_##EL##_list *list);
#define ISL_DECLARE_LIST_FN(EL) \
ISL_DECLARE_LIST_FN3(EL,,)
#define ISL_DECLARE_EXPORTED_LIST_FN(EL) \
ISL_DECLARE_LIST_FN3(EL,__isl_constructor,__isl_export)
#define ISL_DECLARE_LIST(EL) \
ISL_DECLARE_LIST_TYPE(EL) \
ISL_DECLARE_LIST_FN(EL)
#define ISL_DECLARE_EXPORTED_LIST(EL) \
ISL_DECLARE_EXPORTED_LIST_TYPE(EL) \
ISL_DECLARE_EXPORTED_LIST_FN(EL)
#if defined(__cplusplus)
}

View File

@ -29,7 +29,7 @@ __isl_give isl_local_space *isl_local_space_set_tuple_id(
__isl_take isl_local_space *ls,
enum isl_dim_type type, __isl_take isl_id *id);
int isl_local_space_dim(__isl_keep isl_local_space *ls,
isl_size isl_local_space_dim(__isl_keep isl_local_space *ls,
enum isl_dim_type type);
isl_bool isl_local_space_has_dim_name(__isl_keep isl_local_space *ls,
enum isl_dim_type type, unsigned pos);

View File

@ -30,29 +30,16 @@
extern "C" {
#endif
ISL_DEPRECATED
unsigned isl_basic_map_n_in(__isl_keep const isl_basic_map *bmap);
ISL_DEPRECATED
unsigned isl_basic_map_n_out(__isl_keep const isl_basic_map *bmap);
ISL_DEPRECATED
unsigned isl_basic_map_n_param(__isl_keep const isl_basic_map *bmap);
ISL_DEPRECATED
unsigned isl_basic_map_n_div(__isl_keep const isl_basic_map *bmap);
unsigned isl_basic_map_total_dim(__isl_keep const isl_basic_map *bmap);
unsigned isl_basic_map_dim(__isl_keep isl_basic_map *bmap,
isl_size isl_basic_map_total_dim(__isl_keep const isl_basic_map *bmap);
isl_size isl_basic_map_dim(__isl_keep isl_basic_map *bmap,
enum isl_dim_type type);
ISL_DEPRECATED
unsigned isl_map_n_in(__isl_keep const isl_map *map);
ISL_DEPRECATED
unsigned isl_map_n_out(__isl_keep const isl_map *map);
ISL_DEPRECATED
unsigned isl_map_n_param(__isl_keep const isl_map *map);
unsigned isl_map_dim(__isl_keep isl_map *map, enum isl_dim_type type);
isl_size isl_map_dim(__isl_keep isl_map *map, enum isl_dim_type type);
isl_ctx *isl_basic_map_get_ctx(__isl_keep isl_basic_map *bmap);
isl_ctx *isl_map_get_ctx(__isl_keep isl_map *map);
__isl_give isl_space *isl_basic_map_get_space(__isl_keep isl_basic_map *bmap);
__isl_export
__isl_give isl_space *isl_map_get_space(__isl_keep isl_map *map);
__isl_give isl_aff *isl_basic_map_get_div(__isl_keep isl_basic_map *bmap,
@ -112,18 +99,19 @@ int isl_map_find_dim_by_name(__isl_keep isl_map *map, enum isl_dim_type type,
isl_bool isl_basic_map_is_rational(__isl_keep isl_basic_map *bmap);
__isl_give isl_basic_map *isl_basic_map_identity(__isl_take isl_space *dim);
__isl_give isl_basic_map *isl_basic_map_identity(__isl_take isl_space *space);
__isl_null isl_basic_map *isl_basic_map_free(__isl_take isl_basic_map *bmap);
__isl_give isl_basic_map *isl_basic_map_copy(__isl_keep isl_basic_map *bmap);
__isl_give isl_basic_map *isl_basic_map_equal(
__isl_take isl_space *dim, unsigned n_equal);
__isl_give isl_basic_map *isl_basic_map_less_at(__isl_take isl_space *dim,
__isl_take isl_space *space, unsigned n_equal);
__isl_give isl_basic_map *isl_basic_map_less_at(__isl_take isl_space *space,
unsigned pos);
__isl_give isl_basic_map *isl_basic_map_more_at(__isl_take isl_space *dim,
__isl_give isl_basic_map *isl_basic_map_more_at(__isl_take isl_space *space,
unsigned pos);
__isl_give isl_basic_map *isl_basic_map_empty(__isl_take isl_space *space);
__isl_give isl_basic_map *isl_basic_map_universe(__isl_take isl_space *space);
__isl_give isl_basic_map *isl_basic_map_nat_universe(__isl_take isl_space *dim);
__isl_give isl_basic_map *isl_basic_map_nat_universe(
__isl_take isl_space *space);
__isl_give isl_basic_map *isl_basic_map_remove_redundancies(
__isl_take isl_basic_map *bmap);
__isl_give isl_map *isl_map_remove_redundancies(__isl_take isl_map *map);
@ -214,6 +202,18 @@ __isl_give isl_basic_map *isl_basic_map_lower_bound_si(
__isl_give isl_basic_map *isl_basic_map_upper_bound_si(
__isl_take isl_basic_map *bmap,
enum isl_dim_type type, unsigned pos, int value);
__isl_overload
__isl_give isl_map *isl_map_lower_bound_multi_val(__isl_take isl_map *map,
__isl_take isl_multi_val *lower);
__isl_overload
__isl_give isl_map *isl_map_upper_bound_multi_val(__isl_take isl_map *map,
__isl_take isl_multi_val *upper);
__isl_overload
__isl_give isl_map *isl_map_lower_bound_multi_pw_aff(__isl_take isl_map *map,
__isl_take isl_multi_pw_aff *lower);
__isl_overload
__isl_give isl_map *isl_map_upper_bound_multi_pw_aff(__isl_take isl_map *map,
__isl_take isl_multi_pw_aff *upper);
__isl_give isl_basic_map *isl_basic_map_sum(__isl_take isl_basic_map *bmap1,
__isl_take isl_basic_map *bmap2);
@ -259,8 +259,10 @@ __isl_give isl_pw_multi_aff *isl_basic_map_partial_lexmax_pw_multi_aff(
__isl_give isl_set **empty);
__isl_give isl_pw_multi_aff *isl_basic_map_lexmin_pw_multi_aff(
__isl_take isl_basic_map *bmap);
__isl_export
__isl_give isl_pw_multi_aff *isl_map_lexmin_pw_multi_aff(
__isl_take isl_map *map);
__isl_export
__isl_give isl_pw_multi_aff *isl_map_lexmax_pw_multi_aff(
__isl_take isl_map *map);
@ -283,8 +285,10 @@ isl_bool isl_basic_map_is_subset(__isl_keep isl_basic_map *bmap1,
isl_bool isl_basic_map_is_strict_subset(__isl_keep isl_basic_map *bmap1,
__isl_keep isl_basic_map *bmap2);
__isl_export
__isl_give isl_map *isl_map_universe(__isl_take isl_space *space);
__isl_give isl_map *isl_map_nat_universe(__isl_take isl_space *dim);
__isl_export
__isl_give isl_map *isl_map_empty(__isl_take isl_space *space);
__isl_give isl_map *isl_map_identity(__isl_take isl_space *dim);
__isl_give isl_map *isl_map_lex_lt_first(__isl_take isl_space *dim, unsigned n);
@ -300,6 +304,8 @@ __isl_give isl_map *isl_map_copy(__isl_keep isl_map *map);
__isl_export
__isl_give isl_map *isl_map_reverse(__isl_take isl_map *map);
__isl_export
__isl_give isl_map *isl_map_range_reverse(__isl_take isl_map *map);
__isl_export
__isl_give isl_map *isl_map_union(
__isl_take isl_map *map1,
__isl_take isl_map *map2);
@ -315,6 +321,8 @@ __isl_give isl_map *isl_map_intersect_range(
__isl_take isl_set *set);
__isl_give isl_map *isl_map_intersect_domain_factor_range(
__isl_take isl_map *map, __isl_take isl_map *factor);
__isl_give isl_map *isl_map_intersect_range_factor_domain(
__isl_take isl_map *map, __isl_take isl_map *factor);
__isl_give isl_map *isl_map_intersect_range_factor_range(
__isl_take isl_map *map, __isl_take isl_map *factor);
__isl_export
@ -325,14 +333,19 @@ __isl_export
__isl_give isl_map *isl_map_apply_range(
__isl_take isl_map *map1,
__isl_take isl_map *map2);
__isl_overload
__isl_give isl_map *isl_map_preimage_domain_multi_aff(__isl_take isl_map *map,
__isl_take isl_multi_aff *ma);
__isl_overload
__isl_give isl_map *isl_map_preimage_range_multi_aff(__isl_take isl_map *map,
__isl_take isl_multi_aff *ma);
__isl_overload
__isl_give isl_map *isl_map_preimage_domain_pw_multi_aff(
__isl_take isl_map *map, __isl_take isl_pw_multi_aff *pma);
__isl_overload
__isl_give isl_map *isl_map_preimage_range_pw_multi_aff(
__isl_take isl_map *map, __isl_take isl_pw_multi_aff *pma);
__isl_overload
__isl_give isl_map *isl_map_preimage_domain_multi_pw_aff(
__isl_take isl_map *map, __isl_take isl_multi_pw_aff *mpa);
__isl_give isl_basic_map *isl_basic_map_product(
@ -343,8 +356,10 @@ __isl_give isl_basic_map *isl_basic_map_domain_product(
__isl_take isl_basic_map *bmap1, __isl_take isl_basic_map *bmap2);
__isl_give isl_basic_map *isl_basic_map_range_product(
__isl_take isl_basic_map *bmap1, __isl_take isl_basic_map *bmap2);
__isl_export
__isl_give isl_map *isl_map_domain_product(__isl_take isl_map *map1,
__isl_take isl_map *map2);
__isl_export
__isl_give isl_map *isl_map_range_product(__isl_take isl_map *map1,
__isl_take isl_map *map2);
__isl_give isl_basic_map *isl_basic_map_flat_product(
@ -360,11 +375,17 @@ __isl_give isl_map *isl_map_flat_range_product(__isl_take isl_map *map1,
isl_bool isl_map_domain_is_wrapping(__isl_keep isl_map *map);
isl_bool isl_map_range_is_wrapping(__isl_keep isl_map *map);
isl_bool isl_map_is_product(__isl_keep isl_map *map);
__isl_export
__isl_give isl_map *isl_map_factor_domain(__isl_take isl_map *map);
__isl_export
__isl_give isl_map *isl_map_factor_range(__isl_take isl_map *map);
__isl_export
__isl_give isl_map *isl_map_domain_factor_domain(__isl_take isl_map *map);
__isl_export
__isl_give isl_map *isl_map_domain_factor_range(__isl_take isl_map *map);
__isl_export
__isl_give isl_map *isl_map_range_factor_domain(__isl_take isl_map *map);
__isl_export
__isl_give isl_map *isl_map_range_factor_range(__isl_take isl_map *map);
__isl_export
__isl_give isl_map *isl_map_intersect(__isl_take isl_map *map1,
@ -390,8 +411,12 @@ __isl_give isl_map *isl_map_fix_val(__isl_take isl_map *map,
enum isl_dim_type type, unsigned pos, __isl_take isl_val *v);
__isl_give isl_map *isl_map_lower_bound_si(__isl_take isl_map *map,
enum isl_dim_type type, unsigned pos, int value);
__isl_give isl_map *isl_map_lower_bound_val(__isl_take isl_map *map,
enum isl_dim_type type, unsigned pos, __isl_take isl_val *value);
__isl_give isl_map *isl_map_upper_bound_si(__isl_take isl_map *map,
enum isl_dim_type type, unsigned pos, int value);
__isl_give isl_map *isl_map_upper_bound_val(__isl_take isl_map *map,
enum isl_dim_type type, unsigned pos, __isl_take isl_val *value);
__isl_export
__isl_give isl_basic_set *isl_basic_map_deltas(__isl_take isl_basic_map *bmap);
__isl_export
@ -427,6 +452,8 @@ __isl_give isl_basic_map *isl_basic_map_project_out(
enum isl_dim_type type, unsigned first, unsigned n);
__isl_give isl_map *isl_map_project_out(__isl_take isl_map *map,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_export
__isl_give isl_map *isl_map_project_out_all_params(__isl_take isl_map *map);
__isl_give isl_basic_map *isl_basic_map_remove_divs(
__isl_take isl_basic_map *bmap);
__isl_give isl_map *isl_map_remove_unknown_divs(__isl_take isl_map *map);
@ -470,8 +497,10 @@ isl_bool isl_basic_set_is_wrapping(__isl_keep isl_basic_set *bset);
__isl_export
isl_bool isl_set_is_wrapping(__isl_keep isl_set *set);
__isl_give isl_basic_set *isl_basic_map_wrap(__isl_take isl_basic_map *bmap);
__isl_export
__isl_give isl_set *isl_map_wrap(__isl_take isl_map *map);
__isl_give isl_basic_map *isl_basic_set_unwrap(__isl_take isl_basic_set *bset);
__isl_export
__isl_give isl_map *isl_set_unwrap(__isl_take isl_set *set);
__isl_export
__isl_give isl_basic_map *isl_basic_map_flatten(__isl_take isl_basic_map *bmap);
@ -493,7 +522,9 @@ __isl_export
__isl_give isl_set *isl_set_flatten(__isl_take isl_set *set);
__isl_give isl_map *isl_set_flatten_map(__isl_take isl_set *set);
__isl_give isl_set *isl_map_params(__isl_take isl_map *map);
__isl_export
__isl_give isl_set *isl_map_domain(__isl_take isl_map *bmap);
__isl_export
__isl_give isl_set *isl_map_range(__isl_take isl_map *map);
__isl_give isl_map *isl_map_domain_map(__isl_take isl_map *map);
__isl_give isl_map *isl_map_range_map(__isl_take isl_map *map);
@ -513,6 +544,13 @@ __isl_give isl_map *isl_map_from_domain_and_range(__isl_take isl_set *domain,
__isl_export
__isl_give isl_basic_map *isl_map_sample(__isl_take isl_map *map);
__isl_export
__isl_give isl_set *isl_map_bind_domain(__isl_take isl_map *map,
__isl_take isl_multi_id *tuple);
__isl_export
__isl_give isl_set *isl_map_bind_range(__isl_take isl_map *map,
__isl_take isl_multi_id *tuple);
isl_bool isl_map_plain_is_empty(__isl_keep isl_map *map);
isl_bool isl_map_plain_is_universe(__isl_keep isl_map *map);
__isl_export
@ -549,6 +587,7 @@ __isl_give isl_map *isl_map_zip(__isl_take isl_map *map);
isl_bool isl_basic_map_can_curry(__isl_keep isl_basic_map *bmap);
isl_bool isl_map_can_curry(__isl_keep isl_map *map);
__isl_give isl_basic_map *isl_basic_map_curry(__isl_take isl_basic_map *bmap);
__isl_export
__isl_give isl_map *isl_map_curry(__isl_take isl_map *map);
isl_bool isl_map_can_range_curry(__isl_keep isl_map *map);
@ -557,6 +596,7 @@ __isl_give isl_map *isl_map_range_curry(__isl_take isl_map *map);
isl_bool isl_basic_map_can_uncurry(__isl_keep isl_basic_map *bmap);
isl_bool isl_map_can_uncurry(__isl_keep isl_map *map);
__isl_give isl_basic_map *isl_basic_map_uncurry(__isl_take isl_basic_map *bmap);
__isl_export
__isl_give isl_map *isl_map_uncurry(__isl_take isl_map *map);
__isl_give isl_map *isl_map_make_disjoint(__isl_take isl_map *map);
@ -608,6 +648,7 @@ __isl_give isl_map *isl_map_gist_basic_map(__isl_take isl_map *map,
__isl_give isl_stride_info *isl_map_get_range_stride_info(
__isl_keep isl_map *map, int pos);
__isl_export
__isl_give isl_fixed_box *isl_map_get_range_simple_fixed_box_hull(
__isl_keep isl_map *map);
@ -619,7 +660,7 @@ isl_bool isl_map_plain_is_equal(__isl_keep isl_map *map1,
uint32_t isl_map_get_hash(__isl_keep isl_map *map);
int isl_map_n_basic_map(__isl_keep isl_map *map);
isl_size isl_map_n_basic_map(__isl_keep isl_map *map);
__isl_export
isl_stat isl_map_foreach_basic_map(__isl_keep isl_map *map,
isl_stat (*fn)(__isl_take isl_basic_map *bmap, void *user), void *user);
@ -628,11 +669,11 @@ __isl_give isl_basic_map_list *isl_map_get_basic_map_list(
__isl_give isl_map *isl_map_fixed_power_val(__isl_take isl_map *map,
__isl_take isl_val *exp);
__isl_give isl_map *isl_map_power(__isl_take isl_map *map, int *exact);
__isl_give isl_map *isl_map_power(__isl_take isl_map *map, isl_bool *exact);
__isl_give isl_map *isl_map_reaching_path_lengths(__isl_take isl_map *map,
int *exact);
isl_bool *exact);
__isl_give isl_map *isl_map_transitive_closure(__isl_take isl_map *map,
int *exact);
isl_bool *exact);
__isl_give isl_map *isl_map_lex_le_map(__isl_take isl_map *map1,
__isl_take isl_map *map2);

View File

@ -33,8 +33,8 @@ struct isl_mat *isl_mat_identity(struct isl_ctx *ctx, unsigned n_row);
__isl_give isl_mat *isl_mat_copy(__isl_keep isl_mat *mat);
__isl_null isl_mat *isl_mat_free(__isl_take isl_mat *mat);
int isl_mat_rows(__isl_keep isl_mat *mat);
int isl_mat_cols(__isl_keep isl_mat *mat);
isl_size isl_mat_rows(__isl_keep isl_mat *mat);
isl_size isl_mat_cols(__isl_keep isl_mat *mat);
__isl_give isl_val *isl_mat_get_element_val(__isl_keep isl_mat *mat,
int row, int col);
__isl_give isl_mat *isl_mat_set_element_si(__isl_take isl_mat *mat,
@ -106,7 +106,7 @@ isl_bool isl_mat_is_equal(__isl_keep isl_mat *mat1, __isl_keep isl_mat *mat2);
isl_bool isl_mat_has_linearly_independent_rows(__isl_keep isl_mat *mat1,
__isl_keep isl_mat *mat2);
int isl_mat_rank(__isl_keep isl_mat *mat);
isl_size isl_mat_rank(__isl_keep isl_mat *mat);
int isl_mat_initial_non_zero_cols(__isl_keep isl_mat *mat);
void isl_mat_print_internal(__isl_keep isl_mat *mat, FILE *out, int indent);

View File

@ -11,63 +11,37 @@ extern "C" {
#endif
#define ISL_DECLARE_MULTI(BASE) \
unsigned isl_multi_##BASE##_dim(__isl_keep isl_multi_##BASE *multi, \
enum isl_dim_type type); \
isl_ctx *isl_multi_##BASE##_get_ctx( \
__isl_keep isl_multi_##BASE *multi); \
__isl_export \
__isl_give isl_space *isl_multi_##BASE##_get_space( \
__isl_keep isl_multi_##BASE *multi); \
__isl_give isl_space *isl_multi_##BASE##_get_domain_space( \
__isl_keep isl_multi_##BASE *multi); \
int isl_multi_##BASE##_find_dim_by_name( \
__isl_keep isl_multi_##BASE *multi, \
enum isl_dim_type type, const char *name); \
__isl_constructor \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_from_##BASE##_list( \
__isl_take isl_space *space, __isl_take isl_##BASE##_list *list); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_zero( \
__isl_take isl_space *space); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_copy( \
__isl_keep isl_multi_##BASE *multi); \
__isl_null isl_multi_##BASE *isl_multi_##BASE##_free( \
__isl_take isl_multi_##BASE *multi); \
__isl_export \
isl_bool isl_multi_##BASE##_plain_is_equal( \
__isl_keep isl_multi_##BASE *multi1, \
__isl_keep isl_multi_##BASE *multi2); \
isl_bool isl_multi_##BASE##_involves_nan( \
__isl_keep isl_multi_##BASE *multi); \
int isl_multi_##BASE##_find_dim_by_id( \
__isl_keep isl_multi_##BASE *multi, enum isl_dim_type type, \
__isl_keep isl_id *id); \
__isl_give isl_id *isl_multi_##BASE##_get_dim_id( \
__isl_keep isl_multi_##BASE *multi, \
enum isl_dim_type type, unsigned pos); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_dim_name( \
__isl_take isl_multi_##BASE *multi, \
enum isl_dim_type type, unsigned pos, const char *s); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_dim_id( \
__isl_take isl_multi_##BASE *multi, \
enum isl_dim_type type, unsigned pos, __isl_take isl_id *id); \
const char *isl_multi_##BASE##_get_tuple_name( \
__isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \
isl_bool isl_multi_##BASE##_has_tuple_id( \
__isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \
__isl_give isl_id *isl_multi_##BASE##_get_tuple_id( \
__isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_tuple_name( \
__isl_take isl_multi_##BASE *multi, \
enum isl_dim_type type, const char *s); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_tuple_id( \
__isl_take isl_multi_##BASE *multi, \
enum isl_dim_type type, __isl_take isl_id *id); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_reset_tuple_id( \
__isl_take isl_multi_##BASE *multi, enum isl_dim_type type); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_reset_user( \
__isl_take isl_multi_##BASE *multi); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_drop_dims( \
__isl_take isl_multi_##BASE *multi, enum isl_dim_type type, \
unsigned first, unsigned n); \
__isl_export \
isl_size isl_multi_##BASE##_size(__isl_keep isl_multi_##BASE *multi); \
__isl_export \
__isl_give isl_##BASE *isl_multi_##BASE##_get_at( \
__isl_keep isl_multi_##BASE *multi, int pos); \
__isl_give isl_##BASE *isl_multi_##BASE##_get_##BASE( \
__isl_keep isl_multi_##BASE *multi, int pos); \
__isl_export \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_at( \
__isl_take isl_multi_##BASE *multi, int pos, \
__isl_take isl_##BASE *el); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_##BASE( \
__isl_take isl_multi_##BASE *multi, int pos, \
__isl_take isl_##BASE *el); \
@ -92,13 +66,39 @@ __isl_give isl_multi_##BASE *isl_multi_##BASE##_range_factor_domain( \
__isl_take isl_multi_##BASE *multi); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_range_factor_range( \
__isl_take isl_multi_##BASE *multi); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_align_params( \
__isl_take isl_multi_##BASE *multi, \
__isl_take isl_space *model); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_from_range( \
__isl_take isl_multi_##BASE *multi);
#define ISL_DECLARE_MULTI_IDENTITY(BASE) \
__isl_overload \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_identity_multi_##BASE( \
__isl_take isl_multi_##BASE *multi); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_identity( \
__isl_take isl_space *space); \
__isl_overload \
__isl_give isl_multi_##BASE * \
isl_multi_##BASE##_identity_on_domain_space( \
__isl_take isl_space *space);
#define ISL_DECLARE_MULTI_CMP(BASE) \
int isl_multi_##BASE##_plain_cmp(__isl_keep isl_multi_##BASE *multi1, \
__isl_keep isl_multi_##BASE *multi2);
#define ISL_DECLARE_MULTI_ARITH(BASE) \
__isl_overload \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_scale_val( \
__isl_take isl_multi_##BASE *multi, __isl_take isl_val *v); \
__isl_overload \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_scale_down_val( \
__isl_take isl_multi_##BASE *multi, __isl_take isl_val *v); \
__isl_overload \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_scale_multi_val( \
__isl_take isl_multi_##BASE *multi, \
__isl_take isl_multi_val *mv); \
__isl_overload \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_scale_down_multi_val( \
__isl_take isl_multi_##BASE *multi, \
__isl_take isl_multi_val *mv); \
@ -109,24 +109,39 @@ __isl_export \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_add( \
__isl_take isl_multi_##BASE *multi1, \
__isl_take isl_multi_##BASE *multi2); \
__isl_export \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_sub( \
__isl_take isl_multi_##BASE *multi1, \
__isl_take isl_multi_##BASE *multi2); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_align_params( \
__isl_take isl_multi_##BASE *multi, \
__isl_take isl_space *model); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_from_range( \
__isl_take isl_multi_##BASE *multi);
#define ISL_DECLARE_MULTI_CMP(BASE) \
int isl_multi_##BASE##_plain_cmp(__isl_keep isl_multi_##BASE *multi1, \
__isl_keep isl_multi_##BASE *multi2);
#define ISL_DECLARE_MULTI_NEG(BASE) \
__isl_export \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_neg( \
__isl_take isl_multi_##BASE *multi);
#define ISL_DECLARE_MULTI_ADD_CONSTANT(BASE) \
__isl_overload \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_add_constant_val( \
__isl_take isl_multi_##BASE *mpa, __isl_take isl_val *v); \
__isl_overload \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_add_constant_multi_val( \
__isl_take isl_multi_##BASE *mpa, __isl_take isl_multi_val *mv);
#define ISL_DECLARE_MULTI_ZERO(BASE) \
__isl_export \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_zero( \
__isl_take isl_space *space);
#define ISL_DECLARE_MULTI_NAN(BASE) \
isl_bool isl_multi_##BASE##_involves_nan( \
__isl_keep isl_multi_##BASE *multi);
#define ISL_DECLARE_MULTI_DROP_DIMS(BASE) \
isl_size isl_multi_##BASE##_dim(__isl_keep isl_multi_##BASE *multi, \
enum isl_dim_type type); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_drop_dims( \
__isl_take isl_multi_##BASE *multi, enum isl_dim_type type, \
unsigned first, unsigned n);
#define ISL_DECLARE_MULTI_DIMS(BASE) \
ISL_DECLARE_MULTI_DROP_DIMS(BASE) \
isl_bool isl_multi_##BASE##_involves_dims( \
__isl_keep isl_multi_##BASE *multi, enum isl_dim_type type, \
unsigned first, unsigned n); \
@ -140,6 +155,44 @@ __isl_give isl_multi_##BASE * \
isl_multi_##BASE##_project_domain_on_params( \
__isl_take isl_multi_##BASE *multi);
#define ISL_DECLARE_MULTI_LOCALS(BASE) \
__isl_export \
isl_bool isl_multi_##BASE##_involves_locals( \
__isl_keep isl_multi_##BASE *multi);
#define ISL_DECLARE_MULTI_DIM_ID(BASE) \
int isl_multi_##BASE##_find_dim_by_name( \
__isl_keep isl_multi_##BASE *multi, \
enum isl_dim_type type, const char *name); \
int isl_multi_##BASE##_find_dim_by_id( \
__isl_keep isl_multi_##BASE *multi, enum isl_dim_type type, \
__isl_keep isl_id *id); \
__isl_give isl_id *isl_multi_##BASE##_get_dim_id( \
__isl_keep isl_multi_##BASE *multi, \
enum isl_dim_type type, unsigned pos); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_dim_name( \
__isl_take isl_multi_##BASE *multi, \
enum isl_dim_type type, unsigned pos, const char *s); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_dim_id( \
__isl_take isl_multi_##BASE *multi, \
enum isl_dim_type type, unsigned pos, __isl_take isl_id *id);
#define ISL_DECLARE_MULTI_TUPLE_ID(BASE) \
const char *isl_multi_##BASE##_get_tuple_name( \
__isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \
isl_bool isl_multi_##BASE##_has_tuple_id( \
__isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \
__isl_give isl_id *isl_multi_##BASE##_get_tuple_id( \
__isl_keep isl_multi_##BASE *multi, enum isl_dim_type type); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_tuple_name( \
__isl_take isl_multi_##BASE *multi, \
enum isl_dim_type type, const char *s); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_set_tuple_id( \
__isl_take isl_multi_##BASE *multi, \
enum isl_dim_type type, __isl_take isl_id *id); \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_reset_tuple_id( \
__isl_take isl_multi_##BASE *multi, enum isl_dim_type type);
#define ISL_DECLARE_MULTI_WITH_DOMAIN(BASE) \
__isl_export \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_product( \
@ -149,6 +202,26 @@ __isl_give isl_multi_##BASE *isl_multi_##BASE##_splice( \
__isl_take isl_multi_##BASE *multi1, unsigned in_pos, \
unsigned out_pos, __isl_take isl_multi_##BASE *multi2);
#define ISL_DECLARE_MULTI_BIND_DOMAIN(BASE) \
__isl_export \
__isl_give isl_multi_##BASE *isl_multi_##BASE##_bind_domain( \
__isl_take isl_multi_##BASE *multi, \
__isl_take isl_multi_id *tuple); \
__isl_export \
__isl_give isl_multi_##BASE * \
isl_multi_##BASE##_bind_domain_wrapped_domain( \
__isl_take isl_multi_##BASE *multi, \
__isl_take isl_multi_id *tuple);
#define ISL_DECLARE_MULTI_PARAM(BASE) \
__isl_overload \
isl_bool isl_multi_##BASE##_involves_param_id( \
__isl_keep isl_multi_##BASE *multi, __isl_keep isl_id *id); \
__isl_overload \
isl_bool isl_multi_##BASE##_involves_param_id_list( \
__isl_keep isl_multi_##BASE *multi, \
__isl_keep isl_id_list *list);
#if defined(__cplusplus)
}
#endif

View File

@ -15,7 +15,7 @@ typedef struct isl_point isl_point;
isl_ctx *isl_point_get_ctx(__isl_keep isl_point *pnt);
__isl_give isl_space *isl_point_get_space(__isl_keep isl_point *pnt);
__isl_give isl_point *isl_point_zero(__isl_take isl_space *dim);
__isl_give isl_point *isl_point_zero(__isl_take isl_space *space);
__isl_give isl_point *isl_point_copy(__isl_keep isl_point *pnt);
__isl_null isl_point *isl_point_free(__isl_take isl_point *pnt);
@ -23,13 +23,15 @@ __isl_give isl_val *isl_point_get_coordinate_val(__isl_keep isl_point *pnt,
enum isl_dim_type type, int pos);
__isl_give isl_point *isl_point_set_coordinate_val(__isl_take isl_point *pnt,
enum isl_dim_type type, int pos, __isl_take isl_val *v);
__isl_export
__isl_give isl_multi_val *isl_point_get_multi_val(__isl_keep isl_point *pnt);
__isl_give isl_point *isl_point_add_ui(__isl_take isl_point *pnt,
enum isl_dim_type type, int pos, unsigned val);
__isl_give isl_point *isl_point_sub_ui(__isl_take isl_point *pnt,
enum isl_dim_type type, int pos, unsigned val);
__isl_give isl_point *isl_point_void(__isl_take isl_space *dim);
__isl_give isl_point *isl_point_void(__isl_take isl_space *space);
isl_bool isl_point_is_void(__isl_keep isl_point *pnt);
__isl_give isl_printer *isl_printer_print_point(

View File

@ -20,7 +20,7 @@ isl_ctx *isl_qpolynomial_get_ctx(__isl_keep isl_qpolynomial *qp);
__isl_give isl_space *isl_qpolynomial_get_domain_space(
__isl_keep isl_qpolynomial *qp);
__isl_give isl_space *isl_qpolynomial_get_space(__isl_keep isl_qpolynomial *qp);
unsigned isl_qpolynomial_dim(__isl_keep isl_qpolynomial *qp,
isl_size isl_qpolynomial_dim(__isl_keep isl_qpolynomial *qp,
enum isl_dim_type type);
isl_bool isl_qpolynomial_involves_dims(__isl_keep isl_qpolynomial *qp,
enum isl_dim_type type, unsigned first, unsigned n);
@ -32,14 +32,20 @@ __isl_give isl_qpolynomial *isl_qpolynomial_set_dim_name(
__isl_take isl_qpolynomial *qp,
enum isl_dim_type type, unsigned pos, const char *s);
__isl_give isl_qpolynomial *isl_qpolynomial_zero_on_domain(__isl_take isl_space *dim);
__isl_give isl_qpolynomial *isl_qpolynomial_one_on_domain(__isl_take isl_space *dim);
__isl_give isl_qpolynomial *isl_qpolynomial_infty_on_domain(__isl_take isl_space *dim);
__isl_give isl_qpolynomial *isl_qpolynomial_neginfty_on_domain(__isl_take isl_space *dim);
__isl_give isl_qpolynomial *isl_qpolynomial_nan_on_domain(__isl_take isl_space *dim);
__isl_give isl_qpolynomial *isl_qpolynomial_zero_on_domain(
__isl_take isl_space *domain);
__isl_give isl_qpolynomial *isl_qpolynomial_one_on_domain(
__isl_take isl_space *domain);
__isl_give isl_qpolynomial *isl_qpolynomial_infty_on_domain(
__isl_take isl_space *domain);
__isl_give isl_qpolynomial *isl_qpolynomial_neginfty_on_domain(
__isl_take isl_space *domain);
__isl_give isl_qpolynomial *isl_qpolynomial_nan_on_domain(
__isl_take isl_space *domain);
__isl_give isl_qpolynomial *isl_qpolynomial_val_on_domain(
__isl_take isl_space *space, __isl_take isl_val *val);
__isl_give isl_qpolynomial *isl_qpolynomial_var_on_domain(__isl_take isl_space *dim,
__isl_give isl_qpolynomial *isl_qpolynomial_var_on_domain(
__isl_take isl_space *domain,
enum isl_dim_type type, unsigned pos);
__isl_give isl_qpolynomial *isl_qpolynomial_copy(__isl_keep isl_qpolynomial *qp);
__isl_null isl_qpolynomial *isl_qpolynomial_free(
@ -101,11 +107,11 @@ __isl_give isl_qpolynomial *isl_qpolynomial_align_params(
isl_ctx *isl_term_get_ctx(__isl_keep isl_term *term);
__isl_give isl_term *isl_term_copy(__isl_keep isl_term *term);
void isl_term_free(__isl_take isl_term *term);
__isl_null isl_term *isl_term_free(__isl_take isl_term *term);
unsigned isl_term_dim(__isl_keep isl_term *term, enum isl_dim_type type);
isl_size isl_term_dim(__isl_keep isl_term *term, enum isl_dim_type type);
__isl_give isl_val *isl_term_get_coefficient_val(__isl_keep isl_term *term);
int isl_term_get_exp(__isl_keep isl_term *term,
isl_size isl_term_get_exp(__isl_keep isl_term *term,
enum isl_dim_type type, unsigned pos);
__isl_give isl_aff *isl_term_get_div(__isl_keep isl_term *term, unsigned pos);
@ -139,7 +145,8 @@ isl_bool isl_pw_qpolynomial_involves_nan(__isl_keep isl_pw_qpolynomial *pwqp);
isl_bool isl_pw_qpolynomial_plain_is_equal(__isl_keep isl_pw_qpolynomial *pwqp1,
__isl_keep isl_pw_qpolynomial *pwqp2);
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_zero(__isl_take isl_space *dim);
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_zero(
__isl_take isl_space *space);
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_alloc(__isl_take isl_set *set,
__isl_take isl_qpolynomial *qp);
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_from_qpolynomial(
@ -157,8 +164,10 @@ __isl_give isl_space *isl_pw_qpolynomial_get_space(
__isl_keep isl_pw_qpolynomial *pwqp);
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_reset_domain_space(
__isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_space *dim);
unsigned isl_pw_qpolynomial_dim(__isl_keep isl_pw_qpolynomial *pwqp,
isl_size isl_pw_qpolynomial_dim(__isl_keep isl_pw_qpolynomial *pwqp,
enum isl_dim_type type);
isl_bool isl_pw_qpolynomial_involves_param_id(
__isl_keep isl_pw_qpolynomial *pwqp, __isl_keep isl_id *id);
isl_bool isl_pw_qpolynomial_involves_dims(__isl_keep isl_pw_qpolynomial *pwqp,
enum isl_dim_type type, unsigned first, unsigned n);
isl_bool isl_pw_qpolynomial_has_equal_space(
@ -179,6 +188,12 @@ __isl_export
__isl_give isl_set *isl_pw_qpolynomial_domain(__isl_take isl_pw_qpolynomial *pwqp);
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_intersect_domain(
__isl_take isl_pw_qpolynomial *pwpq, __isl_take isl_set *set);
__isl_give isl_pw_qpolynomial *
isl_pw_qpolynomial_intersect_domain_wrapped_domain(
__isl_take isl_pw_qpolynomial *pwpq, __isl_take isl_set *set);
__isl_give isl_pw_qpolynomial *
isl_pw_qpolynomial_intersect_domain_wrapped_range(
__isl_take isl_pw_qpolynomial *pwpq, __isl_take isl_set *set);
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_intersect_params(
__isl_take isl_pw_qpolynomial *pwpq, __isl_take isl_set *set);
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_subtract_domain(
@ -241,7 +256,7 @@ __isl_give isl_val *isl_pw_qpolynomial_eval(
__isl_give isl_val *isl_pw_qpolynomial_max(__isl_take isl_pw_qpolynomial *pwqp);
__isl_give isl_val *isl_pw_qpolynomial_min(__isl_take isl_pw_qpolynomial *pwqp);
int isl_pw_qpolynomial_n_piece(__isl_keep isl_pw_qpolynomial *pwqp);
isl_size isl_pw_qpolynomial_n_piece(__isl_keep isl_pw_qpolynomial *pwqp);
isl_stat isl_pw_qpolynomial_foreach_piece(__isl_keep isl_pw_qpolynomial *pwqp,
isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp,
void *user), void *user);
@ -249,6 +264,10 @@ isl_stat isl_pw_qpolynomial_foreach_lifted_piece(
__isl_keep isl_pw_qpolynomial *pwqp,
isl_stat (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp,
void *user), void *user);
isl_bool isl_pw_qpolynomial_isa_qpolynomial(
__isl_keep isl_pw_qpolynomial *pwqp);
__isl_give isl_qpolynomial *isl_pw_qpolynomial_as_qpolynomial(
__isl_take isl_pw_qpolynomial *pwqp);
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_from_pw_aff(
__isl_take isl_pw_aff *pwaff);
@ -288,9 +307,10 @@ __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_alloc(
enum isl_fold type, __isl_take isl_qpolynomial *qp);
__isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_copy(
__isl_keep isl_qpolynomial_fold *fold);
void isl_qpolynomial_fold_free(__isl_take isl_qpolynomial_fold *fold);
__isl_null isl_qpolynomial_fold *isl_qpolynomial_fold_free(
__isl_take isl_qpolynomial_fold *fold);
int isl_qpolynomial_fold_is_empty(__isl_keep isl_qpolynomial_fold *fold);
isl_bool isl_qpolynomial_fold_is_empty(__isl_keep isl_qpolynomial_fold *fold);
isl_bool isl_qpolynomial_fold_is_nan(__isl_keep isl_qpolynomial_fold *fold);
int isl_qpolynomial_fold_plain_is_equal(__isl_keep isl_qpolynomial_fold *fold1,
__isl_keep isl_qpolynomial_fold *fold2);
@ -342,6 +362,8 @@ void isl_qpolynomial_fold_print(__isl_keep isl_qpolynomial_fold *fold, FILE *out
void isl_qpolynomial_fold_dump(__isl_keep isl_qpolynomial_fold *fold);
isl_ctx *isl_pw_qpolynomial_fold_get_ctx(__isl_keep isl_pw_qpolynomial_fold *pwf);
enum isl_fold isl_pw_qpolynomial_fold_get_type(
__isl_keep isl_pw_qpolynomial_fold *pwf);
isl_bool isl_pw_qpolynomial_fold_involves_nan(
__isl_keep isl_pw_qpolynomial_fold *pwf);
@ -355,6 +377,9 @@ __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_from_pw_qpolynomial(
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_alloc(
enum isl_fold type,
__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold);
__isl_give isl_pw_qpolynomial_fold *
isl_pw_qpolynomial_fold_from_qpolynomial_fold(
__isl_take isl_qpolynomial_fold *fold);
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_copy(
__isl_keep isl_pw_qpolynomial_fold *pwf);
__isl_null isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_free(
@ -369,8 +394,10 @@ __isl_give isl_space *isl_pw_qpolynomial_fold_get_space(
__isl_keep isl_pw_qpolynomial_fold *pwf);
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_reset_space(
__isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_space *dim);
unsigned isl_pw_qpolynomial_fold_dim(__isl_keep isl_pw_qpolynomial_fold *pwf,
isl_size isl_pw_qpolynomial_fold_dim(__isl_keep isl_pw_qpolynomial_fold *pwf,
enum isl_dim_type type);
isl_bool isl_pw_qpolynomial_fold_involves_param_id(
__isl_keep isl_pw_qpolynomial_fold *pwf, __isl_keep isl_id *id);
isl_bool isl_pw_qpolynomial_fold_has_equal_space(
__isl_keep isl_pw_qpolynomial_fold *pwf1,
__isl_keep isl_pw_qpolynomial_fold *pwf2);
@ -378,7 +405,7 @@ isl_bool isl_pw_qpolynomial_fold_has_equal_space(
size_t isl_pw_qpolynomial_fold_size(__isl_keep isl_pw_qpolynomial_fold *pwf);
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_zero(
__isl_take isl_space *dim, enum isl_fold type);
__isl_take isl_space *space, enum isl_fold type);
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_set_dim_name(
__isl_take isl_pw_qpolynomial_fold *pwf,
@ -395,6 +422,12 @@ __isl_give isl_set *isl_pw_qpolynomial_fold_domain(
__isl_take isl_pw_qpolynomial_fold *pwf);
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_intersect_domain(
__isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *set);
__isl_give isl_pw_qpolynomial_fold *
isl_pw_qpolynomial_fold_intersect_domain_wrapped_domain(
__isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *set);
__isl_give isl_pw_qpolynomial_fold *
isl_pw_qpolynomial_fold_intersect_domain_wrapped_range(
__isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *set);
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_intersect_params(
__isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *set);
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_subtract_domain(
@ -432,7 +465,8 @@ __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_drop_unused_params(
__isl_give isl_val *isl_pw_qpolynomial_fold_eval(
__isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_point *pnt);
int isl_pw_qpolynomial_fold_n_piece(__isl_keep isl_pw_qpolynomial_fold *pwf);
isl_size isl_pw_qpolynomial_fold_n_piece(
__isl_keep isl_pw_qpolynomial_fold *pwf);
isl_stat isl_pw_qpolynomial_fold_foreach_piece(
__isl_keep isl_pw_qpolynomial_fold *pwf,
isl_stat (*fn)(__isl_take isl_set *set,
@ -441,6 +475,10 @@ isl_stat isl_pw_qpolynomial_fold_foreach_lifted_piece(
__isl_keep isl_pw_qpolynomial_fold *pwf,
isl_stat (*fn)(__isl_take isl_set *set,
__isl_take isl_qpolynomial_fold *fold, void *user), void *user);
isl_bool isl_pw_qpolynomial_fold_isa_qpolynomial_fold(
__isl_keep isl_pw_qpolynomial_fold *pwf);
__isl_give isl_qpolynomial_fold *isl_pw_qpolynomial_fold_as_qpolynomial_fold(
__isl_take isl_pw_qpolynomial_fold *pwf);
__isl_give isl_printer *isl_printer_print_pw_qpolynomial_fold(
__isl_take isl_printer *p, __isl_keep isl_pw_qpolynomial_fold *pwf);
@ -461,15 +499,16 @@ __isl_give isl_val *isl_pw_qpolynomial_fold_min(
__isl_take isl_pw_qpolynomial_fold *pwf);
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_bound(
__isl_take isl_pw_qpolynomial *pwqp, enum isl_fold type, int *tight);
__isl_take isl_pw_qpolynomial *pwqp, enum isl_fold type,
isl_bool *tight);
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_bound(
__isl_take isl_pw_qpolynomial_fold *pwf, int *tight);
__isl_take isl_pw_qpolynomial_fold *pwf, isl_bool *tight);
__isl_give isl_pw_qpolynomial_fold *isl_set_apply_pw_qpolynomial_fold(
__isl_take isl_set *set, __isl_take isl_pw_qpolynomial_fold *pwf,
int *tight);
isl_bool *tight);
__isl_give isl_pw_qpolynomial_fold *isl_map_apply_pw_qpolynomial_fold(
__isl_take isl_map *map, __isl_take isl_pw_qpolynomial_fold *pwf,
int *tight);
isl_bool *tight);
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_to_polynomial(
__isl_take isl_pw_qpolynomial *pwqp, int sign);
@ -477,7 +516,7 @@ __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_to_polynomial(
isl_ctx *isl_union_pw_qpolynomial_get_ctx(
__isl_keep isl_union_pw_qpolynomial *upwqp);
unsigned isl_union_pw_qpolynomial_dim(
isl_size isl_union_pw_qpolynomial_dim(
__isl_keep isl_union_pw_qpolynomial *upwqp, enum isl_dim_type type);
isl_bool isl_union_pw_qpolynomial_involves_nan(
@ -487,8 +526,12 @@ isl_bool isl_union_pw_qpolynomial_plain_is_equal(
__isl_keep isl_union_pw_qpolynomial *upwqp2);
__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_from_pw_qpolynomial(__isl_take isl_pw_qpolynomial *pwqp);
__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_zero_ctx(
isl_ctx *ctx);
__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_zero_space(
__isl_take isl_space *space);
__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_zero(
__isl_take isl_space *dim);
__isl_take isl_space *space);
__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_add_pw_qpolynomial(
__isl_take isl_union_pw_qpolynomial *upwqp,
__isl_take isl_pw_qpolynomial *pwqp);
@ -526,6 +569,14 @@ __isl_give isl_union_set *isl_union_pw_qpolynomial_domain(
__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_intersect_domain(
__isl_take isl_union_pw_qpolynomial *upwpq,
__isl_take isl_union_set *uset);
__isl_give isl_union_pw_qpolynomial *
isl_union_pw_qpolynomial_intersect_domain_wrapped_domain(
__isl_take isl_union_pw_qpolynomial *upwpq,
__isl_take isl_union_set *uset);
__isl_give isl_union_pw_qpolynomial *
isl_union_pw_qpolynomial_intersect_domain_wrapped_range(
__isl_take isl_union_pw_qpolynomial *upwpq,
__isl_take isl_union_set *uset);
__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_intersect_params(
__isl_take isl_union_pw_qpolynomial *upwpq,
__isl_take isl_set *set);
@ -570,7 +621,7 @@ __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_align_params(
__isl_take isl_union_pw_qpolynomial *upwqp,
__isl_take isl_space *model);
int isl_union_pw_qpolynomial_n_pw_qpolynomial(
isl_size isl_union_pw_qpolynomial_n_pw_qpolynomial(
__isl_keep isl_union_pw_qpolynomial *upwqp);
isl_stat isl_union_pw_qpolynomial_foreach_pw_qpolynomial(
__isl_keep isl_union_pw_qpolynomial *upwqp,
@ -585,7 +636,7 @@ __isl_give isl_printer *isl_printer_print_union_pw_qpolynomial(
isl_ctx *isl_union_pw_qpolynomial_fold_get_ctx(
__isl_keep isl_union_pw_qpolynomial_fold *upwf);
unsigned isl_union_pw_qpolynomial_fold_dim(
isl_size isl_union_pw_qpolynomial_fold_dim(
__isl_keep isl_union_pw_qpolynomial_fold *upwf, enum isl_dim_type type);
isl_bool isl_union_pw_qpolynomial_fold_involves_nan(
@ -595,8 +646,13 @@ isl_bool isl_union_pw_qpolynomial_fold_plain_is_equal(
__isl_keep isl_union_pw_qpolynomial_fold *upwf2);
__isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_from_pw_qpolynomial_fold(__isl_take isl_pw_qpolynomial_fold *pwf);
__isl_give isl_union_pw_qpolynomial_fold *
isl_union_pw_qpolynomial_fold_zero_ctx(isl_ctx *ctx, enum isl_fold type);
__isl_give isl_union_pw_qpolynomial_fold *
isl_union_pw_qpolynomial_fold_zero_space(__isl_take isl_space *space,
enum isl_fold type);
__isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_zero(
__isl_take isl_space *dim, enum isl_fold type);
__isl_take isl_space *space, enum isl_fold type);
__isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_fold_pw_qpolynomial_fold(
__isl_take isl_union_pw_qpolynomial_fold *upwqp,
__isl_take isl_pw_qpolynomial_fold *pwqp);
@ -624,6 +680,14 @@ __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_intersec
__isl_take isl_union_pw_qpolynomial_fold *upwf,
__isl_take isl_union_set *uset);
__isl_give isl_union_pw_qpolynomial_fold *
isl_union_pw_qpolynomial_fold_intersect_domain_wrapped_domain(
__isl_take isl_union_pw_qpolynomial_fold *upwf,
__isl_take isl_union_set *uset);
__isl_give isl_union_pw_qpolynomial_fold *
isl_union_pw_qpolynomial_fold_intersect_domain_wrapped_range(
__isl_take isl_union_pw_qpolynomial_fold *upwf,
__isl_take isl_union_set *uset);
__isl_give isl_union_pw_qpolynomial_fold *
isl_union_pw_qpolynomial_fold_intersect_params(
__isl_take isl_union_pw_qpolynomial_fold *upwf,
__isl_take isl_set *set);
@ -675,7 +739,7 @@ __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_align_pa
__isl_take isl_union_pw_qpolynomial_fold *upwf,
__isl_take isl_space *model);
int isl_union_pw_qpolynomial_fold_n_pw_qpolynomial_fold(
isl_size isl_union_pw_qpolynomial_fold_n_pw_qpolynomial_fold(
__isl_keep isl_union_pw_qpolynomial_fold *upwf);
isl_stat isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold(
__isl_keep isl_union_pw_qpolynomial_fold *upwf,
@ -690,13 +754,13 @@ __isl_give isl_printer *isl_printer_print_union_pw_qpolynomial_fold(
__isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_bound(
__isl_take isl_union_pw_qpolynomial *upwqp,
enum isl_fold type, int *tight);
enum isl_fold type, isl_bool *tight);
__isl_give isl_union_pw_qpolynomial_fold *isl_union_set_apply_union_pw_qpolynomial_fold(
__isl_take isl_union_set *uset,
__isl_take isl_union_pw_qpolynomial_fold *upwf, int *tight);
__isl_take isl_union_pw_qpolynomial_fold *upwf, isl_bool *tight);
__isl_give isl_union_pw_qpolynomial_fold *isl_union_map_apply_union_pw_qpolynomial_fold(
__isl_take isl_union_map *umap,
__isl_take isl_union_pw_qpolynomial_fold *upwf, int *tight);
__isl_take isl_union_pw_qpolynomial_fold *upwf, isl_bool *tight);
__isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_to_polynomial(
__isl_take isl_union_pw_qpolynomial *upwqp, int sign);

View File

@ -13,6 +13,7 @@ typedef struct isl_pw_qpolynomial isl_pw_qpolynomial;
ISL_DECLARE_LIST_TYPE(pw_qpolynomial)
enum isl_fold {
isl_fold_error = -1,
isl_fold_min,
isl_fold_max,
isl_fold_list

View File

@ -129,6 +129,7 @@ __isl_give isl_schedule *isl_union_set_compute_schedule(
__isl_take isl_union_map *proximity);
__isl_give isl_schedule *isl_schedule_empty(__isl_take isl_space *space);
__isl_export
__isl_give isl_schedule *isl_schedule_from_domain(
__isl_take isl_union_set *domain);
__isl_give isl_schedule *isl_schedule_copy(__isl_keep isl_schedule *sched);

View File

@ -7,13 +7,16 @@
#include <isl/ast_type.h>
#include <isl/val_type.h>
#include <isl/space_type.h>
#include <isl/id_type.h>
#if defined(__cplusplus)
extern "C" {
#endif
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_from_domain(
__isl_take isl_union_set *domain);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_from_extension(
__isl_take isl_union_map *extension);
__isl_give isl_schedule_node *isl_schedule_node_copy(
@ -21,10 +24,12 @@ __isl_give isl_schedule_node *isl_schedule_node_copy(
__isl_null isl_schedule_node *isl_schedule_node_free(
__isl_take isl_schedule_node *node);
__isl_export
isl_bool isl_schedule_node_is_equal(__isl_keep isl_schedule_node *node1,
__isl_keep isl_schedule_node *node2);
isl_ctx *isl_schedule_node_get_ctx(__isl_keep isl_schedule_node *node);
__isl_subclass(isl_schedule_node)
enum isl_schedule_node_type isl_schedule_node_get_type(
__isl_keep isl_schedule_node *node);
enum isl_schedule_node_type isl_schedule_node_get_parent_type(
@ -33,56 +38,76 @@ __isl_export
__isl_give isl_schedule *isl_schedule_node_get_schedule(
__isl_keep isl_schedule_node *node);
__isl_export
isl_stat isl_schedule_node_foreach_descendant_top_down(
__isl_keep isl_schedule_node *node,
isl_bool (*fn)(__isl_keep isl_schedule_node *node, void *user),
void *user);
__isl_export
isl_bool isl_schedule_node_every_descendant(__isl_keep isl_schedule_node *node,
isl_bool (*test)(__isl_keep isl_schedule_node *node, void *user),
void *user);
__isl_export
isl_stat isl_schedule_node_foreach_ancestor_top_down(
__isl_keep isl_schedule_node *node,
isl_stat (*fn)(__isl_keep isl_schedule_node *node, void *user),
void *user);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_map_descendant_bottom_up(
__isl_take isl_schedule_node *node,
__isl_give isl_schedule_node *(*fn)(__isl_take isl_schedule_node *node,
void *user), void *user);
int isl_schedule_node_get_tree_depth(__isl_keep isl_schedule_node *node);
__isl_export
isl_size isl_schedule_node_get_tree_depth(__isl_keep isl_schedule_node *node);
__isl_export
isl_bool isl_schedule_node_has_parent(__isl_keep isl_schedule_node *node);
__isl_export
isl_bool isl_schedule_node_has_children(__isl_keep isl_schedule_node *node);
__isl_export
isl_bool isl_schedule_node_has_previous_sibling(
__isl_keep isl_schedule_node *node);
__isl_export
isl_bool isl_schedule_node_has_next_sibling(__isl_keep isl_schedule_node *node);
int isl_schedule_node_n_children(__isl_keep isl_schedule_node *node);
int isl_schedule_node_get_child_position(__isl_keep isl_schedule_node *node);
int isl_schedule_node_get_ancestor_child_position(
__isl_export
isl_size isl_schedule_node_n_children(__isl_keep isl_schedule_node *node);
__isl_export
isl_size isl_schedule_node_get_child_position(
__isl_keep isl_schedule_node *node);
__isl_export
isl_size isl_schedule_node_get_ancestor_child_position(
__isl_keep isl_schedule_node *node,
__isl_keep isl_schedule_node *ancestor);
__isl_give isl_schedule_node *isl_schedule_node_get_child(
__isl_keep isl_schedule_node *node, int pos);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_get_shared_ancestor(
__isl_keep isl_schedule_node *node1,
__isl_keep isl_schedule_node *node2);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_root(
__isl_take isl_schedule_node *node);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_parent(
__isl_take isl_schedule_node *node);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_ancestor(
__isl_take isl_schedule_node *node, int generation);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_child(
__isl_take isl_schedule_node *node, int pos);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_first_child(
__isl_take isl_schedule_node *node);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_previous_sibling(
__isl_take isl_schedule_node *node);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_next_sibling(
__isl_take isl_schedule_node *node);
__isl_export
isl_bool isl_schedule_node_is_subtree_anchored(
__isl_keep isl_schedule_node *node);
@ -94,12 +119,14 @@ __isl_give isl_schedule_node *isl_schedule_node_sequence_splice_child(
__isl_give isl_space *isl_schedule_node_band_get_space(
__isl_keep isl_schedule_node *node);
__isl_export
__isl_give isl_multi_union_pw_aff *isl_schedule_node_band_get_partial_schedule(
__isl_keep isl_schedule_node *node);
__isl_give isl_union_map *isl_schedule_node_band_get_partial_schedule_union_map(
__isl_keep isl_schedule_node *node);
enum isl_ast_loop_type isl_schedule_node_band_member_get_ast_loop_type(
__isl_keep isl_schedule_node *node, int pos);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_band_member_set_ast_loop_type(
__isl_take isl_schedule_node *node, int pos,
enum isl_ast_loop_type type);
@ -109,21 +136,27 @@ __isl_give isl_schedule_node *
isl_schedule_node_band_member_set_isolate_ast_loop_type(
__isl_take isl_schedule_node *node, int pos,
enum isl_ast_loop_type type);
__isl_export
__isl_give isl_union_set *isl_schedule_node_band_get_ast_build_options(
__isl_keep isl_schedule_node *node);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_band_set_ast_build_options(
__isl_take isl_schedule_node *node, __isl_take isl_union_set *options);
__isl_export
__isl_give isl_set *isl_schedule_node_band_get_ast_isolate_option(
__isl_keep isl_schedule_node *node);
unsigned isl_schedule_node_band_n_member(__isl_keep isl_schedule_node *node);
__isl_export
isl_size isl_schedule_node_band_n_member(__isl_keep isl_schedule_node *node);
__isl_export
isl_bool isl_schedule_node_band_member_get_coincident(
__isl_keep isl_schedule_node *node, int pos);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_band_member_set_coincident(
__isl_take isl_schedule_node *node, int pos, int coincident);
__isl_export
isl_bool isl_schedule_node_band_get_permutable(
__isl_keep isl_schedule_node *node);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_band_set_permutable(
__isl_take isl_schedule_node *node, int permutable);
@ -132,40 +165,54 @@ int isl_options_get_tile_scale_tile_loops(isl_ctx *ctx);
isl_stat isl_options_set_tile_shift_point_loops(isl_ctx *ctx, int val);
int isl_options_get_tile_shift_point_loops(isl_ctx *ctx);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_band_scale(
__isl_take isl_schedule_node *node, __isl_take isl_multi_val *mv);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_band_scale_down(
__isl_take isl_schedule_node *node, __isl_take isl_multi_val *mv);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_band_mod(
__isl_take isl_schedule_node *node, __isl_take isl_multi_val *mv);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_band_shift(
__isl_take isl_schedule_node *node,
__isl_take isl_multi_union_pw_aff *shift);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_band_tile(
__isl_take isl_schedule_node *node, __isl_take isl_multi_val *sizes);
__isl_give isl_schedule_node *isl_schedule_node_band_sink(
__isl_take isl_schedule_node *node);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_band_split(
__isl_take isl_schedule_node *node, int pos);
__isl_export
__isl_give isl_set *isl_schedule_node_context_get_context(
__isl_keep isl_schedule_node *node);
__isl_export
__isl_give isl_union_set *isl_schedule_node_domain_get_domain(
__isl_keep isl_schedule_node *node);
__isl_export
__isl_give isl_union_map *isl_schedule_node_expansion_get_expansion(
__isl_keep isl_schedule_node *node);
__isl_export
__isl_give isl_union_pw_multi_aff *isl_schedule_node_expansion_get_contraction(
__isl_keep isl_schedule_node *node);
__isl_export
__isl_give isl_union_map *isl_schedule_node_extension_get_extension(
__isl_keep isl_schedule_node *node);
__isl_export
__isl_give isl_union_set *isl_schedule_node_filter_get_filter(
__isl_keep isl_schedule_node *node);
__isl_export
__isl_give isl_set *isl_schedule_node_guard_get_guard(
__isl_keep isl_schedule_node *node);
__isl_give isl_id *isl_schedule_node_mark_get_id(
__isl_keep isl_schedule_node *node);
int isl_schedule_node_get_schedule_depth(__isl_keep isl_schedule_node *node);
isl_size isl_schedule_node_get_schedule_depth(
__isl_keep isl_schedule_node *node);
__isl_give isl_union_set *isl_schedule_node_get_domain(
__isl_keep isl_schedule_node *node);
__isl_give isl_union_set *isl_schedule_node_get_universe_domain(
@ -190,20 +237,27 @@ __isl_give isl_union_map *isl_schedule_node_get_subtree_expansion(
__isl_give isl_union_pw_multi_aff *isl_schedule_node_get_subtree_contraction(
__isl_keep isl_schedule_node *node);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_insert_context(
__isl_take isl_schedule_node *node, __isl_take isl_set *context);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_insert_partial_schedule(
__isl_take isl_schedule_node *node,
__isl_take isl_multi_union_pw_aff *schedule);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_insert_filter(
__isl_take isl_schedule_node *node, __isl_take isl_union_set *filter);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_insert_guard(
__isl_take isl_schedule_node *node, __isl_take isl_set *context);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_insert_mark(
__isl_take isl_schedule_node *node, __isl_take isl_id *mark);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_insert_sequence(
__isl_take isl_schedule_node *node,
__isl_take isl_union_set_list *filters);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_insert_set(
__isl_take isl_schedule_node *node,
__isl_take isl_union_set_list *filters);
@ -213,14 +267,18 @@ __isl_give isl_schedule_node *isl_schedule_node_cut(
__isl_give isl_schedule_node *isl_schedule_node_delete(
__isl_take isl_schedule_node *node);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_order_before(
__isl_take isl_schedule_node *node, __isl_take isl_union_set *filter);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_order_after(
__isl_take isl_schedule_node *node, __isl_take isl_union_set *filter);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_graft_before(
__isl_take isl_schedule_node *node,
__isl_take isl_schedule_node *graft);
__isl_export
__isl_give isl_schedule_node *isl_schedule_node_graft_after(
__isl_take isl_schedule_node *node,
__isl_take isl_schedule_node *graft);

View File

@ -20,24 +20,26 @@
#include <isl/val_type.h>
#include <isl/stdint.h>
#include <isl/stride_info.h>
#include <isl/fixed_box.h>
#if defined(__cplusplus)
extern "C" {
#endif
unsigned isl_basic_set_n_dim(__isl_keep isl_basic_set *bset);
unsigned isl_basic_set_n_param(__isl_keep isl_basic_set *bset);
unsigned isl_basic_set_total_dim(__isl_keep const isl_basic_set *bset);
unsigned isl_basic_set_dim(__isl_keep isl_basic_set *bset,
isl_size isl_basic_set_n_dim(__isl_keep isl_basic_set *bset);
isl_size isl_basic_set_n_param(__isl_keep isl_basic_set *bset);
isl_size isl_basic_set_total_dim(__isl_keep const isl_basic_set *bset);
isl_size isl_basic_set_dim(__isl_keep isl_basic_set *bset,
enum isl_dim_type type);
unsigned isl_set_n_dim(__isl_keep isl_set *set);
unsigned isl_set_n_param(__isl_keep isl_set *set);
unsigned isl_set_dim(__isl_keep isl_set *set, enum isl_dim_type type);
isl_size isl_set_n_dim(__isl_keep isl_set *set);
isl_size isl_set_n_param(__isl_keep isl_set *set);
isl_size isl_set_dim(__isl_keep isl_set *set, enum isl_dim_type type);
isl_ctx *isl_basic_set_get_ctx(__isl_keep isl_basic_set *bset);
isl_ctx *isl_set_get_ctx(__isl_keep isl_set *set);
__isl_give isl_space *isl_basic_set_get_space(__isl_keep isl_basic_set *bset);
__isl_export
__isl_give isl_space *isl_set_get_space(__isl_keep isl_set *set);
__isl_give isl_set *isl_set_reset_space(__isl_take isl_set *set,
__isl_take isl_space *dim);
@ -95,7 +97,8 @@ __isl_null isl_basic_set *isl_basic_set_free(__isl_take isl_basic_set *bset);
__isl_give isl_basic_set *isl_basic_set_copy(__isl_keep isl_basic_set *bset);
__isl_give isl_basic_set *isl_basic_set_empty(__isl_take isl_space *space);
__isl_give isl_basic_set *isl_basic_set_universe(__isl_take isl_space *space);
__isl_give isl_basic_set *isl_basic_set_nat_universe(__isl_take isl_space *dim);
__isl_give isl_basic_set *isl_basic_set_nat_universe(
__isl_take isl_space *space);
__isl_give isl_basic_set *isl_basic_set_positive_orthant(
__isl_take isl_space *space);
void isl_basic_set_print_internal(__isl_keep isl_basic_set *bset,
@ -166,6 +169,18 @@ __isl_give isl_basic_set *isl_basic_set_upper_bound_val(
__isl_take isl_val *value);
__isl_give isl_set *isl_set_upper_bound_val(__isl_take isl_set *set,
enum isl_dim_type type, unsigned pos, __isl_take isl_val *value);
__isl_overload
__isl_give isl_set *isl_set_lower_bound_multi_val(__isl_take isl_set *set,
__isl_take isl_multi_val *lower);
__isl_overload
__isl_give isl_set *isl_set_upper_bound_multi_val(__isl_take isl_set *set,
__isl_take isl_multi_val *upper);
__isl_overload
__isl_give isl_set *isl_set_lower_bound_multi_pw_aff(__isl_take isl_set *set,
__isl_take isl_multi_pw_aff *lower);
__isl_overload
__isl_give isl_set *isl_set_upper_bound_multi_pw_aff(__isl_take isl_set *set,
__isl_take isl_multi_pw_aff *upper);
__isl_give isl_set *isl_set_equate(__isl_take isl_set *set,
enum isl_dim_type type1, int pos1, enum isl_dim_type type2, int pos2);
@ -202,8 +217,10 @@ __isl_give isl_pw_multi_aff *isl_basic_set_partial_lexmin_pw_multi_aff(
__isl_give isl_pw_multi_aff *isl_basic_set_partial_lexmax_pw_multi_aff(
__isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom,
__isl_give isl_set **empty);
__isl_export
__isl_give isl_pw_multi_aff *isl_set_lexmin_pw_multi_aff(
__isl_take isl_set *set);
__isl_export
__isl_give isl_pw_multi_aff *isl_set_lexmax_pw_multi_aff(
__isl_take isl_set *set);
@ -212,17 +229,29 @@ __isl_give isl_set *isl_basic_set_union(
__isl_take isl_basic_set *bset1,
__isl_take isl_basic_set *bset2);
int isl_basic_set_compare_at(struct isl_basic_set *bset1,
struct isl_basic_set *bset2, int pos);
int isl_basic_set_compare_at(__isl_keep isl_basic_set *bset1,
__isl_keep isl_basic_set *bset2, int pos);
int isl_set_follows_at(__isl_keep isl_set *set1,
__isl_keep isl_set *set2, int pos);
__isl_export
__isl_give isl_basic_set *isl_basic_set_params(__isl_take isl_basic_set *bset);
__isl_give isl_basic_set *isl_basic_set_from_params(
__isl_take isl_basic_set *bset);
__isl_export
__isl_give isl_set *isl_set_params(__isl_take isl_set *set);
__isl_give isl_set *isl_set_from_params(__isl_take isl_set *set);
__isl_export
__isl_give isl_set *isl_set_bind(__isl_take isl_set *set,
__isl_take isl_multi_id *tuple);
__isl_export
__isl_give isl_set *isl_set_unbind_params(__isl_take isl_set *set,
__isl_take isl_multi_id *tuple);
__isl_export
__isl_give isl_map *isl_set_unbind_params_insert_domain(
__isl_take isl_set *set, __isl_take isl_multi_id *domain);
isl_stat isl_basic_set_dims_get_sign(__isl_keep isl_basic_set *bset,
enum isl_dim_type type, unsigned pos, unsigned n, int *signs);
@ -238,7 +267,9 @@ isl_bool isl_basic_set_is_subset(__isl_keep isl_basic_set *bset1,
isl_bool isl_basic_set_plain_is_equal(__isl_keep isl_basic_set *bset1,
__isl_keep isl_basic_set *bset2);
__isl_export
__isl_give isl_set *isl_set_empty(__isl_take isl_space *space);
__isl_export
__isl_give isl_set *isl_set_universe(__isl_take isl_space *space);
__isl_give isl_set *isl_set_nat_universe(__isl_take isl_space *dim);
__isl_give isl_set *isl_set_copy(__isl_keep isl_set *set);
@ -274,6 +305,7 @@ __isl_export
__isl_give isl_set *isl_set_union(
__isl_take isl_set *set1,
__isl_take isl_set *set2);
__isl_export
__isl_give isl_set *isl_set_product(__isl_take isl_set *set1,
__isl_take isl_set *set2);
__isl_give isl_basic_set *isl_basic_set_flat_product(
@ -287,6 +319,10 @@ __isl_give isl_set *isl_set_intersect(
__isl_export
__isl_give isl_set *isl_set_intersect_params(__isl_take isl_set *set,
__isl_take isl_set *params);
__isl_give isl_set *isl_set_intersect_factor_domain(__isl_take isl_set *set,
__isl_take isl_set *domain);
__isl_give isl_set *isl_set_intersect_factor_range(__isl_take isl_set *set,
__isl_take isl_set *range);
__isl_export
__isl_give isl_set *isl_set_subtract(
__isl_take isl_set *set1,
@ -297,10 +333,13 @@ __isl_export
__isl_give isl_set *isl_set_apply(
__isl_take isl_set *set,
__isl_take isl_map *map);
__isl_overload
__isl_give isl_set *isl_set_preimage_multi_aff(__isl_take isl_set *set,
__isl_take isl_multi_aff *ma);
__isl_overload
__isl_give isl_set *isl_set_preimage_pw_multi_aff(__isl_take isl_set *set,
__isl_take isl_pw_multi_aff *pma);
__isl_overload
__isl_give isl_set *isl_set_preimage_multi_pw_aff(__isl_take isl_set *set,
__isl_take isl_multi_pw_aff *mpa);
__isl_give isl_set *isl_set_fix_val(__isl_take isl_set *set,
@ -325,8 +364,16 @@ __isl_give isl_set *isl_set_move_dims(__isl_take isl_set *set,
__isl_give isl_basic_set *isl_basic_set_project_out(
__isl_take isl_basic_set *bset,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_overload
__isl_give isl_set *isl_set_project_out_param_id(__isl_take isl_set *set,
__isl_take isl_id *id);
__isl_overload
__isl_give isl_set *isl_set_project_out_param_id_list(__isl_take isl_set *set,
__isl_take isl_id_list *list);
__isl_give isl_set *isl_set_project_out(__isl_take isl_set *set,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_export
__isl_give isl_set *isl_set_project_out_all_params(__isl_take isl_set *set);
__isl_give isl_map *isl_set_project_onto_map(__isl_take isl_set *set,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_give isl_basic_set *isl_basic_set_remove_divs(
@ -387,6 +434,7 @@ isl_bool isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
__isl_export
isl_bool isl_set_is_disjoint(__isl_keep isl_set *set1,
__isl_keep isl_set *set2);
__isl_export
isl_bool isl_set_is_singleton(__isl_keep isl_set *set);
isl_bool isl_set_is_box(__isl_keep isl_set *set);
isl_bool isl_set_has_equal_space(__isl_keep isl_set *set1,
@ -403,6 +451,9 @@ __isl_give isl_set *isl_set_compute_divs(__isl_take isl_set *set);
ISL_DEPRECATED
__isl_give isl_set *isl_set_align_divs(__isl_take isl_set *set);
__isl_export
__isl_give isl_multi_val *isl_set_get_plain_multi_val_if_fixed(
__isl_keep isl_set *set);
__isl_give isl_val *isl_set_plain_get_val_if_fixed(__isl_keep isl_set *set,
enum isl_dim_type type, unsigned pos);
isl_bool isl_set_dim_is_bounded(__isl_keep isl_set *set,
@ -433,6 +484,9 @@ __isl_give isl_stride_info *isl_set_get_stride_info(__isl_keep isl_set *set,
int pos);
__isl_export
__isl_give isl_val *isl_set_get_stride(__isl_keep isl_set *set, int pos);
__isl_export
__isl_give isl_fixed_box *isl_set_get_simple_fixed_box_hull(
__isl_keep isl_set *set);
__isl_export
__isl_give isl_set *isl_set_coalesce(__isl_take isl_set *set);
@ -445,13 +499,14 @@ isl_bool isl_set_plain_is_disjoint(__isl_keep isl_set *set1,
uint32_t isl_set_get_hash(struct isl_set *set);
int isl_set_n_basic_set(__isl_keep isl_set *set);
isl_size isl_set_n_basic_set(__isl_keep isl_set *set);
__isl_export
isl_stat isl_set_foreach_basic_set(__isl_keep isl_set *set,
isl_stat (*fn)(__isl_take isl_basic_set *bset, void *user), void *user);
__isl_give isl_basic_set_list *isl_set_get_basic_set_list(
__isl_keep isl_set *set);
__isl_export
isl_stat isl_set_foreach_point(__isl_keep isl_set *set,
isl_stat (*fn)(__isl_take isl_point *pnt, void *user), void *user);
__isl_give isl_val *isl_set_count_val(__isl_keep isl_set *set);

View File

@ -19,13 +19,15 @@
extern "C" {
#endif
isl_ctx *isl_space_get_ctx(__isl_keep isl_space *dim);
isl_ctx *isl_space_get_ctx(__isl_keep isl_space *space);
__isl_export
__isl_give isl_space *isl_space_unit(isl_ctx *ctx);
__isl_give isl_space *isl_space_alloc(isl_ctx *ctx,
unsigned nparam, unsigned n_in, unsigned n_out);
__isl_give isl_space *isl_space_set_alloc(isl_ctx *ctx,
unsigned nparam, unsigned dim);
__isl_give isl_space *isl_space_params_alloc(isl_ctx *ctx, unsigned nparam);
__isl_give isl_space *isl_space_copy(__isl_keep isl_space *dim);
__isl_give isl_space *isl_space_copy(__isl_keep isl_space *space);
__isl_null isl_space *isl_space_free(__isl_take isl_space *space);
isl_bool isl_space_is_params(__isl_keep isl_space *space);
@ -35,40 +37,40 @@ isl_bool isl_space_is_map(__isl_keep isl_space *space);
__isl_give isl_space *isl_space_add_param_id(__isl_take isl_space *space,
__isl_take isl_id *id);
__isl_give isl_space *isl_space_set_tuple_name(__isl_take isl_space *dim,
__isl_give isl_space *isl_space_set_tuple_name(__isl_take isl_space *space,
enum isl_dim_type type, const char *s);
isl_bool isl_space_has_tuple_name(__isl_keep isl_space *space,
enum isl_dim_type type);
__isl_keep const char *isl_space_get_tuple_name(__isl_keep isl_space *dim,
__isl_keep const char *isl_space_get_tuple_name(__isl_keep isl_space *space,
enum isl_dim_type type);
__isl_give isl_space *isl_space_set_tuple_id(__isl_take isl_space *dim,
__isl_give isl_space *isl_space_set_tuple_id(__isl_take isl_space *space,
enum isl_dim_type type, __isl_take isl_id *id);
__isl_give isl_space *isl_space_reset_tuple_id(__isl_take isl_space *dim,
__isl_give isl_space *isl_space_reset_tuple_id(__isl_take isl_space *space,
enum isl_dim_type type);
isl_bool isl_space_has_tuple_id(__isl_keep isl_space *dim,
isl_bool isl_space_has_tuple_id(__isl_keep isl_space *space,
enum isl_dim_type type);
__isl_give isl_id *isl_space_get_tuple_id(__isl_keep isl_space *dim,
__isl_give isl_id *isl_space_get_tuple_id(__isl_keep isl_space *space,
enum isl_dim_type type);
__isl_give isl_space *isl_space_reset_user(__isl_take isl_space *space);
__isl_give isl_space *isl_space_set_dim_id(__isl_take isl_space *dim,
enum isl_dim_type type, unsigned pos, __isl_take isl_id *id);
isl_bool isl_space_has_dim_id(__isl_keep isl_space *dim,
isl_bool isl_space_has_dim_id(__isl_keep isl_space *space,
enum isl_dim_type type, unsigned pos);
__isl_give isl_id *isl_space_get_dim_id(__isl_keep isl_space *dim,
__isl_give isl_id *isl_space_get_dim_id(__isl_keep isl_space *space,
enum isl_dim_type type, unsigned pos);
int isl_space_find_dim_by_id(__isl_keep isl_space *dim, enum isl_dim_type type,
__isl_keep isl_id *id);
int isl_space_find_dim_by_id(__isl_keep isl_space *space,
enum isl_dim_type type, __isl_keep isl_id *id);
int isl_space_find_dim_by_name(__isl_keep isl_space *space,
enum isl_dim_type type, const char *name);
isl_bool isl_space_has_dim_name(__isl_keep isl_space *space,
enum isl_dim_type type, unsigned pos);
__isl_give isl_space *isl_space_set_dim_name(__isl_take isl_space *dim,
__isl_give isl_space *isl_space_set_dim_name(__isl_take isl_space *space,
enum isl_dim_type type, unsigned pos,
__isl_keep const char *name);
__isl_keep const char *isl_space_get_dim_name(__isl_keep isl_space *dim,
__isl_keep const char *isl_space_get_dim_name(__isl_keep isl_space *space,
enum isl_dim_type type, unsigned pos);
ISL_DEPRECATED
@ -99,11 +101,13 @@ __isl_give isl_space *isl_space_range_factor_domain(
__isl_take isl_space *space);
__isl_give isl_space *isl_space_range_factor_range(
__isl_take isl_space *space);
__isl_export
__isl_give isl_space *isl_space_map_from_set(__isl_take isl_space *space);
__isl_give isl_space *isl_space_map_from_domain_and_range(
__isl_take isl_space *domain, __isl_take isl_space *range);
__isl_give isl_space *isl_space_reverse(__isl_take isl_space *dim);
__isl_give isl_space *isl_space_drop_dims(__isl_take isl_space *dim,
__isl_give isl_space *isl_space_reverse(__isl_take isl_space *space);
__isl_give isl_space *isl_space_range_reverse(__isl_take isl_space *space);
__isl_give isl_space *isl_space_drop_dims(__isl_take isl_space *space,
enum isl_dim_type type, unsigned first, unsigned num);
ISL_DEPRECATED
__isl_give isl_space *isl_space_drop_inputs(__isl_take isl_space *dim,
@ -111,27 +115,40 @@ __isl_give isl_space *isl_space_drop_inputs(__isl_take isl_space *dim,
ISL_DEPRECATED
__isl_give isl_space *isl_space_drop_outputs(__isl_take isl_space *dim,
unsigned first, unsigned n);
__isl_give isl_space *isl_space_drop_all_params(__isl_take isl_space *space);
__isl_export
__isl_give isl_space *isl_space_domain(__isl_take isl_space *space);
__isl_give isl_space *isl_space_from_domain(__isl_take isl_space *dim);
__isl_give isl_space *isl_space_from_domain(__isl_take isl_space *space);
__isl_export
__isl_give isl_space *isl_space_range(__isl_take isl_space *space);
__isl_give isl_space *isl_space_from_range(__isl_take isl_space *dim);
__isl_give isl_space *isl_space_from_range(__isl_take isl_space *space);
__isl_give isl_space *isl_space_domain_map(__isl_take isl_space *space);
__isl_give isl_space *isl_space_range_map(__isl_take isl_space *space);
__isl_export
__isl_give isl_space *isl_space_params(__isl_take isl_space *space);
__isl_overload
__isl_give isl_space *isl_space_add_unnamed_tuple_ui(
__isl_take isl_space *space, unsigned dim);
__isl_overload
__isl_give isl_space *isl_space_add_named_tuple_id_ui(
__isl_take isl_space *space, __isl_take isl_id *tuple_id, unsigned dim);
__isl_give isl_space *isl_space_set_from_params(__isl_take isl_space *space);
__isl_give isl_space *isl_space_align_params(__isl_take isl_space *dim1,
__isl_take isl_space *dim2);
isl_bool isl_space_is_wrapping(__isl_keep isl_space *dim);
__isl_export
isl_bool isl_space_is_wrapping(__isl_keep isl_space *space);
isl_bool isl_space_domain_is_wrapping(__isl_keep isl_space *space);
isl_bool isl_space_range_is_wrapping(__isl_keep isl_space *space);
isl_bool isl_space_is_product(__isl_keep isl_space *space);
__isl_give isl_space *isl_space_wrap(__isl_take isl_space *dim);
__isl_give isl_space *isl_space_unwrap(__isl_take isl_space *dim);
__isl_export
__isl_give isl_space *isl_space_wrap(__isl_take isl_space *space);
__isl_export
__isl_give isl_space *isl_space_unwrap(__isl_take isl_space *space);
isl_bool isl_space_can_zip(__isl_keep isl_space *space);
__isl_give isl_space *isl_space_zip(__isl_take isl_space *dim);
__isl_give isl_space *isl_space_zip(__isl_take isl_space *space);
isl_bool isl_space_can_curry(__isl_keep isl_space *space);
__isl_give isl_space *isl_space_curry(__isl_take isl_space *space);
@ -146,6 +163,7 @@ isl_bool isl_space_is_domain(__isl_keep isl_space *space1,
__isl_keep isl_space *space2);
isl_bool isl_space_is_range(__isl_keep isl_space *space1,
__isl_keep isl_space *space2);
__isl_export
isl_bool isl_space_is_equal(__isl_keep isl_space *space1,
__isl_keep isl_space *space2);
isl_bool isl_space_has_equal_params(__isl_keep isl_space *space1,
@ -158,15 +176,17 @@ isl_bool isl_space_tuple_is_equal(__isl_keep isl_space *space1,
ISL_DEPRECATED
isl_bool isl_space_match(__isl_keep isl_space *space1, enum isl_dim_type type1,
__isl_keep isl_space *space2, enum isl_dim_type type2);
unsigned isl_space_dim(__isl_keep isl_space *dim, enum isl_dim_type type);
isl_size isl_space_dim(__isl_keep isl_space *space, enum isl_dim_type type);
__isl_export
__isl_give isl_space *isl_space_flatten_domain(__isl_take isl_space *space);
__isl_export
__isl_give isl_space *isl_space_flatten_range(__isl_take isl_space *space);
__isl_give char *isl_space_to_str(__isl_keep isl_space *space);
__isl_give isl_printer *isl_printer_print_space(__isl_take isl_printer *p,
__isl_keep isl_space *dim);
void isl_space_dump(__isl_keep isl_space *dim);
__isl_keep isl_space *space);
void isl_space_dump(__isl_keep isl_space *space);
#if defined(__cplusplus)
}

View File

@ -1,11 +1,13 @@
#ifndef ISL_SPACE_TYPE_H
#define ISL_SPACE_TYPE_H
#include <isl/ctx.h>
#if defined(__cplusplus)
extern "C" {
#endif
struct isl_space;
struct __isl_export isl_space;
typedef struct isl_space isl_space;
enum isl_dim_type {

View File

@ -38,6 +38,7 @@ enum isl_token_type { ISL_TOKEN_ERROR = -1,
ISL_TOKEN_MAP, ISL_TOKEN_AFF,
ISL_TOKEN_CEIL, ISL_TOKEN_FLOOR,
ISL_TOKEN_IMPLIES,
ISL_TOKEN_INT_DIV,
ISL_TOKEN_LAST };
struct isl_token;

View File

@ -13,7 +13,7 @@
extern "C" {
#endif
unsigned isl_union_map_dim(__isl_keep isl_union_map *umap,
isl_size isl_union_map_dim(__isl_keep isl_union_map *umap,
enum isl_dim_type type);
isl_bool isl_union_map_involves_dims(__isl_keep isl_union_map *umap,
enum isl_dim_type type, unsigned first, unsigned n);
@ -25,11 +25,16 @@ __isl_give isl_union_map *isl_union_map_from_basic_map(
__isl_take isl_basic_map *bmap);
__isl_constructor
__isl_give isl_union_map *isl_union_map_from_map(__isl_take isl_map *map);
__isl_overload
__isl_give isl_union_map *isl_union_map_empty_ctx(isl_ctx *ctx);
__isl_give isl_union_map *isl_union_map_empty_space(
__isl_take isl_space *space);
__isl_give isl_union_map *isl_union_map_empty(__isl_take isl_space *space);
__isl_give isl_union_map *isl_union_map_copy(__isl_keep isl_union_map *umap);
__isl_null isl_union_map *isl_union_map_free(__isl_take isl_union_map *umap);
isl_ctx *isl_union_map_get_ctx(__isl_keep isl_union_map *umap);
__isl_export
__isl_give isl_space *isl_union_map_get_space(__isl_keep isl_union_map *umap);
__isl_give isl_union_map *isl_union_map_reset_user(
@ -38,6 +43,7 @@ __isl_give isl_union_map *isl_union_map_reset_user(
int isl_union_map_find_dim_by_name(__isl_keep isl_union_map *umap,
enum isl_dim_type type, const char *name);
__isl_export
__isl_give isl_union_map *isl_union_map_universe(
__isl_take isl_union_map *umap);
__isl_give isl_set *isl_union_map_params(__isl_take isl_union_map *umap);
@ -148,6 +154,10 @@ __isl_give isl_union_map *isl_union_map_intersect_domain(
__isl_export
__isl_give isl_union_map *isl_union_map_intersect_range(
__isl_take isl_union_map *umap, __isl_take isl_union_set *uset);
__isl_give isl_union_map *isl_union_map_intersect_domain_factor_range(
__isl_take isl_union_map *umap, __isl_take isl_union_map *factor);
__isl_give isl_union_map *isl_union_map_intersect_range_factor_domain(
__isl_take isl_union_map *umap, __isl_take isl_union_map *factor);
__isl_give isl_union_map *isl_union_map_intersect_range_factor_range(
__isl_take isl_union_map *umap, __isl_take isl_union_map *factor);
@ -164,25 +174,35 @@ __isl_give isl_union_map *isl_union_map_apply_domain(
__isl_export
__isl_give isl_union_map *isl_union_map_apply_range(
__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2);
__isl_overload
__isl_give isl_union_map *isl_union_map_preimage_domain_multi_aff(
__isl_take isl_union_map *umap, __isl_take isl_multi_aff *ma);
__isl_overload
__isl_give isl_union_map *isl_union_map_preimage_range_multi_aff(
__isl_take isl_union_map *umap, __isl_take isl_multi_aff *ma);
__isl_overload
__isl_give isl_union_map *isl_union_map_preimage_domain_pw_multi_aff(
__isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma);
__isl_overload
__isl_give isl_union_map *isl_union_map_preimage_range_pw_multi_aff(
__isl_take isl_union_map *umap, __isl_take isl_pw_multi_aff *pma);
__isl_overload
__isl_give isl_union_map *isl_union_map_preimage_domain_multi_pw_aff(
__isl_take isl_union_map *umap, __isl_take isl_multi_pw_aff *mpa);
__isl_overload
__isl_give isl_union_map *isl_union_map_preimage_domain_union_pw_multi_aff(
__isl_take isl_union_map *umap,
__isl_take isl_union_pw_multi_aff *upma);
__isl_overload
__isl_give isl_union_map *isl_union_map_preimage_range_union_pw_multi_aff(
__isl_take isl_union_map *umap,
__isl_take isl_union_pw_multi_aff *upma);
__isl_export
__isl_give isl_union_map *isl_union_map_reverse(__isl_take isl_union_map *umap);
__isl_export
__isl_give isl_union_map *isl_union_map_range_reverse(
__isl_take isl_union_map *umap);
__isl_export
__isl_give isl_union_map *isl_union_map_from_domain_and_range(
__isl_take isl_union_set *domain, __isl_take isl_union_set *range);
@ -205,6 +225,10 @@ __isl_give isl_union_map *isl_union_map_project_out_all_params(
__isl_give isl_union_map *isl_union_map_remove_divs(
__isl_take isl_union_map *bmap);
__isl_export
__isl_give isl_union_set *isl_union_map_bind_range(
__isl_take isl_union_map *umap, __isl_take isl_multi_id *tuple);
isl_bool isl_union_map_plain_is_empty(__isl_keep isl_union_map *umap);
__isl_export
isl_bool isl_union_map_is_empty(__isl_keep isl_union_map *umap);
@ -223,6 +247,7 @@ isl_bool isl_union_map_is_subset(__isl_keep isl_union_map *umap1,
__isl_export
isl_bool isl_union_map_is_equal(__isl_keep isl_union_map *umap1,
__isl_keep isl_union_map *umap2);
__isl_export
isl_bool isl_union_map_is_disjoint(__isl_keep isl_union_map *umap1,
__isl_keep isl_union_map *umap2);
__isl_export
@ -231,12 +256,13 @@ isl_bool isl_union_map_is_strict_subset(__isl_keep isl_union_map *umap1,
uint32_t isl_union_map_get_hash(__isl_keep isl_union_map *umap);
int isl_union_map_n_map(__isl_keep isl_union_map *umap);
isl_size isl_union_map_n_map(__isl_keep isl_union_map *umap);
__isl_export
isl_stat isl_union_map_foreach_map(__isl_keep isl_union_map *umap,
isl_stat (*fn)(__isl_take isl_map *map, void *user), void *user);
__isl_give isl_map_list *isl_union_map_get_map_list(
__isl_keep isl_union_map *umap);
__isl_export
isl_bool isl_union_map_every_map(__isl_keep isl_union_map *umap,
isl_bool (*test)(__isl_keep isl_map *map, void *user), void *user);
__isl_give isl_union_map *isl_union_map_remove_map_if(
@ -244,8 +270,11 @@ __isl_give isl_union_map *isl_union_map_remove_map_if(
isl_bool (*fn)(__isl_keep isl_map *map, void *user), void *user);
isl_bool isl_union_map_contains(__isl_keep isl_union_map *umap,
__isl_keep isl_space *space);
__isl_export
__isl_give isl_map *isl_union_map_extract_map(__isl_keep isl_union_map *umap,
__isl_take isl_space *dim);
__isl_take isl_space *space);
__isl_export
isl_bool isl_union_map_isa_map(__isl_keep isl_union_map *umap);
__isl_give isl_map *isl_map_from_union_map(__isl_take isl_union_map *umap);
__isl_give isl_basic_map *isl_union_map_sample(__isl_take isl_union_map *umap);
@ -254,9 +283,9 @@ __isl_overload
__isl_give isl_union_map *isl_union_map_fixed_power_val(
__isl_take isl_union_map *umap, __isl_take isl_val *exp);
__isl_give isl_union_map *isl_union_map_power(__isl_take isl_union_map *umap,
int *exact);
isl_bool *exact);
__isl_give isl_union_map *isl_union_map_transitive_closure(
__isl_take isl_union_map *umap, int *exact);
__isl_take isl_union_map *umap, isl_bool *exact);
__isl_give isl_union_map *isl_union_map_lex_lt_union_map(
__isl_take isl_union_map *umap1, __isl_take isl_union_map *umap2);
@ -295,9 +324,11 @@ __isl_give isl_union_map *isl_union_set_unwrap(__isl_take isl_union_set *uset);
__isl_export
__isl_give isl_union_map *isl_union_map_zip(__isl_take isl_union_map *umap);
__isl_export
__isl_give isl_union_map *isl_union_map_curry(__isl_take isl_union_map *umap);
__isl_give isl_union_map *isl_union_map_range_curry(
__isl_take isl_union_map *umap);
__isl_export
__isl_give isl_union_map *isl_union_map_uncurry(__isl_take isl_union_map *umap);
__isl_give isl_union_map *isl_union_map_align_params(

View File

@ -14,7 +14,7 @@ ISL_DECLARE_LIST_TYPE(union_map)
#ifndef isl_union_set
struct __isl_export isl_union_set;
typedef struct isl_union_set isl_union_set;
ISL_DECLARE_LIST_TYPE(union_set)
ISL_DECLARE_EXPORTED_LIST_TYPE(union_set)
#endif
#if defined(__cplusplus)

View File

@ -8,7 +8,7 @@
extern "C" {
#endif
unsigned isl_union_set_dim(__isl_keep isl_union_set *uset,
isl_size isl_union_set_dim(__isl_keep isl_union_set *uset,
enum isl_dim_type type);
__isl_constructor
@ -16,16 +16,22 @@ __isl_give isl_union_set *isl_union_set_from_basic_set(
__isl_take isl_basic_set *bset);
__isl_constructor
__isl_give isl_union_set *isl_union_set_from_set(__isl_take isl_set *set);
__isl_overload
__isl_give isl_union_set *isl_union_set_empty_ctx(isl_ctx *ctx);
__isl_give isl_union_set *isl_union_set_empty_space(
__isl_take isl_space *space);
__isl_give isl_union_set *isl_union_set_empty(__isl_take isl_space *space);
__isl_give isl_union_set *isl_union_set_copy(__isl_keep isl_union_set *uset);
__isl_null isl_union_set *isl_union_set_free(__isl_take isl_union_set *uset);
isl_ctx *isl_union_set_get_ctx(__isl_keep isl_union_set *uset);
__isl_export
__isl_give isl_space *isl_union_set_get_space(__isl_keep isl_union_set *uset);
__isl_give isl_union_set *isl_union_set_reset_user(
__isl_take isl_union_set *uset);
__isl_export
__isl_give isl_union_set *isl_union_set_universe(
__isl_take isl_union_set *uset);
__isl_give isl_set *isl_union_set_params(__isl_take isl_union_set *uset);
@ -94,6 +100,8 @@ __isl_give isl_union_set *isl_union_set_preimage_union_pw_multi_aff(
__isl_give isl_union_set *isl_union_set_project_out(
__isl_take isl_union_set *uset,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_give isl_union_set *isl_union_set_project_out_all_params(
__isl_take isl_union_set *uset);
__isl_give isl_union_set *isl_union_set_remove_divs(
__isl_take isl_union_set *bset);
@ -107,6 +115,7 @@ isl_bool isl_union_set_is_subset(__isl_keep isl_union_set *uset1,
__isl_export
isl_bool isl_union_set_is_equal(__isl_keep isl_union_set *uset1,
__isl_keep isl_union_set *uset2);
__isl_export
isl_bool isl_union_set_is_disjoint(__isl_keep isl_union_set *uset1,
__isl_keep isl_union_set *uset2);
__isl_export
@ -115,18 +124,24 @@ isl_bool isl_union_set_is_strict_subset(__isl_keep isl_union_set *uset1,
uint32_t isl_union_set_get_hash(__isl_keep isl_union_set *uset);
int isl_union_set_n_set(__isl_keep isl_union_set *uset);
isl_size isl_union_set_n_set(__isl_keep isl_union_set *uset);
__isl_export
isl_stat isl_union_set_foreach_set(__isl_keep isl_union_set *uset,
isl_stat (*fn)(__isl_take isl_set *set, void *user), void *user);
__isl_export
isl_bool isl_union_set_every_set(__isl_keep isl_union_set *uset,
isl_bool (*test)(__isl_keep isl_set *set, void *user), void *user);
__isl_give isl_basic_set_list *isl_union_set_get_basic_set_list(
__isl_keep isl_union_set *uset);
__isl_give isl_set_list *isl_union_set_get_set_list(
__isl_keep isl_union_set *uset);
isl_bool isl_union_set_contains(__isl_keep isl_union_set *uset,
__isl_keep isl_space *space);
__isl_export
__isl_give isl_set *isl_union_set_extract_set(__isl_keep isl_union_set *uset,
__isl_take isl_space *dim);
__isl_take isl_space *space);
__isl_export
isl_bool isl_union_set_isa_set(__isl_keep isl_union_set *uset);
__isl_give isl_set *isl_set_from_union_set(__isl_take isl_union_set *uset);
__isl_export
isl_stat isl_union_set_foreach_point(__isl_keep isl_union_set *uset,
@ -166,7 +181,7 @@ __isl_give isl_printer *isl_printer_print_union_set(__isl_take isl_printer *p,
__isl_keep isl_union_set *uset);
void isl_union_set_dump(__isl_keep isl_union_set *uset);
ISL_DECLARE_LIST_FN(union_set)
ISL_DECLARE_EXPORTED_LIST_FN(union_set)
__isl_give isl_union_set *isl_union_set_list_union(
__isl_take isl_union_set_list *list);

View File

@ -13,8 +13,12 @@ extern "C" {
#endif
ISL_DECLARE_MULTI(val)
ISL_DECLARE_MULTI_NEG(val)
ISL_DECLARE_MULTI_ARITH(val)
ISL_DECLARE_MULTI_ZERO(val)
ISL_DECLARE_MULTI_NAN(val)
ISL_DECLARE_MULTI_DIMS(val)
ISL_DECLARE_MULTI_DIM_ID(val)
ISL_DECLARE_MULTI_TUPLE_ID(val)
ISL_DECLARE_MULTI_WITH_DOMAIN(val)
__isl_export
@ -40,12 +44,14 @@ __isl_null isl_val *isl_val_free(__isl_take isl_val *v);
isl_ctx *isl_val_get_ctx(__isl_keep isl_val *val);
uint32_t isl_val_get_hash(__isl_keep isl_val *val);
__isl_export
long isl_val_get_num_si(__isl_keep isl_val *v);
__isl_export
long isl_val_get_den_si(__isl_keep isl_val *v);
__isl_give isl_val *isl_val_get_den_val(__isl_keep isl_val *v);
double isl_val_get_d(__isl_keep isl_val *v);
size_t isl_val_n_abs_num_chunks(__isl_keep isl_val *v, size_t size);
int isl_val_get_abs_num_chunks(__isl_keep isl_val *v, size_t size,
isl_size isl_val_n_abs_num_chunks(__isl_keep isl_val *v, size_t size);
isl_stat isl_val_get_abs_num_chunks(__isl_keep isl_val *v, size_t size,
void *chunks);
__isl_give isl_val *isl_val_set_si(__isl_take isl_val *v, long i);
@ -145,11 +151,15 @@ __isl_give isl_printer *isl_printer_print_val(__isl_take isl_printer *p,
void isl_val_dump(__isl_keep isl_val *v);
__isl_give char *isl_val_to_str(__isl_keep isl_val *v);
isl_bool isl_multi_val_is_zero(__isl_keep isl_multi_val *mv);
__isl_overload
__isl_give isl_multi_val *isl_multi_val_add_val(__isl_take isl_multi_val *mv,
__isl_take isl_val *v);
__isl_give isl_multi_val *isl_multi_val_mod_val(__isl_take isl_multi_val *mv,
__isl_take isl_val *v);
__isl_constructor
__isl_give isl_multi_val *isl_multi_val_read_from_str(isl_ctx *ctx,
const char *str);
__isl_give isl_printer *isl_printer_print_multi_val(__isl_take isl_printer *p,
@ -157,7 +167,7 @@ __isl_give isl_printer *isl_printer_print_multi_val(__isl_take isl_printer *p,
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)
ISL_DECLARE_EXPORTED_LIST_FN(val)
#if defined(__cplusplus)
}

View File

@ -10,7 +10,7 @@ extern "C" {
struct __isl_export isl_val;
typedef struct isl_val isl_val;
ISL_DECLARE_LIST_TYPE(val)
ISL_DECLARE_EXPORTED_LIST_TYPE(val)
struct __isl_export isl_multi_val;
typedef struct isl_multi_val isl_multi_val;

View File

@ -30,7 +30,7 @@ __isl_null isl_vec *isl_vec_free(__isl_take isl_vec *vec);
isl_ctx *isl_vec_get_ctx(__isl_keep isl_vec *vec);
int isl_vec_size(__isl_keep isl_vec *vec);
isl_size isl_vec_size(__isl_keep isl_vec *vec);
__isl_give isl_val *isl_vec_get_element_val(__isl_keep isl_vec *vec, int pos);
__isl_give isl_vec *isl_vec_set_element_si(__isl_take isl_vec *vec,
int pos, int v);

View File

@ -18,15 +18,15 @@ struct isl_vertices;
typedef struct isl_vertices isl_vertices;
isl_ctx *isl_vertex_get_ctx(__isl_keep isl_vertex *vertex);
int isl_vertex_get_id(__isl_keep isl_vertex *vertex);
isl_size isl_vertex_get_id(__isl_keep isl_vertex *vertex);
__isl_give isl_basic_set *isl_vertex_get_domain(__isl_keep isl_vertex *vertex);
__isl_give isl_multi_aff *isl_vertex_get_expr(__isl_keep isl_vertex *vertex);
void isl_vertex_free(__isl_take isl_vertex *vertex);
__isl_null isl_vertex *isl_vertex_free(__isl_take isl_vertex *vertex);
__isl_give isl_vertices *isl_basic_set_compute_vertices(
__isl_keep isl_basic_set *bset);
isl_ctx *isl_vertices_get_ctx(__isl_keep isl_vertices *vertices);
int isl_vertices_get_n_vertices(__isl_keep isl_vertices *vertices);
isl_size isl_vertices_get_n_vertices(__isl_keep isl_vertices *vertices);
isl_stat isl_vertices_foreach_vertex(__isl_keep isl_vertices *vertices,
isl_stat (*fn)(__isl_take isl_vertex *vertex, void *user), void *user);
__isl_null isl_vertices *isl_vertices_free(__isl_take isl_vertices *vertices);
@ -35,7 +35,7 @@ isl_ctx *isl_cell_get_ctx(__isl_keep isl_cell *cell);
__isl_give isl_basic_set *isl_cell_get_domain(__isl_keep isl_cell *cell);
isl_stat isl_cell_foreach_vertex(__isl_keep isl_cell *cell,
isl_stat (*fn)(__isl_take isl_vertex *vertex, void *user), void *user);
void isl_cell_free(__isl_take isl_cell *cell);
__isl_null isl_cell *isl_cell_free(__isl_take isl_cell *cell);
isl_stat isl_vertices_foreach_cell(__isl_keep isl_vertices *vertices,
isl_stat (*fn)(__isl_take isl_cell *cell, void *user), void *user);

View File

@ -18,7 +18,7 @@ extract_interface_SOURCES = \
cpp_conversion.cc \
extract_interface.h \
extract_interface.cc
extract_interface_LDFLAGS = $(CLANG_LDFLAGS)
extract_interface_LDFLAGS = $(CLANG_LDFLAGS) $(CLANG_RFLAG)
extract_interface_LDADD = \
-lclangFrontend -lclangSerialization -lclangParse -lclangSema \
$(LIB_CLANG_EDIT) \

View File

@ -99,6 +99,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11_no_override.m4 \
$(top_srcdir)/m4/ax_detect_clang.m4 \
$(top_srcdir)/m4/ax_detect_git_head.m4 \
$(top_srcdir)/m4/ax_detect_gmp.m4 \
@ -230,13 +231,15 @@ CFLAGS = @CFLAGS@
CLANG_CXXFLAGS = @CLANG_CXXFLAGS@
CLANG_LDFLAGS = @CLANG_LDFLAGS@
CLANG_LIBS = @CLANG_LIBS@
CLANG_RFLAG = @CLANG_RFLAG@
CONFIG_STATUS_DEPENDENCIES = @CONFIG_STATUS_DEPENDENCIES@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXX11FLAGS = @CXX11FLAGS@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH = @CYGPATH@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
@ -266,12 +269,14 @@ LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_CLANG_EDIT = @LIB_CLANG_EDIT@
LIPO = @LIPO@
LLVM_CONFIG = @LLVM_CONFIG@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
MP_CFLAGS = @MP_CFLAGS@
MP_CPPFLAGS = @MP_CPPFLAGS@
MP_LDFLAGS = @MP_LDFLAGS@
MP_LIBS = @MP_LIBS@
@ -279,6 +284,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_SRCDIR = @OS_SRCDIR@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
@ -341,7 +347,6 @@ infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
llvm_config_found = @llvm_config_found@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
@ -385,7 +390,7 @@ extract_interface_SOURCES = \
extract_interface.h \
extract_interface.cc
extract_interface_LDFLAGS = $(CLANG_LDFLAGS)
extract_interface_LDFLAGS = $(CLANG_LDFLAGS) $(CLANG_RFLAG)
extract_interface_LDADD = \
-lclangFrontend -lclangSerialization -lclangParse -lclangSema \
$(LIB_CLANG_EDIT) \

File diff suppressed because it is too large Load Diff

View File

@ -24,17 +24,21 @@ public:
function_kind_member_method,
function_kind_constructor,
};
enum method_part {
decl,
impl,
};
virtual void generate();
private:
void print_file(ostream &os, std::string filename);
void print_forward_declarations(ostream &os);
void print_declarations(ostream &os);
void print_class(ostream &os, const isl_class &clazz);
void print_subclass_type(ostream &os, const isl_class &clazz);
void print_class_forward_decl(ostream &os, const isl_class &clazz);
void print_class_factory_decl(ostream &os, const isl_class &clazz,
const std::string &prefix = std::string());
void print_private_constructors_decl(ostream &os,
void print_protected_constructors_decl(ostream &os,
const isl_class &clazz);
void print_copy_assignment_decl(ostream &os, const isl_class &clazz);
void print_public_constructors_decl(ostream &os,
@ -42,12 +46,42 @@ private:
void print_constructors_decl(ostream &os, const isl_class &clazz);
void print_destructor_decl(ostream &os, const isl_class &clazz);
void print_ptr_decl(ostream &os, const isl_class &clazz);
void print_get_ctx_decl(ostream &os);
void print_isa_type_template(ostream &os, int indent,
const isl_class &super);
void print_downcast_decl(ostream &os, const isl_class &clazz);
void print_ctx_decl(ostream &os);
void print_persistent_callback_prototype(ostream &os,
const isl_class &clazz, FunctionDecl *method,
bool is_declaration);
void print_persistent_callback_setter_prototype(ostream &os,
const isl_class &clazz, FunctionDecl *method,
bool is_declaration);
void print_persistent_callback_data(ostream &os, const isl_class &clazz,
FunctionDecl *method);
void print_persistent_callbacks_decl(ostream &os,
const isl_class &clazz);
void print_methods_decl(ostream &os, const isl_class &clazz);
bool next_variant(FunctionDecl *fd, std::vector<bool> &convert);
template <enum method_part>
void print_method_variants(ostream &os, const isl_class &clazz,
FunctionDecl *fd);
void print_method_group_decl(ostream &os, const isl_class &clazz,
const set<FunctionDecl *> &methods);
void print_method_decl(ostream &os, const isl_class &clazz,
const function_set &methods);
void print_named_method_decl(ostream &os, const isl_class &clazz,
FunctionDecl *fd, const string &name, function_kind kind,
const std::vector<bool> &convert = {});
template <enum method_part>
void print_method(ostream &os, const isl_class &clazz,
FunctionDecl *method, function_kind kind);
template <enum method_part>
void print_method(ostream &os, const isl_class &clazz,
FunctionDecl *method, function_kind kind,
const std::vector<bool> &convert);
void print_set_enum_decl(ostream &os, const isl_class &clazz,
FunctionDecl *fd, const string &name);
void print_set_enums_decl(ostream &os, const isl_class &clazz,
FunctionDecl *fd);
void print_set_enums_decl(ostream &os, const isl_class &clazz);
void print_implementations(ostream &os);
void print_class_impl(ostream &os, const isl_class &clazz);
void print_check_ptr(ostream &os, const char *ptr);
@ -55,46 +89,81 @@ private:
const char *ptr);
void print_check_ptr_end(ostream &os, const char *ptr);
void print_class_factory_impl(ostream &os, const isl_class &clazz);
void print_private_constructors_impl(ostream &os,
void print_protected_constructors_impl(ostream &os,
const isl_class &clazz);
void print_public_constructors_impl(ostream &os,
const isl_class &clazz);
void print_constructors_impl(ostream &os, const isl_class &clazz);
void print_copy_assignment_impl(ostream &os, const isl_class &clazz);
void print_destructor_impl(ostream &os, const isl_class &clazz);
void print_check_no_persistent_callback(ostream &os,
const isl_class &clazz, FunctionDecl *fd);
void print_ptr_impl(ostream &os, const isl_class &clazz);
void print_get_ctx_impl(ostream &os, const isl_class &clazz);
void print_downcast_impl(ostream &os, const isl_class &clazz);
void print_ctx_impl(ostream &os, const isl_class &clazz);
void print_persistent_callbacks_impl(ostream &os,
const isl_class &clazz);
void print_methods_impl(ostream &os, const isl_class &clazz);
void print_method_group_impl(ostream &os, const isl_class &clazz,
const set<FunctionDecl *> &methods);
const function_set &methods);
void print_argument_validity_check(ostream &os, FunctionDecl *method,
function_kind kind);
void print_save_ctx(ostream &os, FunctionDecl *method,
function_kind kind);
void print_on_error_continue(ostream &os);
void print_exceptional_execution_check(ostream &os,
FunctionDecl *method);
const isl_class &clazz, FunctionDecl *method,
function_kind kind);
void print_set_persistent_callback(ostream &os, const isl_class &clazz,
FunctionDecl *method, function_kind kind);
void print_method_return(ostream &os, const isl_class &clazz,
FunctionDecl *method);
void print_method_impl(ostream &os, const isl_class &clazz,
FunctionDecl *method, function_kind kind);
void print_set_enum_impl(ostream &os, const isl_class &clazz,
FunctionDecl *fd, const string &enum_name,
const string &method_name);
void print_set_enums_impl(ostream &os, const isl_class &clazz,
FunctionDecl *fd);
void print_set_enums_impl(ostream &os, const isl_class &clazz);
template <enum method_part>
void print_get_method(ostream &os, const isl_class &clazz,
FunctionDecl *fd);
void print_invalid(ostream &os, int indent, const char *msg,
const char *checked_code);
void print_stream_insertion(ostream &os, const isl_class &clazz);
void print_method_param_use(ostream &os, ParmVarDecl *param,
bool load_from_this_ptr);
std::string get_return_type(const isl_class &clazz, FunctionDecl *fd);
ParmVarDecl *get_param(FunctionDecl *fd, int pos,
const std::vector<bool> &convert);
void print_method_header(ostream &os, const isl_class &clazz,
FunctionDecl *method, const string &cname, int num_params,
bool is_declaration, function_kind kind,
const std::vector<bool> &convert = {});
void print_named_method_header(ostream &os, const isl_class &clazz,
FunctionDecl *method, string name, bool is_declaration,
function_kind kind, const std::vector<bool> &convert = {});
void print_method_header(ostream &os, const isl_class &clazz,
FunctionDecl *method, bool is_declaration, function_kind kind);
string generate_callback_args(QualType type, bool cpp);
string generate_callback_type(QualType type);
void print_wrapped_call_checked(std::ostream &os,
void print_wrapped_call_checked(std::ostream &os, int indent,
const std::string &call);
void print_wrapped_call(std::ostream &os, const std::string &call);
void print_wrapped_call(std::ostream &os, int indent,
const std::string &call, QualType rtype);
void print_callback_data_decl(ostream &os, ParmVarDecl *param,
const string &name);
void print_callback_body(ostream &os, int indent, ParmVarDecl *param,
const string &name);
void print_callback_local(ostream &os, ParmVarDecl *param);
std::string rename_method(std::string name);
string type2cpp(const isl_class &clazz);
string isl_bool2cpp();
string isl_namespace();
string type2cpp(QualType type);
bool is_implicit_conversion(const isl_class &clazz, FunctionDecl *cons);
bool is_subclass(QualType subclass_type, const isl_class &class_type);
function_kind get_method_kind(const isl_class &clazz,
FunctionDecl *method);
public:
static string type2cpp(const isl_class &clazz);
static string type2cpp(string type_string);
};

View File

@ -6,17 +6,46 @@
* Written by Sven Verdoolaege.
*/
#include <stdio.h>
#include <map>
#include <string>
#include "cpp.h"
#include "cpp_conversion.h"
/* Print a function called "function" for converting objects of
* type "name" from the "from" bindings to the "to" bindings.
/* If "clazz" describes a subclass of a C type, then print code
* for converting an object of the class derived from the C type
* to the subclass. Do this by first converting this class
* to the immediate superclass of the subclass and then converting
* from this superclass to the subclass.
*/
static void convert(const char *name, const char *from, const char *to,
const char *function)
void cpp_conversion_generator::cast(const isl_class &clazz, const char *to)
{
printf("%s%s %s(%s%s obj) {\n", to, name, function, from, name);
printf("\t""return %s""manage(obj.copy());\n", to);
string name = cpp_generator::type2cpp(clazz);
if (!clazz.is_type_subclass())
return;
cast(classes[clazz.superclass_name], to);
printf(".as<%s%s>()", to, name.c_str());
}
/* Print a function called "function" for converting objects of
* "clazz" from the "from" bindings to the "to" bindings.
* If "clazz" describes a subclass of a C type, then the result
* of the conversion between bindings is derived from the C type and
* needs to be converted back to the subclass.
*/
void cpp_conversion_generator::convert(const isl_class &clazz,
const char *from, const char *to, const char *function)
{
string name = cpp_generator::type2cpp(clazz);
printf("%s%s %s(%s%s obj) {\n",
to, name.c_str(), function, from, name.c_str());
printf("\t""return %s""manage(obj.copy())", to);
cast(clazz, to);
printf(";\n");
printf("}\n");
printf("\n");
}
@ -36,12 +65,10 @@ static void convert(const char *name, const char *from, const char *to,
* return manage(obj.copy());
* }
*/
static void print(const isl_class &clazz)
void cpp_conversion_generator::print(const isl_class &clazz)
{
string name = cpp_generator::type2cpp(clazz.name);
convert(name.c_str(), "", "checked::", "check");
convert(name.c_str(), "checked::", "", "uncheck");
convert(clazz, "", "checked::", "check");
convert(clazz, "checked::", "", "uncheck");
}
/* Generate conversion functions for converting objects between

View File

@ -1,6 +1,10 @@
#include "generator.h"
class cpp_conversion_generator : public generator {
void cast(const isl_class &clazz, const char *to);
void convert(const isl_class &clazz, const char *from, const char *to,
const char *function);
void print(const isl_class &clazz);
public:
cpp_conversion_generator(SourceManager &SM,
set<RecordDecl *> &exported_types,

View File

@ -32,6 +32,7 @@
*/
#include "isl_config.h"
#undef PACKAGE
#include <assert.h>
#include <iostream>
@ -41,12 +42,16 @@
#else
#include <memory>
#endif
#ifdef HAVE_LLVM_OPTION_ARG_H
#include <llvm/Option/Arg.h>
#endif
#include <llvm/Support/raw_ostream.h>
#include <llvm/Support/CommandLine.h>
#include <llvm/Support/Host.h>
#include <llvm/Support/ManagedStatic.h>
#include <clang/AST/ASTContext.h>
#include <clang/AST/ASTConsumer.h>
#include <clang/Basic/Builtins.h>
#include <clang/Basic/FileSystemOptions.h>
#include <clang/Basic/FileManager.h>
#include <clang/Basic/TargetOptions.h>
@ -83,6 +88,9 @@
using namespace std;
using namespace clang;
using namespace clang::driver;
#ifdef HAVE_LLVM_OPTION_ARG_H
using namespace llvm::opt;
#endif
#ifdef HAVE_ADT_OWNINGPTR_H
#define unique_ptr llvm::OwningPtr
@ -94,7 +102,7 @@ static llvm::cl::list<string> Includes("I",
llvm::cl::desc("Header search path"),
llvm::cl::value_desc("path"), llvm::cl::Prefix);
static llvm::cl::opt<string> Language(llvm::cl::Required,
static llvm::cl::opt<string> OutputLanguage(llvm::cl::Required,
llvm::cl::ValueRequired, "language",
llvm::cl::desc("Bindings to generate"),
llvm::cl::value_desc("name"));
@ -203,6 +211,32 @@ struct ClangAPI {
static Command *command(Command &C) { return &C; }
};
#ifdef CREATE_FROM_ARGS_TAKES_ARRAYREF
/* Call CompilerInvocation::CreateFromArgs with the right arguments.
* In this case, an ArrayRef<const char *>.
*/
static void create_from_args(CompilerInvocation &invocation,
const ArgStringList *args, DiagnosticsEngine &Diags)
{
CompilerInvocation::CreateFromArgs(invocation, *args, Diags);
}
#else
/* Call CompilerInvocation::CreateFromArgs with the right arguments.
* In this case, two "const char *" pointers.
*/
static void create_from_args(CompilerInvocation &invocation,
const ArgStringList *args, DiagnosticsEngine &Diags)
{
CompilerInvocation::CreateFromArgs(invocation, args->data() + 1,
args->data() + args->size(),
Diags);
}
#endif
/* Create a CompilerInvocation object that stores the command line
* arguments constructed by the driver.
* The arguments are mainly useful for setting up the system include
@ -227,9 +261,7 @@ static CompilerInvocation *construct_invocation(const char *filename,
const ArgStringList *args = &cmd->getArguments();
CompilerInvocation *invocation = new CompilerInvocation;
CompilerInvocation::CreateFromArgs(*invocation, args->data() + 1,
args->data() + args->size(),
Diags);
create_from_args(*invocation, args, Diags);
return invocation;
}
@ -396,6 +428,44 @@ static void set_invocation(CompilerInstance *Clang,
#endif
/* Helper function for ignore_error that only gets enabled if T
* (which is either const FileEntry * or llvm::ErrorOr<const FileEntry *>)
* has getError method, i.e., if it is llvm::ErrorOr<const FileEntry *>.
*/
template <class T>
static const FileEntry *ignore_error_helper(const T obj, int,
int[1][sizeof(obj.getError())])
{
return *obj;
}
/* Helper function for ignore_error that is always enabled,
* but that only gets selected if the variant above is not enabled,
* i.e., if T is const FileEntry *.
*/
template <class T>
static const FileEntry *ignore_error_helper(const T obj, long, void *)
{
return obj;
}
/* Given either a const FileEntry * or a llvm::ErrorOr<const FileEntry *>,
* extract out the const FileEntry *.
*/
template <class T>
static const FileEntry *ignore_error(const T obj)
{
return ignore_error_helper(obj, 0, NULL);
}
/* Return the FileEntry corresponding to the given file name
* in the given compiler instances, ignoring any error.
*/
static const FileEntry *getFile(CompilerInstance *Clang, std::string Filename)
{
return ignore_error(Clang->getFileManager().getFile(Filename));
}
/* Create an interface generator for the selected language and
* then use it to generate the interface.
*/
@ -403,20 +473,21 @@ static void generate(MyASTConsumer &consumer, SourceManager &SM)
{
generator *gen;
if (Language.compare("python") == 0) {
if (OutputLanguage.compare("python") == 0) {
gen = new python_generator(SM, consumer.exported_types,
consumer.exported_functions, consumer.functions);
} else if (Language.compare("cpp") == 0) {
} else if (OutputLanguage.compare("cpp") == 0) {
gen = new cpp_generator(SM, consumer.exported_types,
consumer.exported_functions, consumer.functions);
} else if (Language.compare("cpp-checked") == 0) {
} else if (OutputLanguage.compare("cpp-checked") == 0) {
gen = new cpp_generator(SM, consumer.exported_types,
consumer.exported_functions, consumer.functions, true);
} else if (Language.compare("cpp-checked-conversion") == 0) {
} else if (OutputLanguage.compare("cpp-checked-conversion") == 0) {
gen = new cpp_conversion_generator(SM, consumer.exported_types,
consumer.exported_functions, consumer.functions);
} else {
cerr << "Language '" << Language << "' not recognized." << endl
cerr << "Language '" << OutputLanguage
<< "' not recognized." << endl
<< "Not generating bindings." << endl;
exit(EXIT_FAILURE);
}
@ -432,15 +503,15 @@ int main(int argc, char *argv[])
create_diagnostics(Clang);
DiagnosticsEngine &Diags = Clang->getDiagnostics();
Diags.setSuppressSystemWarnings(true);
TargetInfo *target = create_target_info(Clang, Diags);
Clang->setTarget(target);
set_lang_defaults(Clang);
CompilerInvocation *invocation =
construct_invocation(InputFilename.c_str(), Diags);
if (invocation)
set_invocation(Clang, invocation);
Clang->createFileManager();
Clang->createSourceManager(Clang->getFileManager());
TargetInfo *target = create_target_info(Clang, Diags);
Clang->setTarget(target);
set_lang_defaults(Clang);
HeaderSearchOptions &HSO = Clang->getHeaderSearchOpts();
LangOptions &LO = Clang->getLangOpts();
PreprocessorOptions &PO = Clang->getPreprocessorOpts();
@ -464,7 +535,7 @@ int main(int argc, char *argv[])
PP.getBuiltinInfo().initializeBuiltins(PP.getIdentifierTable(), LO);
const FileEntry *file = Clang->getFileManager().getFile(InputFilename);
const FileEntry *file = getFile(Clang, InputFilename);
assert(file);
create_main_file_id(Clang->getSourceManager(), file);
@ -482,5 +553,7 @@ int main(int argc, char *argv[])
delete Clang;
llvm::llvm_shutdown();
if (Diags.hasErrorOccurred())
return EXIT_FAILURE;
return EXIT_SUCCESS;
}

View File

@ -33,6 +33,7 @@
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <clang/AST/Attr.h>
@ -42,11 +43,26 @@
#include "extract_interface.h"
#include "generator.h"
/* Compare the prefix of "s" to "prefix" up to the length of "prefix".
const char *isl_class::get_prefix = "get_";
const char *isl_class::set_callback_prefix = "set_";
/* Should "method" be considered to be a static method?
* That is, is the first argument something other than
* an instance of the class?
*/
static int prefixcmp(const char *s, const char *prefix)
bool isl_class::is_static(FunctionDecl *method) const
{
return strncmp(s, prefix, strlen(prefix));
ParmVarDecl *param;
QualType type;
if (method->getNumParams() < 1)
return true;
param = method->getParamDecl(0);
type = param->getOriginalType();
if (!generator::is_isl_type(type))
return true;
return generator::extract_type(type) != name;
}
/* Should "method" be considered to be a static method?
@ -55,12 +71,31 @@ static int prefixcmp(const char *s, const char *prefix)
*/
bool generator::is_static(const isl_class &clazz, FunctionDecl *method)
{
ParmVarDecl *param = method->getParamDecl(0);
QualType type = param->getOriginalType();
return clazz.is_static(method);
}
if (!is_isl_type(type))
return true;
return extract_type(type) != clazz.name;
/* Does "fd" modify an object of "clazz"?
* That is, is it an object method that takes the object and
* returns (gives) an object of the same type?
*/
bool generator::is_mutator(const isl_class &clazz, FunctionDecl *fd)
{
ParmVarDecl *param;
QualType type, return_type;
if (fd->getNumParams() < 1)
return false;
if (is_static(clazz, fd))
return false;
if (!gives(fd))
return false;
param = fd->getParamDecl(0);
if (!takes(param))
return false;
type = param->getOriginalType();
return_type = fd->getReturnType();
return return_type == type;
}
/* Find the FunctionDecl with name "name",
@ -79,49 +114,291 @@ FunctionDecl *generator::find_by_name(const string &name, bool required)
return NULL;
}
/* List of conversion functions that are used to automatically convert
* the second argument of the conversion function to its function result.
*/
const std::set<std::string> generator::automatic_conversion_functions = {
"isl_id_read_from_str",
"isl_val_int_from_si",
};
/* Extract information about the automatic conversion function "fd",
* storing the results in this->conversions.
*
* A function used for automatic conversion has exactly two arguments,
* an isl_ctx and a non-isl object, and it returns an isl object.
* Store a mapping from the isl object return type
* to the non-isl object source type.
*/
void generator::extract_automatic_conversion(FunctionDecl *fd)
{
QualType return_type = fd->getReturnType();
const Type *type = return_type.getTypePtr();
if (fd->getNumParams() != 2)
die("Expecting two arguments");
if (!is_isl_ctx(fd->getParamDecl(0)->getOriginalType()))
die("Expecting isl_ctx first argument");
if (!is_isl_type(return_type))
die("Expecting isl object return type");
conversions[type] = fd->getParamDecl(1);
}
/* Extract information about all automatic conversion functions
* for the given class, storing the results in this->conversions.
*
* In particular, look through all exported constructors for the class and
* check if any of them is explicitly marked as a conversion function.
*/
void generator::extract_class_automatic_conversions(const isl_class &clazz)
{
const function_set &constructors = clazz.constructors;
function_set::iterator fi;
for (fi = constructors.begin(); fi != constructors.end(); ++fi) {
FunctionDecl *fd = *fi;
string name = fd->getName();
if (automatic_conversion_functions.count(name) != 0)
extract_automatic_conversion(fd);
}
}
/* Extract information about all automatic conversion functions,
* storing the results in this->conversions.
*/
void generator::extract_automatic_conversions()
{
map<string, isl_class>::iterator ci;
for (ci = classes.begin(); ci != classes.end(); ++ci)
extract_class_automatic_conversions(ci->second);
}
/* Add a subclass derived from "decl" called "sub_name" to the set of classes,
* keeping track of the _to_str, _copy and _free functions, if any, separately.
* "sub_name" is either the name of the class itself or
* the name of a type based subclass.
* If the class is a proper subclass, then "super_name" is the name
* of its immediate superclass.
*/
void generator::add_subclass(RecordDecl *decl, const string &super_name,
const string &sub_name)
{
string name = decl->getName();
classes[sub_name].name = name;
classes[sub_name].superclass_name = super_name;
classes[sub_name].subclass_name = sub_name;
classes[sub_name].type = decl;
classes[sub_name].fn_to_str = find_by_name(name + "_to_str", false);
classes[sub_name].fn_copy = find_by_name(name + "_copy", true);
classes[sub_name].fn_free = find_by_name(name + "_free", true);
}
/* Add a class derived from "decl" to the set of classes,
* keeping track of the _to_str, _copy and _free functions, if any, separately.
*/
void generator::add_class(RecordDecl *decl)
{
return add_subclass(decl, "", decl->getName());
}
/* Given a function "fn_type" that returns the subclass type
* of a C object, create subclasses for each of the (non-negative)
* return values.
*
* The function "fn_type" is also stored in the superclass,
* along with all pairs of type values and subclass names.
*/
void generator::add_type_subclasses(FunctionDecl *fn_type)
{
QualType return_type = fn_type->getReturnType();
const EnumType *enum_type = return_type->getAs<EnumType>();
EnumDecl *decl = enum_type->getDecl();
isl_class *c = method2class(fn_type);
DeclContext::decl_iterator i;
c->fn_type = fn_type;
for (i = decl->decls_begin(); i != decl->decls_end(); ++i) {
EnumConstantDecl *ecd = dyn_cast<EnumConstantDecl>(*i);
int val = (int) ecd->getInitVal().getSExtValue();
string name = ecd->getNameAsString();
if (val < 0)
continue;
c->type_subclasses[val] = name;
add_subclass(c->type, c->subclass_name, name);
}
}
/* Add information about the enum values in "decl", set by "fd",
* to c->set_enums. "prefix" is the prefix of the generated method names.
* In particular, it has the name of the enum type removed.
*
* In particular, for each non-negative enum value, keep track of
* the value, the name and the corresponding method name.
*/
static void add_set_enum(isl_class *c, const string &prefix, EnumDecl *decl,
FunctionDecl *fd)
{
DeclContext::decl_iterator i;
for (i = decl->decls_begin(); i != decl->decls_end(); ++i) {
EnumConstantDecl *ecd = dyn_cast<EnumConstantDecl>(*i);
int val = (int) ecd->getInitVal().getSExtValue();
string name = ecd->getNameAsString();
string method_name;
if (val < 0)
continue;
method_name = prefix + name.substr(4);
c->set_enums[fd].push_back(set_enum(val, name, method_name));
}
}
/* Check if "fd" sets an enum value and, if so, add information
* about the enum values to c->set_enums.
*
* A function is considered to set an enum value if:
* - the function returns an object of the same type
* - the last argument is of type enum
* - the name of the function ends with the name of the enum
*/
static bool handled_sets_enum(isl_class *c, FunctionDecl *fd)
{
unsigned n;
ParmVarDecl *param;
const EnumType *enum_type;
EnumDecl *decl;
string enum_name;
string fd_name;
string prefix;
size_t pos;
if (!generator::is_mutator(*c, fd))
return false;
n = fd->getNumParams();
if (n < 2)
return false;
param = fd->getParamDecl(n - 1);
enum_type = param->getType()->getAs<EnumType>();
if (!enum_type)
return false;
decl = enum_type->getDecl();
enum_name = decl->getName();
enum_name = enum_name.substr(4);
fd_name = c->method_name(fd);
pos = fd_name.find(enum_name);
if (pos == std::string::npos)
return false;
prefix = fd_name.substr(0, pos);
add_set_enum(c, prefix, decl, fd);
return true;
}
/* Return the callback argument of a function setting
* a persistent callback.
* This callback is in the second argument (position 1).
*/
ParmVarDecl *generator::persistent_callback_arg(FunctionDecl *fd)
{
return fd->getParamDecl(1);
}
/* Does the given function set a persistent callback?
* The following heuristics are used to determine this property:
* - the function returns an object of the same type
* - its name starts with "set_"
* - it has exactly three arguments
* - the second (position 1) of which is a callback
*/
static bool sets_persistent_callback(isl_class *c, FunctionDecl *fd)
{
ParmVarDecl *param;
if (!generator::is_mutator(*c, fd))
return false;
if (fd->getNumParams() != 3)
return false;
param = generator::persistent_callback_arg(fd);
if (!generator::is_callback(param->getType()))
return false;
return prefixcmp(c->method_name(fd).c_str(),
c->set_callback_prefix) == 0;
}
/* Sorting function that places declaration of functions
* with a shorter name first.
*/
static bool less_name(const FunctionDecl *a, const FunctionDecl *b)
{
return a->getName().size() < b->getName().size();
}
/* Collect all functions that belong to a certain type, separating
* constructors from regular methods and keeping track of the _to_str,
* constructors from methods that set persistent callback and
* from regular methods, while keeping track of the _to_str,
* _copy and _free functions, if any, separately. If there are any overloaded
* functions, then they are grouped based on their name after removing the
* argument type suffix.
* Check for functions that describe subclasses before considering
* any other functions in order to be able to detect those other
* functions as belonging to the subclasses.
* Sort the names of the functions based on their lengths
* to ensure that nested subclasses are handled later.
*/
generator::generator(SourceManager &SM, set<RecordDecl *> &exported_types,
set<FunctionDecl *> exported_functions, set<FunctionDecl *> functions) :
SM(SM)
{
map<string, isl_class>::iterator ci;
set<FunctionDecl *>::iterator in;
set<RecordDecl *>::iterator it;
vector<FunctionDecl *> type_subclasses;
vector<FunctionDecl *>::iterator iv;
for (in = functions.begin(); in != functions.end(); ++in) {
FunctionDecl *decl = *in;
functions_by_name[decl->getName()] = decl;
}
set<RecordDecl *>::iterator it;
for (it = exported_types.begin(); it != exported_types.end(); ++it) {
RecordDecl *decl = *it;
string name = decl->getName();
classes[name].name = name;
classes[name].type = decl;
classes[name].fn_to_str = find_by_name(name + "_to_str", false);
classes[name].fn_copy = find_by_name(name + "_copy", true);
classes[name].fn_free = find_by_name(name + "_free", true);
for (it = exported_types.begin(); it != exported_types.end(); ++it)
add_class(*it);
for (in = exported_functions.begin(); in != exported_functions.end();
++in) {
if (is_subclass(*in))
type_subclasses.push_back(*in);
}
std::sort(type_subclasses.begin(), type_subclasses.end(), &less_name);
for (iv = type_subclasses.begin(); iv != type_subclasses.end(); ++iv) {
add_type_subclasses(*iv);
}
for (in = exported_functions.begin(); in != exported_functions.end();
++in) {
FunctionDecl *method = *in;
isl_class *c = method2class(method);
isl_class *c;
if (is_subclass(method))
continue;
c = method2class(method);
if (!c)
continue;
if (is_constructor(method)) {
c->constructors.insert(method);
} else if (handled_sets_enum(c, method)) {
} else if (sets_persistent_callback(c, method)) {
c->persistent_callbacks.insert(method);
} else {
string fullname = c->name_without_type_suffix(method);
string fullname = c->name_without_type_suffixes(method);
c->methods[fullname].insert(method);
}
}
extract_automatic_conversions();
}
/* Print error message "msg" and abort.
@ -145,10 +422,20 @@ void generator::die(string msg)
* appear in the source. In particular, the first annotation
* is the one that is closest to the annotated type and the corresponding
* type is then also the first that will appear in the sequence of types.
* This is also the order in which the annotations appear
* in the AttrVec returned by Decl::getAttrs() in older versions of clang.
* In newer versions of clang, the order is that in which
* the attribute appears in the source.
* Use the position of the "isl_export" attribute to determine
* whether this is an old (with reversed order) or a new version.
* The "isl_export" attribute is automatically added
* after each "isl_subclass" attribute. If it appears in the list before
* any "isl_subclass" is encountered, then this must be a reversed list.
*/
std::vector<string> generator::find_superclasses(RecordDecl *decl)
std::vector<string> generator::find_superclasses(Decl *decl)
{
vector<string> super;
bool reversed = false;
if (!decl->hasAttrs())
return super;
@ -161,15 +448,27 @@ std::vector<string> generator::find_superclasses(RecordDecl *decl)
if (!ann)
continue;
string s = ann->getAnnotation().str();
if (s == "isl_export" && super.size() == 0)
reversed = true;
if (s.substr(0, len) == sub) {
s = s.substr(len + 1, s.length() - len - 2);
super.push_back(s);
if (reversed)
super.push_back(s);
else
super.insert(super.begin(), s);
}
}
return super;
}
/* Is "decl" marked as describing subclasses?
*/
bool generator::is_subclass(FunctionDecl *decl)
{
return find_superclasses(decl).size() > 0;
}
/* Is decl marked as being part of an overloaded method?
*/
bool generator::is_overload(Decl *decl)
@ -205,7 +504,7 @@ bool generator::gives(Decl *decl)
return has_annotation(decl, "isl_give");
}
/* Return the class that has a name that matches the initial part
/* Return the class that has a name that best matches the initial part
* of the name of function "fd" or NULL if no such class could be found.
*/
isl_class *generator::method2class(FunctionDecl *fd)
@ -215,7 +514,9 @@ isl_class *generator::method2class(FunctionDecl *fd)
string name = fd->getNameAsString();
for (ci = classes.begin(); ci != classes.end(); ++ci) {
if (name.substr(0, ci->first.length()) == ci->first)
size_t len = ci->first.length();
if (len > best.length() && name.substr(0, len) == ci->first &&
name[len] == '_')
best = ci->first;
}
@ -232,7 +533,7 @@ isl_class *generator::method2class(FunctionDecl *fd)
bool generator::is_isl_ctx(QualType type)
{
if (!type->isPointerType())
return 0;
return false;
type = type->getPointeeType();
if (type.getAsString() != "isl_ctx")
return false;
@ -346,9 +647,17 @@ bool generator::is_isl_type(QualType type)
return false;
}
/* Is "type" the type isl_bool?
/* Is "type" one of the integral types with a negative value
* indicating an error condition?
*/
bool generator::is_isl_bool(QualType type)
bool generator::is_isl_neg_error(QualType type)
{
return is_isl_bool(type) || is_isl_stat(type) || is_isl_size(type);
}
/* Is "type" the primitive type with the given name?
*/
static bool is_isl_primitive(QualType type, const char *name)
{
string s;
@ -356,22 +665,29 @@ bool generator::is_isl_bool(QualType type)
return false;
s = type.getAsString();
return s == "isl_bool";
return s == name;
}
/* Is "type" the type isl_bool?
*/
bool generator::is_isl_bool(QualType type)
{
return is_isl_primitive(type, "isl_bool");
}
/* Is "type" the type isl_stat?
*/
bool generator::is_isl_stat(QualType type)
{
string s;
if (type->isPointerType())
return false;
s = type.getAsString();
return s == "isl_stat";
return is_isl_primitive(type, "isl_stat");
}
/* Is "type" the type isl_size?
*/
bool generator::is_isl_size(QualType type)
{
return is_isl_primitive(type, "isl_size");
}
/* Is "type" that of a pointer to a function?
*/
@ -403,6 +719,14 @@ bool generator::is_long(QualType type)
return builtin && builtin->getKind() == BuiltinType::Long;
}
/* Is "type" that of "unsigned int"?
*/
static bool is_unsigned_int(QualType type)
{
const BuiltinType *builtin = type->getAs<BuiltinType>();
return builtin && builtin->getKind() == BuiltinType::UInt;
}
/* Return the name of the type that "type" points to.
* The input "type" is assumed to be a pointer type.
*/
@ -421,30 +745,90 @@ const FunctionProtoType *generator::extract_prototype(QualType type)
return type->getPointeeType()->getAs<FunctionProtoType>();
}
/* If "method" is overloaded, then return its name with the suffix
* corresponding to the type of the final argument removed.
* Otherwise, simply return the name of the function.
/* Return the function name suffix for the type of "param".
*
* If the type of "param" is an isl object type,
* then the suffix is the name of the type with the "isl" prefix removed,
* but keeping the "_".
* If the type is an unsigned integer, then the type suffix is "_ui".
*/
string isl_class::name_without_type_suffix(FunctionDecl *method)
static std::string type_suffix(ParmVarDecl *param)
{
QualType type;
type = param->getOriginalType();
if (generator::is_isl_type(type))
return generator::extract_type(type).substr(3);
else if (is_unsigned_int(type))
return "_ui";
generator::die("Unsupported type suffix");
}
/* If "suffix" is a suffix of "s", then return "s" with the suffix removed.
* Otherwise, simply return "s".
*/
static std::string drop_suffix(const std::string &s, const std::string &suffix)
{
size_t len, suffix_len;
len = s.length();
suffix_len = suffix.length();
if (len >= suffix_len && s.substr(len - suffix_len) == suffix)
return s.substr(0, len - suffix_len);
else
return s;
}
/* If "method" is overloaded, then return its name with the suffixes
* corresponding to the types of the final arguments removed.
* Otherwise, simply return the name of the function.
* Start from the final argument and keep removing suffixes
* matching arguments, independently of whether previously considered
* arguments matched.
*/
string isl_class::name_without_type_suffixes(FunctionDecl *method)
{
int num_params;
ParmVarDecl *param;
string name, type;
size_t name_len, type_len;
string name;
name = method->getName();
if (!generator::is_overload(method))
return name;
num_params = method->getNumParams();
param = method->getParamDecl(num_params - 1);
type = generator::extract_type(param->getOriginalType());
type = type.substr(4);
name_len = name.length();
type_len = type.length();
for (int i = num_params - 1; i >= 0; --i) {
ParmVarDecl *param;
string type;
if (name_len > type_len && name.substr(name_len - type_len) == type)
name = name.substr(0, name_len - type_len - 1);
param = method->getParamDecl(i);
type = type_suffix(param);
name = drop_suffix(name, type);
}
return name;
}
/* Is function "fd" with the given name a "get" method?
*
* A "get" method is an instance method
* with a name that starts with the get method prefix.
*/
bool isl_class::is_get_method_name(FunctionDecl *fd, const string &name) const
{
return !is_static(fd) && prefixcmp(name.c_str(), get_prefix) == 0;
}
/* Extract the method name corresponding to "fd".
*
* If "fd" is a "get" method, then drop the "get" method prefix.
*/
string isl_class::method_name(FunctionDecl *fd) const
{
string base = base_method_name(fd);
if (is_get_method_name(fd, base))
return base.substr(strlen(get_prefix));
return base;
}

View File

@ -4,39 +4,124 @@
#include <map>
#include <set>
#include <string>
#include <vector>
#include <clang/AST/Decl.h>
using namespace std;
using namespace clang;
/* Compare the prefix of "s" to "prefix" up to the length of "prefix".
*/
inline int prefixcmp(const char *s, const char *prefix)
{
return strncmp(s, prefix, strlen(prefix));
}
/* Information about a single enum value of an enum set by a function.
* "value" is the enum value.
* "name" is the corresponding name.
* "method_name" is the the name of the method that sets this value.
*/
struct set_enum {
int value;
string name;
string method_name;
set_enum(int value, string name, string method_name) :
value(value), name(name), method_name(method_name) {}
};
/* Helper structure for sorting FunctionDecl pointers
* on the corresponding function names.
*/
struct function_name_less {
bool operator()(FunctionDecl *x, FunctionDecl *y) {
return x->getName() < y->getName();
}
};
/* Set of FunctionDecl pointers sorted on function name.
*/
typedef std::set<FunctionDecl *, function_name_less> function_set;
/* isl_class collects all constructors and methods for an isl "class".
* "name" is the name of the class.
* If this object describes a subclass of a C type, then
* "subclass_name" is the name of that subclass and "superclass_name"
* is the name of the immediate superclass of that subclass. Otherwise,
* "subclass_name" is equal to "name" and "superclass_name" is undefined.
* "type" is the declaration that introduces the type.
* "persistent_callbacks" contains the set of functions that
* set a persistent callback.
* "set_enums" maps the set of functions that set an enum value
* to information associated to each value.
* A function is considered to set an enum value if it returns
* an object of the same type and if its last argument is of an enum type.
* "methods" contains the set of methods, grouped by method name.
* "fn_to_str" is a reference to the *_to_str method of this class, if any.
* "fn_copy" is a reference to the *_copy method of this class, if any.
* "fn_free" is a reference to the *_free method of this class, if any.
* "fn_type" is a reference to a function that described subclasses, if any.
* If "fn_type" is set, then "type_subclasses" maps the values returned
* by that function to the names of the corresponding subclasses.
*/
struct isl_class {
string name;
string superclass_name;
string subclass_name;
RecordDecl *type;
set<FunctionDecl *> constructors;
map<string, set<FunctionDecl *> > methods;
function_set constructors;
set<FunctionDecl *> persistent_callbacks;
map<FunctionDecl *, vector<set_enum> > set_enums;
map<string, function_set> methods;
map<int, string> type_subclasses;
FunctionDecl *fn_type;
FunctionDecl *fn_to_str;
FunctionDecl *fn_copy;
FunctionDecl *fn_free;
/* Return name of "fd" without type suffix, if any. */
static string name_without_type_suffix(FunctionDecl *fd);
/* Does "method" correspond to a static method? */
bool is_static(FunctionDecl *method) const;
/* Is this class a subclass based on a type function? */
bool is_type_subclass() const { return name != subclass_name; }
/* Return name of "fd" without type suffixes, if any. */
static string name_without_type_suffixes(FunctionDecl *fd);
/* Extract the method name corresponding to "fd"
* (including "get" method prefix if any).
*/
string base_method_name(FunctionDecl *fd) const {
string m_name = name_without_type_suffixes(fd);
return m_name.substr(subclass_name.length() + 1);
}
/* The prefix of a "get" method. */
static const char *get_prefix;
/* Is function "fd" with the given name a "get" method? */
bool is_get_method_name(FunctionDecl *fd, const string &name) const;
/* Is function "fd" a "get" method? */
bool is_get_method(FunctionDecl *fd) const {
return is_get_method_name(fd, base_method_name(fd));
}
/* Extract the method name corresponding to "fd". */
string method_name(FunctionDecl *fd) const {
string m_name = name_without_type_suffix(fd);
return m_name.substr(name.length() + 1);
string method_name(FunctionDecl *fd) const;
/* The prefix of any method that may set a (persistent) callback. */
static const char *set_callback_prefix;
/* Given a function that sets a persistent callback,
* return the name of the callback.
*/
string persistent_callback_name(FunctionDecl *fd) const {
return method_name(fd).substr(strlen(set_callback_prefix));
}
/* Does this class have any functions that set a persistent callback?
*/
bool has_persistent_callbacks() const {
return persistent_callbacks.size() != 0;
}
};
/* Base class for interface generators.
*
* "conversions" maps the target type of automatic conversion
* to the second input argument of the conversion function.
*/
class generator {
protected:
@ -53,13 +138,24 @@ public:
virtual ~generator() {};
protected:
void add_subclass(RecordDecl *decl, const string &name,
const string &sub_name);
void add_class(RecordDecl *decl);
void add_type_subclasses(FunctionDecl *method);
isl_class *method2class(FunctionDecl *fd);
bool callback_takes_argument(ParmVarDecl *param, int pos);
FunctionDecl *find_by_name(const string &name, bool required);
std::map<const Type *, ParmVarDecl *> conversions;
private:
static const std::set<std::string> automatic_conversion_functions;
void extract_automatic_conversion(FunctionDecl *fd);
void extract_class_automatic_conversions(const isl_class &clazz);
void extract_automatic_conversions();
public:
static void die(const char *msg) __attribute__((noreturn));
static void die(string msg) __attribute__((noreturn));
static vector<string> find_superclasses(RecordDecl *decl);
static vector<string> find_superclasses(Decl *decl);
static bool is_subclass(FunctionDecl *decl);
static bool is_overload(Decl *decl);
static bool is_constructor(Decl *decl);
static bool takes(Decl *decl);
@ -68,14 +164,18 @@ public:
static bool is_isl_ctx(QualType type);
static bool first_arg_is_isl_ctx(FunctionDecl *fd);
static bool is_isl_type(QualType type);
static bool is_isl_neg_error(QualType type);
static bool is_isl_bool(QualType type);
static bool is_isl_stat(QualType type);
static bool is_isl_size(QualType type);
static bool is_long(QualType type);
static bool is_callback(QualType type);
static bool is_string(QualType type);
static bool is_static(const isl_class &clazz, FunctionDecl *method);
static bool is_mutator(const isl_class &clazz, FunctionDecl *fd);
static string extract_type(QualType type);
static const FunctionProtoType *extract_prototype(QualType type);
static ParmVarDecl *persistent_callback_arg(FunctionDecl *fd);
};
#endif /* ISL_INTERFACE_GENERATOR_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -19,28 +19,48 @@ public:
private:
void print(const isl_class &clazz);
void print_method_arguments(int first, int n_arg);
void print_method_header(bool is_static, const string &name, int n_arg);
void print_class_header(const isl_class &clazz, const string &name,
const vector<string> &super);
void print_type_check(const string &type, int pos, bool upcast,
const string &super, const string &name, int n);
void print_type_check(int indent, const string &type, const char *fmt,
int pos, bool upcast, const string &super,
const string &name, int n);
void print_type_checks(const string &cname, FunctionDecl *method,
bool first_is_ctx, int n, const vector<string> &super);
void print_copy(QualType type);
void print_callback(ParmVarDecl *param, int arg);
void print_arg_in_call(FunctionDecl *fd, int arg, int skip);
void print_arg_in_call(FunctionDecl *fd, const char *fmt, int arg,
int skip);
void print_argtypes(FunctionDecl *fd);
void print_method_return(FunctionDecl *method);
void print_method_return(int indent, const isl_class &clazz,
FunctionDecl *method, const char *fmt);
void print_restype(FunctionDecl *fd);
void print(map<string, isl_class> &classes, set<string> &done);
void print_constructor(const isl_class &clazz, FunctionDecl *method);
void print_upcast_constructors(const isl_class &clazz);
void print_new(const isl_class &clazz,
const string &python_name);
void print_representation(const isl_class &clazz,
const string &python_name);
void print_copy_callbacks(const isl_class &clazz);
void print_method_type(FunctionDecl *fd);
void print_method_types(const isl_class &clazz);
void print_get_method(const isl_class &clazz, FunctionDecl *fd);
void print_method(const isl_class &clazz, FunctionDecl *method,
vector<string> super);
void print_method_call(int indent, const isl_class &clazz,
FunctionDecl *method, const char *fmt,
int drop_ctx, int drop_user);
void print_argument_checks(const isl_class &clazz, FunctionDecl *fd,
int drop_ctx);
void print_method_overload(const isl_class &clazz,
FunctionDecl *method);
void print_method(const isl_class &clazz, const string &fullname,
const set<FunctionDecl *> &methods, vector<string> super);
const function_set &methods, vector<string> super);
void print_set_enum(const isl_class &clazz, FunctionDecl *fd,
int value, const string &name, const vector<string> &super);
void print_set_enum(const isl_class &clazz, FunctionDecl *fd,
const vector<string> &super);
};

File diff suppressed because it is too large Load Diff

View File

@ -132,13 +132,15 @@ __isl_give isl_basic_map *isl_basic_map_from_multi_aff2(
__isl_take isl_multi_aff *maff, int rational)
{
int i;
isl_size dim;
isl_space *space;
isl_basic_map *bmap;
if (!maff)
return NULL;
dim = isl_multi_aff_dim(maff, isl_dim_out);
if (dim < 0)
goto error;
if (isl_space_dim(maff->space, isl_dim_out) != maff->n)
if (dim != maff->n)
isl_die(isl_multi_aff_get_ctx(maff), isl_error_internal,
"invalid space", goto error);
@ -198,7 +200,7 @@ __isl_give isl_basic_set *isl_basic_set_from_multi_aff(
{
if (check_input_is_set(isl_multi_aff_peek_space(ma)) < 0)
ma = isl_multi_aff_free(ma);
return bset_from_bmap(isl_basic_map_from_multi_aff(ma));
return bset_from_bmap(basic_map_from_multi_aff(ma));
}
/* Construct a map mapping the domain of the multi-affine expression
@ -377,11 +379,13 @@ static __isl_give isl_map *map_from_multi_pw_aff(
__isl_take isl_multi_pw_aff *mpa)
{
int i;
isl_size dim;
isl_space *space;
isl_map *map;
if (!mpa)
return NULL;
dim = isl_multi_pw_aff_dim(mpa, isl_dim_out);
if (dim < 0)
goto error;
if (isl_space_dim(mpa->space, isl_dim_out) != mpa->n)
isl_die(isl_multi_pw_aff_get_ctx(mpa), isl_error_internal,

View File

@ -76,6 +76,9 @@ __isl_give isl_aff *isl_aff_alloc_vec(__isl_take isl_local_space *ls,
__isl_take isl_vec *v);
__isl_give isl_aff *isl_aff_alloc(__isl_take isl_local_space *ls);
isl_size isl_aff_domain_dim(__isl_keep isl_aff *aff, enum isl_dim_type type);
isl_size isl_aff_domain_offset(__isl_keep isl_aff *aff, enum isl_dim_type type);
__isl_give isl_aff *isl_aff_reset_space_and_domain(__isl_take isl_aff *aff,
__isl_take isl_space *space, __isl_take isl_space *domain);
__isl_give isl_aff *isl_aff_reset_domain_space(__isl_take isl_aff *aff,
@ -107,6 +110,9 @@ __isl_give isl_pw_aff *isl_pw_aff_reset_domain_space(
__isl_give isl_pw_aff *isl_pw_aff_add_disjoint(
__isl_take isl_pw_aff *pwaff1, __isl_take isl_pw_aff *pwaff2);
__isl_give isl_pw_aff *isl_pw_aff_domain_factor_domain(
__isl_take isl_pw_aff *pa);
__isl_give isl_pw_aff *isl_pw_aff_union_opt(__isl_take isl_pw_aff *pwaff1,
__isl_take isl_pw_aff *pwaff2, int max);
@ -146,6 +152,11 @@ __isl_give isl_multi_aff *isl_multi_aff_from_aff_mat(
#include <isl_list_templ.h>
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_move_dims(
__isl_take isl_pw_multi_aff *pma,
enum isl_dim_type dst_type, unsigned dst_pos,
enum isl_dim_type src_type, unsigned src_pos, unsigned n);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_domain_space(
__isl_take isl_pw_multi_aff *pwmaff, __isl_take isl_space *space);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_reset_space(
@ -157,7 +168,7 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_project_out(
__isl_take isl_pw_multi_aff *pma,
enum isl_dim_type type, unsigned first, unsigned n);
void isl_seq_preimage(isl_int *dst, isl_int *src,
isl_stat isl_seq_preimage(isl_int *dst, isl_int *src,
__isl_keep isl_multi_aff *ma, int n_before, int n_after,
int n_div_ma, int n_div_bmap,
isl_int f, isl_int c1, isl_int c2, isl_int g, int has_denom);
@ -169,6 +180,7 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_substitute(
__isl_keep isl_pw_aff *subs);
isl_stat isl_pw_aff_check_named_params(__isl_keep isl_pw_aff *pa);
isl_stat isl_multi_aff_check_named_params(__isl_keep isl_multi_aff *ma);
isl_stat isl_pw_multi_aff_check_named_params(__isl_keep isl_pw_multi_aff *pma);
isl_bool isl_pw_aff_matching_params(__isl_keep isl_pw_aff *pa,

View File

@ -114,18 +114,21 @@ static void delete_row(struct isl_basic_set *bset, unsigned row)
* so that
* A[i][col] = B[i][col] = a * old(B[i][col])
*/
static void construct_column(
struct isl_basic_set *bset1, struct isl_basic_set *bset2,
static isl_stat construct_column(
__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2,
unsigned row, unsigned col)
{
int r;
isl_int a;
isl_int b;
unsigned total;
isl_size total;
total = isl_basic_set_dim(bset1, isl_dim_set);
if (total < 0)
return isl_stat_error;
isl_int_init(a);
isl_int_init(b);
total = 1 + isl_basic_set_n_dim(bset1);
for (r = 0; r < row; ++r) {
if (isl_int_is_zero(bset2->eq[r][col]))
continue;
@ -133,12 +136,14 @@ static void construct_column(
isl_int_divexact(a, bset1->eq[row][col], b);
isl_int_divexact(b, bset2->eq[r][col], b);
isl_seq_combine(bset1->eq[r], a, bset1->eq[r],
b, bset1->eq[row], total);
isl_seq_scale(bset2->eq[r], bset2->eq[r], a, total);
b, bset1->eq[row], 1 + total);
isl_seq_scale(bset2->eq[r], bset2->eq[r], a, 1 + total);
}
isl_int_clear(a);
isl_int_clear(b);
delete_row(bset1, row);
return isl_stat_ok;
}
/* Make first row entries in column col of bset1 identical to
@ -150,21 +155,23 @@ static void construct_column(
* so that
* A[i][col] = B[i][col] = old(A[t][col]*B[i][col]-A[i][col]*B[t][col])
*/
static int transform_column(
struct isl_basic_set *bset1, struct isl_basic_set *bset2,
static isl_bool transform_column(
__isl_keep isl_basic_set *bset1, __isl_keep isl_basic_set *bset2,
unsigned row, unsigned col)
{
int i, t;
isl_int a, b, g;
unsigned total;
isl_size total;
for (t = row-1; t >= 0; --t)
if (isl_int_ne(bset1->eq[t][col], bset2->eq[t][col]))
break;
if (t < 0)
return 0;
return isl_bool_false;
total = 1 + isl_basic_set_n_dim(bset1);
total = isl_basic_set_dim(bset1, isl_dim_set);
if (total < 0)
return isl_bool_error;
isl_int_init(a);
isl_int_init(b);
isl_int_init(g);
@ -175,16 +182,16 @@ static int transform_column(
isl_int_divexact(a, a, g);
isl_int_divexact(g, b, g);
isl_seq_combine(bset1->eq[i], g, bset1->eq[i], a, bset1->eq[t],
total);
1 + total);
isl_seq_combine(bset2->eq[i], g, bset2->eq[i], a, bset2->eq[t],
total);
1 + total);
}
isl_int_clear(a);
isl_int_clear(b);
isl_int_clear(g);
delete_row(bset1, t);
delete_row(bset2, t);
return 1;
return isl_bool_true;
}
/* The implementation is based on Section 5.2 of Michael Karr,
@ -192,17 +199,19 @@ static int transform_column(
* except that the echelon form we use starts from the last column
* and that we are dealing with integer coefficients.
*/
static struct isl_basic_set *affine_hull(
struct isl_basic_set *bset1, struct isl_basic_set *bset2)
static __isl_give isl_basic_set *affine_hull(
__isl_take isl_basic_set *bset1, __isl_take isl_basic_set *bset2)
{
isl_size dim;
unsigned total;
int col;
int row;
if (!bset1 || !bset2)
dim = isl_basic_set_dim(bset1, isl_dim_set);
if (dim < 0 || !bset2)
goto error;
total = 1 + isl_basic_set_n_dim(bset1);
total = 1 + dim;
row = 0;
for (col = total-1; col >= 0; --col) {
@ -214,11 +223,18 @@ static struct isl_basic_set *affine_hull(
set_common_multiple(bset1, bset2, row, col);
++row;
} else if (!is_zero1 && is_zero2) {
construct_column(bset1, bset2, row, col);
if (construct_column(bset1, bset2, row, col) < 0)
goto error;
} else if (is_zero1 && !is_zero2) {
construct_column(bset2, bset1, row, col);
if (construct_column(bset2, bset1, row, col) < 0)
goto error;
} else {
if (transform_column(bset1, bset2, row, col))
isl_bool transform;
transform = transform_column(bset1, bset2, row, col);
if (transform < 0)
goto error;
if (transform)
--row;
}
}
@ -301,11 +317,17 @@ __isl_give isl_basic_set *isl_basic_set_recession_cone(
__isl_take isl_basic_set *bset)
{
int i;
isl_bool empty;
empty = isl_basic_set_plain_is_empty(bset);
if (empty < 0)
return isl_basic_set_free(bset);
if (empty)
return bset;
bset = isl_basic_set_cow(bset);
if (!bset)
return NULL;
isl_assert(bset->ctx, bset->n_div == 0, goto error);
if (isl_basic_set_check_no_locals(bset) < 0)
return isl_basic_set_free(bset);
for (i = 0; i < bset->n_eq; ++i)
isl_int_set_si(bset->eq[i][0], 0);
@ -315,9 +337,6 @@ __isl_give isl_basic_set *isl_basic_set_recession_cone(
ISL_F_CLR(bset, ISL_BASIC_SET_NO_IMPLICIT);
return isl_basic_set_implicit_equalities(bset);
error:
isl_basic_set_free(bset);
return NULL;
}
/* Move "sample" to a point that is one up (or down) from the original
@ -343,12 +362,11 @@ static __isl_give isl_basic_set *add_adjacent_points(
__isl_keep isl_basic_set *bset)
{
int i, up;
int dim;
if (!sample)
goto error;
isl_size dim;
dim = isl_basic_set_dim(hull, isl_dim_set);
if (!sample || dim < 0)
goto error;
for (i = 0; i < dim; ++i) {
for (up = 0; up <= 1; ++up) {
@ -476,17 +494,20 @@ static __isl_give isl_basic_set *initialize_hull(__isl_keep isl_basic_set *bset,
* we check if there is any point on a hyperplane parallel to the
* corresponding hyperplane shifted by at least one (in either direction).
*/
static struct isl_basic_set *uset_affine_hull_bounded(struct isl_basic_set *bset)
static __isl_give isl_basic_set *uset_affine_hull_bounded(
__isl_take isl_basic_set *bset)
{
struct isl_vec *sample = NULL;
struct isl_basic_set *hull;
struct isl_tab *tab = NULL;
unsigned dim;
isl_size dim;
if (isl_basic_set_plain_is_empty(bset))
return bset;
dim = isl_basic_set_n_dim(bset);
dim = isl_basic_set_dim(bset, isl_dim_set);
if (dim < 0)
return isl_basic_set_free(bset);
if (bset->sample && bset->sample->size == 1 + dim) {
int contains = isl_basic_set_contains(bset, bset->sample);
@ -557,7 +578,7 @@ static __isl_give isl_basic_set *initial_hull(struct isl_tab *tab,
int k;
struct isl_basic_set *bset = NULL;
struct isl_ctx *ctx;
unsigned dim;
isl_size dim;
if (!vec || !tab)
return NULL;
@ -565,9 +586,10 @@ static __isl_give isl_basic_set *initial_hull(struct isl_tab *tab,
isl_assert(ctx, vec->size != 0, goto error);
bset = isl_basic_set_alloc(ctx, 0, vec->size - 1, 0, vec->size - 1, 0);
if (!bset)
dim = isl_basic_set_dim(bset, isl_dim_set);
if (dim < 0)
goto error;
dim = isl_basic_set_n_dim(bset) - tab->n_unbounded;
dim -= tab->n_unbounded;
for (i = 0; i < dim; ++i) {
k = isl_basic_set_alloc_equality(bset);
if (k < 0)
@ -707,15 +729,15 @@ error:
static struct isl_basic_set *affine_hull_with_cone(struct isl_basic_set *bset,
struct isl_basic_set *cone)
{
unsigned total;
isl_size total;
unsigned cone_dim;
struct isl_basic_set *hull;
struct isl_mat *M, *U, *Q;
if (!bset || !cone)
total = isl_basic_set_dim(cone, isl_dim_all);
if (!bset || total < 0)
goto error;
total = isl_basic_set_total_dim(cone);
cone_dim = total - cone->n_eq;
M = isl_mat_sub_alloc6(bset->ctx, cone->eq, 0, cone->n_eq, 1, total);
@ -785,6 +807,7 @@ error:
static struct isl_basic_set *uset_affine_hull(struct isl_basic_set *bset)
{
struct isl_basic_set *cone;
isl_size total;
if (isl_basic_set_plain_is_empty(bset))
return bset;
@ -800,7 +823,10 @@ static struct isl_basic_set *uset_affine_hull(struct isl_basic_set *bset)
return isl_basic_set_universe(space);
}
if (cone->n_eq < isl_basic_set_total_dim(cone))
total = isl_basic_set_dim(cone, isl_dim_all);
if (total < 0)
bset = isl_basic_set_free(bset);
if (cone->n_eq < total)
return affine_hull_with_cone(bset, cone);
isl_basic_set_free(cone);
@ -876,6 +902,7 @@ __isl_give isl_basic_map *isl_basic_map_detect_equalities(
__isl_take isl_basic_map *bmap)
{
int i, j;
isl_size total;
struct isl_basic_set *hull = NULL;
if (!bmap)
@ -896,14 +923,15 @@ __isl_give isl_basic_map *isl_basic_map_detect_equalities(
isl_basic_set_free(hull);
return isl_basic_map_set_to_empty(bmap);
}
bmap = isl_basic_map_extend_space(bmap, isl_space_copy(bmap->dim), 0,
hull->n_eq, 0);
bmap = isl_basic_map_extend(bmap, 0, hull->n_eq, 0);
total = isl_basic_set_dim(hull, isl_dim_all);
if (total < 0)
goto error;
for (i = 0; i < hull->n_eq; ++i) {
j = isl_basic_map_alloc_equality(bmap);
if (j < 0)
goto error;
isl_seq_cpy(bmap->eq[j], hull->eq[i],
1 + isl_basic_set_total_dim(hull));
isl_seq_cpy(bmap->eq[j], hull->eq[i], 1 + total);
}
isl_vec_free(bmap->sample);
bmap->sample = isl_vec_copy(hull->sample);
@ -1001,8 +1029,7 @@ static __isl_give isl_basic_map *add_strides(__isl_take isl_basic_map *bmap,
if (isl_int_is_one(M->row[0][0]))
return bmap;
bmap = isl_basic_map_extend_space(bmap, isl_space_copy(bmap->dim),
M->n_row - 1, M->n_row - 1, 0);
bmap = isl_basic_map_extend(bmap, M->n_row - 1, M->n_row - 1, 0);
isl_int_init(gcd);
for (i = 1; i < M->n_row; ++i) {
@ -1060,10 +1087,10 @@ error:
static __isl_give isl_basic_map *isl_basic_map_make_strides_explicit(
__isl_take isl_basic_map *bmap)
{
int known;
isl_bool known;
int n_known;
int n, n_col;
int total;
isl_size v_div;
isl_ctx *ctx;
isl_mat *A, *B, *M;
@ -1081,16 +1108,18 @@ static __isl_give isl_basic_map *isl_basic_map_make_strides_explicit(
if (isl_int_is_zero(bmap->div[n_known][0]))
break;
ctx = isl_basic_map_get_ctx(bmap);
total = isl_space_dim(bmap->dim, isl_dim_all);
v_div = isl_basic_map_var_offset(bmap, isl_dim_div);
if (v_div < 0)
return isl_basic_map_free(bmap);
for (n = 0; n < bmap->n_eq; ++n)
if (isl_seq_first_non_zero(bmap->eq[n] + 1 + total + n_known,
if (isl_seq_first_non_zero(bmap->eq[n] + 1 + v_div + n_known,
bmap->n_div - n_known) == -1)
break;
if (n == 0)
return bmap;
B = isl_mat_sub_alloc6(ctx, bmap->eq, 0, n, 0, 1 + total + n_known);
B = isl_mat_sub_alloc6(ctx, bmap->eq, 0, n, 0, 1 + v_div + n_known);
n_col = bmap->n_div - n_known;
A = isl_mat_sub_alloc6(ctx, bmap->eq, 0, n, 1 + total + n_known, n_col);
A = isl_mat_sub_alloc6(ctx, bmap->eq, 0, n, 1 + v_div + n_known, n_col);
A = isl_mat_left_hermite(A, 0, NULL, NULL);
A = isl_mat_drop_cols(A, n, n_col - n);
A = isl_mat_lin_to_aff(A);

View File

@ -0,0 +1,8 @@
#undef ARG1
#define ARG1 TYPE
#undef ARG2
#define ARG2 TYPE
#undef SUFFIX
#define SUFFIX bin
#include "isl_align_params_templ.c"

View File

@ -0,0 +1,40 @@
/*
* Copyright 2011 Sven Verdoolaege
*
* Use of this software is governed by the MIT license
*
* Written by Sven Verdoolaege
*/
#define xFN(TYPE,NAME) TYPE ## _ ## NAME
#define FN(TYPE,NAME) xFN(TYPE,NAME)
/* Align the parameters of the two arguments of type ARG1 and ARG2
* (if needed).
*/
isl_stat FN(FN(ARG1,align_params),SUFFIX)(__isl_keep ARG1 **obj1,
__isl_keep ARG2 **obj2)
{
isl_space *space1, *space2;
isl_bool equal_params;
space1 = FN(ARG1,peek_space)(*obj1);
space2 = FN(ARG2,peek_space)(*obj2);
equal_params = isl_space_has_equal_params(space1, space2);
if (equal_params < 0)
goto error;
if (equal_params)
return isl_stat_ok;
if (FN(ARG1,check_named_params)(*obj1) < 0 ||
FN(ARG2,check_named_params)(*obj2) < 0)
goto error;
*obj1 = FN(ARG1,align_params)(*obj1, FN(ARG2,get_space)(*obj2));
*obj2 = FN(ARG2,align_params)(*obj2, FN(ARG1,get_space)(*obj1));
if (!*obj1 || !*obj2)
goto error;
return isl_stat_ok;
error:
*obj1 = FN(ARG1,free)(*obj1);
*obj2 = FN(ARG2,free)(*obj2);
return isl_stat_error;
}

View File

@ -21,7 +21,7 @@ ISL_ARG_PHANTOM_BOOL('h', "help", NULL, "print this help, then exit")
static void set_default_choice(struct isl_arg *arg, void *opt)
{
if (arg->offset == (size_t) -1)
if (arg->offset == ISL_ARG_OFFSET_NONE)
return;
*(unsigned *)(((char *)opt) + arg->offset) = arg->u.choice.default_value;
}
@ -33,7 +33,7 @@ static void set_default_flags(struct isl_arg *arg, void *opt)
static void set_default_bool(struct isl_arg *arg, void *opt)
{
if (arg->offset == (size_t) -1)
if (arg->offset == ISL_ARG_OFFSET_NONE)
return;
*(unsigned *)(((char *)opt) + arg->offset) = arg->u.b.default_value;
}
@ -42,7 +42,7 @@ static void set_default_child(struct isl_arg *arg, void *opt)
{
void *child;
if (arg->offset == (size_t) -1)
if (arg->offset == ISL_ARG_OFFSET_NONE)
child = opt;
else {
child = calloc(1, arg->u.child.child->options_size);
@ -137,7 +137,7 @@ static void free_args(struct isl_arg *arg, void *opt);
static void free_child(struct isl_arg *arg, void *opt)
{
if (arg->offset == (size_t) -1)
if (arg->offset == ISL_ARG_OFFSET_NONE)
free_args(arg->u.child.child->args, opt);
else
isl_args_free(arg->u.child.child,
@ -520,7 +520,7 @@ static void print_bool_help(struct isl_arg *decl,
int no = p ? *p == 1 : 0;
pos = print_arg_help(decl, prefixes, no);
pos = print_help_msg(decl, pos);
if (decl->offset != (size_t) -1)
if (decl->offset != ISL_ARG_OFFSET_NONE)
print_default(decl, no ? "yes" : "no", pos);
printf("\n");
}
@ -667,7 +667,7 @@ static void print_help(struct isl_arg *arg,
printf("\n");
if (arg[i].help_msg)
printf(" %s\n", arg[i].help_msg);
if (arg[i].offset == (size_t) -1)
if (arg[i].offset == ISL_ARG_OFFSET_NONE)
child = opt;
else
child = *(void **)(((char *) opt) + arg[i].offset);
@ -812,7 +812,7 @@ static int parse_choice_option(struct isl_arg *decl, char **arg,
if (!has_argument && (!arg[1] || arg[1][0] == '-')) {
unsigned u = decl->u.choice.default_selected;
if (decl->offset != (size_t) -1)
if (decl->offset != ISL_ARG_OFFSET_NONE)
*(unsigned *)(((char *)opt) + decl->offset) = u;
if (decl->u.choice.set)
decl->u.choice.set(opt, u);
@ -830,7 +830,7 @@ static int parse_choice_option(struct isl_arg *decl, char **arg,
continue;
u = decl->u.choice.choice[i].value;
if (decl->offset != (size_t) -1)
if (decl->offset != ISL_ARG_OFFSET_NONE)
*(unsigned *)(((char *)opt) + decl->offset) = u;
if (decl->u.choice.set)
decl->u.choice.set(opt, u);
@ -904,14 +904,14 @@ static int parse_bool_option(struct isl_arg *decl, char **arg,
char *endptr;
int val = strtol(arg[1], &endptr, 0);
if (*endptr == '\0' && (val == 0 || val == 1)) {
if (decl->offset != (size_t) -1)
if (decl->offset != ISL_ARG_OFFSET_NONE)
*p = val;
if (decl->u.b.set)
decl->u.b.set(opt, val);
return 2;
}
}
if (decl->offset != (size_t) -1)
if (decl->offset != ISL_ARG_OFFSET_NONE)
*p = 1;
if (decl->u.b.set)
decl->u.b.set(opt, 1);
@ -936,7 +936,7 @@ static int parse_bool_option(struct isl_arg *decl, char **arg,
name = skip_prefixes(name, prefixes, &next_prefix);
if (match_long_name(decl, name, name + strlen(name))) {
if (decl->offset != (size_t) -1)
if (decl->offset != ISL_ARG_OFFSET_NONE)
*p = 0;
if (decl->u.b.set)
decl->u.b.set(opt, 0);
@ -1116,7 +1116,7 @@ static int parse_child_option(struct isl_arg *decl, char **arg,
void *child;
int first, parsed;
if (decl->offset == (size_t) -1)
if (decl->offset == ISL_ARG_OFFSET_NONE)
child = opt;
else
child = *(void **)(((char *)opt) + decl->offset);
@ -1240,7 +1240,7 @@ static int next_arg(struct isl_arg *arg, int a)
}
/* Unless ISL_ARG_SKIP_HELP is set, check if "arg" is
* equal to "--help" and if so call print_help_and_exit.
* equal to "--help" or "-h" and if so call print_help_and_exit.
*/
static void check_help(struct isl_args *args, char *arg, char *prog, void *opt,
unsigned flags)
@ -1248,7 +1248,7 @@ static void check_help(struct isl_args *args, char *arg, char *prog, void *opt,
if (ISL_FL_ISSET(flags, ISL_ARG_SKIP_HELP))
return;
if (strcmp(arg, "--help") == 0)
if (strcmp(arg, "--help") == 0 || strcmp(arg, "-h") == 0)
print_help_and_exit(args->args, prog, opt);
}

File diff suppressed because it is too large Load Diff

View File

@ -57,13 +57,17 @@ static __isl_give isl_ast_build *isl_ast_build_init_derived(
{
isl_ctx *ctx;
isl_vec *strides;
isl_size dim;
build = isl_ast_build_cow(build);
if (!build || !build->domain)
goto error;
ctx = isl_ast_build_get_ctx(build);
strides = isl_vec_alloc(ctx, isl_space_dim(space, isl_dim_set));
dim = isl_space_dim(space, isl_dim_set);
if (dim < 0)
goto error;
strides = isl_vec_alloc(ctx, dim);
strides = isl_vec_set_si(strides, 1);
isl_vec_free(build->strides);
@ -114,14 +118,16 @@ static __isl_give isl_id *generate_name(isl_ctx *ctx, int i,
*/
__isl_give isl_ast_build *isl_ast_build_from_context(__isl_take isl_set *set)
{
int i, n;
int i;
isl_size n;
isl_ctx *ctx;
isl_space *space;
isl_ast_build *build;
set = isl_set_compute_divs(set);
if (!set)
return NULL;
n = isl_set_dim(set, isl_dim_set);
if (n < 0)
goto error;
ctx = isl_set_get_ctx(set);
@ -134,7 +140,6 @@ __isl_give isl_ast_build *isl_ast_build_from_context(__isl_take isl_set *set)
build->generated = isl_set_copy(build->domain);
build->pending = isl_set_universe(isl_set_get_space(build->domain));
build->options = isl_union_map_empty(isl_space_params_alloc(ctx, 0));
n = isl_set_dim(set, isl_dim_set);
build->depth = n;
build->iterators = isl_id_list_alloc(ctx, n);
for (i = 0; i < n; ++i) {
@ -358,14 +363,16 @@ error:
__isl_give isl_ast_build *isl_ast_build_set_iterators(
__isl_take isl_ast_build *build, __isl_take isl_id_list *iterators)
{
int dim, n_it;
isl_size dim, n_it;
build = isl_ast_build_cow(build);
if (!build)
goto error;
dim = isl_set_dim(build->domain, isl_dim_set);
dim = isl_ast_build_dim(build, isl_dim_set);
n_it = isl_id_list_n_id(build->iterators);
if (dim < 0 || n_it < 0)
goto error;
if (n_it < dim)
isl_die(isl_ast_build_get_ctx(build), isl_error_internal,
"isl_ast_build in inconsistent state", goto error);
@ -562,15 +569,14 @@ static void isl_ast_build_reset_schedule_map(__isl_keep isl_ast_build *build)
* if code has been generated for the entire schedule and if none
* of the loops have been eliminated.
*/
__isl_give int isl_ast_build_need_schedule_map(__isl_keep isl_ast_build *build)
isl_bool isl_ast_build_need_schedule_map(__isl_keep isl_ast_build *build)
{
int dim;
isl_size dim;
if (!build)
return -1;
dim = isl_set_dim(build->domain, isl_dim_set);
return build->depth != dim || any_eliminated(build);
dim = isl_ast_build_dim(build, isl_dim_set);
if (dim < 0)
return isl_bool_error;
return isl_bool_ok(build->depth != dim || any_eliminated(build));
}
/* Return a mapping from the internal schedule space to the external
@ -594,6 +600,7 @@ __isl_give int isl_ast_build_need_schedule_map(__isl_keep isl_ast_build *build)
__isl_give isl_multi_aff *isl_ast_build_get_schedule_map_multi_aff(
__isl_keep isl_ast_build *build)
{
isl_bool needs_map;
isl_space *space;
isl_multi_aff *ma;
@ -601,13 +608,19 @@ __isl_give isl_multi_aff *isl_ast_build_get_schedule_map_multi_aff(
return NULL;
if (build->schedule_map)
return isl_multi_aff_copy(build->schedule_map);
needs_map = isl_ast_build_need_schedule_map(build);
if (needs_map < 0)
return NULL;
space = isl_ast_build_get_space(build, 1);
space = isl_space_map_from_set(space);
ma = isl_multi_aff_identity(space);
if (isl_ast_build_need_schedule_map(build)) {
if (needs_map) {
int i;
int dim = isl_set_dim(build->domain, isl_dim_set);
isl_size dim = isl_ast_build_dim(build, isl_dim_set);
if (dim < 0)
ma = isl_multi_aff_free(ma);
ma = isl_multi_aff_drop_dims(ma, isl_dim_out,
build->depth, dim - build->depth);
for (i = build->depth - 1; i >= 0; --i)
@ -762,7 +775,8 @@ static __isl_give isl_set *intersect_stride_constraint(__isl_take isl_set *set,
static __isl_give isl_ast_build *update_values(
__isl_take isl_ast_build *build, __isl_take isl_basic_set *bounds)
{
int sv;
isl_bool sv;
isl_size n;
isl_pw_multi_aff *pma;
isl_aff *aff = NULL;
isl_map *it_map;
@ -787,10 +801,10 @@ static __isl_give isl_ast_build *update_values(
build->value = isl_pw_aff_coalesce(build->value);
isl_pw_multi_aff_free(pma);
if (!build->value)
n = isl_pw_aff_n_piece(build->value);
if (n < 0)
return isl_ast_build_free(build);
if (isl_pw_aff_n_piece(build->value) != 1)
if (n != 1)
return build;
isl_pw_aff_foreach_piece(build->value, &extract_single_piece, &aff);
@ -992,15 +1006,24 @@ __isl_give isl_ast_build *isl_ast_build_replace_pending_by_guard(
__isl_give isl_ast_build *isl_ast_build_restrict(
__isl_take isl_ast_build *build, __isl_take isl_set *set)
{
isl_bool needs_map;
if (isl_set_is_params(set))
return isl_ast_build_restrict_generated(build, set);
if (isl_ast_build_need_schedule_map(build)) {
needs_map = isl_ast_build_need_schedule_map(build);
if (needs_map < 0)
goto error;
if (needs_map) {
isl_multi_aff *ma;
ma = isl_ast_build_get_schedule_map_multi_aff(build);
set = isl_set_preimage_multi_aff(set, ma);
}
return isl_ast_build_restrict_generated(build, set);
error:
isl_ast_build_free(build);
isl_set_free(set);
return NULL;
}
/* Replace build->executed by "executed".
@ -1049,18 +1072,22 @@ static __isl_give isl_ast_build *extract_loop_types(
__isl_take isl_ast_build *build)
{
int i;
isl_size n;
isl_ctx *ctx;
isl_schedule_node *node;
if (!build)
return NULL;
n = isl_schedule_node_band_n_member(build->node);
if (n < 0)
return isl_ast_build_free(build);
ctx = isl_ast_build_get_ctx(build);
if (!build->node)
isl_die(ctx, isl_error_internal, "missing AST node",
return isl_ast_build_free(build));
free(build->loop_type);
build->n = isl_schedule_node_band_n_member(build->node);
build->n = n;
build->loop_type = isl_alloc_array(ctx,
enum isl_ast_loop_type, build->n);
if (build->n && !build->loop_type)
@ -1146,11 +1173,11 @@ __isl_give isl_multi_aff *isl_ast_build_get_internal2input(
/* Return the number of variables of the given type
* in the (internal) schedule space.
*/
unsigned isl_ast_build_dim(__isl_keep isl_ast_build *build,
isl_size isl_ast_build_dim(__isl_keep isl_ast_build *build,
enum isl_dim_type type)
{
if (!build)
return 0;
return isl_size_error;
return isl_set_dim(build->domain, type);
}
@ -1167,7 +1194,8 @@ __isl_give isl_space *isl_ast_build_get_space(__isl_keep isl_ast_build *build,
int internal)
{
int i;
int dim;
isl_size dim;
isl_bool needs_map;
isl_space *space;
if (!build)
@ -1177,10 +1205,15 @@ __isl_give isl_space *isl_ast_build_get_space(__isl_keep isl_ast_build *build,
if (internal)
return space;
if (!isl_ast_build_need_schedule_map(build))
needs_map = isl_ast_build_need_schedule_map(build);
if (needs_map < 0)
return isl_space_free(space);
if (!needs_map)
return space;
dim = isl_set_dim(build->domain, isl_dim_set);
dim = isl_ast_build_dim(build, isl_dim_set);
if (dim < 0)
return isl_space_free(space);
space = isl_space_drop_dims(space, isl_dim_set,
build->depth, dim - build->depth);
for (i = build->depth - 1; i >= 0; --i) {
@ -1232,14 +1265,16 @@ __isl_give isl_space *isl_ast_build_get_schedule_space(
__isl_give isl_union_map *isl_ast_build_get_schedule(
__isl_keep isl_ast_build *build)
{
isl_bool needs_map;
isl_union_map *executed;
isl_union_map *schedule;
if (!build)
needs_map = isl_ast_build_need_schedule_map(build);
if (needs_map < 0)
return NULL;
executed = isl_union_map_copy(build->executed);
if (isl_ast_build_need_schedule_map(build)) {
if (needs_map) {
isl_map *proj = isl_ast_build_get_schedule_map(build);
executed = isl_union_map_apply_domain(executed,
isl_union_map_from_map(proj));
@ -1820,7 +1855,7 @@ __isl_give isl_ast_build *isl_ast_build_product(
isl_vec *strides;
isl_set *set;
isl_multi_aff *embedding;
int dim, n_it;
isl_size dim, space_dim, n_it;
build = isl_ast_build_cow(build);
if (!build)
@ -1829,9 +1864,12 @@ __isl_give isl_ast_build *isl_ast_build_product(
build->outer_pos = build->depth;
ctx = isl_ast_build_get_ctx(build);
dim = isl_set_dim(build->domain, isl_dim_set);
dim += isl_space_dim(space, isl_dim_set);
dim = isl_ast_build_dim(build, isl_dim_set);
space_dim = isl_space_dim(space, isl_dim_set);
n_it = isl_id_list_n_id(build->iterators);
if (dim < 0 || space_dim < 0 || n_it < 0)
goto error;
dim += space_dim;
if (n_it < dim) {
isl_id_list *l;
l = generate_names(ctx, dim - n_it, n_it, build);
@ -1846,7 +1884,7 @@ __isl_give isl_ast_build *isl_ast_build_product(
build->pending = isl_set_product(build->pending, isl_set_copy(set));
build->generated = isl_set_product(build->generated, set);
strides = isl_vec_alloc(ctx, isl_space_dim(space, isl_dim_set));
strides = isl_vec_alloc(ctx, space_dim);
strides = isl_vec_set_si(strides, 1);
build->strides = isl_vec_concat(build->strides, strides);

View File

@ -188,14 +188,14 @@ static __isl_give isl_ast_expr *var_div(struct isl_ast_add_term_data *data,
isl_aff *aff;
isl_ast_expr *num, *den;
isl_val *d;
enum isl_ast_op_type type;
enum isl_ast_expr_op_type type;
aff = isl_local_space_get_div(ls, pos);
d = isl_aff_get_denominator_val(aff);
aff = isl_aff_scale_val(aff, isl_val_copy(d));
den = isl_ast_expr_from_val(isl_val_copy(d));
type = isl_ast_op_fdiv_q;
type = isl_ast_expr_op_fdiv_q;
if (isl_options_get_ast_build_prefer_pdiv(ctx)) {
int non_neg = isl_ast_build_aff_is_nonneg(data->build, aff);
if (non_neg >= 0 && !non_neg) {
@ -217,7 +217,7 @@ static __isl_give isl_ast_expr *var_div(struct isl_ast_add_term_data *data,
if (non_neg < 0)
aff = isl_aff_free(aff);
else if (non_neg)
type = isl_ast_op_pdiv_q;
type = isl_ast_expr_op_pdiv_q;
}
isl_val_free(d);
@ -297,11 +297,11 @@ error:
* If expr2 is zero, we simply return expr1.
* If expr1 is zero, we return
*
* (isl_ast_op_minus, expr2)
* (isl_ast_expr_op_minus, expr2)
*
* Otherwise, we return
*
* (isl_ast_op_sub, expr1, expr2)
* (isl_ast_expr_op_sub, expr1, expr2)
*/
static __isl_give isl_ast_expr *ast_expr_sub(__isl_take isl_ast_expr *expr1,
__isl_take isl_ast_expr *expr2)
@ -346,7 +346,7 @@ static __isl_give isl_ast_expr *isl_ast_expr_mod(__isl_keep isl_val *v,
expr = isl_ast_expr_from_aff(isl_aff_copy(aff), build);
c = isl_ast_expr_from_val(isl_val_copy(d));
expr = isl_ast_expr_alloc_binary(isl_ast_op_pdiv_r, expr, c);
expr = isl_ast_expr_alloc_binary(isl_ast_expr_op_pdiv_r, expr, c);
if (!isl_val_is_one(v)) {
c = isl_ast_expr_from_val(isl_val_copy(v));
@ -361,11 +361,11 @@ static __isl_give isl_ast_expr *isl_ast_expr_mod(__isl_keep isl_val *v,
* If v is 1, we simply return expr.
* If v is -1, we return
*
* (isl_ast_op_minus, expr)
* (isl_ast_expr_op_minus, expr)
*
* Otherwise, we return
*
* (isl_ast_op_mul, expr(v), expr)
* (isl_ast_expr_op_mul, expr(v), expr)
*/
static __isl_give isl_ast_expr *scale(__isl_take isl_ast_expr *expr,
__isl_take isl_val *v)
@ -404,17 +404,17 @@ error:
* multiplied by the absolute value of "*v".
* If "*v" is negative, we create
*
* (isl_ast_op_sub, expr, e)
* (isl_ast_expr_op_sub, expr, e)
*
* except when expr is trivially zero, in which case we create
*
* (isl_ast_op_minus, e)
* (isl_ast_expr_op_minus, e)
*
* instead.
*
* If "*v" is positive, we simply create
*
* (isl_ast_op_add, expr, e)
* (isl_ast_expr_op_add, expr, e)
*
*/
static __isl_give isl_ast_expr *isl_ast_expr_add_term(
@ -679,11 +679,13 @@ static isl_stat check_parallel_or_opposite(__isl_take isl_constraint *c,
enum isl_dim_type c_type[2] = { isl_dim_param, isl_dim_set };
enum isl_dim_type a_type[2] = { isl_dim_param, isl_dim_in };
int i, t;
int n[2];
isl_size n[2];
int parallel = 1, opposite = 1;
for (t = 0; t < 2; ++t) {
n[t] = isl_constraint_dim(c, c_type[t]);
if (n[t] < 0)
return isl_stat_error;
for (i = 0; i < n[t]; ++i) {
int a, b;
@ -824,12 +826,15 @@ static int try_extract_mod(struct isl_extract_mod_data *data)
{
isl_basic_set *hull;
isl_val *v1, *v2;
int r, n;
isl_stat r;
isl_size n;
if (!data->build)
goto error;
n = isl_aff_dim(data->div, isl_dim_div);
if (n < 0)
goto error;
if (isl_aff_involves_dims(data->div, isl_dim_div, 0, n))
return extract_nonneg_mod(data);
@ -901,7 +906,7 @@ error:
*
* Note that in order to represent "a mod m" as
*
* (isl_ast_op_pdiv_r, a, m)
* (isl_ast_expr_op_pdiv_r, a, m)
*
* we need to make sure that a is non-negative.
* If not, we check if "-a + m - 1" is non-negative.
@ -954,7 +959,7 @@ static __isl_give isl_aff *extract_modulos(__isl_take isl_aff *aff,
{
struct isl_extract_mod_data data = { build, aff, *pos, *neg };
isl_ctx *ctx;
int n;
isl_size n;
if (!aff)
return NULL;
@ -964,6 +969,8 @@ static __isl_give isl_aff *extract_modulos(__isl_take isl_aff *aff,
return aff;
n = isl_aff_dim(data.aff, isl_dim_div);
if (n < 0)
return isl_aff_free(aff);
for (data.i = 0; data.i < n; ++data.i) {
data.v = isl_aff_get_coefficient_val(data.aff,
isl_dim_div, data.i);
@ -1000,7 +1007,8 @@ static __isl_give isl_aff *extract_modulos(__isl_take isl_aff *aff,
static __isl_give isl_aff *extract_rational(__isl_take isl_aff *aff,
__isl_keep isl_ast_expr **expr, __isl_keep isl_ast_build *build)
{
int i, j, n;
int i, j;
isl_size n;
isl_aff *rat = NULL;
isl_local_space *ls = NULL;
isl_ast_expr *rat_expr;
@ -1025,6 +1033,8 @@ static __isl_give isl_aff *extract_rational(__isl_take isl_aff *aff,
for (i = 0; i < 3; ++i) {
n = isl_aff_dim(aff, t[i]);
if (n < 0)
goto error;
for (j = 0; j < n; ++j) {
isl_aff *rat_j;
@ -1082,7 +1092,7 @@ __isl_give isl_ast_expr *isl_ast_expr_from_aff(__isl_take isl_aff *aff,
__isl_keep isl_ast_build *build)
{
int i, j;
int n;
isl_size n;
isl_val *v;
isl_ctx *ctx = isl_aff_get_ctx(aff);
isl_ast_expr *expr, *expr_neg;
@ -1108,6 +1118,8 @@ __isl_give isl_ast_expr *isl_ast_expr_from_aff(__isl_take isl_aff *aff,
data.cst = isl_aff_get_constant_val(aff);
for (i = 0; i < 3; ++i) {
n = isl_aff_dim(aff, t[i]);
if (n < 0)
expr = isl_ast_expr_free(expr);
for (j = 0; j < n; ++j) {
v = isl_aff_get_coefficient_val(aff, t[i], j);
if (!v)
@ -1144,7 +1156,9 @@ static __isl_give isl_ast_expr *add_signed_terms(__isl_take isl_ast_expr *expr,
ls = isl_aff_get_domain_local_space(aff);
for (i = 0; i < 3; ++i) {
int n = isl_aff_dim(aff, t[i]);
isl_size n = isl_aff_dim(aff, t[i]);
if (n < 0)
expr = isl_ast_expr_free(expr);
for (j = 0; j < n; ++j) {
v = isl_aff_get_coefficient_val(aff, t[i], j);
if (sign * isl_val_sgn(v) <= 0) {
@ -1235,24 +1249,26 @@ static int is_stride_constraint(__isl_keep isl_aff *aff, int pos)
/* Are all coefficients of "aff" (zero or) negative?
*/
static int all_negative_coefficients(__isl_keep isl_aff *aff)
static isl_bool all_negative_coefficients(__isl_keep isl_aff *aff)
{
int i, n;
if (!aff)
return 0;
int i;
isl_size n;
n = isl_aff_dim(aff, isl_dim_param);
if (n < 0)
return isl_bool_error;
for (i = 0; i < n; ++i)
if (isl_aff_coefficient_sgn(aff, isl_dim_param, i) > 0)
return 0;
return isl_bool_false;
n = isl_aff_dim(aff, isl_dim_in);
if (n < 0)
return isl_bool_error;
for (i = 0; i < n; ++i)
if (isl_aff_coefficient_sgn(aff, isl_dim_in, i) > 0)
return 0;
return isl_bool_false;
return 1;
return isl_bool_true;
}
/* Give an equality of the form
@ -1266,17 +1282,20 @@ static int all_negative_coefficients(__isl_keep isl_aff *aff)
* with the integer division "pos" equal to floor(e/d),
* construct the AST expression
*
* (isl_ast_op_eq, (isl_ast_op_zdiv_r, expr(e), expr(d)), expr(0))
* (isl_ast_expr_op_eq,
* (isl_ast_expr_op_zdiv_r, expr(e), expr(d)), expr(0))
*
* If e only has negative coefficients, then construct
*
* (isl_ast_op_eq, (isl_ast_op_zdiv_r, expr(-e), expr(d)), expr(0))
* (isl_ast_expr_op_eq,
* (isl_ast_expr_op_zdiv_r, expr(-e), expr(d)), expr(0))
*
* instead.
*/
static __isl_give isl_ast_expr *extract_stride_constraint(
__isl_take isl_aff *aff, int pos, __isl_keep isl_ast_build *build)
{
isl_bool all_neg;
isl_ctx *ctx;
isl_val *c;
isl_ast_expr *expr, *cst;
@ -1289,15 +1308,18 @@ static __isl_give isl_ast_expr *extract_stride_constraint(
c = isl_aff_get_coefficient_val(aff, isl_dim_div, pos);
aff = isl_aff_set_coefficient_si(aff, isl_dim_div, pos, 0);
if (all_negative_coefficients(aff))
all_neg = all_negative_coefficients(aff);
if (all_neg < 0)
aff = isl_aff_free(aff);
else if (all_neg)
aff = isl_aff_neg(aff);
cst = isl_ast_expr_from_val(isl_val_abs(c));
expr = isl_ast_expr_from_aff(aff, build);
expr = isl_ast_expr_alloc_binary(isl_ast_op_zdiv_r, expr, cst);
expr = isl_ast_expr_alloc_binary(isl_ast_expr_op_zdiv_r, expr, cst);
cst = isl_ast_expr_alloc_int_si(ctx, 0);
expr = isl_ast_expr_alloc_binary(isl_ast_op_eq, expr, cst);
expr = isl_ast_expr_alloc_binary(isl_ast_expr_op_eq, expr, cst);
return expr;
}
@ -1315,7 +1337,8 @@ static __isl_give isl_ast_expr *extract_stride_constraint(
*
* If so, we convert it to
*
* (isl_ast_op_eq, (isl_ast_op_zdiv_r, expr(e), expr(d)), expr(0))
* (isl_ast_expr_op_eq,
* (isl_ast_expr_op_zdiv_r, expr(e), expr(d)), expr(0))
*
* Otherwise, let the constraint by either "a >= 0" or "a == 0".
* We first extract hidden modulo computations from "a"
@ -1324,11 +1347,11 @@ static __isl_give isl_ast_expr *extract_stride_constraint(
*
* The result is then of the form
*
* (isl_ast_op_ge, expr(pos), expr(-neg)))
* (isl_ast_expr_op_ge, expr(pos), expr(-neg)))
*
* or
*
* (isl_ast_op_eq, expr(pos), expr(-neg)))
* (isl_ast_expr_op_eq, expr(pos), expr(-neg)))
*
* However, if the first expression is an integer constant (and the second
* is not), then we swap the two expressions. This ensures that we construct,
@ -1341,14 +1364,15 @@ static __isl_give isl_ast_expr *extract_stride_constraint(
static __isl_give isl_ast_expr *isl_ast_expr_from_constraint(
__isl_take isl_constraint *constraint, __isl_keep isl_ast_build *build)
{
int i, n;
int i;
isl_size n;
isl_ctx *ctx;
isl_ast_expr *expr_pos;
isl_ast_expr *expr_neg;
isl_ast_expr *expr;
isl_aff *aff;
int eq;
enum isl_ast_op_type type;
enum isl_ast_expr_op_type type;
struct isl_ast_add_term_data data;
if (!constraint)
@ -1359,6 +1383,8 @@ static __isl_give isl_ast_expr *isl_ast_expr_from_constraint(
isl_constraint_free(constraint);
n = isl_aff_dim(aff, isl_dim_div);
if (n < 0)
aff = isl_aff_free(aff);
if (eq && n > 0)
for (i = 0; i < n; ++i) {
int is_stride;
@ -1391,10 +1417,10 @@ static __isl_give isl_ast_expr *isl_ast_expr_from_constraint(
if (isl_ast_expr_get_type(expr_pos) == isl_ast_expr_int &&
isl_ast_expr_get_type(expr_neg) != isl_ast_expr_int) {
type = eq ? isl_ast_op_eq : isl_ast_op_le;
type = eq ? isl_ast_expr_op_eq : isl_ast_expr_op_le;
expr = isl_ast_expr_alloc_binary(type, expr_neg, expr_pos);
} else {
type = eq ? isl_ast_op_eq : isl_ast_op_ge;
type = eq ? isl_ast_expr_op_eq : isl_ast_expr_op_ge;
expr = isl_ast_expr_alloc_binary(type, expr_pos, expr_neg);
}
@ -1444,7 +1470,8 @@ static int cmp_constraint(__isl_keep isl_constraint *a,
__isl_give isl_ast_expr *isl_ast_build_expr_from_basic_set(
__isl_keep isl_ast_build *build, __isl_take isl_basic_set *bset)
{
int i, n;
int i;
isl_size n;
isl_constraint *c;
isl_constraint_list *list;
isl_ast_expr *res;
@ -1453,9 +1480,9 @@ __isl_give isl_ast_expr *isl_ast_build_expr_from_basic_set(
list = isl_basic_set_get_constraint_list(bset);
isl_basic_set_free(bset);
list = isl_constraint_list_sort(list, &cmp_constraint, NULL);
if (!list)
return NULL;
n = isl_constraint_list_n_constraint(list);
if (n < 0)
build = NULL;
if (n == 0) {
isl_ctx *ctx = isl_constraint_list_get_ctx(list);
isl_constraint_list_free(list);
@ -1510,7 +1537,8 @@ __isl_give isl_ast_expr *isl_ast_build_expr_from_basic_set(
__isl_give isl_ast_expr *isl_ast_build_expr_from_set_internal(
__isl_keep isl_ast_build *build, __isl_take isl_set *set)
{
int i, n;
int i;
isl_size n;
isl_basic_set *bset;
isl_basic_set_list *list;
isl_set *domain;
@ -1519,9 +1547,9 @@ __isl_give isl_ast_expr *isl_ast_build_expr_from_set_internal(
list = isl_set_get_basic_set_list(set);
isl_set_free(set);
if (!list)
return NULL;
n = isl_basic_set_list_n_basic_set(list);
if (n < 0)
build = NULL;
if (n == 0) {
isl_ctx *ctx = isl_ast_build_get_ctx(build);
isl_basic_set_list_free(list);
@ -1570,7 +1598,12 @@ __isl_give isl_ast_expr *isl_ast_build_expr_from_set_internal(
__isl_give isl_ast_expr *isl_ast_build_expr_from_set(
__isl_keep isl_ast_build *build, __isl_take isl_set *set)
{
if (isl_ast_build_need_schedule_map(build)) {
isl_bool needs_map;
needs_map = isl_ast_build_need_schedule_map(build);
if (needs_map < 0) {
set = isl_set_free(set);
} else if (needs_map) {
isl_multi_aff *ma;
ma = isl_ast_build_get_schedule_map_multi_aff(build);
set = isl_set_preimage_multi_aff(set, ma);
@ -1646,11 +1679,13 @@ struct isl_from_pw_aff_data {
static isl_stat isl_from_pw_aff_data_init(struct isl_from_pw_aff_data *data,
__isl_keep isl_ast_build *build, __isl_keep isl_pw_aff *pa)
{
int n;
isl_size n;
isl_ctx *ctx;
ctx = isl_pw_aff_get_ctx(pa);
n = isl_pw_aff_n_piece(pa);
if (n < 0)
return isl_stat_error;
if (n == 0)
isl_die(ctx, isl_error_invalid,
"cannot handle void expression", return isl_stat_error);
@ -1771,10 +1806,11 @@ static __isl_give isl_ast_expr *ast_expr_from_aff_list(
__isl_take isl_aff_list *list, enum isl_from_pw_aff_state state,
__isl_keep isl_ast_build *build)
{
int i, n;
int i;
isl_size n;
isl_aff *aff;
isl_ast_expr *expr;
enum isl_ast_op_type op_type;
isl_ast_expr *expr = NULL;
enum isl_ast_expr_op_type op_type;
if (state == isl_state_single) {
aff = isl_aff_list_get_aff(list, 0);
@ -1782,7 +1818,10 @@ static __isl_give isl_ast_expr *ast_expr_from_aff_list(
return isl_ast_expr_from_aff(aff, build);
}
n = isl_aff_list_n_aff(list);
op_type = state == isl_state_min ? isl_ast_op_min : isl_ast_op_max;
if (n < 0)
goto error;
op_type = state == isl_state_min ? isl_ast_expr_op_min
: isl_ast_expr_op_max;
expr = isl_ast_expr_alloc_op(isl_ast_build_get_ctx(build), op_type, n);
if (!expr)
goto error;
@ -1829,7 +1868,7 @@ static isl_ast_expr **add_intermediate_piece(struct isl_from_pw_aff_data *data,
set = data->p[pos].set;
data->p[pos].set = NULL;
ctx = isl_ast_build_get_ctx(data->build);
ternary = isl_ast_expr_alloc_op(ctx, isl_ast_op_select, 3);
ternary = isl_ast_expr_alloc_op(ctx, isl_ast_expr_op_select, 3);
gist = isl_set_gist(isl_set_copy(set), isl_set_copy(data->dom));
arg = isl_ast_build_expr_from_set_internal(data->build, gist);
ternary = isl_ast_expr_set_op_arg(ternary, 0, arg);
@ -1892,7 +1931,7 @@ static int sort_pieces_cmp(const void *p1, const void *p2, void *arg)
{
const struct isl_from_pw_aff_piece *piece1 = p1;
const struct isl_from_pw_aff_piece *piece2 = p2;
int n1, n2;
isl_size n1, n2;
n1 = isl_set_n_basic_set(piece1->set);
n2 = isl_set_n_basic_set(piece2->set);
@ -1983,10 +2022,14 @@ static isl_bool aff_is_rational(__isl_keep isl_aff *aff)
*/
static isl_bool is_single_rational_aff(__isl_keep isl_aff_list *list)
{
isl_size n;
isl_bool rational;
isl_aff *aff;
if (isl_aff_list_n_aff(list) != 1)
n = isl_aff_list_n_aff(list);
if (n < 0)
return isl_bool_error;
if (n != 1)
return isl_bool_false;
aff = isl_aff_list_get_aff(list, 0);
rational = aff_is_rational(aff);
@ -2019,7 +2062,8 @@ static isl_bool extends(struct isl_from_pw_aff_data *data,
__isl_give isl_basic_set *(*test)(__isl_take isl_aff *aff1,
__isl_take isl_aff *aff2))
{
int i, n;
int i;
isl_size n;
isl_bool is_rational;
isl_ctx *ctx;
isl_set *dom;
@ -2034,10 +2078,13 @@ static isl_bool extends(struct isl_from_pw_aff_data *data,
if (!isl_options_get_ast_build_detect_min_max(ctx))
return isl_bool_false;
n = isl_set_list_n_set(data->p[data->n].set_list);
if (n < 0)
return isl_bool_error;
dom = isl_ast_build_get_domain(data->build);
set = isl_set_intersect(dom, isl_set_copy(set));
n = isl_set_list_n_set(data->p[data->n].set_list);
for (i = 0; i < n ; ++i) {
isl_aff *aff_i;
isl_set *valid;
@ -2206,8 +2253,12 @@ __isl_give isl_ast_expr *isl_ast_build_expr_from_pw_aff(
__isl_keep isl_ast_build *build, __isl_take isl_pw_aff *pa)
{
isl_ast_expr *expr;
isl_bool needs_map;
if (isl_ast_build_need_schedule_map(build)) {
needs_map = isl_ast_build_need_schedule_map(build);
if (needs_map < 0) {
pa = isl_pw_aff_free(pa);
} else if (needs_map) {
isl_multi_aff *ma;
ma = isl_ast_build_get_schedule_map_multi_aff(build);
pa = isl_pw_aff_pullback_multi_aff(pa, ma);
@ -2224,9 +2275,12 @@ __isl_give isl_ast_expr *isl_ast_build_expr_from_pw_aff(
static __isl_give isl_multi_pw_aff *set_iterator_names(
__isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa)
{
int i, n;
int i;
isl_size n;
n = isl_multi_pw_aff_dim(mpa, isl_dim_in);
if (n < 0)
return isl_multi_pw_aff_free(mpa);
for (i = 0; i < n; ++i) {
isl_id *id;
@ -2243,17 +2297,18 @@ static __isl_give isl_multi_pw_aff *set_iterator_names(
* with arguments/indices specified by "mpa".
*/
static __isl_give isl_ast_expr *isl_ast_build_with_arguments(
__isl_keep isl_ast_build *build, enum isl_ast_op_type type,
__isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type,
__isl_take isl_ast_expr *arg0, __isl_take isl_multi_pw_aff *mpa)
{
int i, n;
int i;
isl_size n;
isl_ctx *ctx;
isl_ast_expr *expr;
ctx = isl_ast_build_get_ctx(build);
n = isl_multi_pw_aff_dim(mpa, isl_dim_out);
expr = isl_ast_expr_alloc_op(ctx, type, 1 + n);
expr = n >= 0 ? isl_ast_expr_alloc_op(ctx, type, 1 + n) : NULL;
expr = isl_ast_expr_set_op_arg(expr, 0, arg0);
for (i = 0; i < n; ++i) {
isl_pw_aff *pa;
@ -2269,7 +2324,7 @@ static __isl_give isl_ast_expr *isl_ast_build_with_arguments(
}
static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff_internal(
__isl_keep isl_ast_build *build, enum isl_ast_op_type type,
__isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type,
__isl_take isl_multi_pw_aff *mpa);
/* Construct an isl_ast_expr that accesses the member specified by "mpa".
@ -2286,7 +2341,7 @@ static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff_member(
isl_id *id;
isl_multi_pw_aff *domain;
isl_ast_expr *domain_expr, *expr;
enum isl_ast_op_type type = isl_ast_op_access;
enum isl_ast_expr_op_type type = isl_ast_expr_op_access;
domain = isl_multi_pw_aff_copy(mpa);
domain = isl_multi_pw_aff_range_factor_domain(domain);
@ -2298,7 +2353,8 @@ static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff_member(
"missing field name", goto error);
id = isl_multi_pw_aff_get_tuple_id(mpa, isl_dim_out);
expr = isl_ast_expr_from_id(id);
expr = isl_ast_expr_alloc_binary(isl_ast_op_member, domain_expr, expr);
expr = isl_ast_expr_alloc_binary(isl_ast_expr_op_member,
domain_expr, expr);
return isl_ast_build_with_arguments(build, type, expr, mpa);
error:
isl_multi_pw_aff_free(mpa);
@ -2316,7 +2372,7 @@ error:
* The domain of "mpa" is assumed to live in the internal schedule domain.
*/
static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff_internal(
__isl_keep isl_ast_build *build, enum isl_ast_op_type type,
__isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type,
__isl_take isl_multi_pw_aff *mpa)
{
isl_ctx *ctx;
@ -2326,7 +2382,7 @@ static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff_internal(
if (!mpa)
goto error;
if (type == isl_ast_op_access &&
if (type == isl_ast_expr_op_access &&
isl_multi_pw_aff_range_is_wrapping(mpa))
return isl_ast_build_from_multi_pw_aff_member(build, mpa);
@ -2356,7 +2412,7 @@ error:
* The domain of "pma" is assumed to live in the internal schedule domain.
*/
static __isl_give isl_ast_expr *isl_ast_build_from_pw_multi_aff_internal(
__isl_keep isl_ast_build *build, enum isl_ast_op_type type,
__isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type,
__isl_take isl_pw_multi_aff *pma)
{
isl_multi_pw_aff *mpa;
@ -2373,10 +2429,11 @@ static __isl_give isl_ast_expr *isl_ast_build_from_pw_multi_aff_internal(
* The domain of "mpa" is assumed to live in the external schedule domain.
*/
static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff(
__isl_keep isl_ast_build *build, enum isl_ast_op_type type,
__isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type,
__isl_take isl_multi_pw_aff *mpa)
{
int is_domain;
isl_bool is_domain;
isl_bool needs_map;
isl_ast_expr *expr;
isl_space *space_build, *space_mpa;
@ -2392,7 +2449,10 @@ static __isl_give isl_ast_expr *isl_ast_build_from_multi_pw_aff(
isl_die(isl_ast_build_get_ctx(build), isl_error_invalid,
"spaces don't match", goto error);
if (isl_ast_build_need_schedule_map(build)) {
needs_map = isl_ast_build_need_schedule_map(build);
if (needs_map < 0)
goto error;
if (needs_map) {
isl_multi_aff *ma;
ma = isl_ast_build_get_schedule_map_multi_aff(build);
mpa = isl_multi_pw_aff_pullback_multi_aff(mpa, ma);
@ -2414,7 +2474,8 @@ error:
__isl_give isl_ast_expr *isl_ast_build_call_from_multi_pw_aff(
__isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa)
{
return isl_ast_build_from_multi_pw_aff(build, isl_ast_op_call, mpa);
return isl_ast_build_from_multi_pw_aff(build,
isl_ast_expr_op_call, mpa);
}
/* Construct an isl_ast_expr that accesses the array element specified by "mpa".
@ -2426,7 +2487,8 @@ __isl_give isl_ast_expr *isl_ast_build_call_from_multi_pw_aff(
__isl_give isl_ast_expr *isl_ast_build_access_from_multi_pw_aff(
__isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa)
{
return isl_ast_build_from_multi_pw_aff(build, isl_ast_op_access, mpa);
return isl_ast_build_from_multi_pw_aff(build,
isl_ast_expr_op_access, mpa);
}
/* Construct an isl_ast_expr of type "type" that calls or accesses
@ -2437,7 +2499,7 @@ __isl_give isl_ast_expr *isl_ast_build_access_from_multi_pw_aff(
* The domain of "pma" is assumed to live in the external schedule domain.
*/
static __isl_give isl_ast_expr *isl_ast_build_from_pw_multi_aff(
__isl_keep isl_ast_build *build, enum isl_ast_op_type type,
__isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type,
__isl_take isl_pw_multi_aff *pma)
{
isl_multi_pw_aff *mpa;
@ -2455,7 +2517,8 @@ static __isl_give isl_ast_expr *isl_ast_build_from_pw_multi_aff(
__isl_give isl_ast_expr *isl_ast_build_call_from_pw_multi_aff(
__isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma)
{
return isl_ast_build_from_pw_multi_aff(build, isl_ast_op_call, pma);
return isl_ast_build_from_pw_multi_aff(build,
isl_ast_expr_op_call, pma);
}
/* Construct an isl_ast_expr that accesses the array element specified by "pma".
@ -2467,7 +2530,8 @@ __isl_give isl_ast_expr *isl_ast_build_call_from_pw_multi_aff(
__isl_give isl_ast_expr *isl_ast_build_access_from_pw_multi_aff(
__isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma)
{
return isl_ast_build_from_pw_multi_aff(build, isl_ast_op_access, pma);
return isl_ast_build_from_pw_multi_aff(build,
isl_ast_expr_op_access, pma);
}
/* Construct an isl_ast_expr that calls the domain element
@ -2486,7 +2550,7 @@ __isl_give isl_ast_node *isl_ast_build_call_from_executed(
iteration = isl_ast_build_compute_gist_pw_multi_aff(build, iteration);
iteration = isl_pw_multi_aff_intersect_domain(iteration,
isl_ast_build_get_domain(build));
expr = isl_ast_build_from_pw_multi_aff_internal(build, isl_ast_op_call,
iteration);
expr = isl_ast_build_from_pw_multi_aff_internal(build,
isl_ast_expr_op_call, iteration);
return isl_ast_node_alloc_user(expr);
}

View File

@ -204,7 +204,7 @@ __isl_give isl_ast_build *isl_ast_build_clear_local_info(
__isl_give isl_ast_build *isl_ast_build_increase_depth(
__isl_take isl_ast_build *build);
int isl_ast_build_get_depth(__isl_keep isl_ast_build *build);
unsigned isl_ast_build_dim(__isl_keep isl_ast_build *build,
isl_size isl_ast_build_dim(__isl_keep isl_ast_build *build,
enum isl_dim_type type);
__isl_give isl_space *isl_ast_build_get_space(
__isl_keep isl_ast_build *build, int internal);
@ -244,8 +244,7 @@ __isl_give isl_ast_build *isl_ast_build_restrict_generated(
__isl_take isl_ast_build *build, __isl_take isl_set *set);
__isl_give isl_ast_build *isl_ast_build_replace_pending_by_guard(
__isl_take isl_ast_build *build, __isl_take isl_set *guard);
__isl_give int isl_ast_build_need_schedule_map(
__isl_keep isl_ast_build *build);
isl_bool isl_ast_build_need_schedule_map(__isl_keep isl_ast_build *build);
__isl_give isl_multi_aff *isl_ast_build_get_schedule_map_multi_aff(
__isl_keep isl_ast_build *build);
__isl_give isl_map *isl_ast_build_get_schedule_map(

View File

@ -529,14 +529,15 @@ static int reduce_list_cmp(__isl_keep isl_pw_aff *a, __isl_keep isl_pw_aff *b,
static __isl_give isl_pw_aff_list *remove_redundant_lower_bounds(
__isl_take isl_pw_aff_list *list, __isl_keep isl_ast_build *build)
{
int i, j, n;
int i, j;
isl_size n;
isl_set *domain;
list = isl_pw_aff_list_sort(list, &reduce_list_cmp, NULL);
if (!list)
return NULL;
n = isl_pw_aff_list_n_pw_aff(list);
if (n < 0)
return isl_pw_aff_list_free(list);
if (n <= 1)
return list;
@ -600,12 +601,15 @@ static __isl_give isl_pw_aff_list *lower_bounds(
{
isl_ctx *ctx;
isl_pw_aff_list *list;
int i, n;
int i;
isl_size n;
if (!build)
return NULL;
n = isl_constraint_list_n_constraint(constraints);
if (n < 0)
return NULL;
if (n == 0) {
isl_pw_aff *pa;
pa = exact_bound(domain, build, 0);
@ -642,9 +646,12 @@ static __isl_give isl_pw_aff_list *upper_bounds(
{
isl_ctx *ctx;
isl_pw_aff_list *list;
int i, n;
int i;
isl_size n;
n = isl_constraint_list_n_constraint(constraints);
if (n < 0)
return NULL;
if (n == 0) {
isl_pw_aff *pa;
pa = exact_bound(domain, build, 1);
@ -675,19 +682,19 @@ static __isl_give isl_pw_aff_list *upper_bounds(
* If the list contains exactly one element, then the returned isl_ast_expr
* simply computes that affine expression.
* If the list contains more than one element, then we sort it
* using a fairly abitrary but hopefully reasonably stable order.
* using a fairly arbitrary but hopefully reasonably stable order.
*/
static __isl_give isl_ast_expr *reduce_list(enum isl_ast_op_type type,
static __isl_give isl_ast_expr *reduce_list(enum isl_ast_expr_op_type type,
__isl_keep isl_pw_aff_list *list, __isl_keep isl_ast_build *build)
{
int i, n;
int i;
isl_size n;
isl_ctx *ctx;
isl_ast_expr *expr;
if (!list)
return NULL;
n = isl_pw_aff_list_n_pw_aff(list);
if (n < 0)
return NULL;
if (n == 1)
return isl_ast_build_expr_from_pw_aff_internal(build,
@ -803,10 +810,13 @@ static __isl_give isl_ast_graft *refine_degenerate(
static __isl_give isl_set *intersect_constraints(
__isl_keep isl_constraint_list *list)
{
int i, n;
int i;
isl_size n;
isl_basic_set *bset;
n = isl_constraint_list_n_constraint(list);
if (n < 0)
return NULL;
if (n < 1)
isl_die(isl_constraint_list_get_ctx(list), isl_error_internal,
"expecting at least one constraint", return NULL);
@ -859,9 +869,11 @@ static __isl_give isl_ast_graft *set_enforced_from_set(
isl_space *space;
isl_basic_set *enforced;
isl_pw_multi_aff *pma;
int i, n;
int i;
isl_size n;
if (!graft || !lower)
n = isl_pw_aff_list_n_pw_aff(lower);
if (!graft || n < 0)
return isl_ast_graft_free(graft);
space = isl_set_get_space(upper);
@ -870,7 +882,6 @@ static __isl_give isl_ast_graft *set_enforced_from_set(
space = isl_space_map_from_set(space);
pma = isl_pw_multi_aff_identity(space);
n = isl_pw_aff_list_n_pw_aff(lower);
for (i = 0; i < n; ++i) {
isl_pw_aff *pa;
isl_set *enforced_i;
@ -971,17 +982,21 @@ static int list_constant_is_negative(__isl_keep isl_pw_aff_list *list)
static __isl_give isl_pw_aff_list *list_add_one(
__isl_take isl_pw_aff_list *list, __isl_keep isl_ast_build *build)
{
int i, n;
int i;
isl_size n;
isl_space *space;
isl_aff *aff;
isl_pw_aff *one;
n = isl_pw_aff_list_n_pw_aff(list);
if (n < 0)
return isl_pw_aff_list_free(list);
space = isl_ast_build_get_space(build, 1);
aff = isl_aff_zero_on_domain(isl_local_space_from_space(space));
aff = isl_aff_add_constant_si(aff, 1);
one = isl_pw_aff_from_aff(aff);
n = isl_pw_aff_list_n_pw_aff(list);
for (i = 0; i < n; ++i) {
isl_pw_aff *pa;
pa = isl_pw_aff_list_get_pw_aff(list, i);
@ -1013,7 +1028,7 @@ static __isl_give isl_ast_graft *set_for_cond_from_list(
{
int neg;
isl_ast_expr *bound, *iterator, *cond;
enum isl_ast_op_type type = isl_ast_op_le;
enum isl_ast_expr_op_type type = isl_ast_expr_op_le;
if (!graft || !list)
return isl_ast_graft_free(graft);
@ -1024,10 +1039,10 @@ static __isl_give isl_ast_graft *set_for_cond_from_list(
list = isl_pw_aff_list_copy(list);
if (neg) {
list = list_add_one(list, build);
type = isl_ast_op_lt;
type = isl_ast_expr_op_lt;
}
bound = reduce_list(isl_ast_op_min, list, build);
bound = reduce_list(isl_ast_expr_op_min, list, build);
iterator = isl_ast_expr_copy(graft->node->u.f.iterator);
cond = isl_ast_expr_alloc_binary(type, iterator, bound);
graft->node->u.f.cond = cond;
@ -1127,7 +1142,7 @@ static __isl_give isl_ast_graft *set_for_node_expressions(
build = isl_ast_build_copy(build);
node = graft->node;
node->u.f.init = reduce_list(isl_ast_op_max, lower, build);
node->u.f.init = reduce_list(isl_ast_expr_op_max, lower, build);
node->u.f.inc = for_inc(build);
if (!node->u.f.init || !node->u.f.inc)
@ -1186,7 +1201,7 @@ static __isl_give isl_ast_graft *refine_generic_bounds(
int use_list;
isl_set *upper_set = NULL;
isl_pw_aff_list *upper_list = NULL;
int n_lower, n_upper;
isl_size n_lower, n_upper;
if (!graft || !c_lower || !c_upper || !build)
goto error;
@ -1196,6 +1211,8 @@ static __isl_give isl_ast_graft *refine_generic_bounds(
n_lower = isl_constraint_list_n_constraint(c_lower);
n_upper = isl_constraint_list_n_constraint(c_upper);
if (n_lower < 0 || n_upper < 0)
goto error;
use_list = use_upper_bound_list(ctx, n_upper, domain, depth);
@ -1478,6 +1495,7 @@ static __isl_give isl_ast_graft *create_node_scaled(
int depth;
int degenerate;
isl_bool eliminated;
isl_size n;
isl_basic_set *hull;
isl_basic_set *enforced;
isl_set *guard, *hoisted;
@ -1522,7 +1540,10 @@ static __isl_give isl_ast_graft *create_node_scaled(
enforced = extract_shared_enforced(children, build);
guard = extract_pending(sub_build, enforced);
hoisted = isl_ast_graft_list_extract_hoistable_guard(children, build);
if (isl_set_n_basic_set(hoisted) > 1)
n = isl_set_n_basic_set(hoisted);
if (n < 0)
children = isl_ast_graft_list_free(children);
if (n > 1)
children = isl_ast_graft_list_gist_guards(children,
isl_set_copy(hoisted));
guard = isl_set_intersect(guard, hoisted);
@ -1579,7 +1600,8 @@ static isl_stat constraint_check_scaled(__isl_take isl_constraint *c,
void *user)
{
struct isl_check_scaled_data *data = user;
int i, j, n;
int i, j;
isl_size n;
enum isl_dim_type t[] = { isl_dim_param, isl_dim_in, isl_dim_out,
isl_dim_div };
@ -1590,6 +1612,8 @@ static isl_stat constraint_check_scaled(__isl_take isl_constraint *c,
for (i = 0; i < 4; ++i) {
n = isl_constraint_dim(c, t[i]);
if (n < 0)
break;
for (j = 0; j < n; ++j) {
isl_val *d;
@ -1770,16 +1794,18 @@ static isl_stat collect_basic_set(__isl_take isl_basic_set *bset, void *user)
static __isl_give isl_basic_set_list *isl_basic_set_list_from_set(
__isl_take isl_set *set)
{
int n;
isl_size n;
isl_ctx *ctx;
isl_basic_set_list *list;
n = isl_set_n_basic_set(set);
if (n < 0)
set = isl_set_free(set);
if (!set)
return NULL;
ctx = isl_set_get_ctx(set);
n = isl_set_n_basic_set(set);
list = isl_basic_set_list_alloc(ctx, n);
if (isl_set_foreach_basic_set(set, &collect_basic_set, &list) < 0)
list = isl_basic_set_list_free(list);
@ -1869,7 +1895,7 @@ static isl_bool domain_follows_at_depth(__isl_keep isl_basic_set *i,
empty = isl_basic_map_is_empty(test);
isl_basic_map_free(test);
return empty < 0 ? isl_bool_error : !empty;
return isl_bool_not(empty);
}
/* Split up each element of "list" into a part that is related to "bset"
@ -1880,15 +1906,16 @@ static __isl_give isl_basic_set_list *add_split_on(
__isl_take isl_basic_set_list *list, __isl_take isl_basic_set *bset,
__isl_keep isl_basic_map *gt)
{
int i, n;
int i;
isl_size n;
isl_basic_set_list *res;
if (!list)
n = isl_basic_set_list_n_basic_set(list);
if (n < 0)
bset = isl_basic_set_free(bset);
gt = isl_basic_map_copy(gt);
gt = isl_basic_map_intersect_domain(gt, isl_basic_set_copy(bset));
n = isl_basic_set_list_n_basic_set(list);
res = isl_basic_set_list_from_basic_set(bset);
for (i = 0; res && i < n; ++i) {
isl_basic_set *bset;
@ -1976,13 +2003,16 @@ struct isl_add_nodes_data {
static isl_stat add_nodes(__isl_take isl_basic_set_list *scc, void *user)
{
struct isl_add_nodes_data *data = user;
int i, n, depth;
int i, depth;
isl_size n;
isl_basic_set *bset, *first;
isl_basic_set_list *list;
isl_space *space;
isl_basic_map *gt;
n = isl_basic_set_list_n_basic_set(scc);
if (n < 0)
goto error;
bset = isl_basic_set_list_get_basic_set(scc, 0);
if (n == 1) {
isl_basic_set_list_free(scc);
@ -2027,6 +2057,9 @@ static isl_stat add_nodes(__isl_take isl_basic_set_list *scc, void *user)
isl_basic_set_list_free(scc);
return data->list ? isl_stat_ok : isl_stat_error;
error:
isl_basic_set_list_free(scc);
return isl_stat_error;
}
/* Sort the domains in "domain_list" according to the execution order
@ -2049,13 +2082,13 @@ static __isl_give isl_ast_graft_list *generate_sorted_domains(
isl_ctx *ctx;
struct isl_add_nodes_data data;
int depth;
int n;
isl_size n;
if (!domain_list)
n = isl_basic_set_list_n_basic_set(domain_list);
if (n < 0)
return NULL;
ctx = isl_basic_set_list_get_ctx(domain_list);
n = isl_basic_set_list_n_basic_set(domain_list);
data.list = isl_ast_graft_list_alloc(ctx, n);
if (n == 0)
return data.list;
@ -2093,7 +2126,7 @@ static isl_bool shared_outer(__isl_keep isl_basic_set *i,
empty = isl_basic_map_is_empty(test);
isl_basic_map_free(test);
return empty < 0 ? isl_bool_error : !empty;
return isl_bool_not(empty);
}
/* Internal data structure for generate_sorted_domains_wrap.
@ -2107,7 +2140,7 @@ static isl_bool shared_outer(__isl_keep isl_basic_set *i,
* "list" collects the results.
*/
struct isl_ast_generate_parallel_domains_data {
int n;
isl_size n;
isl_union_map *executed;
isl_ast_build *build;
@ -2129,9 +2162,13 @@ static isl_stat generate_sorted_domains_wrap(__isl_take isl_basic_set_list *scc,
{
struct isl_ast_generate_parallel_domains_data *data = user;
isl_ast_graft_list *list;
isl_size n;
n = isl_basic_set_list_n_basic_set(scc);
if (n < 0)
scc = isl_basic_set_list_free(scc);
list = generate_sorted_domains(scc, data->executed, data->build);
data->single = isl_basic_set_list_n_basic_set(scc) == data->n;
data->single = n == data->n;
if (!data->single)
list = isl_ast_graft_list_fuse(list, data->build);
if (!data->list)
@ -2169,10 +2206,10 @@ static __isl_give isl_ast_graft_list *generate_parallel_domains(
int depth;
struct isl_ast_generate_parallel_domains_data data;
if (!domain_list)
data.n = isl_basic_set_list_n_basic_set(domain_list);
if (data.n < 0)
return NULL;
data.n = isl_basic_set_list_n_basic_set(domain_list);
if (data.n <= 1)
return generate_sorted_domains(domain_list, executed, build);
@ -2232,9 +2269,12 @@ static __isl_give isl_set *explicit_bounds(__isl_take isl_map *map,
__isl_keep isl_ast_build *build)
{
isl_set *domain;
int depth, dim;
int depth;
isl_size dim;
dim = isl_map_dim(map, isl_dim_out);
if (dim < 0)
return isl_map_domain(isl_map_free(map));
map = isl_map_drop_constraints_involving_dims(map, isl_dim_out, 0, dim);
domain = isl_map_domain(map);
@ -2343,7 +2383,7 @@ static __isl_give isl_constraint *at_offset(int depth, __isl_keep isl_aff *aff,
return isl_equality_from_aff(aff);
}
/* Update *user to the number of integer divsions in the first element
/* Update *user to the number of integer divisions in the first element
* of "ma", if it is larger than the current value.
*/
static isl_stat update_n_div(__isl_take isl_set *set,
@ -2351,7 +2391,7 @@ static isl_stat update_n_div(__isl_take isl_set *set,
{
isl_aff *aff;
int *n = user;
int n_div;
isl_size n_div;
aff = isl_multi_aff_get_aff(ma, 0);
n_div = isl_aff_dim(aff, isl_dim_div);
@ -2362,7 +2402,7 @@ static isl_stat update_n_div(__isl_take isl_set *set,
if (n_div > *n)
*n = n_div;
return aff ? isl_stat_ok : isl_stat_error;
return n_div >= 0 ? isl_stat_ok : isl_stat_error;
}
/* Get the number of integer divisions in the expression for the iterator
@ -2786,8 +2826,9 @@ static __isl_give isl_set *compute_unroll_domains(
{
isl_set *unroll_domain;
isl_basic_set_list *unroll_list;
int i, n;
int empty;
int i;
isl_size n;
isl_bool empty;
empty = isl_set_is_empty(domains->option[isl_ast_loop_unroll]);
if (empty < 0)
@ -2799,6 +2840,8 @@ static __isl_give isl_set *compute_unroll_domains(
unroll_list = isl_basic_set_list_from_set(unroll_domain);
n = isl_basic_set_list_n_basic_set(unroll_list);
if (n < 0)
class_domain = isl_set_free(class_domain);
for (i = 0; i < n; ++i) {
isl_basic_set *bset;
@ -3083,7 +3126,7 @@ static __isl_give isl_basic_set_list *compute_domains(
isl_space *space;
int n_param;
enum isl_ast_loop_type type;
int empty;
isl_bool empty;
if (!executed)
return NULL;
@ -3099,6 +3142,8 @@ static __isl_give isl_basic_set_list *compute_domains(
domains.sep_class = isl_ast_build_get_separation_class(build);
classes = isl_map_range(isl_map_copy(domains.sep_class));
n_param = isl_set_dim(classes, isl_dim_param);
if (n_param < 0)
classes = isl_set_free(classes);
classes = isl_set_project_out(classes, isl_dim_param, 0, n_param);
space = isl_set_get_space(domain);
@ -3258,14 +3303,21 @@ static isl_bool has_pure_outer_disjunction(__isl_keep isl_set *domain,
isl_basic_set *hull;
isl_set *shared, *inner;
isl_bool equal;
int depth, dim;
int depth;
isl_size n;
isl_size dim;
if (isl_set_n_basic_set(domain) <= 1)
n = isl_set_n_basic_set(domain);
if (n < 0)
return isl_bool_error;
if (n <= 1)
return isl_bool_false;
dim = isl_set_dim(domain, isl_dim_set);
if (dim < 0)
return isl_bool_error;
inner = isl_set_copy(domain);
depth = isl_ast_build_get_depth(build);
dim = isl_set_dim(inner, isl_dim_set);
inner = isl_set_drop_constraints_not_involving_dims(inner,
isl_dim_set, depth, dim - depth);
hull = isl_set_plain_unshifted_simple_hull(isl_set_copy(inner));
@ -3375,11 +3427,14 @@ static __isl_give isl_set *extract_disjunction(__isl_take isl_set *domain,
__isl_keep isl_ast_build *build)
{
isl_set *hull;
int depth, dim;
int depth;
isl_size dim;
domain = isl_ast_build_specialize(build, domain);
depth = isl_ast_build_get_depth(build);
dim = isl_set_dim(domain, isl_dim_set);
if (dim < 0)
return isl_set_free(domain);
domain = isl_set_eliminate(domain, isl_dim_set, depth, dim - depth);
domain = isl_set_remove_unknown_divs(domain);
hull = isl_set_copy(domain);
@ -3402,10 +3457,14 @@ static __isl_give isl_ast_graft_list *list_add_guard(
__isl_keep isl_ast_build *build, __isl_keep isl_ast_build *sub_build)
{
isl_ast_graft *graft;
isl_size n;
list = isl_ast_graft_list_fuse(list, sub_build);
if (isl_ast_graft_list_n_ast_graft(list) != 1)
n = isl_ast_graft_list_n_ast_graft(list);
if (n < 0)
return isl_ast_graft_list_free(list);
if (n != 1)
return list;
graft = isl_ast_graft_list_get_ast_graft(list, 0);
@ -4231,18 +4290,18 @@ static isl_stat extract_domain(__isl_take isl_map *map, void *user)
return isl_stat_ok;
}
static int after_in_tree(__isl_keep isl_union_map *umap,
static isl_bool after_in_tree(__isl_keep isl_union_map *umap,
__isl_keep isl_schedule_node *node);
/* Is any domain element of "umap" scheduled after any of
* the corresponding image elements by the tree rooted at
* the child of "node"?
*/
static int after_in_child(__isl_keep isl_union_map *umap,
static isl_bool after_in_child(__isl_keep isl_union_map *umap,
__isl_keep isl_schedule_node *node)
{
isl_schedule_node *child;
int after;
isl_bool after;
child = isl_schedule_node_get_child(node, 0);
after = after_in_tree(umap, child);
@ -4263,17 +4322,21 @@ static int after_in_child(__isl_keep isl_union_map *umap,
* If there are no such pairs then the map passed to after_in_child
* will be empty causing it to return 0.
*/
static int after_in_band(__isl_keep isl_union_map *umap,
static isl_bool after_in_band(__isl_keep isl_union_map *umap,
__isl_keep isl_schedule_node *node)
{
isl_multi_union_pw_aff *mupa;
isl_union_map *partial, *test, *gt, *universe, *umap1, *umap2;
isl_union_set *domain, *range;
isl_space *space;
int empty;
int after;
isl_bool empty;
isl_bool after;
isl_size n;
if (isl_schedule_node_band_n_member(node) == 0)
n = isl_schedule_node_band_n_member(node);
if (n < 0)
return isl_bool_error;
if (n == 0)
return after_in_child(umap, node);
mupa = isl_schedule_node_band_get_partial_schedule(node);
@ -4289,7 +4352,7 @@ static int after_in_band(__isl_keep isl_union_map *umap,
if (empty < 0 || !empty) {
isl_union_map_free(partial);
return empty < 0 ? -1 : 1;
return isl_bool_not(empty);
}
universe = isl_union_map_universe(isl_union_map_copy(umap));
@ -4315,13 +4378,13 @@ static int after_in_band(__isl_keep isl_union_map *umap,
* to the range of the prefix schedule for both domain and
* range of "umap".
*/
static int after_in_context(__isl_keep isl_union_map *umap,
static isl_bool after_in_context(__isl_keep isl_union_map *umap,
__isl_keep isl_schedule_node *node)
{
isl_union_map *prefix, *universe, *umap1, *umap2;
isl_union_set *domain, *range;
isl_set *context;
int after;
isl_bool after;
umap = isl_union_map_copy(umap);
context = isl_schedule_node_context_get_context(node);
@ -4351,11 +4414,11 @@ static int after_in_context(__isl_keep isl_union_map *umap,
* We apply the expansion to domain and range of "umap" and
* continue with its child.
*/
static int after_in_expansion(__isl_keep isl_union_map *umap,
static isl_bool after_in_expansion(__isl_keep isl_union_map *umap,
__isl_keep isl_schedule_node *node)
{
isl_union_map *expansion;
int after;
isl_bool after;
expansion = isl_schedule_node_expansion_get_expansion(node);
umap = isl_union_map_copy(umap);
@ -4374,13 +4437,13 @@ static int after_in_expansion(__isl_keep isl_union_map *umap,
* the extension node "node"?
*
* Since the extension node may add statement instances before or
* after the pairs of statement instances in "umap", we return 1
* after the pairs of statement instances in "umap", we return isl_bool_true
* to ensure that these pairs are not broken up.
*/
static int after_in_extension(__isl_keep isl_union_map *umap,
static isl_bool after_in_extension(__isl_keep isl_union_map *umap,
__isl_keep isl_schedule_node *node)
{
return 1;
return isl_bool_true;
}
/* Is any domain element of "umap" scheduled after any of
@ -4390,11 +4453,11 @@ static int after_in_extension(__isl_keep isl_union_map *umap,
* We intersect domain and range of "umap" with the filter and
* continue with its child.
*/
static int after_in_filter(__isl_keep isl_union_map *umap,
static isl_bool after_in_filter(__isl_keep isl_union_map *umap,
__isl_keep isl_schedule_node *node)
{
isl_union_set *filter;
int after;
isl_bool after;
umap = isl_union_map_copy(umap);
filter = isl_schedule_node_filter_get_filter(node);
@ -4418,15 +4481,18 @@ static int after_in_filter(__isl_keep isl_union_map *umap,
* are contained in different children, then the condition
* does not hold.
*/
static int after_in_set(__isl_keep isl_union_map *umap,
static isl_bool after_in_set(__isl_keep isl_union_map *umap,
__isl_keep isl_schedule_node *node)
{
int i, n;
int i;
isl_size n;
n = isl_schedule_node_n_children(node);
if (n < 0)
return isl_bool_error;
for (i = 0; i < n; ++i) {
isl_schedule_node *child;
int after;
isl_bool after;
child = isl_schedule_node_get_child(node, i);
after = after_in_tree(umap, child);
@ -4436,7 +4502,7 @@ static int after_in_set(__isl_keep isl_union_map *umap,
return after;
}
return 0;
return isl_bool_false;
}
/* Return the filter of child "i" of "node".
@ -4463,14 +4529,18 @@ static __isl_give isl_union_set *child_filter(
* if the condition holds within a given child in the sequence.
* The later part of the condition is checked by after_in_set.
*/
static int after_in_sequence(__isl_keep isl_union_map *umap,
static isl_bool after_in_sequence(__isl_keep isl_union_map *umap,
__isl_keep isl_schedule_node *node)
{
int i, j, n;
int i, j;
isl_size n;
isl_union_map *umap_i;
int empty, after = 0;
isl_bool empty;
isl_bool after = isl_bool_false;
n = isl_schedule_node_n_children(node);
if (n < 0)
return isl_bool_error;
for (i = 1; i < n; ++i) {
isl_union_set *filter_i;
@ -4499,7 +4569,7 @@ static int after_in_sequence(__isl_keep isl_union_map *umap,
if (empty < 0)
goto error;
if (!empty)
after = 1;
after = isl_bool_true;
if (after)
break;
}
@ -4515,7 +4585,7 @@ static int after_in_sequence(__isl_keep isl_union_map *umap,
return after_in_set(umap, node);
error:
isl_union_map_free(umap_i);
return -1;
return isl_bool_error;
}
/* Is any domain element of "umap" scheduled after any of
@ -4524,31 +4594,32 @@ error:
* If "umap" is empty, then clearly there is no such element.
* Otherwise, consider the different types of nodes separately.
*/
static int after_in_tree(__isl_keep isl_union_map *umap,
static isl_bool after_in_tree(__isl_keep isl_union_map *umap,
__isl_keep isl_schedule_node *node)
{
int empty;
isl_bool empty;
enum isl_schedule_node_type type;
empty = isl_union_map_is_empty(umap);
if (empty < 0)
return -1;
return isl_bool_error;
if (empty)
return 0;
return isl_bool_false;
if (!node)
return -1;
return isl_bool_error;
type = isl_schedule_node_get_type(node);
switch (type) {
case isl_schedule_node_error:
return -1;
return isl_bool_error;
case isl_schedule_node_leaf:
return 0;
return isl_bool_false;
case isl_schedule_node_band:
return after_in_band(umap, node);
case isl_schedule_node_domain:
isl_die(isl_schedule_node_get_ctx(node), isl_error_internal,
"unexpected internal domain node", return -1);
"unexpected internal domain node",
return isl_bool_error);
case isl_schedule_node_context:
return after_in_context(umap, node);
case isl_schedule_node_expansion:
@ -4566,7 +4637,7 @@ static int after_in_tree(__isl_keep isl_union_map *umap,
return after_in_sequence(umap, node);
}
return 1;
return isl_bool_true;
}
/* Is any domain element of "map1" scheduled after any domain
@ -4582,21 +4653,21 @@ static int after_in_tree(__isl_keep isl_union_map *umap,
* together and then check if the subtree underneath the current
* band node determines their relative order.
*/
static int after_in_subtree(__isl_keep isl_ast_build *build,
static isl_bool after_in_subtree(__isl_keep isl_ast_build *build,
__isl_keep isl_map *map1, __isl_keep isl_map *map2)
{
isl_schedule_node *node;
isl_map *map;
isl_union_map *umap;
int after;
isl_bool after;
node = isl_ast_build_get_schedule_node(build);
if (!node)
return -1;
return isl_bool_error;
node = isl_schedule_node_child(node, 0);
if (isl_schedule_node_get_type(node) == isl_schedule_node_leaf) {
isl_schedule_node_free(node);
return 0;
return isl_bool_false;
}
map = isl_map_copy(map2);
map = isl_map_apply_domain(map, isl_map_copy(map1));
@ -4640,9 +4711,12 @@ struct isl_any_scheduled_after_data {
static isl_bool any_scheduled_after(int i, int j, void *user)
{
struct isl_any_scheduled_after_data *data = user;
int dim = isl_set_dim(data->domain[i].set, isl_dim_set);
isl_size dim = isl_set_dim(data->domain[i].set, isl_dim_set);
int pos;
if (dim < 0)
return isl_bool_error;
for (pos = data->depth; pos < dim; ++pos) {
int follows;
@ -4658,7 +4732,7 @@ static isl_bool any_scheduled_after(int i, int j, void *user)
}
if (isl_ast_build_has_schedule_node(data->build)) {
int after;
isl_bool after;
after = after_in_subtree(data->build, data->domain[i].map,
data->domain[j].map);
@ -4666,7 +4740,7 @@ static isl_bool any_scheduled_after(int i, int j, void *user)
return after;
}
return data->group_coscheduled;
return isl_bool_ok(data->group_coscheduled);
}
/* Look for independent components at the current depth and generate code
@ -4694,13 +4768,16 @@ static __isl_give isl_ast_graft_list *generate_components(
{
int i;
isl_ctx *ctx = isl_ast_build_get_ctx(build);
int n = isl_union_map_n_map(executed);
isl_size n = isl_union_map_n_map(executed);
struct isl_any_scheduled_after_data data;
struct isl_set_map_pair *next;
struct isl_tarjan_graph *g = NULL;
isl_ast_graft_list *list = NULL;
int n_domain = 0;
data.domain = NULL;
if (n < 0)
goto error;
data.domain = isl_calloc_array(ctx, struct isl_set_map_pair, n);
if (!data.domain)
goto error;
@ -4774,6 +4851,8 @@ static __isl_give isl_ast_graft_list *generate_next_level(
__isl_take isl_union_map *executed, __isl_take isl_ast_build *build)
{
int depth;
isl_size dim;
isl_size n;
if (!build || !executed)
goto error;
@ -4786,10 +4865,16 @@ static __isl_give isl_ast_graft_list *generate_next_level(
}
depth = isl_ast_build_get_depth(build);
if (depth >= isl_ast_build_dim(build, isl_dim_set))
dim = isl_ast_build_dim(build, isl_dim_set);
if (dim < 0)
goto error;
if (depth >= dim)
return generate_inner_level(executed, build);
if (isl_union_map_n_map(executed) == 1)
n = isl_union_map_n_map(executed);
if (n < 0)
goto error;
if (n == 1)
return generate_shifted_component(executed, build);
return generate_components(executed, build);
@ -5088,6 +5173,37 @@ __isl_give isl_ast_node *isl_ast_build_ast_from_schedule(
return isl_ast_build_node_from_schedule_map(build, schedule);
}
/* Generate an AST that visits the elements in the domain of "executed"
* in the relative order specified by the leaf node "node".
*
* The relation "executed" maps the outer generated loop iterators
* to the domain elements executed by those iterations.
*
* Simply pass control to generate_inner_level.
* Note that the current build does not refer to any band node, so
* that generate_inner_level will not try to visit the child of
* the leaf node.
*
* If multiple statement instances reach a leaf,
* then they can be executed in any order.
* Group the list of grafts based on shared guards
* such that identical guards are only generated once
* when the list is eventually passed on to isl_ast_graft_list_fuse.
*/
static __isl_give isl_ast_graft_list *build_ast_from_leaf(
__isl_take isl_ast_build *build, __isl_take isl_schedule_node *node,
__isl_take isl_union_map *executed)
{
isl_ast_graft_list *list;
isl_schedule_node_free(node);
list = generate_inner_level(executed, isl_ast_build_copy(build));
list = isl_ast_graft_list_group_on_guard(list, build);
isl_ast_build_free(build);
return list;
}
/* Generate an AST that visits the elements in the domain of "executed"
* in the relative order specified by the band node "node" and its descendants.
*
@ -5110,12 +5226,14 @@ static __isl_give isl_ast_graft_list *build_ast_from_band(
isl_multi_union_pw_aff *extra;
isl_union_map *extra_umap;
isl_ast_graft_list *list;
unsigned n1, n2;
isl_size n1, n2;
isl_size n;
if (!build || !node || !executed)
n = isl_schedule_node_band_n_member(node);
if (!build || n < 0 || !executed)
goto error;
if (isl_schedule_node_band_n_member(node) == 0)
if (n == 0)
return build_ast_from_child(build, node, executed);
extra = isl_schedule_node_band_get_partial_schedule(node);
@ -5132,7 +5250,9 @@ static __isl_give isl_ast_graft_list *build_ast_from_band(
n1 = isl_ast_build_dim(build, isl_dim_param);
build = isl_ast_build_product(build, space);
n2 = isl_ast_build_dim(build, isl_dim_param);
if (n2 > n1)
if (n1 < 0 || n2 < 0)
build = isl_ast_build_free(build);
else if (n2 > n1)
isl_die(isl_ast_build_get_ctx(build), isl_error_invalid,
"band node is not allowed to introduce new parameters",
build = isl_ast_build_free(build));
@ -5165,13 +5285,12 @@ static __isl_give isl_ast_graft_list *hoist_out_of_context(
isl_ast_graft *graft;
isl_basic_set *enforced;
isl_set *guard;
unsigned n_param, extra_param;
if (!build || !sub_build)
return isl_ast_graft_list_free(list);
isl_size n_param, extra_param;
n_param = isl_ast_build_dim(build, isl_dim_param);
extra_param = isl_ast_build_dim(sub_build, isl_dim_param);
if (n_param < 0 || extra_param < 0)
return isl_ast_graft_list_free(list);
if (extra_param == n_param)
return list;
@ -5234,9 +5353,12 @@ static __isl_give isl_ast_graft_list *build_ast_from_context(
isl_multi_aff *internal2input;
isl_ast_build *sub_build;
isl_ast_graft_list *list;
int n, depth;
isl_size n;
isl_size depth;
depth = isl_schedule_node_get_tree_depth(node);
if (depth < 0)
build = isl_ast_build_free(build);
space = isl_ast_build_get_space(build, 1);
context = isl_schedule_node_context_get_context(node);
context = isl_set_align_params(context, space);
@ -5285,7 +5407,7 @@ static __isl_give isl_ast_graft_list *build_ast_from_expansion(
__isl_take isl_union_map *executed)
{
isl_union_map *expansion;
unsigned n1, n2;
isl_size n1, n2;
expansion = isl_schedule_node_expansion_get_expansion(node);
expansion = isl_union_map_align_params(expansion,
@ -5294,6 +5416,8 @@ static __isl_give isl_ast_graft_list *build_ast_from_expansion(
n1 = isl_union_map_dim(executed, isl_dim_param);
executed = isl_union_map_apply_range(executed, expansion);
n2 = isl_union_map_dim(executed, isl_dim_param);
if (n1 < 0 || n2 < 0)
goto error;
if (n2 > n1)
isl_die(isl_ast_build_get_ctx(build), isl_error_invalid,
"expansion node is not allowed to introduce "
@ -5370,7 +5494,7 @@ static __isl_give isl_ast_graft_list *build_ast_from_filter(
isl_ast_graft_list *list;
int empty;
isl_bool unchanged;
unsigned n1, n2;
isl_size n1, n2;
orig = isl_union_map_copy(executed);
if (!build || !node || !executed)
@ -5382,6 +5506,8 @@ static __isl_give isl_ast_graft_list *build_ast_from_filter(
n1 = isl_union_map_dim(executed, isl_dim_param);
executed = isl_union_map_intersect_range(executed, filter);
n2 = isl_union_map_dim(executed, isl_dim_param);
if (n1 < 0 || n2 < 0)
goto error;
if (n2 > n1)
isl_die(isl_ast_build_get_ctx(build), isl_error_invalid,
"filter node is not allowed to introduce "
@ -5436,14 +5562,16 @@ static __isl_give isl_ast_graft_list *build_ast_from_guard(
isl_ast_build *sub_build;
isl_ast_graft *graft;
isl_ast_graft_list *list;
unsigned n1, n2;
isl_size n1, n2, n;
space = isl_ast_build_get_space(build, 1);
guard = isl_schedule_node_guard_get_guard(node);
n1 = isl_space_dim(space, isl_dim_param);
guard = isl_set_align_params(guard, space);
n2 = isl_set_dim(guard, isl_dim_param);
if (n2 > n1)
if (n1 < 0 || n2 < 0)
guard = isl_set_free(guard);
else if (n2 > n1)
isl_die(isl_ast_build_get_ctx(build), isl_error_invalid,
"guard node is not allowed to introduce "
"new parameters", guard = isl_set_free(guard));
@ -5460,7 +5588,10 @@ static __isl_give isl_ast_graft_list *build_ast_from_guard(
node, executed);
hoisted = isl_ast_graft_list_extract_hoistable_guard(list, sub_build);
if (isl_set_n_basic_set(hoisted) > 1)
n = isl_set_n_basic_set(hoisted);
if (n < 0)
list = isl_ast_graft_list_free(list);
if (n > 1)
list = isl_ast_graft_list_gist_guards(list,
isl_set_copy(hoisted));
guard = isl_set_intersect(guard, hoisted);
@ -5532,7 +5663,7 @@ static __isl_give isl_ast_graft_list *build_ast_from_mark(
isl_id *mark;
isl_ast_graft *graft;
isl_ast_graft_list *list;
int n;
isl_size n;
build = isl_ast_build_set_executed(build, isl_union_map_copy(executed));
@ -5576,7 +5707,8 @@ static __isl_give isl_ast_graft_list *build_ast_from_sequence(
__isl_take isl_ast_build *build, __isl_take isl_schedule_node *node,
__isl_take isl_union_map *executed)
{
int i, n;
int i;
isl_size n;
isl_ctx *ctx;
isl_ast_graft_list *list;
@ -5584,6 +5716,8 @@ static __isl_give isl_ast_graft_list *build_ast_from_sequence(
list = isl_ast_graft_list_alloc(ctx, 0);
n = isl_schedule_node_n_children(node);
if (n < 0)
list = isl_ast_graft_list_free(list);
for (i = 0; i < n; ++i) {
isl_schedule_node *child;
isl_ast_graft_list *list_i;
@ -5606,12 +5740,7 @@ static __isl_give isl_ast_graft_list *build_ast_from_sequence(
* The relation "executed" maps the outer generated loop iterators
* to the domain elements executed by those iterations.
*
* If the node is a leaf, then we pass control to generate_inner_level.
* Note that the current build does not refer to any band node, so
* that generate_inner_level will not try to visit the child of
* the leaf node.
*
* The other node types are handled in separate functions.
* The node types are handled in separate functions.
* Set nodes are currently treated in the same way as sequence nodes.
* The children of a set node may be executed in any order,
* including the order of the children.
@ -5628,8 +5757,7 @@ static __isl_give isl_ast_graft_list *build_ast_from_schedule_node(
case isl_schedule_node_error:
goto error;
case isl_schedule_node_leaf:
isl_schedule_node_free(node);
return generate_inner_level(executed, build);
return build_ast_from_leaf(build, node, executed);
case isl_schedule_node_band:
return build_ast_from_band(build, node, executed);
case isl_schedule_node_context:

View File

@ -1,6 +1,7 @@
/*
* Copyright 2012 Ecole Normale Superieure
* Copyright 2014 INRIA Rocquencourt
* Copyright 2019 Cerebras Systems
*
* Use of this software is governed by the MIT license
*
@ -8,6 +9,7 @@
* Ecole Normale Superieure, 45 rue dUlm, 75230 Paris, France
* and Inria Paris - Rocquencourt, Domaine de Voluceau - Rocquencourt,
* B.P. 105 - 78153 Le Chesnay, France
* and Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA
*/
#include <isl/id.h>
@ -16,12 +18,13 @@
#include <isl_ast_build_expr.h>
#include <isl_ast_build_private.h>
#include <isl_ast_graft_private.h>
#include "isl_set_to_ast_graft_list.h"
static __isl_give isl_ast_graft *isl_ast_graft_copy(
__isl_keep isl_ast_graft *graft);
#undef BASE
#define BASE ast_graft
#undef EL_BASE
#define EL_BASE ast_graft
#include <isl_list_templ.c>
@ -102,36 +105,43 @@ static __isl_give isl_ast_graft *isl_ast_graft_copy(
/* Do all the grafts in "list" have the same guard and is this guard
* independent of the current depth?
*/
static int equal_independent_guards(__isl_keep isl_ast_graft_list *list,
static isl_bool equal_independent_guards(__isl_keep isl_ast_graft_list *list,
__isl_keep isl_ast_build *build)
{
int i, n;
int i;
isl_size n;
int depth;
isl_size dim;
isl_ast_graft *graft_0;
int equal = 1;
int skip;
isl_bool equal = isl_bool_true;
isl_bool skip;
n = isl_ast_graft_list_n_ast_graft(list);
if (n < 0)
return isl_bool_error;
graft_0 = isl_ast_graft_list_get_ast_graft(list, 0);
if (!graft_0)
return -1;
return isl_bool_error;
depth = isl_ast_build_get_depth(build);
if (isl_set_dim(graft_0->guard, isl_dim_set) <= depth)
skip = 0;
dim = isl_set_dim(graft_0->guard, isl_dim_set);
if (dim < 0)
return isl_bool_error;
if (dim <= depth)
skip = isl_bool_false;
else
skip = isl_set_involves_dims(graft_0->guard,
isl_dim_set, depth, 1);
if (skip < 0 || skip) {
isl_ast_graft_free(graft_0);
return skip < 0 ? -1 : 0;
return isl_bool_not(skip);
}
n = isl_ast_graft_list_n_ast_graft(list);
for (i = 1; i < n; ++i) {
isl_ast_graft *graft;
graft = isl_ast_graft_list_get_ast_graft(list, i);
if (!graft)
equal = -1;
equal = isl_bool_error;
else
equal = isl_set_is_equal(graft_0->guard, graft->guard);
isl_ast_graft_free(graft);
@ -152,9 +162,13 @@ static __isl_give isl_set *hoist_guard(__isl_take isl_set *guard,
__isl_keep isl_ast_build *build)
{
int depth;
isl_size dim;
depth = isl_ast_build_get_depth(build);
if (depth < isl_set_dim(guard, isl_dim_set)) {
dim = isl_set_dim(guard, isl_dim_set);
if (dim < 0)
return isl_set_free(guard);
if (depth < dim) {
guard = isl_set_remove_divs_involving_dims(guard,
isl_dim_set, depth, 1);
guard = isl_set_eliminate(guard, isl_dim_set, depth, 1);
@ -193,8 +207,9 @@ static __isl_give isl_set *hoist_guard(__isl_take isl_set *guard,
__isl_give isl_set *isl_ast_graft_list_extract_hoistable_guard(
__isl_keep isl_ast_graft_list *list, __isl_keep isl_ast_build *build)
{
int i, n;
int equal;
int i;
isl_size n;
isl_bool equal;
isl_ctx *ctx;
isl_set *guard;
isl_set_list *set_list;
@ -204,6 +219,8 @@ __isl_give isl_set *isl_ast_graft_list_extract_hoistable_guard(
return NULL;
n = isl_ast_graft_list_n_ast_graft(list);
if (n < 0)
return NULL;
if (n == 0)
return isl_set_universe(isl_ast_build_get_space(build, 1));
@ -277,10 +294,13 @@ static __isl_give isl_ast_node *ast_node_insert_if(
{
struct isl_insert_if_data data;
isl_ctx *ctx;
isl_size n;
n = isl_set_n_basic_set(guard);
if (n < 0)
goto error;
ctx = isl_ast_build_get_ctx(build);
if (isl_options_get_ast_build_allow_or(ctx) ||
isl_set_n_basic_set(guard) <= 1) {
if (isl_options_get_ast_build_allow_or(ctx) || n <= 1) {
isl_ast_node *if_node;
isl_ast_expr *expr;
@ -301,6 +321,10 @@ static __isl_give isl_ast_node *ast_node_insert_if(
isl_set_free(guard);
isl_ast_node_free(data.node);
return isl_ast_node_alloc_block(data.list);
error:
isl_set_free(guard);
isl_ast_node_free(node);
return NULL;
}
/* Insert an if node around a copy of "data->node" testing the condition
@ -389,10 +413,14 @@ static __isl_give isl_basic_set *update_enforced(
__isl_take isl_basic_set *enforced, __isl_keep isl_ast_graft *graft,
int depth)
{
isl_size dim;
isl_basic_set *enforced_g;
enforced_g = isl_ast_graft_get_enforced(graft);
if (depth < isl_basic_set_dim(enforced_g, isl_dim_set))
dim = isl_basic_set_dim(enforced_g, isl_dim_set);
if (dim < 0)
enforced_g = isl_basic_set_free(enforced_g);
if (depth < dim)
enforced_g = isl_basic_set_eliminate(enforced_g,
isl_dim_set, depth, 1);
enforced_g = isl_basic_set_remove_unknown_divs(enforced_g);
@ -444,19 +472,19 @@ static __isl_give isl_ast_graft_list *graft_extend_body(
__isl_keep isl_ast_node **body, __isl_take isl_ast_graft *graft,
__isl_keep isl_ast_build *build)
{
int n;
isl_size n;
int depth;
isl_ast_graft *last;
isl_space *space;
isl_basic_set *enforced;
if (!list || !graft)
n = isl_ast_graft_list_n_ast_graft(list);
if (n < 0 || !graft)
goto error;
extend_body(body, isl_ast_node_copy(graft->node));
if (!*body)
goto error;
n = isl_ast_graft_list_n_ast_graft(list);
last = isl_ast_graft_list_get_ast_graft(list, n - 1);
depth = isl_ast_build_get_depth(build);
@ -543,17 +571,18 @@ static __isl_give isl_ast_graft_list *insert_pending_guard_nodes(
__isl_take isl_ast_graft_list *list,
__isl_keep isl_ast_build *build)
{
int i, j, n, n_if;
int i, j, n_if;
isl_size n;
int allow_else;
isl_ctx *ctx;
isl_ast_graft_list *res;
struct isl_if_node *if_node = NULL;
if (!build || !list)
n = isl_ast_graft_list_n_ast_graft(list);
if (!build || n < 0)
return isl_ast_graft_list_free(list);
ctx = isl_ast_build_get_ctx(build);
n = isl_ast_graft_list_n_ast_graft(list);
allow_else = isl_options_get_ast_build_allow_else(ctx);
@ -663,15 +692,16 @@ static __isl_give isl_ast_graft_list *insert_pending_guard_nodes(
__isl_give isl_ast_graft_list *isl_ast_graft_list_insert_pending_guard_nodes(
__isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build)
{
int i, n;
int i;
isl_size n;
isl_set *universe;
list = insert_pending_guard_nodes(list, build);
if (!list)
return NULL;
n = isl_ast_graft_list_n_ast_graft(list);
if (n < 0)
return isl_ast_graft_list_free(list);
universe = isl_set_universe(isl_ast_build_get_space(build, 1));
n = isl_ast_graft_list_n_ast_graft(list);
for (i = 0; i < n; ++i) {
isl_ast_graft *graft;
@ -696,14 +726,15 @@ __isl_give isl_ast_graft_list *isl_ast_graft_list_insert_pending_guard_nodes(
static __isl_give isl_ast_node_list *extract_node_list(
__isl_keep isl_ast_graft_list *list)
{
int i, n;
int i;
isl_size n;
isl_ctx *ctx;
isl_ast_node_list *node_list;
if (!list)
n = isl_ast_graft_list_n_ast_graft(list);
if (n < 0)
return NULL;
ctx = isl_ast_graft_list_get_ctx(list);
n = isl_ast_graft_list_n_ast_graft(list);
node_list = isl_ast_node_list_alloc(ctx, n);
for (i = 0; i < n; ++i) {
isl_ast_node *node;
@ -727,19 +758,20 @@ __isl_give isl_basic_set *isl_ast_graft_list_extract_shared_enforced(
__isl_keep isl_ast_graft_list *list,
__isl_keep isl_ast_build *build)
{
int i, n;
int i;
isl_size n;
int depth;
isl_space *space;
isl_basic_set *enforced;
if (!list)
n = isl_ast_graft_list_n_ast_graft(list);
if (n < 0)
return NULL;
space = isl_ast_build_get_space(build, 1);
enforced = isl_basic_set_empty(space);
depth = isl_ast_build_get_depth(build);
n = isl_ast_graft_list_n_ast_graft(list);
for (i = 0; i < n; ++i) {
isl_ast_graft *graft;
@ -794,12 +826,13 @@ error:
static __isl_give isl_ast_graft_list *gist_guards(
__isl_take isl_ast_graft_list *list, __isl_keep isl_set *context)
{
int i, n;
if (!list)
return NULL;
int i;
isl_size n;
n = isl_ast_graft_list_n_ast_graft(list);
if (!list)
return isl_ast_graft_list_free(list);
for (i = 0; i < n; ++i) {
isl_ast_graft *graft;
@ -909,11 +942,13 @@ __isl_give isl_ast_graft_list *isl_ast_graft_list_fuse(
__isl_take isl_ast_graft_list *list,
__isl_keep isl_ast_build *build)
{
isl_size n;
isl_ast_graft *graft;
if (!list)
return NULL;
if (isl_ast_graft_list_n_ast_graft(list) <= 1)
n = isl_ast_graft_list_n_ast_graft(list);
if (n < 0)
return isl_ast_graft_list_free(list);
if (n <= 1)
return list;
graft = ast_graft_list_fuse(list, build);
return isl_ast_graft_list_from_ast_graft(graft);
@ -1098,9 +1133,12 @@ __isl_give isl_ast_graft *isl_ast_graft_unembed(__isl_take isl_ast_graft *graft,
__isl_give isl_ast_graft_list *isl_ast_graft_list_unembed(
__isl_take isl_ast_graft_list *list, int product)
{
int i, n;
int i;
isl_size n;
n = isl_ast_graft_list_n_ast_graft(list);
if (n < 0)
return isl_ast_graft_list_free(list);
for (i = 0; i < n; ++i) {
isl_ast_graft *graft;
@ -1140,9 +1178,12 @@ __isl_give isl_ast_graft *isl_ast_graft_preimage_multi_aff(
__isl_give isl_ast_graft_list *isl_ast_graft_list_preimage_multi_aff(
__isl_take isl_ast_graft_list *list, __isl_take isl_multi_aff *ma)
{
int i, n;
int i;
isl_size n;
n = isl_ast_graft_list_n_ast_graft(list);
if (n < 0)
list = isl_ast_graft_list_free(list);
for (i = 0; i < n; ++i) {
isl_ast_graft *graft;
@ -1278,6 +1319,130 @@ error:
return NULL;
}
/* Internal data structure for split_on_guard.
*
* "guard2list" is the constructed associative array.
* "any_match" gets set if any guard was seen more than once.
*/
struct isl_split_on_guard_data {
isl_set_to_ast_graft_list *guard2list;
int *any_match;
};
/* Add "graft" to the list associated to its guard in data->guard2list.
* If some other graft was already associated to this guard,
* then set data->any_match.
*/
static isl_stat add_to_guard_list(__isl_take isl_ast_graft *graft, void *user)
{
struct isl_split_on_guard_data *data = user;
isl_set *guard;
isl_maybe_isl_ast_graft_list m;
if (!graft)
return isl_stat_error;
m = isl_set_to_ast_graft_list_try_get(data->guard2list, graft->guard);
if (m.valid < 0)
return isl_stat_non_null(isl_ast_graft_free(graft));
if (m.valid) {
*data->any_match = 1;
m.value = isl_ast_graft_list_add(m.value, graft);
} else {
m.value = isl_ast_graft_list_from_ast_graft(graft);
}
guard = isl_set_copy(graft->guard);
data->guard2list =
isl_set_to_ast_graft_list_set(data->guard2list, guard, m.value);
return isl_stat_non_null(data->guard2list);
}
/* Construct an associative array that groups the elements
* of "list" based on their guards.
* If any guard appears more than once, then set "any_match".
*/
static __isl_give isl_set_to_ast_graft_list *split_on_guard(
__isl_keep isl_ast_graft_list *list, int *any_match)
{
struct isl_split_on_guard_data data = { NULL, any_match };
isl_size n;
isl_ctx *ctx;
n = isl_ast_graft_list_size(list);
if (n < 0)
return NULL;
ctx = isl_ast_graft_list_get_ctx(list);
data.guard2list = isl_set_to_ast_graft_list_alloc(ctx, n);
if (isl_ast_graft_list_foreach(list, &add_to_guard_list, &data) < 0)
return isl_set_to_ast_graft_list_free(data.guard2list);
return data.guard2list;
}
/* Add the elements of "guard_list" to "list".
*/
static isl_stat add_same_guard(__isl_take isl_set *guard,
__isl_take isl_ast_graft_list *guard_list, void *user)
{
isl_ast_graft_list **list = user;
isl_set_free(guard);
*list = isl_ast_graft_list_concat(*list, guard_list);
return isl_stat_non_null(*list);
}
/* Given an associative array "guard2list" containing the elements
* of "list" grouped on common guards, reconstruct "list"
* by placing elements with the same guard consecutively.
*/
static __isl_give isl_ast_graft_list *reconstruct(
__isl_take isl_ast_graft_list *list,
__isl_keep isl_set_to_ast_graft_list *guard2list,
__isl_keep isl_ast_build *build)
{
list = isl_ast_graft_list_clear(list);
if (isl_set_to_ast_graft_list_foreach(guard2list,
&add_same_guard, &list) < 0)
list = isl_ast_graft_list_free(list);
return list;
}
/* Group the grafts in "list" based on identical guards.
*
* Note that there need to be a least three elements in the list
* for the elements not to be grouped already.
*
* Group the elements in an associative array based on their guards.
* If any guard was seen more than once, then reconstruct the list
* from the associative array. Otherwise, simply return the original list.
*/
__isl_give isl_ast_graft_list *isl_ast_graft_list_group_on_guard(
__isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build)
{
int any_match = 0;
isl_size n;
isl_set_to_ast_graft_list *guard2list;
n = isl_ast_graft_list_size(list);
if (n < 0)
return isl_ast_graft_list_free(list);
if (n <= 2)
return list;
guard2list = split_on_guard(list, &any_match);
if (any_match)
list = reconstruct(list, guard2list, build);
isl_set_to_ast_graft_list_free(guard2list);
return list;
}
__isl_give isl_printer *isl_printer_print_ast_graft(__isl_take isl_printer *p,
__isl_keep isl_ast_graft *graft)
{

View File

@ -2,6 +2,7 @@
#define ISL_AST_GRAFT_PRIVATE_H
#include <isl/ast.h>
#include <isl/ast_build.h>
#include <isl/set.h>
#include <isl/list.h>
#include <isl/printer.h>
@ -61,6 +62,8 @@ __isl_give isl_ast_graft_list *isl_ast_graft_list_merge(
__isl_take isl_ast_graft_list *list1,
__isl_take isl_ast_graft_list *list2,
__isl_keep isl_ast_build *build);
__isl_give isl_ast_graft_list *isl_ast_graft_list_group_on_guard(
__isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build);
__isl_give isl_ast_node *isl_ast_graft_get_node(
__isl_keep isl_ast_graft *graft);

View File

@ -22,7 +22,7 @@ struct isl_ast_expr {
isl_val *v;
isl_id *id;
struct {
enum isl_ast_op_type op;
enum isl_ast_expr_op_type op;
unsigned n_arg;
isl_ast_expr **args;
} op;
@ -36,8 +36,9 @@ struct isl_ast_expr {
__isl_give isl_ast_expr *isl_ast_expr_alloc_int_si(isl_ctx *ctx, int i);
__isl_give isl_ast_expr *isl_ast_expr_alloc_op(isl_ctx *ctx,
enum isl_ast_op_type op, int n_arg);
__isl_give isl_ast_expr *isl_ast_expr_alloc_binary(enum isl_ast_op_type type,
enum isl_ast_expr_op_type op, int n_arg);
__isl_give isl_ast_expr *isl_ast_expr_alloc_binary(
enum isl_ast_expr_op_type type,
__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2);
#undef EL

View File

@ -38,92 +38,105 @@ struct bernstein_data {
isl_pw_qpolynomial_fold *pwf_tight;
};
static int vertex_is_integral(__isl_keep isl_basic_set *vertex)
static isl_bool vertex_is_integral(__isl_keep isl_basic_set *vertex)
{
unsigned nvar;
unsigned nparam;
isl_size nvar;
isl_size nparam;
int i;
nvar = isl_basic_set_dim(vertex, isl_dim_set);
nparam = isl_basic_set_dim(vertex, isl_dim_param);
if (nvar < 0 || nparam < 0)
return isl_bool_error;
for (i = 0; i < nvar; ++i) {
int r = nvar - 1 - i;
if (!isl_int_is_one(vertex->eq[r][1 + nparam + i]) &&
!isl_int_is_negone(vertex->eq[r][1 + nparam + i]))
return 0;
return isl_bool_false;
}
return 1;
return isl_bool_true;
}
static __isl_give isl_qpolynomial *vertex_coordinate(
__isl_keep isl_basic_set *vertex, int i, __isl_take isl_space *dim)
__isl_keep isl_basic_set *vertex, int i, __isl_take isl_space *space)
{
unsigned nvar;
unsigned nparam;
isl_size nvar;
isl_size nparam;
isl_size total;
int r;
isl_int denom;
isl_qpolynomial *v;
isl_int_init(denom);
nvar = isl_basic_set_dim(vertex, isl_dim_set);
nparam = isl_basic_set_dim(vertex, isl_dim_param);
total = isl_basic_set_dim(vertex, isl_dim_all);
if (nvar < 0 || nparam < 0 || total < 0)
goto error;
r = nvar - 1 - i;
isl_int_init(denom);
isl_int_set(denom, vertex->eq[r][1 + nparam + i]);
isl_assert(vertex->ctx, !isl_int_is_zero(denom), goto error);
if (isl_int_is_pos(denom))
isl_seq_neg(vertex->eq[r], vertex->eq[r],
1 + isl_basic_set_total_dim(vertex));
isl_seq_neg(vertex->eq[r], vertex->eq[r], 1 + total);
else
isl_int_neg(denom, denom);
v = isl_qpolynomial_from_affine(dim, vertex->eq[r], denom);
v = isl_qpolynomial_from_affine(space, vertex->eq[r], denom);
isl_int_clear(denom);
return v;
error:
isl_space_free(dim);
isl_space_free(space);
isl_int_clear(denom);
return NULL;
}
/* Check whether the bound associated to the selection "k" is tight,
* which is the case if we select exactly one vertex and if that vertex
* which is the case if we select exactly one vertex (i.e., one of the
* exponents in "k" is exactly "d") and if that vertex
* is integral for all values of the parameters.
*/
static int is_tight(int *k, int n, int d, isl_cell *cell)
static isl_bool is_tight(int *k, int n, int d, isl_cell *cell)
{
int i;
for (i = 0; i < n; ++i) {
int v;
if (k[i] != d) {
if (k[i])
return 0;
if (!k[i])
continue;
}
if (k[i] != d)
return isl_bool_false;
v = cell->ids[n - 1 - i];
return vertex_is_integral(cell->vertices->v[v].vertex);
}
return 0;
return isl_bool_false;
}
static void add_fold(__isl_take isl_qpolynomial *b, __isl_keep isl_set *dom,
static isl_stat add_fold(__isl_take isl_qpolynomial *b, __isl_keep isl_set *dom,
int *k, int n, int d, struct bernstein_data *data)
{
isl_qpolynomial_fold *fold;
isl_bool tight;
fold = isl_qpolynomial_fold_alloc(data->type, b);
if (data->check_tight && is_tight(k, n, d, data->cell))
tight = isl_bool_false;
if (data->check_tight)
tight = is_tight(k, n, d, data->cell);
if (tight < 0)
return isl_stat_error;
if (tight)
data->fold_tight = isl_qpolynomial_fold_fold_on_domain(dom,
data->fold_tight, fold);
else
data->fold = isl_qpolynomial_fold_fold_on_domain(dom,
data->fold, fold);
return isl_stat_ok;
}
/* Extract the coefficients of the Bernstein base polynomials and store
@ -136,25 +149,25 @@ static void add_fold(__isl_take isl_qpolynomial *b, __isl_keep isl_set *dom,
* c[i] contains the coefficient of the selected powers of the first i+1 vars.
* multinom[i] contains the partial multinomial coefficient.
*/
static void extract_coefficients(isl_qpolynomial *poly,
static isl_stat extract_coefficients(isl_qpolynomial *poly,
__isl_keep isl_set *dom, struct bernstein_data *data)
{
int i;
int d;
int n;
isl_size n;
isl_ctx *ctx;
isl_qpolynomial **c = NULL;
int *k = NULL;
int *left = NULL;
isl_vec *multinom = NULL;
if (!poly)
return;
n = isl_qpolynomial_dim(poly, isl_dim_in);
if (n < 0)
return isl_stat_error;
ctx = isl_qpolynomial_get_ctx(poly);
n = isl_qpolynomial_dim(poly, isl_dim_in);
d = isl_qpolynomial_degree(poly);
isl_assert(ctx, n >= 2, return);
isl_assert(ctx, n >= 2, return isl_stat_error);
c = isl_calloc_array(ctx, isl_qpolynomial *, n);
k = isl_alloc_array(ctx, int, n);
@ -188,7 +201,8 @@ static void extract_coefficients(isl_qpolynomial *poly,
multinom->el[i]);
b = isl_qpolynomial_mul(b, f);
k[n - 1] = left[n - 2];
add_fold(b, dom, k, n, d, data);
if (add_fold(b, dom, k, n, d, data) < 0)
goto error;
--i;
continue;
}
@ -218,7 +232,7 @@ static void extract_coefficients(isl_qpolynomial *poly,
free(left);
free(k);
free(c);
return;
return isl_stat_ok;
error:
isl_vec_free(multinom);
free(left);
@ -227,7 +241,7 @@ error:
for (i = 0; i < n; ++i)
isl_qpolynomial_free(c[i]);
free(c);
return;
return isl_stat_error;
}
/* Perform bernstein expansion on the parametric vertices that are active
@ -247,9 +261,10 @@ static isl_stat bernstein_coefficients_cell(__isl_take isl_cell *cell,
{
int i, j;
struct bernstein_data *data = (struct bernstein_data *)user;
isl_space *dim_param;
isl_space *dim_dst;
isl_space *space_param;
isl_space *space_dst;
isl_qpolynomial *poly = data->poly;
isl_size n_in;
unsigned nvar;
int n_vertices;
isl_qpolynomial **subs;
@ -257,10 +272,11 @@ static isl_stat bernstein_coefficients_cell(__isl_take isl_cell *cell,
isl_set *dom;
isl_ctx *ctx;
if (!poly)
n_in = isl_qpolynomial_dim(poly, isl_dim_in);
if (n_in < 0)
goto error;
nvar = isl_qpolynomial_dim(poly, isl_dim_in) - 1;
nvar = n_in - 1;
n_vertices = cell->n_vertices;
ctx = isl_qpolynomial_get_ctx(poly);
@ -272,22 +288,23 @@ static isl_stat bernstein_coefficients_cell(__isl_take isl_cell *cell,
if (!subs)
goto error;
dim_param = isl_basic_set_get_space(cell->dom);
dim_dst = isl_qpolynomial_get_domain_space(poly);
dim_dst = isl_space_add_dims(dim_dst, isl_dim_set, n_vertices);
space_param = isl_basic_set_get_space(cell->dom);
space_dst = isl_qpolynomial_get_domain_space(poly);
space_dst = isl_space_add_dims(space_dst, isl_dim_set, n_vertices);
for (i = 0; i < 1 + nvar; ++i)
subs[i] = isl_qpolynomial_zero_on_domain(isl_space_copy(dim_dst));
subs[i] =
isl_qpolynomial_zero_on_domain(isl_space_copy(space_dst));
for (i = 0; i < n_vertices; ++i) {
isl_qpolynomial *c;
c = isl_qpolynomial_var_on_domain(isl_space_copy(dim_dst), isl_dim_set,
1 + nvar + i);
c = isl_qpolynomial_var_on_domain(isl_space_copy(space_dst),
isl_dim_set, 1 + nvar + i);
for (j = 0; j < nvar; ++j) {
int k = cell->ids[i];
isl_qpolynomial *v;
v = vertex_coordinate(cell->vertices->v[k].vertex, j,
isl_space_copy(dim_param));
isl_space_copy(space_param));
v = isl_qpolynomial_add_dims(v, isl_dim_in,
1 + nvar + n_vertices);
v = isl_qpolynomial_mul(v, isl_qpolynomial_copy(c));
@ -295,7 +312,7 @@ static isl_stat bernstein_coefficients_cell(__isl_take isl_cell *cell,
}
subs[0] = isl_qpolynomial_add(subs[0], c);
}
isl_space_free(dim_dst);
isl_space_free(space_dst);
poly = isl_qpolynomial_copy(poly);
@ -305,9 +322,13 @@ static isl_stat bernstein_coefficients_cell(__isl_take isl_cell *cell,
data->cell = cell;
dom = isl_set_from_basic_set(isl_basic_set_copy(cell->dom));
data->fold = isl_qpolynomial_fold_empty(data->type, isl_space_copy(dim_param));
data->fold_tight = isl_qpolynomial_fold_empty(data->type, dim_param);
extract_coefficients(poly, dom, data);
data->fold = isl_qpolynomial_fold_empty(data->type,
isl_space_copy(space_param));
data->fold_tight = isl_qpolynomial_fold_empty(data->type, space_param);
if (extract_coefficients(poly, dom, data) < 0) {
data->fold = isl_qpolynomial_fold_free(data->fold);
data->fold_tight = isl_qpolynomial_fold_free(data->fold_tight);
}
pwf = isl_pw_qpolynomial_fold_alloc(data->type, isl_set_copy(dom),
data->fold);
@ -334,15 +355,18 @@ error:
*/
static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_base(
__isl_take isl_basic_set *bset,
__isl_take isl_qpolynomial *poly, struct bernstein_data *data, int *tight)
__isl_take isl_qpolynomial *poly, struct bernstein_data *data,
isl_bool *tight)
{
unsigned nvar;
isl_space *dim;
isl_size nvar;
isl_space *space;
isl_pw_qpolynomial_fold *pwf;
isl_vertices *vertices;
int covers;
isl_bool covers;
nvar = isl_basic_set_dim(bset, isl_dim_set);
if (nvar < 0)
bset = isl_basic_set_free(bset);
if (nvar == 0) {
isl_set *dom;
isl_qpolynomial_fold *fold;
@ -350,7 +374,7 @@ static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_base(
fold = isl_qpolynomial_fold_alloc(data->type, poly);
dom = isl_set_from_basic_set(bset);
if (tight)
*tight = 1;
*tight = isl_bool_true;
pwf = isl_pw_qpolynomial_fold_alloc(data->type, dom, fold);
return isl_pw_qpolynomial_fold_project_domain_on_params(pwf);
}
@ -362,16 +386,17 @@ static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_base(
dom = isl_set_from_basic_set(bset);
pwf = isl_pw_qpolynomial_fold_alloc(data->type, dom, fold);
if (tight)
*tight = 1;
*tight = isl_bool_true;
return isl_pw_qpolynomial_fold_project_domain_on_params(pwf);
}
dim = isl_basic_set_get_space(bset);
dim = isl_space_params(dim);
dim = isl_space_from_domain(dim);
dim = isl_space_add_dims(dim, isl_dim_set, 1);
data->pwf = isl_pw_qpolynomial_fold_zero(isl_space_copy(dim), data->type);
data->pwf_tight = isl_pw_qpolynomial_fold_zero(dim, data->type);
space = isl_basic_set_get_space(bset);
space = isl_space_params(space);
space = isl_space_from_domain(space);
space = isl_space_add_dims(space, isl_dim_set, 1);
data->pwf = isl_pw_qpolynomial_fold_zero(isl_space_copy(space),
data->type);
data->pwf_tight = isl_pw_qpolynomial_fold_zero(space, data->type);
data->poly = isl_qpolynomial_homogenize(isl_qpolynomial_copy(poly));
vertices = isl_basic_set_compute_vertices(bset);
if (isl_vertices_foreach_disjoint_cell(vertices,
@ -409,18 +434,17 @@ error:
*/
static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_recursive(
__isl_take isl_pw_qpolynomial *pwqp,
int n_group, int *len, struct bernstein_data *data, int *tight)
int n_group, int *len, struct bernstein_data *data, isl_bool *tight)
{
int i;
unsigned nparam;
unsigned nvar;
isl_size nparam;
isl_size nvar;
isl_pw_qpolynomial_fold *pwf;
if (!pwqp)
return NULL;
nparam = isl_pw_qpolynomial_dim(pwqp, isl_dim_param);
nvar = isl_pw_qpolynomial_dim(pwqp, isl_dim_in);
if (nparam < 0 || nvar < 0)
goto error;
pwqp = isl_pw_qpolynomial_move_dims(pwqp, isl_dim_param, nparam,
isl_dim_in, 0, nvar - len[n_group - 1]);
@ -428,6 +452,8 @@ static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_recursive(
for (i = n_group - 2; i >= 0; --i) {
nparam = isl_pw_qpolynomial_fold_dim(pwf, isl_dim_param);
if (nparam < 0)
return isl_pw_qpolynomial_fold_free(pwf);
pwf = isl_pw_qpolynomial_fold_move_dims(pwf, isl_dim_in, 0,
isl_dim_param, nparam - len[i], len[i]);
if (tight && !*tight)
@ -436,11 +462,15 @@ static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_recursive(
}
return pwf;
error:
isl_pw_qpolynomial_free(pwqp);
return NULL;
}
static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_factors(
__isl_take isl_basic_set *bset,
__isl_take isl_qpolynomial *poly, struct bernstein_data *data, int *tight)
__isl_take isl_qpolynomial *poly, struct bernstein_data *data,
isl_bool *tight)
{
isl_factorizer *f;
isl_set *set;
@ -473,19 +503,19 @@ error:
static __isl_give isl_pw_qpolynomial_fold *bernstein_coefficients_full_recursive(
__isl_take isl_basic_set *bset,
__isl_take isl_qpolynomial *poly, struct bernstein_data *data, int *tight)
__isl_take isl_qpolynomial *poly, struct bernstein_data *data,
isl_bool *tight)
{
int i;
int *len;
unsigned nvar;
isl_size nvar;
isl_pw_qpolynomial_fold *pwf;
isl_set *set;
isl_pw_qpolynomial *pwqp;
if (!bset || !poly)
goto error;
nvar = isl_basic_set_dim(bset, isl_dim_set);
if (nvar < 0 || !poly)
goto error;
len = isl_alloc_array(bset->ctx, int, nvar);
if (nvar && !len)
@ -525,18 +555,17 @@ isl_stat isl_qpolynomial_bound_on_domain_bernstein(
{
struct bernstein_data data;
isl_pw_qpolynomial_fold *pwf;
unsigned nvar;
int tight = 0;
int *tp = bound->check_tight ? &tight : NULL;
isl_size nvar;
isl_bool tight = isl_bool_false;
isl_bool *tp = bound->check_tight ? &tight : NULL;
if (!bset || !poly)
nvar = isl_basic_set_dim(bset, isl_dim_set);
if (nvar < 0 || !poly)
goto error;
data.type = bound->type;
data.check_tight = bound->check_tight;
nvar = isl_basic_set_dim(bset, isl_dim_set);
if (bset->ctx->opt->bernstein_recurse & ISL_BERNSTEIN_FACTORS)
pwf = bernstein_coefficients_factors(bset, poly, &data, tp);
else if (nvar > 1 &&

View File

@ -0,0 +1,168 @@
/*
* Copyright 2018 Cerebras Systems
*
* Use of this software is governed by the MIT license
*
* Written by Sven Verdoolaege,
* Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA
*/
#include <isl/space.h>
/* Merge parameter "param" into the input dimension "i" of "obj".
*
* First plug in the parameter for the input dimension in "obj".
* The drop the (now defunct) input dimension and
* move the parameter in its original position.
* Since dimension manipulations destroy spaces, modify the space
* separately by only dropping the parameter.
*/
static __isl_give TYPE *FN(TYPE,merge_param)(__isl_take TYPE *obj, int i,
int param)
{
isl_id *id;
isl_aff *aff;
isl_space *space;
isl_multi_aff *ma;
space = FN(TYPE,get_domain_space)(obj);
id = isl_space_get_dim_id(space, isl_dim_param, param);
aff = isl_aff_param_on_domain_space_id(isl_space_copy(space), id);
space = isl_space_map_from_set(space);
ma = isl_multi_aff_identity(space);
ma = isl_multi_aff_set_aff(ma, i, aff);
obj = FN(TYPE,pullback_multi_aff)(obj, ma);
space = FN(TYPE,get_domain_space)(obj);
obj = FN(TYPE,drop_dims)(obj, isl_dim_in, i, 1);
obj = FN(TYPE,move_dims)(obj, isl_dim_in, i, isl_dim_param, param, 1);
space = isl_space_drop_dims(space, isl_dim_param, param, 1);
obj = FN(TYPE,reset_domain_space)(obj, space);
return obj;
}
/* Given a tuple of identifiers "tuple" that correspond
* to the initial input dimensions of "obj",
* if any of those identifiers appear as parameters
* in "obj", then equate those parameters with the corresponding
* input dimensions and project out the parameters.
* The result therefore has no such parameters.
*/
static __isl_give TYPE *FN(TYPE,equate_initial_params)(__isl_take TYPE *obj,
__isl_keep isl_multi_id *tuple)
{
int i;
isl_size n;
n = isl_multi_id_size(tuple);
if (n < 0)
return FN(TYPE,free)(obj);
for (i = 0; i < n; ++i) {
isl_id *id;
int pos;
id = isl_multi_id_get_at(tuple, i);
if (!id)
return FN(TYPE,free)(obj);
pos = FN(TYPE,find_dim_by_id)(obj, isl_dim_param, id);
isl_id_free(id);
if (pos < 0)
continue;
obj = FN(TYPE,merge_param)(obj, i, pos);
}
return obj;
}
/* Given a tuple of identifiers "tuple" in a space that corresponds
* to the domain of "obj", if any of those identifiers appear as parameters
* in "obj", then equate those parameters with the corresponding
* input dimensions and project out the parameters.
* The result therefore has no such parameters.
*/
static __isl_give TYPE *FN(TYPE,equate_domain_params)(__isl_take TYPE *obj,
__isl_keep isl_multi_id *tuple)
{
isl_stat r;
isl_space *obj_space, *tuple_space;
obj_space = FN(TYPE,get_space)(obj);
tuple_space = isl_multi_id_peek_space(tuple);
r = isl_space_check_domain_tuples(tuple_space, obj_space);
isl_space_free(obj_space);
if (r < 0)
return FN(TYPE,free)(obj);
return FN(TYPE,equate_initial_params)(obj, tuple);
}
/* Bind the domain dimensions of the function "obj" to parameters
* with identifiers specified by "tuple", living in the same space
* as the domain of "obj".
*
* If no parameters with these identifiers appear in "obj" already,
* then the domain dimensions are simply reinterpreted as parameters.
* Otherwise, the parameters are first equated to the corresponding
* domain dimensions.
*/
__isl_give TYPE *FN(TYPE,bind_domain)(__isl_take TYPE *obj,
__isl_take isl_multi_id *tuple)
{
isl_space *space;
obj = FN(TYPE,equate_domain_params)(obj, tuple);
space = FN(TYPE,get_space)(obj);
space = isl_space_bind_map_domain(space, tuple);
isl_multi_id_free(tuple);
obj = FN(TYPE,reset_space)(obj, space);
return obj;
}
/* Given a tuple of identifiers "tuple" in a space that corresponds
* to the domain of the wrapped relation in the domain of "obj",
* if any of those identifiers appear as parameters
* in "obj", then equate those parameters with the corresponding
* input dimensions and project out the parameters.
* The result therefore has no such parameters.
*/
static __isl_give TYPE *FN(TYPE,equate_domain_wrapped_domain_params)(
__isl_take TYPE *obj, __isl_keep isl_multi_id *tuple)
{
isl_stat r;
isl_space *obj_space, *tuple_space;
obj_space = FN(TYPE,get_space)(obj);
tuple_space = isl_multi_id_peek_space(tuple);
r = isl_space_check_domain_wrapped_domain_tuples(tuple_space,
obj_space);
isl_space_free(obj_space);
if (r < 0)
return FN(TYPE,free)(obj);
return FN(TYPE,equate_initial_params)(obj, tuple);
}
/* Given a function living in a space of the form [A -> B] -> C and
* a tuple of identifiers in A, bind the domain dimensions of the relation
* wrapped in the domain of "obj" with identifiers specified by "tuple",
* returning a function in the space B -> C.
*
* If no parameters with these identifiers appear in "obj" already,
* then the domain dimensions are simply reinterpreted as parameters.
* Otherwise, the parameters are first equated to the corresponding
* domain dimensions.
*/
__isl_give TYPE *FN(TYPE,bind_domain_wrapped_domain)(__isl_take TYPE *obj,
__isl_take isl_multi_id *tuple)
{
isl_space *space;
obj = FN(TYPE,equate_domain_wrapped_domain_params)(obj, tuple);
space = FN(TYPE,get_space)(obj);
space = isl_space_bind_domain_wrapped_domain(space, tuple);
isl_multi_id_free(tuple);
obj = FN(TYPE,reset_space)(obj, space);
return obj;
}

View File

@ -109,11 +109,11 @@ static isl_stat guarded_poly_bound(__isl_take isl_basic_set *bset,
__isl_take isl_qpolynomial *poly, void *user)
{
struct isl_bound *bound = (struct isl_bound *)user;
isl_space *dim;
isl_space *space;
isl_pw_qpolynomial_fold *top_pwf;
isl_pw_qpolynomial_fold *top_pwf_tight;
int nparam;
int n_in;
isl_size nparam;
isl_size n_in;
isl_stat r;
if (!bound->wrapping)
@ -121,23 +121,25 @@ static isl_stat guarded_poly_bound(__isl_take isl_basic_set *bset,
nparam = isl_space_dim(bound->dim, isl_dim_param);
n_in = isl_space_dim(bound->dim, isl_dim_in);
if (nparam < 0 || n_in < 0)
goto error;
bset = isl_basic_set_move_dims(bset, isl_dim_param, nparam,
isl_dim_set, 0, n_in);
poly = isl_qpolynomial_move_dims(poly, isl_dim_param, nparam,
isl_dim_in, 0, n_in);
dim = isl_basic_set_get_space(bset);
dim = isl_space_params(dim);
space = isl_basic_set_get_space(bset);
space = isl_space_params(space);
top_pwf = bound->pwf;
top_pwf_tight = bound->pwf_tight;
dim = isl_space_from_domain(dim);
dim = isl_space_add_dims(dim, isl_dim_out, 1);
bound->pwf = isl_pw_qpolynomial_fold_zero(isl_space_copy(dim),
space = isl_space_from_domain(space);
space = isl_space_add_dims(space, isl_dim_out, 1);
bound->pwf = isl_pw_qpolynomial_fold_zero(isl_space_copy(space),
bound->type);
bound->pwf_tight = isl_pw_qpolynomial_fold_zero(dim, bound->type);
bound->pwf_tight = isl_pw_qpolynomial_fold_zero(space, bound->type);
r = unwrapped_guarded_poly_bound(bset, poly, user);
@ -151,6 +153,10 @@ static isl_stat guarded_poly_bound(__isl_take isl_basic_set *bset,
bound->pwf_tight);
return r;
error:
isl_basic_set_free(bset);
isl_qpolynomial_free(poly);
return isl_stat_error;
}
static isl_stat guarded_qp(__isl_take isl_qpolynomial *qp, void *user)
@ -203,11 +209,11 @@ error:
}
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_bound(
__isl_take isl_pw_qpolynomial_fold *pwf, int *tight)
__isl_take isl_pw_qpolynomial_fold *pwf, isl_bool *tight)
{
unsigned nvar;
isl_size nvar;
struct isl_bound bound;
int covers;
isl_bool covers;
if (!pwf)
return NULL;
@ -218,13 +224,15 @@ __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_bound(
if (bound.wrapping)
bound.dim = isl_space_unwrap(bound.dim);
nvar = isl_space_dim(bound.dim, isl_dim_out);
if (nvar < 0)
bound.dim = isl_space_free(bound.dim);
bound.dim = isl_space_domain(bound.dim);
bound.dim = isl_space_from_domain(bound.dim);
bound.dim = isl_space_add_dims(bound.dim, isl_dim_out, 1);
if (nvar == 0) {
if (tight)
*tight = 1;
*tight = isl_bool_true;
return isl_pw_qpolynomial_fold_reset_space(pwf, bound.dim);
}
@ -232,7 +240,7 @@ __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_bound(
enum isl_fold type = pwf->type;
isl_pw_qpolynomial_fold_free(pwf);
if (tight)
*tight = 1;
*tight = isl_bool_true;
return isl_pw_qpolynomial_fold_zero(bound.dim, type);
}
@ -273,7 +281,8 @@ error:
}
__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_bound(
__isl_take isl_pw_qpolynomial *pwqp, enum isl_fold type, int *tight)
__isl_take isl_pw_qpolynomial *pwqp, enum isl_fold type,
isl_bool *tight)
{
isl_pw_qpolynomial_fold *pwf;
@ -283,7 +292,7 @@ __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_bound(
struct isl_union_bound_data {
enum isl_fold type;
int tight;
isl_bool tight;
isl_union_pw_qpolynomial_fold *res;
};
@ -302,7 +311,7 @@ static isl_stat bound_pw(__isl_take isl_pw_qpolynomial *pwqp, void *user)
__isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_bound(
__isl_take isl_union_pw_qpolynomial *upwqp,
enum isl_fold type, int *tight)
enum isl_fold type, isl_bool *tight)
{
isl_space *dim;
struct isl_union_bound_data data = { type, 1, NULL };
@ -311,7 +320,7 @@ __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_bound(
return NULL;
if (!tight)
data.tight = 0;
data.tight = isl_bool_false;
dim = isl_union_pw_qpolynomial_get_space(upwqp);
data.res = isl_union_pw_qpolynomial_fold_zero(dim, type);

View File

@ -76,7 +76,8 @@ static __isl_give isl_fixed_box *isl_fixed_box_init(
isl_multi_val *size;
offset = isl_multi_aff_zero(isl_space_copy(space));
size = isl_multi_val_zero(isl_space_range(space));
space = isl_space_drop_all_params(isl_space_range(space));
size = isl_multi_val_zero(space);
return isl_fixed_box_alloc(offset, size);
}
@ -130,7 +131,8 @@ static __isl_give isl_fixed_box *isl_fixed_box_set_valid_extent(
static __isl_give isl_fixed_box *isl_fixed_box_invalidate(
__isl_take isl_fixed_box *box)
{
int i, n;
int i;
isl_size n;
isl_space *space;
isl_val *infty;
isl_aff *nan;
@ -138,6 +140,8 @@ static __isl_give isl_fixed_box *isl_fixed_box_invalidate(
if (!box)
return NULL;
n = isl_multi_val_dim(box->size, isl_dim_set);
if (n < 0)
return isl_fixed_box_free(box);
infty = isl_val_infty(isl_fixed_box_get_ctx(box));
space = isl_space_domain(isl_fixed_box_get_space(box));
@ -152,6 +156,27 @@ static __isl_give isl_fixed_box *isl_fixed_box_invalidate(
return box;
}
/* Project the domain of the fixed box onto its parameter space.
* In particular, project out the domain of the offset.
*/
static __isl_give isl_fixed_box *isl_fixed_box_project_domain_on_params(
__isl_take isl_fixed_box *box)
{
isl_bool valid;
valid = isl_fixed_box_is_valid(box);
if (valid < 0)
return isl_fixed_box_free(box);
if (!valid)
return box;
box->offset = isl_multi_aff_project_domain_on_params(box->offset);
if (!box->offset)
return isl_fixed_box_free(box);
return box;
}
/* Return the isl_ctx to which "box" belongs.
*/
isl_ctx *isl_fixed_box_get_ctx(__isl_keep isl_fixed_box *box)
@ -212,7 +237,7 @@ __isl_give isl_multi_val *isl_fixed_box_get_size(__isl_keep isl_fixed_box *box)
*/
struct isl_size_info {
isl_basic_set *bset;
int pos;
isl_size pos;
isl_val *size;
isl_aff *offset;
};
@ -225,7 +250,7 @@ struct isl_size_info {
*/
static isl_bool is_suitable_bound(__isl_keep isl_constraint *c, unsigned pos)
{
unsigned n_div;
isl_size n_div;
isl_bool is_bound, any_divs;
is_bound = isl_constraint_is_lower_bound(c, isl_dim_set, pos);
@ -233,6 +258,8 @@ static isl_bool is_suitable_bound(__isl_keep isl_constraint *c, unsigned pos)
return is_bound;
n_div = isl_constraint_dim(c, isl_dim_div);
if (n_div < 0)
return isl_bool_error;
any_divs = isl_constraint_involves_dims(c, isl_dim_div, 0, n_div);
return isl_bool_not(any_divs);
}
@ -316,6 +343,8 @@ static __isl_give isl_fixed_box *set_dim_extent(__isl_take isl_fixed_box *box,
info.offset = NULL;
info.pos = isl_map_dim(map, isl_dim_in);
info.bset = isl_basic_map_wrap(isl_map_simple_hull(map));
if (info.pos < 0)
info.bset = isl_basic_set_free(info.bset);
if (isl_basic_set_foreach_constraint(info.bset,
&compute_size_in_direction, &info) < 0)
box = isl_fixed_box_free(box);
@ -345,11 +374,14 @@ static __isl_give isl_fixed_box *set_dim_extent(__isl_take isl_fixed_box *box,
__isl_give isl_fixed_box *isl_map_get_range_simple_fixed_box_hull(
__isl_keep isl_map *map)
{
int i, n;
int i;
isl_size n;
isl_space *space;
isl_fixed_box *box;
n = isl_map_dim(map, isl_dim_out);
if (n < 0)
return NULL;
space = isl_map_get_space(map);
box = isl_fixed_box_init(space);
@ -366,3 +398,55 @@ __isl_give isl_fixed_box *isl_map_get_range_simple_fixed_box_hull(
return box;
}
/* Try and construct a fixed-size rectangular box with an offset
* in terms of the parameters of "set" that contains "set".
* If no such box can be constructed, then return an invalidated box,
* i.e., one where isl_fixed_box_is_valid returns false.
*
* Compute the box using isl_map_get_range_simple_fixed_box_hull
* by constructing a map from the set and
* project out the domain again from the result.
*/
__isl_give isl_fixed_box *isl_set_get_simple_fixed_box_hull(
__isl_keep isl_set *set)
{
isl_map *map;
isl_fixed_box *box;
map = isl_map_from_range(isl_set_copy(set));
box = isl_map_get_range_simple_fixed_box_hull(map);
isl_map_free(map);
box = isl_fixed_box_project_domain_on_params(box);
return box;
}
#undef BASE
#define BASE multi_val
#include "print_yaml_field_templ.c"
#undef BASE
#define BASE multi_aff
#include "print_yaml_field_templ.c"
/* Print the information contained in "box" to "p".
* The information is printed as a YAML document.
*/
__isl_give isl_printer *isl_printer_print_fixed_box(
__isl_take isl_printer *p, __isl_keep isl_fixed_box *box)
{
if (!box)
return isl_printer_free(p);
p = isl_printer_yaml_start_mapping(p);
p = print_yaml_field_multi_aff(p, "offset", box->offset);
p = print_yaml_field_multi_val(p, "size", box->size);
p = isl_printer_yaml_end_mapping(p);
return p;
}
#undef BASE
#define BASE fixed_box
#include <print_templ_yaml.c>

View File

@ -0,0 +1,10 @@
#define xFN(TYPE,NAME) TYPE ## _ ## NAME
#define FN(TYPE,NAME) xFN(TYPE,NAME)
/* Check that "obj" has only named parameters, reporting an error
* if it does not.
*/
isl_stat FN(TYPE,check_named_params)(__isl_keep TYPE *obj)
{
return isl_space_check_named_params(FN(TYPE,peek_space)(obj));
}

View File

@ -66,13 +66,17 @@ static int *eq_status_in(__isl_keep isl_basic_map *bmap_i,
struct isl_tab *tab_j)
{
int k, l;
int *eq = isl_calloc_array(bmap_i->ctx, int, 2 * bmap_i->n_eq);
unsigned dim;
int *eq;
isl_size dim;
dim = isl_basic_map_dim(bmap_i, isl_dim_all);
if (dim < 0)
return NULL;
eq = isl_calloc_array(bmap_i->ctx, int, 2 * bmap_i->n_eq);
if (!eq)
return NULL;
dim = isl_basic_map_total_dim(bmap_i);
for (k = 0; k < bmap_i->n_eq; ++k) {
for (l = 0; l < 2; ++l) {
isl_seq_neg(bmap_i->eq[k], bmap_i->eq[k], 1+dim);
@ -173,6 +177,8 @@ static int all(int *con, unsigned len, int status)
* "bmap" is the basic map itself (or NULL if "removed" is set)
* "tab" is the corresponding tableau (or NULL if "removed" is set)
* "hull_hash" identifies the affine space in which "bmap" lives.
* "modified" is set if this basic map may not be identical
* to any of the basic maps in the input.
* "removed" is set if this basic map has been removed from the map
* "simplify" is set if this basic map may have some unknown integer
* divisions that were not present in the input basic maps. The basic
@ -190,6 +196,7 @@ struct isl_coalesce_info {
isl_basic_map *bmap;
struct isl_tab *tab;
uint32_t hull_hash;
int modified;
int removed;
int simplify;
int *eq;
@ -309,11 +316,13 @@ static int all_valid_or_cut(struct isl_coalesce_info *info)
static int coalesce_info_set_hull_hash(struct isl_coalesce_info *info)
{
isl_basic_map *hull;
unsigned n_div;
isl_size n_div;
hull = isl_basic_map_copy(info->bmap);
hull = isl_basic_map_plain_affine_hull(hull);
n_div = isl_basic_map_dim(hull, isl_dim_div);
if (n_div < 0)
hull = isl_basic_map_free(hull);
hull = isl_basic_map_drop_constraints_involving_dims(hull,
isl_dim_div, 0, n_div);
info->hull_hash = isl_basic_map_get_hash(hull);
@ -340,15 +349,22 @@ static void clear_coalesce_info(int n, struct isl_coalesce_info *info)
free(info);
}
/* Clear the memory associated to "info".
*/
static void clear(struct isl_coalesce_info *info)
{
info->bmap = isl_basic_map_free(info->bmap);
isl_tab_free(info->tab);
info->tab = NULL;
}
/* Drop the basic map represented by "info".
* That is, clear the memory associated to the entry and
* mark it as having been removed.
*/
static void drop(struct isl_coalesce_info *info)
{
info->bmap = isl_basic_map_free(info->bmap);
isl_tab_free(info->tab);
info->tab = NULL;
clear(info);
info->removed = 1;
}
@ -491,11 +507,13 @@ static enum isl_change fuse(int i, int j, struct isl_coalesce_info *info,
int k, l;
struct isl_basic_map *fused = NULL;
struct isl_tab *fused_tab = NULL;
unsigned total = isl_basic_map_total_dim(info[i].bmap);
isl_size total = isl_basic_map_dim(info[i].bmap, isl_dim_all);
unsigned extra_rows = extra ? extra->n_row : 0;
unsigned n_eq, n_ineq;
int simplify = 0;
if (total < 0)
return isl_change_error;
if (j < i)
return fuse(j, i, info, extra, detect_equalities, check_number);
@ -552,10 +570,10 @@ static enum isl_change fuse(int i, int j, struct isl_coalesce_info *info,
return isl_change_none;
}
isl_basic_map_free(info[i].bmap);
clear(&info[i]);
info[i].bmap = fused;
isl_tab_free(info[i].tab);
info[i].tab = fused_tab;
info[i].modified = 1;
drop(&info[j]);
return isl_change_fuse;
@ -644,10 +662,12 @@ static enum isl_change check_facets(int i, int j,
static isl_bool contains(struct isl_coalesce_info *info, struct isl_tab *tab)
{
int k;
unsigned dim;
isl_size dim;
isl_basic_map *bmap = info->bmap;
dim = isl_basic_map_total_dim(bmap);
dim = isl_basic_map_dim(bmap, isl_dim_all);
if (dim < 0)
return isl_bool_error;
for (k = 0; k < bmap->n_eq; ++k) {
int stat;
isl_seq_neg(bmap->eq[k], bmap->eq[k], 1 + dim);
@ -723,10 +743,12 @@ static enum isl_change is_adj_ineq_extension(int i, int j,
int k;
struct isl_tab_undo *snap;
unsigned n_eq = info[i].bmap->n_eq;
unsigned total = isl_basic_map_total_dim(info[i].bmap);
isl_size total = isl_basic_map_dim(info[i].bmap, isl_dim_all);
isl_stat r;
isl_bool super;
if (total < 0)
return isl_change_error;
if (isl_tab_extend_cons(info[i].tab, 1 + info[j].bmap->n_ineq) < 0)
return isl_change_error;
@ -982,7 +1004,7 @@ static __isl_give isl_vec *try_tightening(struct isl_coalesce_info *info,
static isl_stat tighten_on_relaxed_facet(struct isl_coalesce_info *info,
int n, int *relaxed, int l)
{
unsigned total;
isl_size total;
isl_ctx *ctx;
isl_vec *v = NULL;
isl_mat *T;
@ -992,7 +1014,9 @@ static isl_stat tighten_on_relaxed_facet(struct isl_coalesce_info *info,
k = relaxed[l];
ctx = isl_basic_map_get_ctx(info->bmap);
total = isl_basic_map_total_dim(info->bmap);
total = isl_basic_map_dim(info->bmap, isl_dim_all);
if (total < 0)
return isl_stat_error;
isl_int_add_ui(info->bmap->ineq[k][0], info->bmap->ineq[k][0], 1);
T = isl_mat_sub_alloc6(ctx, info->bmap->ineq, k, 1, 0, 1 + total);
T = isl_mat_variable_compression(T, NULL);
@ -1057,12 +1081,12 @@ static enum isl_change extend(int i, int j, int n, int *relax,
struct isl_coalesce_info *info)
{
int l;
unsigned total;
isl_size total;
info[i].bmap = isl_basic_map_cow(info[i].bmap);
if (!info[i].bmap)
total = isl_basic_map_dim(info[i].bmap, isl_dim_all);
if (total < 0)
return isl_change_error;
total = isl_basic_map_total_dim(info[i].bmap);
for (l = 0; l < info[i].bmap->n_div; ++l)
if (!isl_seq_eq(info[i].bmap->div[l],
info[j].bmap->div[l], 1 + 1 + total)) {
@ -1072,8 +1096,10 @@ static enum isl_change extend(int i, int j, int n, int *relax,
for (l = 0; l < n; ++l)
isl_int_add_ui(info[i].bmap->ineq[relax[l]][0],
info[i].bmap->ineq[relax[l]][0], 1);
ISL_F_CLR(info[i].bmap, ISL_BASIC_MAP_NO_REDUNDANT);
ISL_F_SET(info[i].bmap, ISL_BASIC_MAP_FINAL);
drop(&info[j]);
info[i].modified = 1;
if (j < i)
exchange(&info[i], &info[j]);
return isl_change_fuse;
@ -1191,8 +1217,10 @@ static isl_stat wraps_update_max(struct isl_wraps *wraps,
{
int k;
isl_int max_k;
unsigned total = isl_basic_map_total_dim(info->bmap);
isl_size total = isl_basic_map_dim(info->bmap, isl_dim_all);
if (total < 0)
return isl_stat_error;
isl_int_init(max_k);
for (k = 0; k < info->bmap->n_eq; ++k) {
@ -1256,6 +1284,14 @@ static void wraps_free(struct isl_wraps *wraps)
isl_int_clear(wraps->max);
}
/* Mark the wrapping as failed by resetting wraps->mat->n_row to zero.
*/
static isl_stat wraps_mark_failed(struct isl_wraps *wraps)
{
wraps->mat->n_row = 0;
return isl_stat_ok;
}
/* Is the wrapping constraint in row "row" allowed?
*
* If wraps->bound is set, we check that none of the coefficients
@ -1327,7 +1363,11 @@ static isl_stat add_wraps(struct isl_wraps *wraps,
int w;
int added;
isl_basic_map *bmap = info->bmap;
unsigned len = 1 + isl_basic_map_total_dim(bmap);
isl_size total = isl_basic_map_dim(bmap, isl_dim_all);
unsigned len = 1 + total;
if (total < 0)
return isl_stat_error;
w = wraps->mat->n_row;
@ -1371,8 +1411,7 @@ static isl_stat add_wraps(struct isl_wraps *wraps,
wraps->mat->n_row = w;
return isl_stat_ok;
unbounded:
wraps->mat->n_row = 0;
return isl_stat_ok;
return wraps_mark_failed(wraps);
}
/* Check if the constraints in "wraps" from "first" until the last
@ -1426,6 +1465,32 @@ static __isl_give isl_set *set_from_updated_bmap(__isl_keep isl_basic_map *bmap,
return isl_set_from_basic_set(bset);
}
/* Does "info" have any cut constraints that are redundant?
*/
static isl_bool has_redundant_cuts(struct isl_coalesce_info *info)
{
int l;
int n_eq, n_ineq;
n_eq = isl_basic_map_n_equality(info->bmap);
n_ineq = isl_basic_map_n_inequality(info->bmap);
if (n_eq < 0 || n_ineq < 0)
return isl_bool_error;
for (l = 0; l < n_ineq; ++l) {
int red;
if (info->ineq[l] != STATUS_CUT)
continue;
red = isl_tab_is_redundant(info->tab, n_eq + l);
if (red < 0)
return isl_bool_error;
if (red)
return isl_bool_true;
}
return isl_bool_false;
}
/* Wrap the constraints of info->bmap that bound the facet defined
* by inequality "k" around (the opposite of) this inequality to
* include "set". "bound" may be used to store the negated inequality.
@ -1433,14 +1498,24 @@ static __isl_give isl_set *set_from_updated_bmap(__isl_keep isl_basic_map *bmap,
* of info->bmap, we check them in check_wraps.
* If any of the wrapped constraints turn out to be invalid, then
* check_wraps will reset wrap->n_row to zero.
*
* If any of the cut constraints of info->bmap turn out
* to be redundant with respect to other constraints
* then these will neither be wrapped nor added directly to the result.
* The result may therefore not be correct.
* Skip wrapping and reset wrap->mat->n_row to zero in this case.
*/
static isl_stat add_wraps_around_facet(struct isl_wraps *wraps,
struct isl_coalesce_info *info, int k, isl_int *bound,
__isl_keep isl_set *set)
{
isl_bool nowrap;
struct isl_tab_undo *snap;
int n;
unsigned total = isl_basic_map_total_dim(info->bmap);
isl_size total = isl_basic_map_dim(info->bmap, isl_dim_all);
if (total < 0)
return isl_stat_error;
snap = isl_tab_snap(info->tab);
@ -1448,15 +1523,22 @@ static isl_stat add_wraps_around_facet(struct isl_wraps *wraps,
return isl_stat_error;
if (isl_tab_detect_redundant(info->tab) < 0)
return isl_stat_error;
isl_seq_neg(bound, info->bmap->ineq[k], 1 + total);
nowrap = has_redundant_cuts(info);
if (nowrap < 0)
return isl_stat_error;
n = wraps->mat->n_row;
if (add_wraps(wraps, info, bound, set) < 0)
return isl_stat_error;
if (!nowrap) {
isl_seq_neg(bound, info->bmap->ineq[k], 1 + total);
if (add_wraps(wraps, info, bound, set) < 0)
return isl_stat_error;
}
if (isl_tab_rollback(info->tab, snap) < 0)
return isl_stat_error;
if (nowrap)
return wraps_mark_failed(wraps);
if (check_wraps(wraps->mat, n, info->tab) < 0)
return isl_stat_error;
@ -1494,8 +1576,10 @@ static enum isl_change can_wrap_in_facet(int i, int j, int k,
struct isl_set *set_i = NULL;
struct isl_set *set_j = NULL;
struct isl_vec *bound = NULL;
unsigned total = isl_basic_map_total_dim(info[i].bmap);
isl_size total = isl_basic_map_dim(info[i].bmap, isl_dim_all);
if (total < 0)
return isl_change_error;
set_i = set_from_updated_bmap(info[i].bmap, info[i].tab);
set_j = set_from_updated_bmap(info[j].bmap, info[j].tab);
ctx = isl_basic_map_get_ctx(info[i].bmap);
@ -1611,10 +1695,12 @@ static enum isl_change try_wrap_in_facets(int i, int j,
__isl_keep isl_set *set_i)
{
int k, l, w;
unsigned total;
isl_size total;
struct isl_tab_undo *snap;
total = isl_basic_map_total_dim(info[i].bmap);
total = isl_basic_map_dim(info[i].bmap, isl_dim_all);
if (total < 0)
return isl_change_error;
snap = isl_tab_snap(info[j].tab);
@ -1674,9 +1760,11 @@ static enum isl_change wrap_in_facets(int i, int j, int n,
isl_ctx *ctx;
isl_mat *mat;
isl_set *set_i = NULL;
unsigned total = isl_basic_map_total_dim(info[i].bmap);
isl_size total = isl_basic_map_dim(info[i].bmap, isl_dim_all);
int max_wrap;
if (total < 0)
return isl_change_error;
if (isl_tab_extend_cons(info[j].tab, 1) < 0)
return isl_change_error;
@ -1781,7 +1869,7 @@ static enum isl_change can_wrap_in_set(int i, int j,
{
int k, l;
int n;
unsigned total;
isl_size total;
if (ISL_F_ISSET(info[i].bmap, ISL_BASIC_MAP_RATIONAL) ||
ISL_F_ISSET(info[j].bmap, ISL_BASIC_MAP_RATIONAL))
@ -1791,7 +1879,9 @@ static enum isl_change can_wrap_in_set(int i, int j,
if (n == 0)
return isl_change_none;
total = isl_basic_map_total_dim(info[i].bmap);
total = isl_basic_map_dim(info[i].bmap, isl_dim_all);
if (total < 0)
return isl_change_error;
for (k = 0; k < info[i].bmap->n_eq; ++k) {
for (l = 0; l < 2; ++l) {
enum isl_ineq_type type;
@ -2028,8 +2118,10 @@ static enum isl_change check_eq_adj_eq(int i, int j,
struct isl_set *set_i = NULL;
struct isl_set *set_j = NULL;
struct isl_vec *bound = NULL;
unsigned total = isl_basic_map_total_dim(info[i].bmap);
isl_size total = isl_basic_map_dim(info[i].bmap, isl_dim_all);
if (total < 0)
return isl_change_error;
if (count_eq(&info[i], STATUS_ADJ_EQ) != 1)
detect_equalities = 1;
@ -2372,14 +2464,17 @@ static enum isl_change coalesce_local_pair(int i, int j,
static isl_stat shift_div(struct isl_coalesce_info *info, int div,
isl_int shift)
{
unsigned total;
isl_size total, n_div;
info->bmap = isl_basic_map_shift_div(info->bmap, div, 0, shift);
if (!info->bmap)
return isl_stat_error;
total = isl_basic_map_dim(info->bmap, isl_dim_all);
total -= isl_basic_map_dim(info->bmap, isl_dim_div);
n_div = isl_basic_map_dim(info->bmap, isl_dim_div);
if (total < 0 || n_div < 0)
return isl_stat_error;
total -= n_div;
if (isl_tab_shift_var(info->tab, total + div, shift) < 0)
return isl_stat_error;
@ -2466,9 +2561,12 @@ static isl_stat normalize_stride_div(struct isl_coalesce_info *info, int div)
static isl_stat harmonize_stride_divs(struct isl_coalesce_info *info1,
struct isl_coalesce_info *info2)
{
int i, n;
int i;
isl_size n;
n = isl_basic_map_dim(info1->bmap, isl_dim_div);
if (n < 0)
return isl_stat_error;
for (i = 0; i < n; ++i) {
isl_bool known, harmonize;
@ -2577,10 +2675,12 @@ static isl_stat harmonize_divs_with_hulls(struct isl_coalesce_info *info1,
__isl_keep isl_basic_set *eq2)
{
int i;
int total;
isl_size total;
isl_local_space *ls1, *ls2;
total = isl_basic_map_total_dim(info1->bmap);
total = isl_basic_map_dim(info1->bmap, isl_dim_all);
if (total < 0)
return isl_stat_error;
ls1 = isl_local_space_wrap(isl_basic_map_get_local_space(info1->bmap));
ls2 = isl_local_space_wrap(isl_basic_map_get_local_space(info2->bmap));
for (i = 0; i < info1->bmap->n_div; ++i) {
@ -2684,7 +2784,7 @@ static isl_bool same_divs(__isl_keep isl_basic_map *bmap1,
{
int i;
isl_bool known;
int total;
isl_size total;
if (!bmap1 || !bmap2)
return isl_bool_error;
@ -2701,7 +2801,9 @@ static isl_bool same_divs(__isl_keep isl_basic_map *bmap1,
if (known < 0 || !known)
return known;
total = isl_basic_map_total_dim(bmap1);
total = isl_basic_map_dim(bmap1, isl_dim_all);
if (total < 0)
return isl_bool_error;
for (i = 0; i < bmap1->n_div; ++i)
if (!isl_seq_eq(bmap1->div[i], bmap2->div[i], 2 + total))
return isl_bool_false;
@ -2784,9 +2886,8 @@ static isl_stat fix_constant_divs(struct isl_coalesce_info *info,
if (!expanded[i].cst) {
info->bmap = isl_basic_map_extend_constraints(
info->bmap, 0, 2);
if (isl_basic_map_add_div_constraints(info->bmap,
expanded[i].pos - o_div) < 0)
break;
info->bmap = isl_basic_map_add_div_constraints(
info->bmap, expanded[i].pos - o_div);
} else {
isl_int_set_si(ineq->el[1 + expanded[i].pos], -1);
isl_int_set(ineq->el[0], expanded[i].val);
@ -2891,7 +2992,8 @@ static isl_stat tab_insert_divs(struct isl_coalesce_info *info,
if (isl_tab_rollback(info->tab, snap) < 0)
return isl_stat_error;
info->bmap = isl_basic_map_cow(info->bmap);
if (isl_basic_map_free_inequality(info->bmap, 2 * n) < 0)
info->bmap = isl_basic_map_free_inequality(info->bmap, 2 * n);
if (info->bmap < 0)
return isl_stat_error;
return fix_constant_divs(info, n, expanded);
@ -2929,11 +3031,14 @@ static isl_stat expand_tab(struct isl_coalesce_info *info, int *exp,
struct isl_expanded *expanded;
int i, j, k, n;
int extra_var;
unsigned total, pos, n_div;
isl_size total, n_div;
unsigned pos;
isl_stat r;
total = isl_basic_map_dim(bmap, isl_dim_all);
n_div = isl_basic_map_dim(bmap, isl_dim_div);
if (total < 0 || n_div < 0)
return isl_stat_error;
pos = total - n_div;
extra_var = total - info->tab->n_var;
n = n_div - extra_var;
@ -3297,11 +3402,13 @@ static enum isl_change coalesce_divs(int i, int j,
static isl_bool has_nested_div(__isl_keep isl_basic_map *bmap)
{
int i;
unsigned total;
unsigned n_div;
isl_size total;
isl_size n_div;
total = isl_basic_map_dim(bmap, isl_dim_all);
n_div = isl_basic_map_dim(bmap, isl_dim_div);
if (total < 0 || n_div < 0)
return isl_bool_error;
total -= n_div;
for (i = 0; i < n_div; ++i)
@ -3327,7 +3434,7 @@ static __isl_give isl_aff_list *set_up_substitutions(
__isl_keep isl_basic_map *bmap_i, __isl_keep isl_basic_map *bmap_j,
__isl_take isl_basic_map *hull)
{
unsigned n_div_i, n_div_j, total;
isl_size n_div_i, n_div_j, total;
isl_ctx *ctx;
isl_local_space *ls;
isl_basic_set *wrap_hull;
@ -3335,14 +3442,14 @@ static __isl_give isl_aff_list *set_up_substitutions(
isl_aff_list *list;
int i, j;
if (!hull)
n_div_i = isl_basic_map_dim(bmap_i, isl_dim_div);
n_div_j = isl_basic_map_dim(bmap_j, isl_dim_div);
total = isl_basic_map_dim(bmap_i, isl_dim_all);
if (!hull || n_div_i < 0 || n_div_j < 0 || total < 0)
return NULL;
ctx = isl_basic_map_get_ctx(hull);
n_div_i = isl_basic_map_dim(bmap_i, isl_dim_div);
n_div_j = isl_basic_map_dim(bmap_j, isl_dim_div);
total = isl_basic_map_total_dim(bmap_i) - n_div_i;
total -= n_div_i;
ls = isl_basic_map_get_local_space(bmap_i);
ls = isl_local_space_wrap(ls);
@ -3354,6 +3461,7 @@ static __isl_give isl_aff_list *set_up_substitutions(
j = 0;
for (i = 0; i < n_div_i; ++i) {
isl_aff *aff;
isl_size n_div;
if (j < n_div_j &&
isl_basic_map_equal_div_expr_part(bmap_i, i, bmap_j, j,
@ -3369,9 +3477,10 @@ static __isl_give isl_aff_list *set_up_substitutions(
aff = isl_aff_substitute_equalities(aff,
isl_basic_set_copy(wrap_hull));
aff = isl_aff_floor(aff);
if (!aff)
n_div = isl_aff_dim(aff, isl_dim_div);
if (n_div < 0)
goto error;
if (isl_aff_dim(aff, isl_dim_div) != 0) {
if (n_div != 0) {
isl_aff_free(aff);
break;
}
@ -3411,16 +3520,14 @@ error:
static isl_stat add_sub_vars(struct isl_coalesce_info *info,
__isl_keep isl_aff_list *list, int dim, int extra_var)
{
int i, j, n, d;
isl_space *space;
int i, j, d;
isl_size n;
space = isl_basic_map_get_space(info->bmap);
info->bmap = isl_basic_map_cow(info->bmap);
info->bmap = isl_basic_map_extend_space(info->bmap, space,
extra_var, 0, 0);
if (!info->bmap)
return isl_stat_error;
info->bmap = isl_basic_map_extend(info->bmap, extra_var, 0, 0);
n = isl_aff_list_n_aff(list);
if (!info->bmap || n < 0)
return isl_stat_error;
for (i = 0; i < n; ++i) {
int is_nan;
isl_aff *aff;
@ -3439,10 +3546,11 @@ static isl_stat add_sub_vars(struct isl_coalesce_info *info,
if (d < 0)
return isl_stat_error;
info->bmap = isl_basic_map_mark_div_unknown(info->bmap, d);
for (j = d; j > i; --j)
info->bmap = isl_basic_map_swap_div(info->bmap,
j - 1, j);
if (!info->bmap)
return isl_stat_error;
for (j = d; j > i; --j)
isl_basic_map_swap_div(info->bmap, j - 1, j);
}
return isl_stat_ok;
@ -3456,20 +3564,23 @@ static isl_stat add_sub_vars(struct isl_coalesce_info *info,
* This function assumes that a sufficient number of rows and
* elements in the constraint array are available in the tableau.
*/
static int add_sub_equalities(struct isl_tab *tab,
static isl_stat add_sub_equalities(struct isl_tab *tab,
__isl_keep isl_aff_list *list, int dim)
{
int i, n;
int i;
isl_size n;
isl_ctx *ctx;
isl_vec *sub;
isl_aff *aff;
n = isl_aff_list_n_aff(list);
if (n < 0)
return isl_stat_error;
ctx = isl_tab_get_ctx(tab);
sub = isl_vec_alloc(ctx, 1 + dim + n);
if (!sub)
return -1;
return isl_stat_error;
isl_seq_clr(sub->el + 1 + dim, n);
for (i = 0; i < n; ++i) {
@ -3489,11 +3600,11 @@ static int add_sub_equalities(struct isl_tab *tab,
}
isl_vec_free(sub);
return 0;
return isl_stat_ok;
error:
isl_aff_free(aff);
isl_vec_free(sub);
return -1;
return isl_stat_error;
}
/* Add variables to info->tab and info->bmap corresponding to the elements
@ -3504,24 +3615,24 @@ error:
* When this function returns, the total number of variables in info->tab
* is equal to "dim" plus the number of elements in "list".
*/
static int add_subs(struct isl_coalesce_info *info,
static isl_stat add_subs(struct isl_coalesce_info *info,
__isl_keep isl_aff_list *list, int dim)
{
int extra_var;
int n;
if (!list)
return -1;
isl_size n;
n = isl_aff_list_n_aff(list);
if (n < 0)
return isl_stat_error;
extra_var = n - (info->tab->n_var - dim);
if (isl_tab_extend_vars(info->tab, extra_var) < 0)
return -1;
return isl_stat_error;
if (isl_tab_extend_cons(info->tab, 2 * extra_var) < 0)
return -1;
return isl_stat_error;
if (add_sub_vars(info, list, dim, extra_var) < 0)
return -1;
return isl_stat_error;
return add_sub_equalities(info->tab, list, dim);
}
@ -3544,14 +3655,17 @@ static enum isl_change coalesce_with_subs(int i, int j,
{
isl_basic_map *bmap_j;
struct isl_tab_undo *snap;
unsigned dim;
isl_size dim, n_div;
enum isl_change change;
bmap_j = isl_basic_map_copy(info[j].bmap);
snap = isl_tab_snap(info[j].tab);
dim = isl_basic_map_dim(bmap_j, isl_dim_all);
dim -= isl_basic_map_dim(bmap_j, isl_dim_div);
n_div = isl_basic_map_dim(bmap_j, isl_dim_div);
if (dim < 0 || n_div < 0)
goto error;
dim -= n_div;
if (add_subs(&info[j], list, dim) < 0)
goto error;
@ -3583,20 +3697,22 @@ error:
* extra equalities to a purely affine expression.
* If these tests succeed, then we try to coalesce the two basic maps
* by introducing extra dimensions in "j" corresponding to
* the extra integer divsisions "i" fixed to the corresponding
* the extra integer divisions "i" fixed to the corresponding
* purely affine expression.
*/
static enum isl_change check_coalesce_into_eq(int i, int j,
struct isl_coalesce_info *info)
{
unsigned n_div_i, n_div_j;
isl_size n_div_i, n_div_j, n;
isl_basic_map *hull_i, *hull_j;
int equal, empty;
isl_bool equal, empty;
isl_aff_list *list;
enum isl_change change;
n_div_i = isl_basic_map_dim(info[i].bmap, isl_dim_div);
n_div_j = isl_basic_map_dim(info[j].bmap, isl_dim_div);
if (n_div_i < 0 || n_div_j < 0)
return isl_change_error;
if (n_div_i <= n_div_j)
return isl_change_none;
if (info[j].bmap->n_eq == 0)
@ -3622,7 +3738,10 @@ static enum isl_change check_coalesce_into_eq(int i, int j,
list = set_up_substitutions(info[i].bmap, info[j].bmap, hull_j);
if (!list)
return isl_change_error;
if (isl_aff_list_n_aff(list) < n_div_i)
n = isl_aff_list_n_aff(list);
if (n < 0)
change = isl_change_error;
else if (n < n_div_i)
change = isl_change_none;
else
change = coalesce_with_subs(i, j, info, list);
@ -3813,6 +3932,10 @@ static int coalesce(isl_ctx *ctx, int n, struct isl_coalesce_info *info)
* isl_basic_map_gauss, we need to do it now.
* Also call isl_basic_map_simplify if we may have lost the definition
* of one or more integer divisions.
* If a basic map is still equal to the one from which the corresponding "info"
* entry was created, then redundant constraint and
* implicit equality constraint detection have been performed
* on the corresponding tableau and the basic map can be marked as such.
*/
static __isl_give isl_map *update_basic_maps(__isl_take isl_map *map,
int n, struct isl_coalesce_info *info)
@ -3839,8 +3962,10 @@ static __isl_give isl_map *update_basic_maps(__isl_take isl_map *map,
info[i].bmap = isl_basic_map_finalize(info[i].bmap);
if (!info[i].bmap)
return isl_map_free(map);
ISL_F_SET(info[i].bmap, ISL_BASIC_MAP_NO_IMPLICIT);
ISL_F_SET(info[i].bmap, ISL_BASIC_MAP_NO_REDUNDANT);
if (!info[i].modified) {
ISL_F_SET(info[i].bmap, ISL_BASIC_MAP_NO_IMPLICIT);
ISL_F_SET(info[i].bmap, ISL_BASIC_MAP_NO_REDUNDANT);
}
isl_basic_map_free(map->p[i]);
map->p[i] = info[i].bmap;
info[i].bmap = NULL;
@ -3855,16 +3980,22 @@ static __isl_give isl_map *update_basic_maps(__isl_take isl_map *map,
*
* We factor out any (hidden) common factor from the constraint
* coefficients to improve the detection of adjacent constraints.
* Note that this function does not call isl_basic_map_gauss,
* but it does make sure that only a single copy of the basic map
* is affected. This means that isl_basic_map_gauss may have
* to be called at the end of the computation (in update_basic_maps)
* on this single copy to ensure that
* the basic maps are not left in an unexpected state.
*
* Since we are constructing the tableaus of the basic maps anyway,
* we exploit them to detect implicit equalities and redundant constraints.
* This also helps the coalescing as it can ignore the redundant constraints.
* In order to avoid confusion, we make all implicit equalities explicit
* in the basic maps. We don't call isl_basic_map_gauss, though,
* as that may affect the number of constraints.
* This means that we have to call isl_basic_map_gauss at the end
* of the computation (in update_basic_maps) to ensure that
* the basic maps are not left in an unexpected state.
* in the basic maps. If the basic map only has a single reference
* (this happens in particular if it was modified by
* isl_basic_map_reduce_coefficients), then isl_basic_map_gauss
* does not get called on the result. The call to
* isl_basic_map_gauss in update_basic_maps resolves this as well.
* For each basic map, we also compute the hash of the apparent affine hull
* for use in coalesce.
*/

View File

@ -18,6 +18,9 @@
/* Define if TargetInfo::CreateTargetInfo takes shared_ptr */
#undef CREATETARGETINFO_TAKES_SHARED_PTR
/* Define if CompilerInvocation::CreateFromArgs takes ArrayRef */
#undef CREATE_FROM_ARGS_TAKES_ARRAYREF
/* Define if Driver constructor takes default image name */
#undef DRIVER_CTOR_TAKES_DEFAULTIMAGENAME
@ -94,6 +97,9 @@
/* Define to 1 if you have the `gmp' library (-lgmp). */
#undef HAVE_LIBGMP
/* Define if llvm/Option/Arg.h exists */
#undef HAVE_LLVM_OPTION_ARG_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
@ -130,7 +136,7 @@
/* Return type of HandleTopLevelDeclReturn */
#undef HandleTopLevelDeclReturn
/* Define to InputKind::C for newer versions of clang */
/* Define to Language::C or InputKind::C for newer versions of clang */
#undef IK_C
/* Define to the sub-directory where libtool stores uninstalled libraries. */

Some files were not shown because too many files have changed in this diff Show More