Update isl to isl-0.17.1-57-g1879898

With this update the isl AST generation extracts disjunctive constraints early
on. As a result, code that previously resulted in two branches with (close-to)
identical code within them:

  if (P <= -1) {
    for (int c0 = 0; c0 < N; c0 += 1)
      Stmt_store(c0);
  } else if (P >= 1)
    for (int c0 = 0; c0 < N; c0 += 1)
       Stmt_store(c0);

results now in only a single branch body:

  if (P <= -1 || P >= 1)
    for (int c0 = 0; c0 < N; c0 += 1)
       Stmt_store(c0);

This resolves http://llvm.org/PR27559

Besides the above change, this isl update brings better simplification of
sets/maps containing existentially quantified dimensions and fixes a bug in
isl's coalescing.

llvm-svn: 272500
This commit is contained in:
Tobias Grosser 2016-06-12 04:30:40 +00:00
parent 8620679eb5
commit 07b2095234
89 changed files with 5336 additions and 7392 deletions

View File

@ -1,3 +1,8 @@
version: 0.17.1
date: Fri May 6 12:02:48 CEST 2016
changes:
- fix bug in coalescing treatment
---
version: 0.17
date: Tue May 3 14:26:43 CEST 2016
changes:

View File

@ -1 +1 @@
isl-0.17-5-g57dc5ff
isl-0.17.1-57-g1879898

View File

@ -707,7 +707,6 @@ LIB_CLANG_EDIT = @LIB_CLANG_EDIT@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@ -787,7 +786,6 @@ pkgconfig_libfile = @pkgconfig_libfile@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@

View File

@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2015 Free Software Foundation, Inc.
# Copyright 1992-2014 Free Software Foundation, Inc.
timestamp='2015-08-20'
timestamp='2014-03-23'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -24,12 +24,12 @@ timestamp='2015-08-20'
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
# Please send patches to <config-patches@gnu.org>.
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
me=`echo "$0" | sed -e 's,.*/,,'`
@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2015 Free Software Foundation, Inc.
Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -168,27 +168,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || \
echo unknown)`
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
earmv*)
arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
machine=${arch}${endian}-unknown
;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
@ -204,13 +197,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
os=netbsd
;;
esac
# Determine ABI tags.
case "${UNAME_MACHINE_ARCH}" in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
@ -221,13 +207,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}${abi}"
echo "${machine}-${os}${release}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
@ -249,9 +235,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:Sortix:*:*)
echo ${UNAME_MACHINE}-unknown-sortix
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
@ -596,9 +579,8 @@ EOF
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/lslpp ] ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
@ -950,9 +932,6 @@ EOF
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
e2k:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
@ -1041,7 +1020,7 @@ EOF
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}

View File

@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2015 Free Software Foundation, Inc.
# Copyright 1992-2014 Free Software Foundation, Inc.
timestamp='2015-08-20'
timestamp='2014-09-11'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -25,7 +25,7 @@ timestamp='2015-08-20'
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches to <config-patches@gnu.org>.
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@ -68,7 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2015 Free Software Foundation, Inc.
Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -117,7 +117,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
@ -255,13 +255,12 @@ case $basic_machine in
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| ba \
| be32 | be64 \
| bfin \
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| e2k | epiphany \
| fido | fr30 | frv | ft32 \
| epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
@ -306,7 +305,7 @@ case $basic_machine in
| riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@ -314,7 +313,6 @@ case $basic_machine in
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| visium \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
@ -329,9 +327,6 @@ case $basic_machine in
c6x)
basic_machine=tic6x-unknown
;;
leon|leon[3-9])
basic_machine=sparc-$basic_machine
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
@ -377,13 +372,12 @@ case $basic_machine in
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| ba-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| e2k-* | elxsi-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
@ -430,13 +424,12 @@ case $basic_machine in
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
| riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
@ -444,7 +437,6 @@ case $basic_machine in
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| visium-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
@ -521,9 +513,6 @@ case $basic_machine in
basic_machine=i386-pc
os=-aros
;;
asmjs)
basic_machine=asmjs-unknown
;;
aux)
basic_machine=m68k-apple
os=-aux
@ -785,9 +774,6 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
leon-*|leon[3-9]-*)
basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
@ -1379,7 +1365,7 @@ case $os in
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* | -cloudabi* | -sortix* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,10 @@
AC_INIT([isl], [0.17], [isl-development@googlegroups.com])
AC_INIT([isl], [0.17.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=17:0:2
versioninfo=17:1:2
if test "x$prefix" != "xNONE"; then
prefix_wd=`cd $prefix && pwd`

View File

@ -185,7 +185,6 @@ LIB_CLANG_EDIT = @LIB_CLANG_EDIT@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@ -265,7 +264,6 @@ pkgconfig_libfile = @pkgconfig_libfile@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@

Binary file not shown.

View File

@ -4828,6 +4828,9 @@ variables, then the result of these operations is currently undefined.
__isl_give isl_basic_set *isl_set_simple_hull(
__isl_take isl_set *set);
__isl_give isl_basic_set *
isl_set_plain_unshifted_simple_hull(
__isl_take isl_set *set);
__isl_give isl_basic_set *
isl_set_unshifted_simple_hull_from_set_list(
__isl_take isl_set *set,
__isl_take isl_set_list *list);
@ -4839,6 +4842,9 @@ variables, then the result of these operations is currently undefined.
__isl_give isl_basic_map *isl_map_simple_hull(
__isl_take isl_map *map);
__isl_give isl_basic_map *
isl_map_plain_unshifted_simple_hull(
__isl_take isl_map *map);
__isl_give isl_basic_map *
isl_map_unshifted_simple_hull_from_map_list(
__isl_take isl_map *map,
__isl_take isl_map_list *list);
@ -4853,6 +4859,10 @@ In particular, the output is described by translates
of the constraints describing the basic sets or relations in the input.
In case of C<isl_set_unshifted_simple_hull>, only the original
constraints are used, without any translation.
In case of C<isl_set_plain_unshifted_simple_hull> and
C<isl_map_plain_unshifted_simple_hull>, the result is described
by original constraints that are obviously satisfied
by the entire input set or relation.
In case of C<isl_set_unshifted_simple_hull_from_set_list> and
C<isl_map_unshifted_simple_hull_from_map_list>, the
constraints are taken from the elements of the second argument.
@ -4916,6 +4926,11 @@ per space.
__isl_take isl_set *set,
enum isl_dim_type type,
unsigned first, unsigned n);
__isl_give isl_set *
isl_set_drop_constraints_not_involving_dims(
__isl_take isl_set *set,
enum isl_dim_type type,
unsigned first, unsigned n);
#include <isl/map.h>
__isl_give isl_basic_map *
@ -4933,6 +4948,11 @@ per space.
__isl_take isl_map *map,
enum isl_dim_type type,
unsigned first, unsigned n);
__isl_give isl_map *
isl_map_drop_constraints_not_involving_dims(
__isl_take isl_map *map,
enum isl_dim_type type,
unsigned first, unsigned n);
These functions drop any constraints (not) involving the specified dimensions.
Note that the result depends on the representation of the input.
@ -7245,6 +7265,32 @@ on those parts of the domain where only a single function is defined.
__isl_take isl_pw_multi_aff *pma1,
__isl_take isl_pw_multi_aff *pma2);
If the input to a lexicographic optimization problem has
multiple constraints with the same coefficients for the optimized
variables, then, by default, this symmetry is exploited by
replacing those constraints by a single constraint with
an abstract bound, which is in turn bounded by the corresponding terms
in the original constraints.
Without this optimization, the solver would typically consider
all possible orderings of those original bounds, resulting in a needless
decomposition of the domain.
However, the optimization can also result in slowdowns since
an extra parameter is introduced that may get used in additional
integer divisions.
The following option determines whether symmetry detection is applied
during lexicographic optimization.
#include <isl/options.h>
isl_stat isl_options_set_pip_symmetry(isl_ctx *ctx,
int val);
int isl_options_get_pip_symmetry(isl_ctx *ctx);
=begin latex
See also \autoref{s:offline}.
=end latex
=head2 Ternary Operations
#include <isl/aff.h>

View File

@ -136,6 +136,8 @@ __isl_give isl_basic_map *isl_map_simple_hull(__isl_take isl_map *map);
__isl_export
__isl_give isl_basic_map *isl_map_unshifted_simple_hull(
__isl_take isl_map *map);
__isl_give isl_basic_map *isl_map_plain_unshifted_simple_hull(
__isl_take isl_map *map);
__isl_give isl_basic_map *isl_map_unshifted_simple_hull_from_map_list(
__isl_take isl_map *map, __isl_take isl_map_list *list);
@ -577,6 +579,9 @@ __isl_give isl_basic_map *isl_basic_map_drop_constraints_not_involving_dims(
__isl_give isl_map *isl_map_drop_constraints_involving_dims(
__isl_take isl_map *map,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_give isl_map *isl_map_drop_constraints_not_involving_dims(
__isl_take isl_map *map,
enum isl_dim_type type, unsigned first, unsigned n);
isl_bool isl_basic_map_involves_dims(__isl_keep isl_basic_map *bmap,
enum isl_dim_type type, unsigned first, unsigned n);

View File

@ -40,6 +40,9 @@ int isl_options_get_gbr_only_first(isl_ctx *ctx);
isl_stat isl_options_set_schedule_algorithm(isl_ctx *ctx, int val);
int isl_options_get_schedule_algorithm(isl_ctx *ctx);
isl_stat isl_options_set_pip_symmetry(isl_ctx *ctx, int val);
int isl_options_get_pip_symmetry(isl_ctx *ctx);
isl_stat isl_options_set_coalesce_bounded_wrapping(isl_ctx *ctx, int val);
int isl_options_get_coalesce_bounded_wrapping(isl_ctx *ctx);

View File

@ -254,6 +254,8 @@ __isl_give isl_basic_set *isl_set_simple_hull(__isl_take isl_set *set);
__isl_export
__isl_give isl_basic_set *isl_set_unshifted_simple_hull(
__isl_take isl_set *set);
__isl_give isl_basic_set *isl_set_plain_unshifted_simple_hull(
__isl_take isl_set *set);
__isl_give isl_basic_set *isl_set_unshifted_simple_hull_from_set_list(
__isl_take isl_set *set, __isl_take isl_set_list *list);
struct isl_basic_set *isl_set_bounded_simple_hull(struct isl_set *set);
@ -355,6 +357,9 @@ __isl_give isl_basic_set *isl_basic_set_drop_constraints_not_involving_dims(
__isl_give isl_set *isl_set_drop_constraints_involving_dims(
__isl_take isl_set *set,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_give isl_set *isl_set_drop_constraints_not_involving_dims(
__isl_take isl_set *set,
enum isl_dim_type type, unsigned first, unsigned n);
isl_bool isl_basic_set_involves_dims(__isl_keep isl_basic_set *bset,
enum isl_dim_type type, unsigned first, unsigned n);

View File

@ -56,51 +56,87 @@ int isl_val_get_abs_num_chunks(__isl_keep isl_val *v, size_t size,
__isl_give isl_val *isl_val_set_si(__isl_take isl_val *v, long i);
__isl_export
__isl_give isl_val *isl_val_abs(__isl_take isl_val *v);
__isl_export
__isl_give isl_val *isl_val_neg(__isl_take isl_val *v);
__isl_export
__isl_give isl_val *isl_val_inv(__isl_take isl_val *v);
__isl_export
__isl_give isl_val *isl_val_floor(__isl_take isl_val *v);
__isl_export
__isl_give isl_val *isl_val_ceil(__isl_take isl_val *v);
__isl_export
__isl_give isl_val *isl_val_trunc(__isl_take isl_val *v);
__isl_give isl_val *isl_val_2exp(__isl_take isl_val *v);
__isl_export
__isl_give isl_val *isl_val_min(__isl_take isl_val *v1, __isl_take isl_val *v2);
__isl_export
__isl_give isl_val *isl_val_max(__isl_take isl_val *v1, __isl_take isl_val *v2);
__isl_export
__isl_give isl_val *isl_val_add(__isl_take isl_val *v1, __isl_take isl_val *v2);
__isl_give isl_val *isl_val_add_ui(__isl_take isl_val *v1, unsigned long v2);
__isl_export
__isl_give isl_val *isl_val_sub(__isl_take isl_val *v1, __isl_take isl_val *v2);
__isl_give isl_val *isl_val_sub_ui(__isl_take isl_val *v1, unsigned long v2);
__isl_export
__isl_give isl_val *isl_val_mul(__isl_take isl_val *v1, __isl_take isl_val *v2);
__isl_give isl_val *isl_val_mul_ui(__isl_take isl_val *v1, unsigned long v2);
__isl_export
__isl_give isl_val *isl_val_div(__isl_take isl_val *v1, __isl_take isl_val *v2);
__isl_export
__isl_give isl_val *isl_val_mod(__isl_take isl_val *v1, __isl_take isl_val *v2);
__isl_export
__isl_give isl_val *isl_val_gcd(__isl_take isl_val *v1, __isl_take isl_val *v2);
__isl_give isl_val *isl_val_gcdext(__isl_take isl_val *v1,
__isl_take isl_val *v2, __isl_give isl_val **x, __isl_give isl_val **y);
__isl_export
int isl_val_sgn(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_zero(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_one(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_negone(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_nonneg(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_nonpos(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_pos(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_neg(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_int(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_rat(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_nan(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_infty(__isl_keep isl_val *v);
__isl_export
isl_bool isl_val_is_neginfty(__isl_keep isl_val *v);
__isl_export
int isl_val_cmp_si(__isl_keep isl_val *v, long i);
__isl_export
isl_bool isl_val_lt(__isl_keep isl_val *v1, __isl_keep isl_val *v2);
__isl_export
isl_bool isl_val_le(__isl_keep isl_val *v1, __isl_keep isl_val *v2);
__isl_export
isl_bool isl_val_gt(__isl_keep isl_val *v1, __isl_keep isl_val *v2);
__isl_export
isl_bool isl_val_ge(__isl_keep isl_val *v1, __isl_keep isl_val *v2);
__isl_export
isl_bool isl_val_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2);
__isl_export
isl_bool isl_val_ne(__isl_keep isl_val *v1, __isl_keep isl_val *v2);
__isl_export
isl_bool isl_val_abs_eq(__isl_keep isl_val *v1, __isl_keep isl_val *v2);
__isl_export
isl_bool isl_val_is_divisible_by(__isl_keep isl_val *v1,
__isl_keep isl_val *v2);

View File

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2014-09-12.12; # UTC
scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -324,41 +324,34 @@ do
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
# $RANDOM is not portable (e.g. dash); use it when possible to
# lower collision chance
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
# As "mkdir -p" follows symlinks and we work in /tmp possibly; so
# create the $tmpdir first (and fail if unsuccessful) to make sure
# that nobody tries to guess the $tmpdir name.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;

View File

@ -4963,14 +4963,10 @@ static __isl_give isl_pw_multi_aff *pw_multi_aff_from_map_stride(
}
/* Try and create an isl_pw_multi_aff that is equivalent to the given isl_map.
* "hull" contains the equalities valid for "map".
*
* As a special case, we first check if all output dimensions are uniquely
* defined in terms of the parameters and input dimensions over the entire
* domain. If so, we extract the desired isl_pw_multi_aff directly
* from the affine hull of "map" and its domain.
*
* Otherwise, we check if any of the output dimensions is "strided".
* That is, we check if can be written as
* Check if any of the output dimensions is "strided".
* That is, we check if it can be written as
*
* x = m a + f(..)
*
@ -4981,30 +4977,16 @@ static __isl_give isl_pw_multi_aff *pw_multi_aff_from_map_stride(
* Otherwise, we continue with pw_multi_aff_from_map_check_div for a further
* special case.
*/
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_map(__isl_take isl_map *map)
static __isl_give isl_pw_multi_aff *pw_multi_aff_from_map_check_strides(
__isl_take isl_map *map, __isl_take isl_basic_map *hull)
{
int i, j;
isl_bool sv;
isl_basic_map *hull;
unsigned n_out;
unsigned o_out;
unsigned n_div;
unsigned o_div;
isl_int gcd;
if (!map)
return NULL;
map = isl_map_detect_equalities(map);
hull = isl_map_unshifted_simple_hull(isl_map_copy(map));
sv = isl_basic_map_plain_is_single_valued(hull);
if (sv >= 0 && sv)
return plain_pw_multi_aff_from_map(isl_map_domain(map), hull);
if (sv < 0)
hull = isl_basic_map_free(hull);
if (!hull)
goto error;
n_div = isl_basic_map_dim(hull, isl_dim_div);
o_div = isl_basic_map_offset(hull, isl_dim_div);
@ -5047,7 +5029,43 @@ __isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_map(__isl_take isl_map *map)
isl_int_clear(gcd);
isl_basic_map_free(hull);
return pw_multi_aff_from_map_check_div(map);
error:
}
/* Try and create an isl_pw_multi_aff that is equivalent to the given isl_map.
*
* As a special case, we first check if all output dimensions are uniquely
* defined in terms of the parameters and input dimensions over the entire
* domain. If so, we extract the desired isl_pw_multi_aff directly
* from the affine hull of "map" and its domain.
*
* Otherwise, continue with pw_multi_aff_from_map_check_strides for more
* special cases.
*/
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_map(__isl_take isl_map *map)
{
isl_bool sv;
isl_basic_map *hull;
if (!map)
return NULL;
if (isl_map_n_basic_map(map) == 1) {
hull = isl_map_unshifted_simple_hull(isl_map_copy(map));
hull = isl_basic_map_plain_affine_hull(hull);
sv = isl_basic_map_plain_is_single_valued(hull);
if (sv >= 0 && sv)
return plain_pw_multi_aff_from_map(isl_map_domain(map),
hull);
isl_basic_map_free(hull);
}
map = isl_map_detect_equalities(map);
hull = isl_map_unshifted_simple_hull(isl_map_copy(map));
sv = isl_basic_map_plain_is_single_valued(hull);
if (sv >= 0 && sv)
return plain_pw_multi_aff_from_map(isl_map_domain(map), hull);
if (sv >= 0)
return pw_multi_aff_from_map_check_strides(map, hull);
isl_basic_map_free(hull);
isl_map_free(map);
return NULL;
}

View File

@ -621,20 +621,18 @@ __isl_give isl_basic_set *isl_basic_set_drop_constraints_involving_dims(
type, first, n);
}
/* Drop all constraints in map that involve any of the dimensions
* first to first + n - 1 of the given type.
/* Drop constraints from "map" by applying "drop" to each basic map.
*/
__isl_give isl_map *isl_map_drop_constraints_involving_dims(
__isl_take isl_map *map,
enum isl_dim_type type, unsigned first, unsigned n)
__isl_give isl_map *drop_constraints(__isl_take isl_map *map,
enum isl_dim_type type, unsigned first, unsigned n,
__isl_give isl_basic_map *(*drop)(__isl_take isl_basic_map *bmap,
enum isl_dim_type type, unsigned first, unsigned n))
{
int i;
unsigned dim;
if (!map)
return NULL;
if (n == 0)
return map;
dim = isl_map_dim(map, type);
if (first + n > dim || first + n < first)
@ -646,8 +644,7 @@ __isl_give isl_map *isl_map_drop_constraints_involving_dims(
return NULL;
for (i = 0; i < map->n; ++i) {
map->p[i] = isl_basic_map_drop_constraints_involving_dims(
map->p[i], type, first, n);
map->p[i] = drop(map->p[i], type, first, n);
if (!map->p[i])
return isl_map_free(map);
}
@ -658,6 +655,35 @@ __isl_give isl_map *isl_map_drop_constraints_involving_dims(
return map;
}
/* Drop all constraints in map that involve any of the dimensions
* first to first + n - 1 of the given type.
*/
__isl_give isl_map *isl_map_drop_constraints_involving_dims(
__isl_take isl_map *map,
enum isl_dim_type type, unsigned first, unsigned n)
{
if (n == 0)
return map;
return drop_constraints(map, type, first, n,
&isl_basic_map_drop_constraints_involving_dims);
}
/* Drop all constraints in "map" that do not involve any of the dimensions
* first to first + n - 1 of the given type.
*/
__isl_give isl_map *isl_map_drop_constraints_not_involving_dims(
__isl_take isl_map *map,
enum isl_dim_type type, unsigned first, unsigned n)
{
if (n == 0) {
isl_space *space = isl_map_get_space(map);
isl_map_free(map);
return isl_map_universe(space);
}
return drop_constraints(map, type, first, n,
&isl_basic_map_drop_constraints_not_involving_dims);
}
/* Drop all constraints in set that involve any of the dimensions
* first to first + n - 1 of the given type.
*/
@ -668,7 +694,17 @@ __isl_give isl_set *isl_set_drop_constraints_involving_dims(
return isl_map_drop_constraints_involving_dims(set, type, first, n);
}
/* Construct an initial underapproximatino of the hull of "bset"
/* Drop all constraints in "set" that do not involve any of the dimensions
* first to first + n - 1 of the given type.
*/
__isl_give isl_set *isl_set_drop_constraints_not_involving_dims(
__isl_take isl_set *set,
enum isl_dim_type type, unsigned first, unsigned n)
{
return isl_map_drop_constraints_not_involving_dims(set, type, first, n);
}
/* Construct an initial underapproximation of the hull of "bset"
* from "sample" and any of its adjacent points that also belong to "bset".
*/
static __isl_give isl_basic_set *initialize_hull(__isl_keep isl_basic_set *bset,

View File

@ -1961,32 +1961,37 @@ static __isl_give isl_printer *print_ast_node_c(__isl_take isl_printer *p,
__isl_keep isl_ast_print_options *options, int in_block, int in_list);
static __isl_give isl_printer *print_if_c(__isl_take isl_printer *p,
__isl_keep isl_ast_node *node,
__isl_keep isl_ast_print_options *options, int new_line);
__isl_keep isl_ast_print_options *options, int new_line,
int force_block);
/* Print the body "node" of a for or if node.
* If "else_node" is set, then it is printed as well.
* If "force_block" is set, then print out the body as a block.
*
* We first check if we need to print out a block.
* We always print out a block if there is an else node to make
* sure that the else node is matched to the correct if node.
* For consistency, the corresponding else node is also printed as a block.
*
* If the else node is itself an if, then we print it as
*
* } else if (..)
* } else if (..) {
* }
*
* Otherwise the else node is printed as
*
* } else
* } else {
* node
* }
*/
static __isl_give isl_printer *print_body_c(__isl_take isl_printer *p,
__isl_keep isl_ast_node *node, __isl_keep isl_ast_node *else_node,
__isl_keep isl_ast_print_options *options)
__isl_keep isl_ast_print_options *options, int force_block)
{
if (!node)
return isl_printer_free(p);
if (!else_node && !need_block(node)) {
if (!force_block && !else_node && !need_block(node)) {
p = isl_printer_end_line(p);
p = isl_printer_indent(p, 2);
p = isl_ast_node_print(node, p,
@ -2005,10 +2010,10 @@ static __isl_give isl_printer *print_body_c(__isl_take isl_printer *p,
if (else_node) {
if (else_node->type == isl_ast_node_if) {
p = isl_printer_print_str(p, " else ");
p = print_if_c(p, else_node, options, 0);
p = print_if_c(p, else_node, options, 0, 1);
} else {
p = isl_printer_print_str(p, " else");
p = print_body_c(p, else_node, NULL, options);
p = print_body_c(p, else_node, NULL, options, 1);
}
} else
p = isl_printer_end_line(p);
@ -2086,7 +2091,7 @@ static __isl_give isl_printer *print_for_c(__isl_take isl_printer *p,
p = isl_printer_print_str(p, " += ");
p = isl_printer_print_ast_expr(p, node->u.f.inc);
p = isl_printer_print_str(p, ")");
p = print_body_c(p, node->u.f.body, NULL, options);
p = print_body_c(p, node->u.f.body, NULL, options, 0);
} else {
id = isl_ast_expr_get_id(node->u.f.iterator);
name = isl_id_get_name(id);
@ -2111,17 +2116,20 @@ static __isl_give isl_printer *print_for_c(__isl_take isl_printer *p,
/* Print the if node "node".
* If "new_line" is set then the if node should be printed on a new line.
* If "force_block" is set, then print out the body as a block.
*/
static __isl_give isl_printer *print_if_c(__isl_take isl_printer *p,
__isl_keep isl_ast_node *node,
__isl_keep isl_ast_print_options *options, int new_line)
__isl_keep isl_ast_print_options *options, int new_line,
int force_block)
{
if (new_line)
p = isl_printer_start_line(p);
p = isl_printer_print_str(p, "if (");
p = isl_printer_print_ast_expr(p, node->u.i.guard);
p = isl_printer_print_str(p, ")");
p = print_body_c(p, node->u.i.then, node->u.i.else_node, options);
p = print_body_c(p, node->u.i.then, node->u.i.else_node, options,
force_block);
return p;
}
@ -2148,7 +2156,7 @@ static __isl_give isl_printer *print_ast_node_c(__isl_take isl_printer *p,
p = print_for_c(p, node, options, in_block, in_list);
break;
case isl_ast_node_if:
p = print_if_c(p, node, options, 1);
p = print_if_c(p, node, options, 1, 0);
break;
case isl_ast_node_block:
if (!in_block)
@ -2209,7 +2217,7 @@ __isl_give isl_printer *isl_ast_node_if_print(__isl_keep isl_ast_node *node,
if (node->type != isl_ast_node_if)
isl_die(isl_ast_node_get_ctx(node), isl_error_invalid,
"not an if node", goto error);
p = print_if_c(p, node, options, 1);
p = print_if_c(p, node, options, 1, 0);
isl_ast_print_options_free(options);
return p;
error:

View File

@ -3221,6 +3221,38 @@ static __isl_give isl_ast_graft_list *generate_shifted_component_tree_unroll(
return data.list;
}
/* Does "domain" involve a disjunction that is purely based on
* constraints involving only outer dimension?
*
* In particular, is there a disjunction such that the constraints
* involving the current and later dimensions are the same over
* all the disjuncts?
*/
static isl_bool has_pure_outer_disjunction(__isl_keep isl_set *domain,
__isl_keep isl_ast_build *build)
{
isl_basic_set *hull;
isl_set *shared, *inner;
isl_bool equal;
int depth, dim;
if (isl_set_n_basic_set(domain) <= 1)
return isl_bool_false;
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));
shared = isl_set_from_basic_set(hull);
equal = isl_set_plain_is_equal(inner, shared);
isl_set_free(inner);
isl_set_free(shared);
return equal;
}
/* Generate code for a single component, after shifting (if any)
* has been applied, in case the schedule was specified as a schedule tree.
* In particular, handle the base case where there is either no isolated
@ -3246,11 +3278,18 @@ static __isl_give isl_ast_graft_list *generate_shifted_component_tree_unroll(
* split up into disjoint basic sets.
* Finally an AST is generated for each basic set and the results are
* concatenated.
*
* If the schedule domain involves a disjunction that is purely based on
* constraints involving only outer dimension, then it is treated as
* if atomic was specified. This ensures that only a single loop
* is generated instead of a sequence of identical loops with
* different guards.
*/
static __isl_give isl_ast_graft_list *generate_shifted_component_tree_base(
__isl_take isl_union_map *executed, __isl_take isl_ast_build *build,
int isolated)
{
isl_bool outer_disjunction;
isl_union_set *schedule_domain;
isl_set *domain;
isl_basic_set_list *domain_list;
@ -3275,7 +3314,11 @@ static __isl_give isl_ast_graft_list *generate_shifted_component_tree_base(
domain = isl_ast_build_eliminate(build, domain);
domain = isl_set_coalesce(domain);
if (type == isl_ast_loop_atomic) {
outer_disjunction = has_pure_outer_disjunction(domain, build);
if (outer_disjunction < 0)
domain = isl_set_free(domain);
if (outer_disjunction || type == isl_ast_loop_atomic) {
isl_basic_set *hull;
hull = isl_set_unshifted_simple_hull(domain);
domain_list = isl_basic_set_list_from_basic_set(hull);

View File

@ -39,6 +39,15 @@ int isl_blk_is_error(struct isl_blk block)
return block.size == -1 && block.data == NULL;
}
static void isl_blk_free_force(struct isl_ctx *ctx, struct isl_blk block)
{
int i;
for (i = 0; i < block.size; ++i)
isl_int_clear(block.data[i]);
free(block.data);
}
static struct isl_blk extend(struct isl_ctx *ctx, struct isl_blk block,
size_t new_n)
{
@ -48,12 +57,12 @@ static struct isl_blk extend(struct isl_ctx *ctx, struct isl_blk block,
if (block.size >= new_n)
return block;
p = block.data;
block.data = isl_realloc_array(ctx, block.data, isl_int, new_n);
if (!block.data) {
free(p);
p = isl_realloc_array(ctx, block.data, isl_int, new_n);
if (!p) {
isl_blk_free_force(ctx, block);
return isl_blk_error();
}
block.data = p;
for (i = block.size; i < new_n; ++i)
isl_int_init(block.data[i]);
@ -62,15 +71,6 @@ static struct isl_blk extend(struct isl_ctx *ctx, struct isl_blk block,
return block;
}
static void isl_blk_free_force(struct isl_ctx *ctx, struct isl_blk block)
{
int i;
for (i = 0; i < block.size; ++i)
isl_int_clear(block.data[i]);
free(block.data);
}
struct isl_blk isl_blk_alloc(struct isl_ctx *ctx, size_t n)
{
int i;

View File

@ -1182,7 +1182,7 @@ static enum isl_change wrap_in_facets(int i, int j, int *cuts, int n,
struct isl_tab_undo *snap;
if (isl_tab_extend_cons(info[j].tab, 1) < 0)
goto error;
return isl_change_error;
max_wrap = 1 + 2 * info[j].bmap->n_eq + info[j].bmap->n_ineq;
max_wrap *= n;
@ -1819,7 +1819,7 @@ static int contains_with_expanded_divs(__isl_keep isl_basic_map *bmap,
int *ineq_i = NULL;
bmap = isl_basic_map_copy(bmap);
bmap = isl_basic_set_expand_divs(bmap, isl_mat_copy(div), exp);
bmap = isl_basic_map_expand_divs(bmap, isl_mat_copy(div), exp);
if (!bmap)
goto error;
@ -2149,11 +2149,19 @@ error:
* start considering the elements in "list".
* When this function returns, the total number of variables in "tab"
* is equal to "dim" plus the number of elements in "list".
*
* The newly added existentially quantified variables are not given
* an explicit representation because the corresponding div constraints
* do not appear in info->bmap. These constraints are not added
* to info->bmap because for internal consistency, they would need to
* be added to info->tab as well, where they could combine with the equality
* that is added later to result in constraints that do not hold
* in the original input.
*/
static int add_sub_vars(struct isl_coalesce_info *info,
__isl_keep isl_aff_list *list, int dim, int extra_var)
{
int i, j, n;
int i, j, n, d;
isl_space *space;
space = isl_basic_map_get_space(info->bmap);
@ -2177,9 +2185,13 @@ static int add_sub_vars(struct isl_coalesce_info *info,
if (isl_tab_insert_var(info->tab, dim + i) < 0)
return -1;
if (isl_basic_map_alloc_div(info->bmap) < 0)
d = isl_basic_map_alloc_div(info->bmap);
if (d < 0)
return -1;
for (j = n - 1; j > i; --j)
info->bmap = isl_basic_map_mark_div_unknown(info->bmap, d);
if (!info->bmap)
return -1;
for (j = d; j > i; --j)
isl_basic_map_swap_div(info->bmap, j - 1, j);
}

View File

@ -124,7 +124,8 @@
/* Return type of HandleTopLevelDeclReturn */
#undef HandleTopLevelDeclReturn
/* Define to the sub-directory where libtool stores uninstalled libraries. */
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */

View File

@ -80,7 +80,7 @@ int isl_basic_set_constraint_is_redundant(struct isl_basic_set **bset,
* is the same if the constraint is removed, then the constraint is redundant.
*
* Alternatively, we could have intersected the basic map with the
* corresponding equality and the checked if the dimension was that
* corresponding equality and then checked if the dimension was that
* of a facet.
*/
__isl_give isl_basic_map *isl_basic_map_remove_redundancies(
@ -106,6 +106,8 @@ __isl_give isl_basic_map *isl_basic_map_remove_redundancies(
goto error;
bmap = isl_basic_map_update_from_tab(bmap, tab);
isl_tab_free(tab);
if (!bmap)
return NULL;
ISL_F_SET(bmap, ISL_BASIC_MAP_NO_IMPLICIT);
ISL_F_SET(bmap, ISL_BASIC_MAP_NO_REDUNDANT);
return bmap;
@ -2378,6 +2380,21 @@ static __isl_give isl_basic_map *map_simple_hull_trivial(
return hull;
}
/* Return a copy of the simple hull cached inside "map".
* "shift" determines whether to return the cached unshifted or shifted
* simple hull.
*/
static __isl_give isl_basic_map *cached_simple_hull(__isl_take isl_map *map,
int shift)
{
isl_basic_map *hull;
hull = isl_basic_map_copy(map->cached_simple_hull[shift]);
isl_map_free(map);
return hull;
}
/* Compute a superset of the convex hull of map that is described
* by only (translates of) the constraints in the constituents of map.
* Translation is only allowed if "shift" is set.
@ -2387,6 +2404,14 @@ static __isl_give isl_basic_map *map_simple_hull_trivial(
* be preserved. In particular, pairs of constraints that are
* sorted together are preferred to either both be preserved
* or both be removed.
*
* The result of the computation is stored in map->cached_simple_hull[shift]
* such that it can be reused in subsequent calls. The cache is cleared
* whenever the map is modified (in isl_map_cow).
* Note that the results need to be stored in the input map for there
* to be any chance that they may get reused. In particular, they
* are stored in a copy of the input map that is saved before
* the integer division alignment.
*/
static __isl_give isl_basic_map *map_simple_hull(__isl_take isl_map *map,
int shift)
@ -2396,14 +2421,19 @@ static __isl_give isl_basic_map *map_simple_hull(__isl_take isl_map *map,
struct isl_basic_map *hull;
struct isl_basic_map *affine_hull;
struct isl_basic_set *bset = NULL;
isl_map *input;
if (!map || map->n <= 1)
return map_simple_hull_trivial(map);
if (map->cached_simple_hull[shift])
return cached_simple_hull(map, shift);
map = isl_map_detect_equalities(map);
if (!map || map->n <= 1)
return map_simple_hull_trivial(map);
affine_hull = isl_map_affine_hull(isl_map_copy(map));
input = isl_map_copy(map);
map = isl_map_align_divs(map);
model = map ? isl_basic_map_copy(map->p[0]) : NULL;
@ -2417,12 +2447,15 @@ static __isl_give isl_basic_map *map_simple_hull(__isl_take isl_map *map,
hull = isl_basic_map_sort_constraints(hull);
hull = isl_basic_map_remove_redundancies(hull);
if (!hull)
return NULL;
ISL_F_SET(hull, ISL_BASIC_MAP_NO_IMPLICIT);
ISL_F_SET(hull, ISL_BASIC_MAP_ALL_EQUALITIES);
if (hull) {
ISL_F_SET(hull, ISL_BASIC_MAP_NO_IMPLICIT);
ISL_F_SET(hull, ISL_BASIC_MAP_ALL_EQUALITIES);
}
hull = isl_basic_map_finalize(hull);
if (input)
input->cached_simple_hull[shift] = isl_basic_map_copy(hull);
isl_map_free(input);
return hull;
}
@ -2626,6 +2659,17 @@ __isl_give isl_basic_map *isl_map_plain_unshifted_simple_hull(
return hull;
}
/* Compute a superset of the convex hull of "set" that is described
* by only the constraints in the constituents of "set".
* In particular, the result is composed of constraints that appear
* in each of the basic sets of "set"
*/
__isl_give isl_basic_set *isl_set_plain_unshifted_simple_hull(
__isl_take isl_set *set)
{
return isl_map_plain_unshifted_simple_hull(set);
}
/* Check if "ineq" is a bound on "set" and, if so, add it to "hull".
*
* For each basic set in "set", we first check if the basic set

View File

@ -326,7 +326,7 @@ __isl_give isl_local_space *isl_basic_set_get_local_space(
/* For each known div d = floor(f/m), add the constraints
*
* f - m d >= 0
* -(f-(n-1)) + m d >= 0
* -(f-(m-1)) + m d >= 0
*
* Do not finalize the result.
*/
@ -1673,24 +1673,42 @@ struct isl_basic_map *isl_basic_map_cow(struct isl_basic_map *bmap)
return bmap;
}
struct isl_set *isl_set_cow(struct isl_set *set)
/* Clear all cached information in "map", either because it is about
* to be modified or because it is being freed.
* Always return the same pointer that is passed in.
* This is needed for the use in isl_map_free.
*/
static __isl_give isl_map *clear_caches(__isl_take isl_map *map)
{
if (!set)
return NULL;
if (set->ref == 1)
return set;
set->ref--;
return isl_set_dup(set);
isl_basic_map_free(map->cached_simple_hull[0]);
isl_basic_map_free(map->cached_simple_hull[1]);
map->cached_simple_hull[0] = NULL;
map->cached_simple_hull[1] = NULL;
return map;
}
struct isl_set *isl_set_cow(struct isl_set *set)
{
return isl_map_cow(set);
}
/* Return an isl_map that is equal to "map" and that has only
* a single reference.
*
* If the original input already has only one reference, then
* simply return it, but clear all cached information, since
* it may be rendered invalid by the operations that will be
* performed on the result.
*
* Otherwise, create a duplicate (without any cached information).
*/
struct isl_map *isl_map_cow(struct isl_map *map)
{
if (!map)
return NULL;
if (map->ref == 1)
return map;
return clear_caches(map);
map->ref--;
return isl_map_dup(map);
}
@ -2580,31 +2598,17 @@ int isl_inequality_negate(struct isl_basic_map *bmap, unsigned pos)
return 0;
}
__isl_give isl_set *isl_set_alloc_space(__isl_take isl_space *dim, int n,
__isl_give isl_set *isl_set_alloc_space(__isl_take isl_space *space, int n,
unsigned flags)
{
struct isl_set *set;
if (!dim)
if (!space)
return NULL;
isl_assert(dim->ctx, dim->n_in == 0, goto error);
isl_assert(dim->ctx, n >= 0, goto error);
set = isl_alloc(dim->ctx, struct isl_set,
sizeof(struct isl_set) +
(n - 1) * sizeof(struct isl_basic_set *));
if (!set)
goto error;
set->ctx = dim->ctx;
isl_ctx_ref(set->ctx);
set->ref = 1;
set->size = n;
set->n = 0;
set->dim = dim;
set->flags = flags;
return set;
if (isl_space_dim(space, isl_dim_in) != 0)
isl_die(isl_space_get_ctx(space), isl_error_invalid,
"set cannot have input dimensions", goto error);
return isl_map_alloc_space(space, n, flags);
error:
isl_space_free(dim);
isl_space_free(space);
return NULL;
}
@ -2699,21 +2703,7 @@ __isl_give isl_set *isl_set_add_basic_set(__isl_take isl_set *set,
__isl_null isl_set *isl_set_free(__isl_take isl_set *set)
{
int i;
if (!set)
return NULL;
if (--set->ref > 0)
return NULL;
isl_ctx_deref(set->ctx);
for (i = 0; i < set->n; ++i)
isl_basic_set_free(set->p[i]);
isl_space_free(set->dim);
free(set);
return NULL;
return isl_map_free(set);
}
void isl_set_print_internal(struct isl_set *set, FILE *out, int indent)
@ -4493,7 +4483,7 @@ static int add_upper_div_constraint(__isl_keep isl_basic_map *bmap,
/* For a div d = floor(f/m), add the constraint
*
* -(f-(n-1)) + m d >= 0
* -(f-(m-1)) + m d >= 0
*/
static int add_lower_div_constraint(__isl_keep isl_basic_map *bmap,
unsigned pos, isl_int *div)
@ -4515,11 +4505,11 @@ static int add_lower_div_constraint(__isl_keep isl_basic_map *bmap,
/* For a div d = floor(f/m), add the constraints
*
* f - m d >= 0
* -(f-(n-1)) + m d >= 0
* -(f-(m-1)) + m d >= 0
*
* Note that the second constraint is the negation of
*
* f - m d >= n
* f - m d >= m
*/
int isl_basic_map_add_div_constraints_var(__isl_keep isl_basic_map *bmap,
unsigned pos, isl_int *div)
@ -4550,7 +4540,7 @@ int isl_basic_map_add_div_constraints(struct isl_basic_map *bmap, unsigned div)
/* For each known div d = floor(f/m), add the constraints
*
* f - m d >= 0
* -(f-(n-1)) + m d >= 0
* -(f-(m-1)) + m d >= 0
*
* Remove duplicate constraints in case of some these div constraints
* already appear in "bmap".
@ -4581,7 +4571,7 @@ __isl_give isl_basic_map *isl_basic_map_add_known_div_constraints(
*
* if sign < 0 or the constraint
*
* -(f-(n-1)) + m d >= 0
* -(f-(m-1)) + m d >= 0
*
* if sign > 0.
*/
@ -5276,32 +5266,36 @@ __isl_give isl_map *isl_map_from_domain_and_range(__isl_take isl_set *domain,
return isl_map_apply_range(isl_map_reverse(domain), range);
}
__isl_give isl_map *isl_map_alloc_space(__isl_take isl_space *dim, int n,
/* Return a newly allocated isl_map with given space and flags and
* room for "n" basic maps.
* Make sure that all cached information is cleared.
*/
__isl_give isl_map *isl_map_alloc_space(__isl_take isl_space *space, int n,
unsigned flags)
{
struct isl_map *map;
if (!dim)
if (!space)
return NULL;
if (n < 0)
isl_die(dim->ctx, isl_error_internal,
isl_die(space->ctx, isl_error_internal,
"negative number of basic maps", goto error);
map = isl_alloc(dim->ctx, struct isl_map,
map = isl_calloc(space->ctx, struct isl_map,
sizeof(struct isl_map) +
(n - 1) * sizeof(struct isl_basic_map *));
if (!map)
goto error;
map->ctx = dim->ctx;
map->ctx = space->ctx;
isl_ctx_ref(map->ctx);
map->ref = 1;
map->size = n;
map->n = 0;
map->dim = dim;
map->dim = space;
map->flags = flags;
return map;
error:
isl_space_free(dim);
isl_space_free(space);
return NULL;
}
@ -5463,6 +5457,7 @@ __isl_null isl_map *isl_map_free(__isl_take isl_map *map)
if (--map->ref > 0)
return NULL;
clear_caches(map);
isl_ctx_deref(map->ctx);
for (i = 0; i < map->n; ++i)
isl_basic_map_free(map->p[i]);
@ -8213,59 +8208,71 @@ error:
* The expansion itself is given by "exp" while the resulting
* list of divs is given by "div".
*
* Move the integer divisions of "bset" into the right position
* Move the integer divisions of "bmap" into the right position
* according to "exp" and then introduce the additional integer
* divisions, adding div constraints.
* The moving should be done first to avoid moving coefficients
* in the definitions of the extra integer divisions.
*/
__isl_give isl_basic_set *isl_basic_set_expand_divs(
__isl_take isl_basic_set *bset, __isl_take isl_mat *div, int *exp)
__isl_give isl_basic_map *isl_basic_map_expand_divs(
__isl_take isl_basic_set *bmap, __isl_take isl_mat *div, int *exp)
{
int i, j;
int n_div;
bset = isl_basic_set_cow(bset);
if (!bset || !div)
bmap = isl_basic_map_cow(bmap);
if (!bmap || !div)
goto error;
if (div->n_row < bset->n_div)
if (div->n_row < bmap->n_div)
isl_die(isl_mat_get_ctx(div), isl_error_invalid,
"not an expansion", goto error);
n_div = bset->n_div;
bset = isl_basic_map_extend_space(bset, isl_space_copy(bset->dim),
n_div = bmap->n_div;
bmap = isl_basic_map_extend_space(bmap, isl_space_copy(bmap->dim),
div->n_row - n_div, 0,
2 * (div->n_row - n_div));
for (i = n_div; i < div->n_row; ++i)
if (isl_basic_set_alloc_div(bset) < 0)
if (isl_basic_map_alloc_div(bmap) < 0)
goto error;
for (j = n_div - 1; j >= 0; --j) {
if (exp[j] == j)
break;
isl_basic_map_swap_div(bset, j, exp[j]);
isl_basic_map_swap_div(bmap, j, exp[j]);
}
j = 0;
for (i = 0; i < div->n_row; ++i) {
if (j < n_div && exp[j] == i) {
j++;
} else {
isl_seq_cpy(bset->div[i], div->row[i], div->n_col);
if (isl_basic_map_add_div_constraints(bset, i) < 0)
isl_seq_cpy(bmap->div[i], div->row[i], div->n_col);
if (!isl_basic_map_div_is_known(bmap, i))
continue;
if (isl_basic_map_add_div_constraints(bmap, i) < 0)
goto error;
}
}
isl_mat_free(div);
return bset;
return bmap;
error:
isl_basic_set_free(bset);
isl_basic_map_free(bmap);
isl_mat_free(div);
return NULL;
}
/* Apply the expansion computed by isl_merge_divs.
* The expansion itself is given by "exp" while the resulting
* list of divs is given by "div".
*/
__isl_give isl_basic_set *isl_basic_set_expand_divs(
__isl_take isl_basic_set *bset, __isl_take isl_mat *div, int *exp)
{
return isl_basic_map_expand_divs(bset, div, exp);
}
/* Look for a div in dst that corresponds to the div "div" in src.
* The divs before "div" in src and dst are assumed to be the same.
*

View File

@ -88,6 +88,10 @@ struct isl_basic_map {
* Currently, the isl_set structure is identical to the isl_map structure
* and the library depends on this correspondence internally.
* However, users should not depend on this correspondence.
*
* "cached_simple_hull" contains copies of the unshifted and shifted
* simple hulls, if they have already been computed. Otherwise,
* the entries are NULL.
*/
struct isl_map {
int ref;
@ -96,6 +100,7 @@ struct isl_map {
#define ISL_SET_DISJOINT (1 << 0)
#define ISL_SET_NORMALIZED (1 << 1)
unsigned flags;
isl_basic_map *cached_simple_hull[2];
struct isl_ctx *ctx;
@ -412,6 +417,8 @@ __isl_give isl_basic_map *isl_basic_map_from_local_space(
__isl_take isl_local_space *ls);
__isl_give isl_basic_set *isl_basic_set_expand_divs(
__isl_take isl_basic_set *bset, __isl_take isl_mat *div, int *exp);
__isl_give isl_basic_map *isl_basic_map_expand_divs(
__isl_take isl_basic_set *bmap, __isl_take isl_mat *div, int *exp);
__isl_give isl_basic_map *isl_basic_map_mark_div_unknown(
__isl_take isl_basic_map *bmap, int div);
@ -461,8 +468,6 @@ int isl_basic_set_plain_dim_is_fixed(__isl_keep isl_basic_set *bset,
__isl_give isl_map *isl_map_plain_gist_basic_map(__isl_take isl_map *map,
__isl_take isl_basic_map *context);
__isl_give isl_basic_map *isl_map_plain_unshifted_simple_hull(
__isl_take isl_map *map);
__isl_give isl_basic_set *isl_basic_set_plain_affine_hull(
__isl_take isl_basic_set *bset);
__isl_give isl_basic_map *isl_basic_map_plain_affine_hull(

View File

@ -4109,12 +4109,60 @@ static int div_find_coalesce(struct isl_basic_map *bmap, int *pairs,
return coalesce;
}
/* Given a lower and an upper bound on div i, construct an inequality
* that when nonnegative ensures that this pair of bounds always allows
* for an integer value of the given div.
/* Internal data structure used during the construction and/or evaluation of
* an inequality that ensures that a pair of bounds always allows
* for an integer value.
*
* "tab" is the tableau in which the inequality is evaluated. It may
* be NULL until it is actually needed.
* "v" contains the inequality coefficients.
* "g", "fl" and "fu" are temporary scalars used during the construction and
* evaluation.
*/
struct test_ineq_data {
struct isl_tab *tab;
isl_vec *v;
isl_int g;
isl_int fl;
isl_int fu;
};
/* Free all the memory allocated by the fields of "data".
*/
static void test_ineq_data_clear(struct test_ineq_data *data)
{
isl_tab_free(data->tab);
isl_vec_free(data->v);
isl_int_clear(data->g);
isl_int_clear(data->fl);
isl_int_clear(data->fu);
}
/* Is the inequality stored in data->v satisfied by "bmap"?
* That is, does it only attain non-negative values?
* data->tab is a tableau corresponding to "bmap".
*/
static isl_bool test_ineq_is_satisfied(__isl_keep isl_basic_map *bmap,
struct test_ineq_data *data)
{
isl_ctx *ctx;
enum isl_lp_result res;
ctx = isl_basic_map_get_ctx(bmap);
if (!data->tab)
data->tab = isl_tab_from_basic_map(bmap, 0);
res = isl_tab_min(data->tab, data->v->el, ctx->one, &data->g, NULL, 0);
if (res == isl_lp_error)
return isl_bool_error;
return res == isl_lp_ok && isl_int_is_nonneg(data->g);
}
/* Given a lower and an upper bound on div i, do they always allow
* for an integer value of the given div?
* Determine this property by constructing an inequality
* such that the property is guaranteed when the inequality is nonnegative.
* The lower bound is inequality l, while the upper bound is inequality u.
* The constructed inequality is stored in ineq.
* g, fl, fu are temporary scalars.
* The constructed inequality is stored in data->v.
*
* Let the upper bound be
*
@ -4138,62 +4186,107 @@ static int div_find_coalesce(struct isl_basic_map *bmap, int *pairs,
* That is, the test constraint is
*
* f_l e_u + f_u e_l + f_l - 1 + f_u - 1 + 1 >= f_u f_l g
*
* or
*
* f_l e_u + f_u e_l + f_l - 1 + f_u - 1 + 1 - f_u f_l g >= 0
*
* If the coefficients of f_l e_u + f_u e_l have a common divisor g',
* then the constraint can be scaled down by a factor g',
* with the constant term replaced by
* floor((f_l e_{u,0} + f_u e_{l,0} + f_l - 1 + f_u - 1 + 1 - f_u f_l g)/g').
* Note that the result of applying Fourier-Motzkin to this pair
* of constraints is
*
* f_l e_u + f_u e_l >= 0
*
* If the constant term of the scaled down version of this constraint,
* i.e., floor((f_l e_{u,0} + f_u e_{l,0})/g') is equal to the constant
* term of the scaled down test constraint, then the test constraint
* is known to hold and no explicit evaluation is required.
* This is essentially the Omega test.
*
* If the test constraint consists of only a constant term, then
* it is sufficient to look at the sign of this constant term.
*/
static void construct_test_ineq(struct isl_basic_map *bmap, int i,
int l, int u, isl_int *ineq, isl_int *g, isl_int *fl, isl_int *fu)
static isl_bool int_between_bounds(__isl_keep isl_basic_map *bmap, int i,
int l, int u, struct test_ineq_data *data)
{
unsigned dim;
dim = isl_space_dim(bmap->dim, isl_dim_all);
unsigned offset, n_div;
offset = isl_basic_map_offset(bmap, isl_dim_div);
n_div = isl_basic_map_dim(bmap, isl_dim_div);
isl_int_gcd(*g, bmap->ineq[l][1 + dim + i], bmap->ineq[u][1 + dim + i]);
isl_int_divexact(*fl, bmap->ineq[l][1 + dim + i], *g);
isl_int_divexact(*fu, bmap->ineq[u][1 + dim + i], *g);
isl_int_neg(*fu, *fu);
isl_seq_combine(ineq, *fl, bmap->ineq[u], *fu, bmap->ineq[l],
1 + dim + bmap->n_div);
isl_int_add(ineq[0], ineq[0], *fl);
isl_int_add(ineq[0], ineq[0], *fu);
isl_int_sub_ui(ineq[0], ineq[0], 1);
isl_int_mul(*g, *g, *fl);
isl_int_mul(*g, *g, *fu);
isl_int_sub(ineq[0], ineq[0], *g);
isl_int_gcd(data->g,
bmap->ineq[l][offset + i], bmap->ineq[u][offset + i]);
isl_int_divexact(data->fl, bmap->ineq[l][offset + i], data->g);
isl_int_divexact(data->fu, bmap->ineq[u][offset + i], data->g);
isl_int_neg(data->fu, data->fu);
isl_seq_combine(data->v->el, data->fl, bmap->ineq[u],
data->fu, bmap->ineq[l], offset + n_div);
isl_int_mul(data->g, data->g, data->fl);
isl_int_mul(data->g, data->g, data->fu);
isl_int_sub(data->g, data->g, data->fl);
isl_int_sub(data->g, data->g, data->fu);
isl_int_add_ui(data->g, data->g, 1);
isl_int_sub(data->fl, data->v->el[0], data->g);
isl_seq_gcd(data->v->el + 1, offset - 1 + n_div, &data->g);
if (isl_int_is_zero(data->g))
return isl_int_is_nonneg(data->fl);
if (isl_int_is_one(data->g)) {
isl_int_set(data->v->el[0], data->fl);
return test_ineq_is_satisfied(bmap, data);
}
isl_int_fdiv_q(data->fl, data->fl, data->g);
isl_int_fdiv_q(data->v->el[0], data->v->el[0], data->g);
if (isl_int_eq(data->fl, data->v->el[0]))
return isl_bool_true;
isl_int_set(data->v->el[0], data->fl);
isl_seq_scale_down(data->v->el + 1, data->v->el + 1, data->g,
offset - 1 + n_div);
return test_ineq_is_satisfied(bmap, data);
}
/* Remove more kinds of divs that are not strictly needed.
* In particular, if all pairs of lower and upper bounds on a div
* are such that they allow at least one integer value of the div,
* the we can eliminate the div using Fourier-Motzkin without
* then we can eliminate the div using Fourier-Motzkin without
* introducing any spurious solutions.
*
* If at least one of the two constraints has a unit coefficient for the div,
* then the presence of such a value is guaranteed so there is no need to check.
* In particular, the value attained by the bound with unit coefficient
* can serve as this intermediate value.
*/
static struct isl_basic_map *drop_more_redundant_divs(
struct isl_basic_map *bmap, int *pairs, int n)
{
struct isl_tab *tab = NULL;
struct isl_vec *vec = NULL;
unsigned dim;
isl_ctx *ctx;
struct test_ineq_data data = { NULL, NULL };
unsigned off, n_div;
int remove = -1;
isl_int g, fl, fu;
isl_int_init(g);
isl_int_init(fl);
isl_int_init(fu);
isl_int_init(data.g);
isl_int_init(data.fl);
isl_int_init(data.fu);
if (!bmap)
goto error;
dim = isl_space_dim(bmap->dim, isl_dim_all);
vec = isl_vec_alloc(bmap->ctx, 1 + dim + bmap->n_div);
if (!vec)
ctx = isl_basic_map_get_ctx(bmap);
off = isl_basic_map_offset(bmap, isl_dim_div);
n_div = isl_basic_map_dim(bmap, isl_dim_div);
data.v = isl_vec_alloc(ctx, off + n_div);
if (!data.v)
goto error;
tab = isl_tab_from_basic_map(bmap, 0);
while (n > 0) {
int i, l, u;
int best = -1;
enum isl_lp_result res;
isl_bool has_int;
for (i = 0; i < bmap->n_div; ++i) {
for (i = 0; i < n_div; ++i) {
if (!pairs[i])
continue;
if (best >= 0 && pairs[best] <= pairs[i])
@ -4203,27 +4296,31 @@ static struct isl_basic_map *drop_more_redundant_divs(
i = best;
for (l = 0; l < bmap->n_ineq; ++l) {
if (!isl_int_is_pos(bmap->ineq[l][1 + dim + i]))
if (!isl_int_is_pos(bmap->ineq[l][off + i]))
continue;
if (isl_int_is_one(bmap->ineq[l][off + i]))
continue;
for (u = 0; u < bmap->n_ineq; ++u) {
if (!isl_int_is_neg(bmap->ineq[u][1 + dim + i]))
if (!isl_int_is_neg(bmap->ineq[u][off + i]))
continue;
construct_test_ineq(bmap, i, l, u,
vec->el, &g, &fl, &fu);
res = isl_tab_min(tab, vec->el,
bmap->ctx->one, &g, NULL, 0);
if (res == isl_lp_error)
if (isl_int_is_negone(bmap->ineq[u][off + i]))
continue;
has_int = int_between_bounds(bmap, i, l, u,
&data);
if (has_int < 0)
goto error;
if (res == isl_lp_empty) {
bmap = isl_basic_map_set_to_empty(bmap);
if (data.tab && data.tab->empty)
break;
}
if (res != isl_lp_ok || isl_int_is_neg(g))
if (!has_int)
break;
}
if (u < bmap->n_ineq)
break;
}
if (data.tab && data.tab->empty) {
bmap = isl_basic_map_set_to_empty(bmap);
break;
}
if (l == bmap->n_ineq) {
remove = i;
break;
@ -4232,12 +4329,7 @@ static struct isl_basic_map *drop_more_redundant_divs(
--n;
}
isl_tab_free(tab);
isl_vec_free(vec);
isl_int_clear(g);
isl_int_clear(fl);
isl_int_clear(fu);
test_ineq_data_clear(&data);
free(pairs);
@ -4249,11 +4341,7 @@ static struct isl_basic_map *drop_more_redundant_divs(
error:
free(pairs);
isl_basic_map_free(bmap);
isl_tab_free(tab);
isl_vec_free(vec);
isl_int_clear(g);
isl_int_clear(fl);
isl_int_clear(fu);
test_ineq_data_clear(&data);
return NULL;
}
@ -4516,6 +4604,27 @@ static __isl_give isl_basic_map *set_eq_and_try_again(
return drop_redundant_divs_again(bmap, pairs, 1);
}
/* Drop the integer division at position "div", along with the two
* inequality constraints "ineq1" and "ineq2" in which it appears
* from "bmap" and then try and drop redundant divs again,
* freeing the temporary data structure "pairs" that was associated
* to the old version of "bmap".
*/
static __isl_give isl_basic_map *drop_div_and_try_again(
__isl_take isl_basic_map *bmap, int div, int ineq1, int ineq2,
__isl_take int *pairs)
{
if (ineq1 > ineq2) {
isl_basic_map_drop_inequality(bmap, ineq1);
isl_basic_map_drop_inequality(bmap, ineq2);
} else {
isl_basic_map_drop_inequality(bmap, ineq2);
isl_basic_map_drop_inequality(bmap, ineq1);
}
bmap = isl_basic_map_drop_div(bmap, div);
return drop_redundant_divs_again(bmap, pairs, 0);
}
/* Given two inequality constraints
*
* f(x) + n d + c >= 0, (ineq)
@ -4794,25 +4903,15 @@ static __isl_give isl_basic_map *isl_basic_map_drop_redundant_divs_ineq(
bmap->ineq[last_pos][0], 1);
isl_int_sub(bmap->ineq[last_pos][0],
bmap->ineq[last_pos][0], bmap->ineq[last_neg][0]);
if (!redundant) {
if (defined ||
!ok_to_set_div_from_bound(bmap, i, last_pos)) {
pairs[i] = 0;
--n;
continue;
}
if (redundant)
return drop_div_and_try_again(bmap, i,
last_pos, last_neg, pairs);
if (!defined && ok_to_set_div_from_bound(bmap, i, last_pos)) {
bmap = set_div_from_lower_bound(bmap, i, last_pos);
return drop_redundant_divs_again(bmap, pairs, 1);
}
if (last_pos > last_neg) {
isl_basic_map_drop_inequality(bmap, last_pos);
isl_basic_map_drop_inequality(bmap, last_neg);
} else {
isl_basic_map_drop_inequality(bmap, last_neg);
isl_basic_map_drop_inequality(bmap, last_pos);
}
bmap = isl_basic_map_drop_div(bmap, i);
return drop_redundant_divs_again(bmap, pairs, 0);
pairs[i] = 0;
--n;
}
if (n > 0)

View File

@ -229,6 +229,11 @@ ISL_CTX_SET_CHOICE_DEF(isl_options, struct isl_options, isl_options_args,
ISL_CTX_GET_CHOICE_DEF(isl_options, struct isl_options, isl_options_args,
on_error)
ISL_CTX_SET_BOOL_DEF(isl_options, struct isl_options, isl_options_args,
pip_symmetry)
ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args,
pip_symmetry)
ISL_CTX_SET_BOOL_DEF(isl_options, struct isl_options, isl_options_args,
coalesce_bounded_wrapping)
ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args,

View File

@ -238,7 +238,7 @@ static enum isl_dim_type pos2type(__isl_keep isl_space *dim, unsigned *pos)
* be printed?
* In particular, are the div expressions available and does the selected
* variable have a known explicit representation?
* Furthermore, the Omega format does not allow and div expressions
* Furthermore, the Omega format does not allow any div expressions
* to be printed.
*/
static isl_bool can_print_div_expr(__isl_keep isl_printer *p,
@ -634,6 +634,7 @@ static __isl_give isl_printer *print_constraints(__isl_keep isl_basic_map *bmap,
if (l < 0)
continue;
if (!p->dump && l >= o_div &&
can_print_div_expr(p, div, l - o_div) &&
isl_basic_map_is_div_constraint(bmap, bmap->ineq[i],
l - o_div))
continue;
@ -750,6 +751,8 @@ static __isl_give isl_printer *print_disjunct(__isl_keep isl_basic_map *bmap,
isl_mat *div;
isl_bool exists;
if (!p)
return NULL;
div = isl_basic_map_get_divs(bmap);
if (p->dump)
exists = bmap->n_div > 0;
@ -931,6 +934,8 @@ static __isl_give isl_printer *print_disjuncts(__isl_keep isl_map *map,
return p;
p = isl_printer_print_str(p, s_such_that[latex]);
if (!p)
return NULL;
if (!p->dump && map->n >= 2) {
isl_basic_map *hull;
@ -1151,7 +1156,7 @@ static __isl_give isl_printer *print_dim_eq(__isl_take isl_printer *p,
p = isl_printer_print_str(p, " = ");
}
pos += 1 + isl_space_offset(data->space, data->type);
p = print_affine_of_len(eq->dim, NULL, p, eq->eq[j], pos);
p = print_affine_of_len(data->space, NULL, p, eq->eq[j], pos);
} else {
p = print_name(data->space, p, data->type, pos, data->latex);
}

View File

@ -5900,7 +5900,7 @@ static isl_bool has_singular_src_or_dst(__isl_keep isl_map *map, int pos)
* in the remaining dimensions, but only if either the source or
* the destination has a fixed value in that direction.
* This allows a statement that produces values that are used by
* several instance of another statement to be merged with that
* several instances of another statement to be merged with that
* other statement.
* However, merging such clusters will introduce an inherently
* large proximity distance inside the merged cluster, meaning

View File

@ -2569,9 +2569,9 @@ struct isl_basic_map *isl_basic_map_update_from_tab(struct isl_basic_map *bmap,
isl_basic_map_drop_inequality(bmap, i);
}
if (bmap->n_eq != n_eq)
isl_basic_map_gauss(bmap, NULL);
bmap = isl_basic_map_gauss(bmap, NULL);
if (!tab->rational &&
!bmap->sample && isl_tab_sample_is_integer(tab))
bmap && !bmap->sample && isl_tab_sample_is_integer(tab))
bmap->sample = extract_integer_sample(tab);
return bmap;
}

View File

@ -113,7 +113,7 @@ struct isl_tab_undo {
* However, the basic operations do not ensure that all dead columns
* or all redundant rows are detected.
* isl_tab_detect_implicit_equalities and isl_tab_detect_redundant can be used
* to perform and exhaustive search for dead columns and redundant rows.
* to perform an exhaustive search for dead columns and redundant rows.
*
* The samples matrix contains "n_sample" integer points that have at some
* point been elements satisfying the tableau. The first "n_outside"

View File

@ -2158,7 +2158,7 @@ error:
* Given two rows in the main tableau, if the inequality corresponding
* to the first row is redundant with respect to that of the second row
* in the current tableau, then it is better to split on the second row,
* since in the positive part, both row will be positive.
* since in the positive part, both rows will be positive.
* (In the negative part a pivot will have to be performed and just about
* anything can happen to the sign of the other row.)
*
@ -3692,6 +3692,21 @@ error:
sol->error = 1;
}
/* Reset all row variables that are marked to have a sign that may
* be both positive and negative to have an unknown sign.
*/
static void reset_any_to_unknown(struct isl_tab *tab)
{
int row;
for (row = tab->n_redundant; row < tab->n_row; ++row) {
if (!isl_tab_var_from_row(tab, row)->is_nonneg)
continue;
if (tab->row_sign[row] == isl_tab_row_any)
tab->row_sign[row] = isl_tab_row_unknown;
}
}
/* Compute the lexicographic minimum of the set represented by the main
* tableau "tab" within the context "sol->context_tab".
* On entry the sample value of the main tableau is lexicographically
@ -3834,12 +3849,7 @@ static void find_solutions(struct isl_sol *sol, struct isl_tab *tab)
if (!ineq)
goto error;
is_strict(ineq);
for (row = tab->n_redundant; row < tab->n_row; ++row) {
if (!isl_tab_var_from_row(tab, row)->is_nonneg)
continue;
if (tab->row_sign[row] == isl_tab_row_any)
tab->row_sign[row] = isl_tab_row_unknown;
}
reset_any_to_unknown(tab);
tab->row_sign[split] = isl_tab_row_pos;
sol_inc_level(sol);
find_in_pos(sol, tab, ineq->el);

View File

@ -632,9 +632,40 @@ static int test_val(isl_ctx *ctx)
return 0;
}
/* Sets described using existentially quantified variables that
* can also be described without.
*/
static const char *elimination_tests[] = {
"{ [i,j] : 2 * [i/2] + 3 * [j/4] <= 10 and 2 i = j }",
"{ [m, w] : exists a : w - 2m - 5 <= 3a <= m - 2w }",
"{ [m, w] : exists a : w >= 0 and a < m and -1 + w <= a <= 2m - w }",
};
/* Check that redundant existentially quantified variables are
* getting removed.
*/
static int test_elimination(isl_ctx *ctx)
{
int i;
unsigned n;
isl_basic_set *bset;
for (i = 0; i < ARRAY_SIZE(elimination_tests); ++i) {
bset = isl_basic_set_read_from_str(ctx, elimination_tests[i]);
n = isl_basic_set_dim(bset, isl_dim_div);
isl_basic_set_free(bset);
if (!bset)
return -1;
if (n != 0)
isl_die(ctx, isl_error_unknown,
"expecting no existentials", return -1);
}
return 0;
}
static int test_div(isl_ctx *ctx)
{
unsigned n;
const char *str;
int empty;
isl_int v;
@ -941,15 +972,8 @@ static int test_div(isl_ctx *ctx)
if (!set)
return -1;
str = "{ [i,j] : 2*[i/2] + 3 * [j/4] <= 10 and 2 i = j }";
bset = isl_basic_set_read_from_str(ctx, str);
n = isl_basic_set_dim(bset, isl_dim_div);
isl_basic_set_free(bset);
if (!bset)
if (test_elimination(ctx) < 0)
return -1;
if (n != 0)
isl_die(ctx, isl_error_unknown,
"expecting no existentials", return -1);
str = "{ [i,j,k] : 3 + i + 2j >= 0 and 2 * [(i+2j)/4] <= k }";
set = isl_set_read_from_str(ctx, str);
@ -1813,6 +1837,8 @@ struct {
"2*floor((c)/2) = c and 0 <= a <= 192;"
"[224, 224, b, c] : 2*floor((b)/2) = b and 2*floor((c)/2) = c }"
},
{ 1, "[n] -> { [a,b] : (exists e : 1 <= a <= 7e and 9e <= b <= n) or "
"(0 <= a <= b <= n) }" },
};
/* A specialized coalescing test case that would result
@ -4849,6 +4875,40 @@ static int test_eval(isl_ctx *ctx)
return 0;
}
/* Descriptions of sets that are tested for reparsing after printing.
*/
const char *output_tests[] = {
"{ [1, y] : 0 <= y <= 1; [x, -x] : 0 <= x <= 1 }",
};
/* Check that printing a set and reparsing a set from the printed output
* results in the same set.
*/
static int test_output_set(isl_ctx *ctx)
{
int i;
char *str;
isl_set *set1, *set2;
isl_bool equal;
for (i = 0; i < ARRAY_SIZE(output_tests); ++i) {
set1 = isl_set_read_from_str(ctx, output_tests[i]);
str = isl_set_to_str(set1);
set2 = isl_set_read_from_str(ctx, str);
free(str);
equal = isl_set_is_equal(set1, set2);
isl_set_free(set1);
isl_set_free(set2);
if (equal < 0)
return -1;
if (!equal)
isl_die(ctx, isl_error_unknown,
"parsed output not the same", return -1);
}
return 0;
}
int test_output(isl_ctx *ctx)
{
char *s;
@ -4857,6 +4917,9 @@ int test_output(isl_ctx *ctx)
isl_printer *p;
int equal;
if (test_output_set(ctx) < 0)
return -1;
str = "[x] -> { [1] : x % 4 <= 2; [2] : x = 3 }";
pa = isl_pw_aff_read_from_str(ctx, str);

View File

@ -51,6 +51,7 @@ struct isl_vec *isl_vec_alloc(struct isl_ctx *ctx, unsigned size)
return vec;
error:
isl_blk_free(ctx, vec->block);
free(vec);
return NULL;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,14 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
# Foundation, Inc.
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 8 ltoptions.m4
# serial 7 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@ -29,7 +29,7 @@ m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option '$2'])])[]dnl
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
@ -75,15 +75,13 @@ m4_if([$1],[LT_INIT],[
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
_LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
[_LT_WITH_AIX_SONAME([aix])])
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
@ -114,7 +112,7 @@ AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'dlopen' option into LT_INIT's first parameter.])
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
@ -150,7 +148,7 @@ AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'win32-dll' option into LT_INIT's first parameter.])
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
@ -159,9 +157,9 @@ dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the 'shared' and
# 'disable-shared' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
@ -174,14 +172,14 @@ AC_ARG_ENABLE([shared],
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS=$lt_save_ifs
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS=$lt_save_ifs
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
@ -213,9 +211,9 @@ dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the 'static' and
# 'disable-static' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
@ -228,14 +226,14 @@ AC_ARG_ENABLE([static],
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS=$lt_save_ifs
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS=$lt_save_ifs
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
@ -267,9 +265,9 @@ dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the 'fast-install'
# and 'disable-fast-install' LT_INIT options.
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
@ -282,14 +280,14 @@ AC_ARG_ENABLE([fast-install],
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS=$lt_save_ifs
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS=$lt_save_ifs
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
@ -306,14 +304,14 @@ AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the 'fast-install' option into LT_INIT's first parameter.])
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the 'disable-fast-install' option into LT_INIT's first parameter.])
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
@ -321,64 +319,11 @@ dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_AIX_SONAME([DEFAULT])
# ----------------------------------
# implement the --with-aix-soname flag, and support the `aix-soname=aix'
# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
m4_define([_LT_WITH_AIX_SONAME],
[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[[5-9]]*,yes)
AC_MSG_CHECKING([which variant of shared library versioning to provide])
AC_ARG_WITH([aix-soname],
[AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
[shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
[case $withval in
aix|svr4|both)
;;
*)
AC_MSG_ERROR([Unknown argument to --with-aix-soname])
;;
esac
lt_cv_with_aix_soname=$with_aix_soname],
[AC_CACHE_VAL([lt_cv_with_aix_soname],
[lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
with_aix_soname=$lt_cv_with_aix_soname])
AC_MSG_RESULT([$with_aix_soname])
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
# based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
# and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
# Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
# the AIX toolchain works better with OBJECT_MODE set (default 32).
if test 64 = "${OBJECT_MODE-32}"; then
shared_archive_member_spec=shr_64
else
shared_archive_member_spec=shr
fi
fi
;;
*)
with_aix_soname=aix
;;
esac
_LT_DECL([], [shared_archive_member_spec], [0],
[Shared archive member basename, for filename based shared library versioning on AIX])dnl
])# _LT_WITH_AIX_SONAME
LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
@ -389,17 +334,19 @@ m4_define([_LT_WITH_PIC],
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for lt_pkg in $withval; do
IFS=$lt_save_ifs
IFS="$lt_save_ifs"
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS=$lt_save_ifs
IFS="$lt_save_ifs"
;;
esac],
[pic_mode=m4_default([$1], [default])])
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
@ -412,7 +359,7 @@ AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the 'pic-only' option into LT_INIT's first parameter.])
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:

View File

@ -1,7 +1,6 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
# Foundation, Inc.
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
@ -34,7 +33,7 @@ m4_define([_lt_join],
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59, which quotes differently.
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
@ -45,7 +44,7 @@ m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different

View File

@ -1,6 +1,6 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
@ -9,15 +9,15 @@
# @configure_input@
# serial 4179 ltversion.m4
# serial 3337 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.6])
m4_define([LT_PACKAGE_REVISION], [2.4.6])
m4_define([LT_PACKAGE_VERSION], [2.4.2])
m4_define([LT_PACKAGE_REVISION], [1.3337])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.6'
macro_revision='2.4.6'
[macro_version='2.4.2'
macro_revision='1.3337'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

View File

@ -1,7 +1,6 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
# Foundation, Inc.
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
@ -12,7 +11,7 @@
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
@ -26,7 +25,7 @@
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until

View File

@ -3,6 +3,7 @@ for (int c0 = 0; c0 <= 64; c0 += 1) {
sync();
} else if (c0 >= 1) {
sync();
} else
} else {
sync();
}
}

View File

@ -5,7 +5,8 @@ for (int c0 = 1; c0 <= floord(Ny, 2) + 2; c0 += 1)
S1(c0 - c1, c1, 2 * c0 - 2 * c1, -2 * c0 + 4 * c1, c2);
S2(c0 - c1, c1, 2 * c0 - 2 * c1, -2 * c0 + 4 * c1 - 1, c2);
}
} else
} else {
for (int c2 = 1; c2 <= 2; c2 += 1)
S2((-Ny + 2 * c0) / 4, (Ny + 2 * c0) / 4, (-Ny / 2) + c0, Ny - 1, c2);
}
}

View File

@ -1,6 +1,7 @@
if (M >= 11) {
for (int c0 = -100; c0 <= 0; c0 += 1)
S1(-c0);
} else
} else {
for (int c0 = 0; c0 <= 100; c0 += 1)
S1(c0);
}

View File

@ -16,8 +16,9 @@
}
if (32 * c2 + 31 >= N) {
S6(c0, c1, c2, N - 1);
} else
} else {
S6(c0, c1, c2, 32 * c2 + 31);
}
}
S8();
}

View File

@ -46,8 +46,9 @@
}
if (n == 2 && c0 == 4)
S1(3);
} else
} else {
S1(1);
}
if (c0 % 2 == 0)
S3(c0 / 2);
for (int c1 = max(1, -n + c0); c1 < (c0 + 1) / 2; c1 += 1)

View File

@ -23,9 +23,10 @@
S6(2, n);
S1(n + 1);
}
} else if (c0 + 2 >= 2 * n)
} else if (c0 + 2 >= 2 * n) {
for (int c2 = 1; c2 < -n + c0; c2 += 1)
S5(-n + c0, n, c2);
}
if (c0 >= n + 3) {
S6(-n + c0, n);
S1(c0 - 1);
@ -39,8 +40,9 @@
if (n + 1 >= c0)
S6(1, c0 - 1);
}
} else
} else {
S1(1);
}
if (c0 % 2 == 0)
S3(c0 / 2);
for (int c1 = max(1, -n + c0); c1 < (c0 + 1) / 2; c1 += 1)

View File

@ -8,8 +8,9 @@
S1(c0, c0 / 3, c0 / 3, c0 / 3);
} else if ((c0 - 1) % 3 == 0) {
S2(c0, (c0 - 1) / 3, (c0 + 2) / 3, (c0 - 1) / 3);
} else
} else {
S3(c0, (c0 - 2) / 3, (c0 + 1) / 3, (c0 + 1) / 3);
}
S4(c0, c0 / 3, (c0 - 1) / 3 + 1, c0 - (c0 - 1) / 3 - c0 / 3 - 1);
}
}

View File

@ -32,16 +32,18 @@ for (int c0 = 0; c0 < m; c0 += 32)
if (c0 + 31 >= m && c1 + 31 >= n && c2 == c0) {
for (int c5 = m - c0 - 1; c5 <= min(31, 2 * m - c0 - 3); c5 += 1)
S_29(-m + c0 + c5 + 1, m - 1);
} else if (m >= c0 + 32 && c1 + 31 >= n && c2 == c0)
} else if (m >= c0 + 32 && c1 + 31 >= n && c2 == c0) {
S_29(0, c0 + 31);
}
} else if (c1 + 31 >= n && c2 >= m) {
for (int c3 = max(0, (c2 / 2) - c0 + 1); c3 <= min(31, m - c0 - 1); c3 += 1)
for (int c5 = 0; c5 <= min(31, 2 * c0 - c2 + 2 * c3 - 1); c5 += 1)
S_29(-c0 + c2 - c3 + c5, c0 + c3);
} else if (c1 <= -32 && c1 + 31 >= n && m >= c2 + 1)
} else if (c1 <= -32 && c1 + 31 >= n && m >= c2 + 1) {
for (int c3 = max(0, (c2 / 2) - c0 + 1); c3 <= min(31, m - c0 - 1); c3 += 1)
for (int c5 = max(0, c0 - c2 + c3); c5 <= min(31, 2 * c0 - c2 + 2 * c3 - 1); c5 += 1)
S_29(-c0 + c2 - c3 + c5, c0 + c3);
}
if (m == 1 && c0 == 0 && c1 >= 32 && c2 == 0) {
for (int c4 = 0; c4 <= min(31, n - c1 - 1); c4 += 1)
S_19(c1 + c4, 0);

View File

@ -3,6 +3,7 @@ for (int c0 = 0; c0 < Ncl; c0 += 1) {
S(c0, 28);
} else if (c0 == 0) {
S(0, 26);
} else
} else {
S(Ncl - 1, 27);
}
}

View File

@ -2,7 +2,8 @@ if (n >= m + 1) {
for (int c0 = 0; c0 < n; c0 += 1)
for (int c2 = 0; c2 < n; c2 += 1)
A(c0, c2);
} else
} else {
for (int c0 = 0; c0 < n; c0 += 1)
for (int c2 = 0; c2 < n; c2 += 1)
A(c0, c2);
}

View File

@ -2,10 +2,8 @@ for (int c0 = 0; c0 <= 99; c0 += 1) {
if (c0 >= 4 && c0 <= 6) {
for (int c1 = 0; c1 <= 99; c1 += 1)
A(c0, c1);
} else if (c0 >= 7) {
for (int c1 = 0; c1 <= 99; c1 += 1)
A(c0, c1);
} else
} else {
for (int c1 = 0; c1 <= 99; c1 += 1)
A(c0, c1);
}
}

View File

@ -3,21 +3,24 @@
for (int c1 = 0; c1 <= 1; c1 += 1) {
if (c0 % 2 == 0) {
A(c0 / 2, c1);
} else
} else {
B((c0 - 1) / 2, c1);
}
}
for (int c0 = 10; c0 <= 89; c0 += 1)
for (int c1 = 0; c1 <= 1; c1 += 1) {
if (c0 % 2 == 0) {
A(c0 / 2, c1);
} else
} else {
B((c0 - 1) / 2, c1);
}
}
for (int c0 = 90; c0 <= 199; c0 += 1)
for (int c1 = 0; c1 <= 1; c1 += 1) {
if (c0 % 2 == 0) {
A(c0 / 2, c1);
} else
} else {
B((c0 - 1) / 2, c1);
}
}
}

View File

@ -5,23 +5,25 @@
for (int c2 = 0; c2 <= 31; c2 += 1)
for (int c3 = 0; c3 <= 31; c3 += 1)
S_1(c0 + c2, c1 + c3);
} else
} else {
for (int c2 = 0; c2 <= 31; c2 += 1) {
for (int c3 = 0; c3 < n - c1; c3 += 1)
S_1(c0 + c2, c1 + c3);
S_2(c0 + c2);
}
}
}
for (int c1 = 0; c1 < n; c1 += 32) {
if (n >= c1 + 32) {
for (int c2 = 0; c2 < (n + 32) % 32; c2 += 1)
for (int c3 = 0; c3 <= 31; c3 += 1)
S_1(-((n + 32) % 32) + n + c2, c1 + c3);
} else
} else {
for (int c2 = 0; c2 < n - c1; c2 += 1) {
for (int c3 = 0; c3 < n - c1; c3 += 1)
S_1(c1 + c2, c1 + c3);
S_2(c1 + c2);
}
}
}
}

View File

@ -6,7 +6,7 @@ for (int c0 = 0; c0 < n - 1; c0 += 32)
for (int c4 = c1; c4 <= min(n - 1, c1 + 31); c4 += 1)
for (int c5 = max(c2, c3 + 1); c5 <= min(n - 1, c2 + 31); c5 += 1)
S_6(c3, c4, c5);
} else
} else {
for (int c3 = c0; c3 <= min(min(n - 2, c0 + 31), c2 + 30); c3 += 1) {
for (int c5 = max(c2, c3 + 1); c5 <= min(n - 1, c2 + 31); c5 += 1)
S_2(c3, c5);
@ -14,4 +14,5 @@ for (int c0 = 0; c0 < n - 1; c0 += 32)
for (int c5 = max(c2, c3 + 1); c5 <= min(n - 1, c2 + 31); c5 += 1)
S_6(c3, c4, c5);
}
}
}

View File

@ -9,7 +9,8 @@ for (int c0 = 1; c0 <= 8; c0 += 1) {
}
for (int c1 = max(5, c0 - 1); c1 <= 7; c1 += 1)
s0(c0, c1);
} else
} else {
for (int c1 = 0; c1 <= 7; c1 += 1)
s0(1, c1);
}
}

View File

@ -6,7 +6,8 @@ if (m <= 1) {
for (int c0 = 1; c0 <= n; c0 += 1)
for (int c1 = 1; c1 <= n; c1 += 1)
s0(c0, c1);
} else
} else {
for (int c0 = 1; c0 <= n; c0 += 1)
for (int c1 = 1; c1 <= n; c1 += 1)
s1(c0, c1);
}

View File

@ -5,7 +5,8 @@ for (int c0 = 1; c0 <= 100; c0 += 1) {
s1(c0, c1);
s2(c0, c1);
}
} else
} else {
for (int c1 = 1; c1 <= 100; c1 += 1)
s2(c0, c1);
}
}

View File

@ -6,7 +6,8 @@ if (n >= 2) {
s2(c0, c1);
}
}
} else
} else {
for (int c0 = 1; c0 <= 100; c0 += 1)
for (int c1 = 1; c1 <= 100; c1 += 1)
s2(c0, c1);
}

View File

@ -5,9 +5,10 @@ for (int c0 = 1; c0 <= 100; c0 += 1)
if (c0 >= 61) {
for (int c4 = 1; c4 <= 100; c4 += 1)
s1(c0, c1, c2, c3, c4);
} else
} else {
for (int c4 = 1; c4 <= 100; c4 += 1) {
s1(c0, c1, c2, c3, c4);
s0(c0, c1, c2, c3, c4);
}
}
}

View File

@ -5,10 +5,11 @@ for (int c0 = 1; c0 <= 100; c0 += 1)
for (int c3 = 1; c3 <= 100; c3 += 1)
for (int c4 = 1; c4 <= 100; c4 += 1)
s1(c0, c1, c2, c3, c4);
} else
} else {
for (int c3 = 1; c3 <= 100; c3 += 1)
for (int c4 = 1; c4 <= 100; c4 += 1) {
s1(c0, c1, c2, c3, c4);
s0(c0, c1, c2, c3, c4);
}
}
}

View File

@ -5,11 +5,12 @@ for (int c0 = 1; c0 <= 100; c0 += 1)
for (int c3 = 1; c3 <= 100; c3 += 1)
for (int c4 = 1; c4 <= 100; c4 += 1)
s1(c0, c1, c2, c3, c4);
} else
} else {
for (int c2 = 1; c2 <= 100; c2 += 1)
for (int c3 = 1; c3 <= 100; c3 += 1)
for (int c4 = 1; c4 <= 100; c4 += 1) {
s1(c0, c1, c2, c3, c4);
s0(c0, c1, c2, c3, c4);
}
}
}

View File

@ -5,7 +5,7 @@ for (int c0 = 1; c0 <= 100; c0 += 1) {
for (int c3 = 1; c3 <= 100; c3 += 1)
for (int c4 = 1; c4 <= 100; c4 += 1)
s1(c0, c1, c2, c3, c4);
} else
} else {
for (int c1 = 1; c1 <= 100; c1 += 1)
for (int c2 = 1; c2 <= 100; c2 += 1)
for (int c3 = 1; c3 <= 100; c3 += 1)
@ -13,4 +13,5 @@ for (int c0 = 1; c0 <= 100; c0 += 1) {
s1(c0, c1, c2, c3, c4);
s0(c0, c1, c2, c3, c4);
}
}
}

View File

@ -8,9 +8,10 @@ for (int c0 = 1; c0 <= 100; c0 += 1)
} else if (c0 <= 4) {
for (int c4 = 1; c4 <= 100; c4 += 1)
s1(c0, c1, c2, c3, c4);
} else
} else {
for (int c4 = 1; c4 <= 100; c4 += 1) {
s1(c0, c1, c2, c3, c4);
s0(c0, c1, c2, c3, c4);
}
}
}

View File

@ -9,10 +9,11 @@ for (int c0 = 1; c0 <= 100; c0 += 1)
for (int c3 = 1; c3 <= 100; c3 += 1)
for (int c4 = 1; c4 <= 100; c4 += 1)
s1(c0, c1, c2, c3, c4);
} else
} else {
for (int c3 = 1; c3 <= 100; c3 += 1)
for (int c4 = 1; c4 <= 100; c4 += 1) {
s1(c0, c1, c2, c3, c4);
s0(c0, c1, c2, c3, c4);
}
}
}

View File

@ -10,11 +10,12 @@ for (int c0 = 1; c0 <= 100; c0 += 1)
for (int c3 = 1; c3 <= 100; c3 += 1)
for (int c4 = 1; c4 <= 100; c4 += 1)
s1(c0, c1, c2, c3, c4);
} else
} else {
for (int c2 = 1; c2 <= 100; c2 += 1)
for (int c3 = 1; c3 <= 100; c3 += 1)
for (int c4 = 1; c4 <= 100; c4 += 1) {
s1(c0, c1, c2, c3, c4);
s0(c0, c1, c2, c3, c4);
}
}
}

View File

@ -11,7 +11,7 @@ for (int c0 = 1; c0 <= 100; c0 += 1) {
for (int c3 = 1; c3 <= 100; c3 += 1)
for (int c4 = 1; c4 <= 100; c4 += 1)
s1(c0, c1, c2, c3, c4);
} else
} else {
for (int c1 = 1; c1 <= 100; c1 += 1)
for (int c2 = 1; c2 <= 100; c2 += 1)
for (int c3 = 1; c3 <= 100; c3 += 1)
@ -19,4 +19,5 @@ for (int c0 = 1; c0 <= 100; c0 += 1) {
s1(c0, c1, c2, c3, c4);
s0(c0, c1, c2, c3, c4);
}
}
}

View File

@ -5,8 +5,9 @@ if (ub >= lb)
s0(c0, c1);
if (n >= ub + 1)
s2(c0, c1);
} else if (lb >= c0 + 1)
} else if (lb >= c0 + 1) {
s3(c0, c1, lb, c0, c1);
}
for (int c3 = max(lb, c0); c3 <= ub; c3 += 1)
s1(c0, c1, c3);
}

View File

@ -5,8 +5,9 @@ if (ub >= lb)
s0(c0, c1);
if (n >= ub + 1)
s2(c0, c1);
} else if (lb >= c0 + 1)
} else if (lb >= c0 + 1) {
s3(c0, c1, lb, c0, c1);
}
for (int c3 = max(lb, c0); c3 <= ub; c3 += 1)
s1(c0, c1, c3);
}

View File

@ -5,9 +5,10 @@ for (int c0 = 1; c0 <= 9; c0 += 1) {
} else if (c0 <= 4) {
for (int c1 = 1; c1 <= 9; c1 += 1)
s0(c0, c1);
} else
} else {
for (int c1 = 1; c1 <= 9; c1 += 1) {
s0(5, c1);
s1(5, c1);
}
}
}

View File

@ -8,7 +8,8 @@ for (int c0 = 1; c0 <= 18; c0 += 1) {
} else if (c0 == 1) {
for (int c1 = 1; c1 <= 9; c1 += 1)
s1(c1, 1);
} else if (c0 % 2 == 0)
} else if (c0 % 2 == 0) {
for (int c1 = 1; c1 <= 9; c1 += 1)
s0(c1, c0 / 2);
}
}

View File

@ -5,7 +5,8 @@ for (int c0 = 2; c0 <= 9; c0 += 1) {
s1(c0, c1);
s0(c0, c1);
}
} else
} else {
for (int c1 = 2; c1 <= 9; c1 += 1)
s0(c0, c1);
}
}

View File

@ -4,7 +4,8 @@ for (int c0 = 1; c0 <= 9; c0 += 1) {
s0(c1, c0);
s1(c1, c0);
}
} else
} else {
for (int c1 = 1; c1 <= 9; c1 += 1)
s0(c1, c0);
}
}

View File

@ -4,7 +4,8 @@ for (int c0 = 2; c0 <= 8; c0 += 2) {
s0(c1, c0);
s1(c1, c0);
}
} else
} else {
for (int c1 = 1; c1 <= 9; c1 += 1)
s1(c1, c0);
}
}

View File

@ -5,6 +5,7 @@ if (P1 >= 0 && P1 <= 3 && P2 >= 0 && P2 <= 3)
if ((5 * P2 + 2 * c3) % 9 <= 3) {
if (P1 >= 1 && c0 + 1 == P1 && (5 * P1 + 2 * c2) % 9 <= 2) {
s0(P1 - 1, P2, c2, c3, ((5 * P1 + 2 * c2 + 9) % 9) + 1, -4 * P2 + 2 * c3 - 9 * floord(-4 * P2 + 2 * c3, 9));
} else if (P1 == 0 && c0 == 3 && c2 % 4 == 0)
} else if (P1 == 0 && c0 == 3 && c2 % 4 == 0) {
s0(3, P2, c2, c3, (-c2 / 4) + 3, -4 * P2 + 2 * c3 - 9 * floord(-4 * P2 + 2 * c3, 9));
}
}

View File

@ -8,7 +8,8 @@ for (int c0 = 1; c0 <= 36; c0 += 1) {
s0(c1, c0 / 4);
s1(c1, c0);
}
} else if (c0 % 4 == 0)
} else if (c0 % 4 == 0) {
for (int c1 = 1; c1 <= 9; c1 += 1)
s0(c1, c0 / 4);
}
}

View File

@ -3,9 +3,10 @@
if (c1 == 1) {
s0(1, 1, 1, 0, 0);
s0(1, 1, 1, N - 1, 0);
} else
} else {
for (int c3 = 0; c3 < N; c3 += 1)
s0(1, 0, 1, c3, 0);
}
}
for (int c1 = 0; c1 <= floord(T - 1, 1000); c1 += 1)
for (int c2 = 1000 * c1 + 1; c2 <= min(N + T - 3, N + 1000 * c1 + 997); c2 += 1)

View File

@ -5,8 +5,9 @@
s0(1, -1, c2, 0, 0);
} else if (c2 == 0) {
s0(1, c1, 0, 0, 0);
} else if (c2 + 1 == N)
} else if (c2 + 1 == N) {
s0(1, c1, N - 1, 0, 0);
}
}
for (int c1 = 0; c1 <= floord(T - 1, 500); c1 += 1) {
for (int c3 = -((c1 + 9) / 8) + 2; c3 <= floord(N - 500 * c1 - 3, 4000) + 1; c3 += 1)

View File

@ -6,7 +6,7 @@
for (int c0 = max(a1, a2); c0 <= min(b1, b2); c0 += 1)
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
} else
} else {
for (int c0 = a2; c0 <= b2; c0 += 1) {
if (c0 >= a1 && b1 >= c0)
for (int c1_0 = c1; c1_0 <= min(d1, c2 - 1); c1_0 += 1)
@ -20,6 +20,7 @@
for (int c1_0 = max(c1, d2 + 1); c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
}
}
for (int c0 = max(max(a1, a2), b2 + 1); c0 <= b1; c0 += 1)
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);

View File

@ -6,7 +6,7 @@
for (int c0 = max(a1, a2); c0 <= min(b1, b2); c0 += 1)
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);
} else
} else {
for (int c0 = a2; c0 <= b2; c0 += 1) {
if (a1 >= c0 + 1) {
for (int c1_0 = c2; c1_0 <= d2; c1_0 += 1)
@ -29,6 +29,7 @@
s1(c0, c1_0);
}
}
}
for (int c0 = max(max(a1, a2), b2 + 1); c0 <= b1; c0 += 1)
for (int c1_0 = c1; c1_0 <= d1; c1_0 += 1)
s0(c0, c1_0);

View File

@ -5,7 +5,8 @@ for (int c0 = 1; c0 <= 100; c0 += 1) {
s1(c0, c1);
s2(c0, c1);
}
} else
} else {
for (int c1 = 1; c1 <= 100; c1 += 1)
s2(c0, c1);
}
}

View File

@ -6,7 +6,8 @@ if (n >= 2) {
s2(c0, c1);
}
}
} else
} else {
for (int c0 = 1; c0 <= 100; c0 += 1)
for (int c1 = 1; c1 <= 100; c1 += 1)
s2(c0, c1);
}

View File

@ -6,10 +6,11 @@ for (int c0 = 0; c0 <= 4; c0 += 1) {
if (c0 == 4) {
for (int c6 = 3; c6 <= 5; c6 += 1)
S_0(7, c6);
} else
} else {
for (int c4 = 2 * c0 - 1; c4 <= 2 * c0; c4 += 1)
for (int c6 = -2 * c0 + c4 + 4; c6 <= 2 * c0 - c4 + 4; c6 += 1)
S_0(c4, c6);
}
}
for (int c4 = max(0, 2 * c0 - 1); c4 <= min(7, 2 * c0); c4 += 1)
for (int c6 = -2 * c0 + c4 + 8; c6 <= 8; c6 += 1)
@ -22,8 +23,9 @@ for (int c0 = 0; c0 <= 4; c0 += 1) {
} else if (c0 == 4) {
for (int c2 = 0; c2 <= 1; c2 += 1)
S_0(7, 4 * c2 + 2);
} else
} else {
for (int c2 = 0; c2 <= 1; c2 += 1)
for (int c6 = 4 * c2 + 1; c6 <= 4 * c2 + 3; c6 += 1)
S_0(0, c6);
}
}

View File

@ -4,17 +4,19 @@ for (int c0 = 0; c0 <= 128; c0 += 1) {
for (int c3 = 0; c3 <= 1; c3 += 1)
for (int c5 = c3 + 58; c5 <= -c3 + 61; c5 += 1)
S_0(c3, c5);
} else
} else {
for (int c2 = 1; c2 <= 2; c2 += 1)
for (int c3 = max(4 * c0 - 2, 4 * c0 + 6 * c2 - 12); c3 <= min(4 * c0 + 1, 4 * c0 + 6 * c2 - 7); c3 += 1)
for (int c5 = max(4 * c0 - c3 + 57, -4 * c0 + c3 + 58); c5 <= min(4 * c0 - c3 + 61, -4 * c0 + c3 + 62); c5 += 1)
S_0(c3, c5);
}
for (int c2 = 1; c2 <= 2; c2 += 1)
for (int c3 = max(4 * c0, 4 * c0 + 6 * c2 - 10); c3 <= min(4 * c0 + 3, 4 * c0 + 6 * c2 - 5); c3 += 1)
for (int c5 = max(-4 * c0 + c3 + 59, 4 * c0 - c3 + 62); c5 <= min(-4 * c0 + c3 + 63, 4 * c0 - c3 + 66); c5 += 1)
S_0(c3, c5);
} else
} else {
for (int c3 = 510; c3 <= 511; c3 += 1)
for (int c5 = -c3 + 569; c5 < c3 - 449; c5 += 1)
S_0(c3, c5);
}
}

View File

@ -31,8 +31,9 @@ for (int c0 = 0; c0 <= 1; c0 += 1) {
S_4(c0);
} else if (length >= 32) {
S_4(c0);
} else
} else {
S_4(c0);
}
}
for (int c1 = 32; c1 < length - 1; c1 += 32)
for (int c2 = c1; c2 < length; c2 += 32)

View File

@ -2,17 +2,13 @@
;
; CHECK: #pragma known-parallel reduction (+ : A)
; CHECK-NEXT: for (int c0 = 0; c0 <= 2; c0 += 1) {
; CHECK-NEXT: if (c0 == 2) {
; CHECK-NEXT: #pragma simd reduction (+ : A)
; CHECK-NEXT: for (int c1 = 1; c1 <= 2 * n; c1 += 2)
; CHECK-NEXT: Stmt_S0(2 * n - c1);
; CHECK-NEXT: } else if (c0 == 1) {
; CHECK-NEXT: if (c0 == 1) {
; CHECK-NEXT: #pragma simd
; CHECK-NEXT: for (int c1 = 0; c1 < 2 * n; c1 += 1)
; CHECK-NEXT: Stmt_S1(c1);
; CHECK-NEXT: } else
; CHECK-NEXT: #pragma simd reduction (+ : A)
; CHECK-NEXT: for (int c1 = 2; c1 <= 2 * n; c1 += 2)
; CHECK-NEXT: for (int c1 = (-c0 / 2) + 2; c1 <= 2 * n; c1 += 2)
; CHECK-NEXT: Stmt_S0(2 * n - c1);
; CHECK-NEXT: }
;

View File

@ -2,17 +2,13 @@
;
; CHECK: #pragma known-parallel reduction (+ : A)
; CHECK-NEXT: for (int c0 = 0; c0 <= 2; c0 += 1) {
; CHECK-NEXT: if (c0 == 2) {
; CHECK-NEXT: #pragma simd reduction (+ : A)
; CHECK-NEXT: for (int c1 = 1; c1 < 2 * n; c1 += 2)
; CHECK-NEXT: Stmt_S0(c1);
; CHECK-NEXT: } else if (c0 == 1) {
; CHECK-NEXT: if (c0 == 1) {
; CHECK-NEXT: #pragma simd
; CHECK-NEXT: for (int c1 = 0; c1 < 2 * n; c1 += 1)
; CHECK-NEXT: Stmt_S1(c1);
; CHECK-NEXT: } else
; CHECK-NEXT: #pragma simd reduction (+ : A)
; CHECK-NEXT: for (int c1 = 0; c1 < 2 * n; c1 += 2)
; CHECK-NEXT: for (int c1 = c0 / 2; c1 < 2 * n; c1 += 2)
; CHECK-NEXT: Stmt_S0(c1);
; CHECK-NEXT: }
;

View File

@ -8,10 +8,10 @@
; CHECK-LABEL: polly.cond:
; CHECK-NEXT: %[[R0:[0-9]*]] = sext i32 %polly.access.C.load to i64
; CHECK-NEXT: %[[R1:[0-9]*]] = icmp sle i64 %[[R0]], -1
;
; CHECK-LABEL: polly.cond4:
; CHECK-NEXT: %[[R2:[0-9]*]] = sext i32 %polly.access.C.load to i64
; CHECK-NEXT: %[[R3:[0-9]*]] = icmp sge i64 %[[R2]], 1
; CHECK-NEXT: %[[R4:[0-9]*]] = or i1 %[[R1]], %[[R3]]
; CHECK-NEXT: br i1 %[[R4]]
;
; CHECK-NOT: polly.stmt.bb2
;

View File

@ -33,19 +33,15 @@ return:
ret void
}
; CHECK: if (P <= -1) {
; CHECK-NEXT: for (int c0 = 0; c0 < N; c0 += 1)
; CHECK-NEXT: Stmt_store(c0);
; CHECK-NEXT: } else if (P >= 1)
; CHECK: if (P <= -1 || P >= 1)
; CHECK-NEXT: for (int c0 = 0; c0 < N; c0 += 1)
; CHECK-NEXT: Stmt_store(c0);
; CODEGEN-LABEL: polly.cond:
; CODEGEN-NEXT: %[[R1:[0-9]*]] = ptrtoint float* %P to i64
; CODEGEN-NEXT: %[[R2:[0-9]*]] = icmp sle i64 %[[R1]], -1
; CODEGEN-NEXT: br i1 %[[R2]]
; CODEGEN-LABEL: polly.cond2:
; CODEGEN-NEXT: %[[R3:[0-9]*]] = ptrtoint float* %P to i64
; CODEGEN-NEXT: %[[R4:[0-9]*]] = icmp sge i64 %[[R3]], 1
; CODEGEN-NEXT: br i1 %[[R4]]
; CODEGEN-NEXT: %[[R5:[0-9]*]] = or i1 %[[R2]], %[[R4]]
; CODEGEN-NEXT: br i1 %[[R5]]

View File

@ -34,10 +34,7 @@ return:
ret void
}
; CHECK: if (Q >= P + 1) {
; CHECK-NEXT: for (int c0 = 0; c0 < N; c0 += 1)
; CHECK-NEXT: Stmt_store(c0);
; CHECK-NEXT: } else if (P >= Q + 1)
; CHECK: if (Q >= P + 1 || P >= Q + 1)
; CHECK-NEXT: for (int c0 = 0; c0 < N; c0 += 1)
; CHECK-NEXT: Stmt_store(c0);
@ -46,11 +43,9 @@ return:
; CODEGEN-NEXT: %[[P:[_a-zA-Z0-9]+]] = ptrtoint float* %P to i64
; CODEGEN-NEXT: %[[PInc:[_a-zA-Z0-9]+]] = add nsw i64 %[[P]], 1
; CODEGEN-NEXT: %[[CMP:[_a-zA-Z0-9]+]] = icmp sge i64 %[[Q]], %[[PInc]]
; CODEGEN-NEXT: br i1 %[[CMP]]
; CODEGEN: polly.cond2:
; CODEGEN-NEXT: %[[P2:[_a-zA-Z0-9]+]] = ptrtoint float* %P to i64
; CODEGEN-NEXT: %[[Q2:[_a-zA-Z0-9]+]] = ptrtoint float* %Q to i64
; CODEGEN-NEXT: %[[QInc:[_a-zA-Z0-9]+]] = add nsw i64 %[[Q2]], 1
; CODEGEN-NEXT: %[[CMP2:[_a-zA-Z0-9]+]] = icmp sge i64 %[[P2]], %[[QInc]]
; CODEGEN-NEXT: br i1 %[[CMP2]]
; CODEGEN-NEXT: %[[CMP3:[_a-zA-Z0-9]+]] = or i1 %[[CMP]], %[[CMP2]]
; CODEGEN-NEXT: br i1 %[[CMP3]]