diff options
Diffstat (limited to 'polly/lib/External')
390 files changed, 6670 insertions, 1222 deletions
diff --git a/polly/lib/External/isl/codegen.c b/polly/lib/External/isl/codegen.c index e9cd692fe8d..78483f7ea1d 100644 --- a/polly/lib/External/isl/codegen.c +++ b/polly/lib/External/isl/codegen.c @@ -1,5 +1,5 @@ /* - * Copyright 2012 Ecole Normale Superieure + * Copyright 2012,2014 Ecole Normale Superieure * * Use of this software is governed by the MIT license * @@ -8,19 +8,24 @@ */ /* This program prints an AST that scans the domain elements of - * the domain of a given schedule in the order of their image(s). + * the domain of a given schedule in the order specified by + * the schedule tree or by their image(s) in the schedule map. * - * The input consists of three sets/relations. - * - a schedule + * The input consists of either a schedule tree or + * a sequence of three sets/relations. + * - a schedule map * - a context * - a relation describing AST generation options */ #include <assert.h> +#include <stdlib.h> #include <isl/ast.h> #include <isl/ast_build.h> #include <isl/options.h> #include <isl/set.h> +#include <isl/stream.h> +#include <isl/schedule_node.h> struct options { struct isl_options *isl; @@ -36,7 +41,8 @@ ISL_ARG_BOOL(struct options, separate, 0, "separate", 0, "globally set the separate option") ISL_ARGS_END -ISL_ARG_DEF(options, struct options, options_args) +ISL_ARG_DEF(cg_options, struct options, options_args) +ISL_ARG_CTX_DEF(cg_options, struct options, options_args) /* Return a universal, 1-dimensional set with the given name. */ @@ -100,32 +106,130 @@ static __isl_give isl_ast_build *set_options(__isl_take isl_ast_build *build, return build; } -int main(int argc, char **argv) +/* Construct an AST in case the schedule is specified by a union map. + * + * We read the context and the options from "s" and construct the AST. + */ +static __isl_give isl_ast_node *construct_ast_from_union_map( + __isl_take isl_union_map *schedule, __isl_keep isl_stream *s) { - isl_ctx *ctx; isl_set *context; - isl_union_map *schedule; isl_union_map *options_map; isl_ast_build *build; isl_ast_node *tree; struct options *options; - isl_printer *p; - - options = options_new_with_defaults(); - assert(options); - argc = options_parse(options, argc, argv, ISL_ARG_ALL); - ctx = isl_ctx_alloc_with_options(&options_args, options); + options = isl_ctx_peek_cg_options(isl_stream_get_ctx(s)); - schedule = isl_union_map_read_from_file(ctx, stdin); - context = isl_set_read_from_file(ctx, stdin); - options_map = isl_union_map_read_from_file(ctx, stdin); + context = isl_stream_read_set(s); + options_map = isl_stream_read_union_map(s); build = isl_ast_build_from_context(context); build = set_options(build, options_map, options, schedule); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); + return tree; +} + +/* If "node" is a band node, then replace the AST build options + * by "options". + */ +static __isl_give isl_schedule_node *node_set_options( + __isl_take isl_schedule_node *node, void *user) +{ + enum isl_ast_loop_type *type = user; + int i, n; + + if (isl_schedule_node_get_type(node) != isl_schedule_node_band) + return node; + + n = isl_schedule_node_band_n_member(node); + for (i = 0; i < n; ++i) + node = isl_schedule_node_band_member_set_ast_loop_type(node, + i, *type); + return node; +} + +/* Replace the AST build options on all band nodes if requested + * by the user. + */ +static __isl_give isl_schedule *schedule_set_options( + __isl_take isl_schedule *schedule, struct options *options) +{ + enum isl_ast_loop_type type; + + if (!options->separate && !options->atomic) + return schedule; + + type = options->separate ? isl_ast_loop_separate : isl_ast_loop_atomic; + schedule = isl_schedule_map_schedule_node(schedule, + &node_set_options, &type); + + return schedule; +} + +/* Construct an AST in case the schedule is specified by a schedule tree. + */ +static __isl_give isl_ast_node *construct_ast_from_schedule( + __isl_take isl_schedule *schedule) +{ + isl_ast_build *build; + isl_ast_node *tree; + struct options *options; + + options = isl_ctx_peek_cg_options(isl_schedule_get_ctx(schedule)); + + build = isl_ast_build_alloc(isl_schedule_get_ctx(schedule)); + schedule = schedule_set_options(schedule, options); + tree = isl_ast_build_node_from_schedule(build, schedule); + isl_ast_build_free(build); + + return tree; +} + +/* Read an object from stdin. + * If it is a (union) map, then assume an input specified by + * schedule map, context and options and construct an AST from + * those elements + * If it is a schedule object, then construct the AST from the schedule. + */ +int main(int argc, char **argv) +{ + isl_ctx *ctx; + isl_stream *s; + isl_ast_node *tree = NULL; + struct options *options; + isl_printer *p; + struct isl_obj obj; + int r = EXIT_SUCCESS; + + options = cg_options_new_with_defaults(); + assert(options); + argc = cg_options_parse(options, argc, argv, ISL_ARG_ALL); + + ctx = isl_ctx_alloc_with_options(&options_args, options); + + s = isl_stream_new_file(ctx, stdin); + obj = isl_stream_read_obj(s); + if (obj.v == NULL) { + r = EXIT_FAILURE; + } else if (obj.type == isl_obj_map) { + isl_union_map *umap; + + umap = isl_union_map_from_map(obj.v); + tree = construct_ast_from_union_map(umap, s); + } else if (obj.type == isl_obj_union_map) { + tree = construct_ast_from_union_map(obj.v, s); + } else if (obj.type == isl_obj_schedule) { + tree = construct_ast_from_schedule(obj.v); + } else { + obj.type->free(obj.v); + isl_die(ctx, isl_error_invalid, "unknown input", + r = EXIT_FAILURE); + } + isl_stream_free(s); + p = isl_printer_to_file(ctx, stdout); p = isl_printer_set_output_format(p, ISL_FORMAT_C); p = isl_printer_print_ast_node(p, tree); @@ -134,5 +238,5 @@ int main(int argc, char **argv) isl_ast_node_free(tree); isl_ctx_free(ctx); - return 0; + return r; } diff --git a/polly/lib/External/isl/codegen_test.sh.in b/polly/lib/External/isl/codegen_test.sh.in index 36a1815b762..5b519e71063 100644 --- a/polly/lib/External/isl/codegen_test.sh.in +++ b/polly/lib/External/isl/codegen_test.sh.in @@ -5,8 +5,17 @@ srcdir=@srcdir@ failed=0 +for i in $srcdir/test_inputs/codegen/*.st \ + $srcdir/test_inputs/codegen/cloog/*.st; do + echo $i; + base=`basename $i .st` + test=test-$base.c + dir=`dirname $i` + ref=$dir/$base.c + (./isl_codegen$EXEEXT < $i > $test && + diff -uw $ref $test && rm $test) || failed=1 +done for i in $srcdir/test_inputs/codegen/*.in \ - $srcdir/test_inputs/codegen/cloog/*.in \ $srcdir/test_inputs/codegen/omega/*.in \ $srcdir/test_inputs/codegen/pldi2012/*.in; do echo $i; diff --git a/polly/lib/External/isl/doc/user.pod b/polly/lib/External/isl/doc/user.pod index 28cd255ebec..d9df0cb8aa8 100644 --- a/polly/lib/External/isl/doc/user.pod +++ b/polly/lib/External/isl/doc/user.pod @@ -236,6 +236,14 @@ for backward compatibility, but it will be removed in the future. =item * The function C<isl_basic_set_drop_constraint> has been deprecated. +=item * The function C<isl_ast_build_ast_from_schedule> has been +renamed to C<isl_ast_build_node_from_schedule_map>. +The original name is still available +for backward compatibility, but it will be removed in the future. + +=item * The C<separation_class> AST generation option has been +deprecated. + =back =head1 License @@ -7272,6 +7280,28 @@ is therefore also immaterial. =back +The following node type is only supported by the AST generator. + +=over + +=item C<isl_schedule_node_context> + +The context describes constraints on the parameters and +the schedule dimensions of outer +bands that the AST generator may assume to hold. It is also the only +kind of node that may introduce additional parameters. +The space of the context is that of the flat product of the outer +band nodes. In particular, if there are no outer band nodes, then +this space is the unnamed zero-dimensional space. +Since a context node references the outer band nodes, any tree +containing a context node is considered to be anchored. + +=back + +Except for the C<isl_schedule_node_context> nodes, +none of the nodes may introduce any parameters that were not +already present in the root domain node. + A schedule tree is encapsulated in an C<isl_schedule> object. The simplest such objects, those with a tree consisting of single domain node, can be created using the following functions with either an empty @@ -7311,6 +7341,7 @@ can be obtained using the following function. An extra top-level band node (right underneath the domain node) can be introduced into the schedule using the following function. +The schedule tree is assumed not to have any anchored nodes. #include <isl/schedule.h> __isl_give isl_schedule * @@ -7318,6 +7349,14 @@ be introduced into the schedule using the following function. __isl_take isl_schedule *schedule, __isl_take isl_multi_union_pw_aff *partial); +A top-level context node (right underneath the domain node) can +be introduced into the schedule using the following function. + + #include <isl/schedule.h> + __isl_give isl_schedule *isl_schedule_insert_context( + __isl_take isl_schedule *schedule, + __isl_take isl_set *context) + A schedule that combines two schedules either in the given order or in an arbitrary order, i.e., with an C<isl_schedule_node_sequence> or an C<isl_schedule_node_set> node, @@ -7584,12 +7623,24 @@ from a schedule tree and returns a pointer to the child of the node, now located at the position of the original node or to a leaf node at that position if there was no child. It is not allowed to remove the root of a schedule tree, -a set or sequence node or a child of a set or sequence node. +a set or sequence node, a child of a set or sequence node or +a band node with an anchored subtree. #include <isl/schedule_node.h> __isl_give isl_schedule_node *isl_schedule_node_delete( __isl_take isl_schedule_node *node); +Most nodes in a schedule tree only contain local information. +In some cases, however, a node may also refer to outer band nodes. +This means that the position of the node within the tree should +not be changed, or at least that no changes are performed to the +outer band nodes. The following function can be used to test +whether the subtree rooted at a given node contains any such nodes. + + #include <isl/schedule_node.h> + int isl_schedule_node_is_subtree_anchored( + __isl_keep isl_schedule_node *node); + The following function resets the user pointers on all parameter and tuple identifiers referenced by the given schedule node. @@ -7631,6 +7682,27 @@ Several node types have their own functions for querying __isl_give isl_schedule_node * isl_schedule_node_band_set_permutable( __isl_take isl_schedule_node *node, int permutable); + enum isl_ast_loop_type + isl_schedule_node_band_member_get_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos); + __isl_give isl_schedule_node * + isl_schedule_node_band_member_set_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type); + __isl_give isl_union_set * + enum isl_ast_loop_type + isl_schedule_node_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos); + __isl_give isl_schedule_node * + isl_schedule_node_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type); + isl_schedule_node_band_get_ast_build_options( + __isl_keep isl_schedule_node *node); + __isl_give isl_schedule_node * + isl_schedule_node_band_set_ast_build_options( + __isl_take isl_schedule_node *node, + __isl_take isl_union_set *options); The function C<isl_schedule_node_band_get_space> returns the space of the partial schedule of the band. @@ -7648,6 +7720,22 @@ iterations of outer bands). A band is marked permutable if it was produced using the Pluto-like scheduler. Note that the scheduler may have to resort to a Feautrier style scheduling step even if the default scheduler is used. +An C<isl_ast_loop_type> is one of C<isl_ast_loop_default>, +C<isl_ast_loop_atomic>, C<isl_ast_loop_unroll> or C<isl_ast_loop_separate>. +For the meaning of these loop AST generation types and the difference +between the regular loop AST generation type and the isolate +loop AST generation type, see L</"AST Generation Options (Schedule Tree)">. +The functions C<isl_schedule_node_band_member_get_ast_loop_type> +and C<isl_schedule_node_band_member_get_isolate_ast_loop_type> +may return C<isl_ast_loop_error> if an error occurs. +The AST build options govern how an AST is generated for +the individual schedule dimensions during AST generation. +See L</"AST Generation Options (Schedule Tree)">. + + #include <isl/schedule_node.h> + __isl_give isl_set * + isl_schedule_node_context_get_context( + __isl_keep isl_schedule_node *node); #include <isl/schedule_node.h> __isl_give isl_union_set * @@ -7691,11 +7779,14 @@ using the following function. int isl_schedule_node_get_schedule_depth( __isl_keep isl_schedule_node *node); -The following function returns the union of universes in the spaces that -contain elements that reach the given node. +The following functions return the elements that reach the given node +or the union of universes in the spaces that contain these elements. #include <isl/schedule_node.h> __isl_give isl_union_set * + isl_schedule_node_get_domain( + __isl_keep isl_schedule_node *node); + __isl_give isl_union_set * isl_schedule_node_get_universe_domain( __isl_keep isl_schedule_node *node); @@ -7712,6 +7803,16 @@ the results points to the new node. This function inserts a new band node with (the greatest integer part of) the given partial schedule. +The subtree rooted at the given node is assumed not to have +any anchored nodes. + + #include <isl/schedule_node.h> + __isl_give isl_schedule_node * + isl_schedule_node_insert_context( + __isl_take isl_schedule_node *node, + __isl_take isl_set *context); + +This function inserts a new context node with the given context constraints. #include <isl/schedule_node.h> __isl_give isl_schedule_node * @@ -7771,6 +7872,8 @@ The C<isl_schedule_node_band_tile> function tiles the band using the given tile sizes inside its schedule. A new child band node is created to represent the point loops and it is inserted between the modified band and its children. +The subtree rooted at the given node is assumed not to have +any anchored nodes. The C<tile_scale_tile_loops> option specifies whether the tile loops iterators should be scaled by the tile sizes. If the C<tile_shift_point_loops> option is set, then the point loops @@ -7794,6 +7897,8 @@ at the band node using the following function. __isl_give isl_schedule_node *isl_schedule_node_band_sink( __isl_take isl_schedule_node *node); +The subtree rooted at the given node is assumed not to have +any anchored nodes. The result points to the node in the resulting tree that is in the same position as the node pointed to by C<node> in the original tree. @@ -8307,23 +8412,28 @@ will treat set nodes in the same way as sequence nodes. This section describes the C<isl> functionality for generating ASTs that visit all the elements -in a domain in an order specified by a schedule. -In particular, given a C<isl_union_map>, an AST is generated +in a domain in an order specified by a schedule tree or +a schedule map. +In case the schedule given as a C<isl_union_map>, an AST is generated that visits all the elements in the domain of the C<isl_union_map> according to the lexicographic order of the corresponding image element(s). If the range of the C<isl_union_map> consists of elements in more than one space, then each of these spaces is handled separately in an arbitrary order. -It should be noted that the image elements only specify the I<order> +It should be noted that the schedule tree or the image elements +in a schedule map only specify the I<order> in which the corresponding domain elements should be visited. -No direct relation between the image elements and the loop iterators -in the generated AST should be assumed. +No direct relation between the partial schedule values +or the image elements on the one hand and the loop iterators +in the generated AST on the other hand should be assumed. Each AST is generated within a build. The initial build simply specifies the constraints on the parameters (if any) and can be created, inspected, copied and freed using the following functions. #include <isl/ast_build.h> + __isl_give isl_ast_build *isl_ast_build_alloc( + isl_ctx *ctx); __isl_give isl_ast_build *isl_ast_build_from_context( __isl_take isl_set *set); __isl_give isl_ast_build *isl_ast_build_copy( @@ -8332,13 +8442,21 @@ and can be created, inspected, copied and freed using the following functions. __isl_take isl_ast_build *build); The C<set> argument is usually a parameter set with zero or more parameters. +In fact, when creating an AST using C<isl_ast_build_node_from_schedule>, +this set is required to be a parameter set. +An C<isl_ast_build> created using C<isl_ast_build_alloc> does not +specify any parameter constraints. More C<isl_ast_build> functions are described in L</"Nested AST Generation"> and L</"Fine-grained Control over AST Generation">. -Finally, the AST itself can be constructed using the following -function. +Finally, the AST itself can be constructed using one of the following +functions. #include <isl/ast_build.h> - __isl_give isl_ast_node *isl_ast_build_ast_from_schedule( + __isl_give isl_ast_node *isl_ast_build_node_from_schedule( + __isl_keep isl_ast_build *build, + __isl_take isl_schedule *schedule); + __isl_give isl_ast_node * + isl_ast_build_node_from_schedule_map( __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule); @@ -8976,13 +9094,223 @@ to construct if conditions with disjunctions. =back -=head3 Fine-grained Control over AST Generation +=head3 AST Generation Options (Schedule Tree) + +In case of AST construction from a schedule tree, the options +that control how an AST is created from the individual schedule +dimensions are stored in the band nodes of the tree +(see L</"Schedule Trees">). + +In particular, a schedule dimension can be handled in four +different ways, atomic, separate, unroll or the default. +This loop AST generation type can be set using +C<isl_schedule_node_band_member_set_ast_loop_type>. +Alternatively, +the first three can be selected by including a one-dimensional +element with as value the position of the schedule dimension +within the band and as name one of C<atomic>, C<separate> +or C<unroll> in the options +set by C<isl_schedule_node_band_set_ast_build_options>. +Only one of these three may be specified for +any given schedule dimension within a band node. +If none of these is specified, then the default +is used. The meaning of the options is as follows. -Besides specifying the constraints on the parameters, -an C<isl_ast_build> object can be used to control -various aspects of the AST generation process. -The most prominent way of control is through ``options'', -which can be set using the following function. +=over + +=item C<atomic> + +When this option is specified, the AST generator will make +sure that a given domains space only appears in a single +loop at the specified level. + +For example, for the schedule tree + + domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }" + child: + schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]" + options: "{ atomic[x] }" + +the following AST will be generated + + for (int c0 = 0; c0 <= 10; c0 += 1) { + if (c0 >= 1) + b(c0 - 1); + if (c0 <= 9) + a(c0); + } + +On the other hand, for the schedule tree + + domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }" + child: + schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]" + options: "{ separate[x] }" + +the following AST will be generated + + { + a(0); + for (int c0 = 1; c0 <= 9; c0 += 1) { + b(c0 - 1); + a(c0); + } + b(9); + } + +If neither C<atomic> nor C<separate> is specified, then the AST generator +may produce either of these two results or some intermediate form. + +=item C<separate> + +When this option is specified, the AST generator will +split the domain of the specified schedule dimension +into pieces with a fixed set of statements for which +instances need to be executed by the iterations in +the schedule domain part. This option tends to avoid +the generation of guards inside the corresponding loops. +See also the C<atomic> option. + +=item C<unroll> + +When this option is specified, the AST generator will +I<completely> unroll the corresponding schedule dimension. +It is the responsibility of the user to ensure that such +unrolling is possible. +To obtain a partial unrolling, the user should apply an additional +strip-mining to the schedule and fully unroll the inner schedule +dimension. + +=back + +The C<isolate> option is a bit more involved. It allows the user +to isolate a range of schedule dimension values from smaller and +greater values. Additionally, the user may specify a different +atomic/separate/unroll choice for the isolated part and the remaining +parts. The typical use case of the C<isolate> option is to isolate +full tiles from partial tiles. +The part that needs to be isolated may depend on outer schedule dimensions. +The option therefore needs to be able to reference those outer schedule +dimensions. In particular, the space of the C<isolate> option is that +of a wrapped map with as domain the flat product of all outer band nodes +and as range the space of the current band node. +The atomic/separate/unroll choice for the isolated part is determined +by an option that lives in an unnamed wrapped space with as domain +a zero-dimensional C<isolate> space and as range the regular +C<atomic>, C<separate> or C<unroll> space. +This option may also be set directly using +C<isl_schedule_node_band_member_set_isolate_ast_loop_type>. +The atomic/separate/unroll choice for the remaining part is determined +by the regular C<atomic>, C<separate> or C<unroll> option. +The use of the C<isolate> option causes any tree containing the node +to be considered anchored. + +As an example, consider the isolation of full tiles from partial tiles +in a tiling of a triangular domain. The original schedule is as follows. + + domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }" + child: + schedule: "[{ A[i,j] -> [floor(i/10)] }, \ + { A[i,j] -> [floor(j/10)] }, \ + { A[i,j] -> [i] }, { A[i,j] -> [j] }]" + +The output is + + for (int c0 = 0; c0 <= 10; c0 += 1) + for (int c1 = 0; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; + c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; + c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + +Isolating the full tiles, we have the following input + + domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }" + child: + schedule: "[{ A[i,j] -> [floor(i/10)] }, \ + { A[i,j] -> [floor(j/10)] }, \ + { A[i,j] -> [i] }, { A[i,j] -> [j] }]" + options: "{ isolate[[] -> [a,b,c,d]] : 0 <= 10a,10b and \ + 10a+9+10b+9 <= 100 }" + +and output + + { + for (int c0 = 0; c0 <= 8; c0 += 1) { + for (int c1 = 0; c1 <= -c0 + 8; c1 += 1) + for (int c2 = 10 * c0; + c2 <= 10 * c0 + 9; c2 += 1) + for (int c3 = 10 * c1; + c3 <= 10 * c1 + 9; c3 += 1) + A(c2, c3); + for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; + c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; + c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + } + for (int c0 = 9; c0 <= 10; c0 += 1) + for (int c1 = 0; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; + c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; + c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + } + +We may then additionally unroll the innermost loop of the isolated part + + domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }" + child: + schedule: "[{ A[i,j] -> [floor(i/10)] }, \ + { A[i,j] -> [floor(j/10)] }, \ + { A[i,j] -> [i] }, { A[i,j] -> [j] }]" + options: "{ isolate[[] -> [a,b,c,d]] : 0 <= 10a,10b and \ + 10a+9+10b+9 <= 100; [isolate[] -> unroll[3]] }" + +to obtain + + { + for (int c0 = 0; c0 <= 8; c0 += 1) { + for (int c1 = 0; c1 <= -c0 + 8; c1 += 1) + for (int c2 = 10 * c0; c2 <= 10 * c0 + 9; c2 += 1) { + A(c2, 10 * c1); + A(c2, 10 * c1 + 1); + A(c2, 10 * c1 + 2); + A(c2, 10 * c1 + 3); + A(c2, 10 * c1 + 4); + A(c2, 10 * c1 + 5); + A(c2, 10 * c1 + 6); + A(c2, 10 * c1 + 7); + A(c2, 10 * c1 + 8); + A(c2, 10 * c1 + 9); + } + for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; + c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; + c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + } + for (int c0 = 9; c0 <= 10; c0 += 1) + for (int c1 = 0; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; + c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; + c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + } + + +=head3 AST Generation Options (Schedule Map) + +In case of AST construction using +C<isl_ast_build_node_from_schedule_map>, the options +that control how an AST is created from the individual schedule +dimensions are stored in the C<isl_ast_build>. +They can be set using the following function. #include <isl/ast_build.h> __isl_give isl_ast_build * @@ -8992,7 +9320,8 @@ which can be set using the following function. The options are encoded in an C<isl_union_map>. The domain of this union relation refers to the schedule domain, -i.e., the range of the schedule passed to C<isl_ast_build_ast_from_schedule>. +i.e., the range of the schedule passed +to C<isl_ast_build_node_from_schedule_map>. In the case of nested AST generation (see L</"Nested AST Generation">), the domain of C<options> should refer to the extra piece of the schedule. That is, it should be equal to the range of the wrapped relation in the @@ -9011,6 +9340,9 @@ We consider the following spaces. =item C<separation_class> +B<This option has been deprecated. Use the isolate option on +schedule trees instead.> + This space is a wrapped relation between two one dimensional spaces. The input space represents the schedule dimension to which the option applies and the output space represents the separation class. @@ -9158,6 +9490,16 @@ strip-mining to the schedule and fully unroll the inner loop. =back +=head3 Fine-grained Control over AST Generation + +Besides specifying the constraints on the parameters, +an C<isl_ast_build> object can be used to control +various aspects of the AST generation process. +In case of AST construction using +C<isl_ast_build_node_from_schedule_map>, +the most prominent way of control is through ``options'', +as explained above. + Additional control is available through the following functions. #include <isl/ast_build.h> @@ -9252,8 +9594,8 @@ or C<isl_ast_build_call_from_pw_multi_aff>. C<isl> allows the user to create an AST within the context of another AST. These nested ASTs are created using the -same C<isl_ast_build_ast_from_schedule> function that is used to create the -outer AST. The C<build> argument should be an C<isl_ast_build> +same C<isl_ast_build_node_from_schedule_map> function that is used to create +the outer AST. The C<build> argument should be an C<isl_ast_build> passed to a callback set by C<isl_ast_build_set_create_leaf>. The space of the range of the C<schedule> argument should refer diff --git a/polly/lib/External/isl/include/isl/ast_build.h b/polly/lib/External/isl/include/isl/ast_build.h index 4668a79a18d..08778eb2115 100644 --- a/polly/lib/External/isl/include/isl/ast_build.h +++ b/polly/lib/External/isl/include/isl/ast_build.h @@ -4,6 +4,7 @@ #include <isl/ctx.h> #include <isl/set.h> #include <isl/ast.h> +#include <isl/schedule.h> #if defined(__cplusplus) extern "C" { @@ -41,6 +42,7 @@ int isl_options_get_ast_build_allow_or(isl_ctx *ctx); isl_ctx *isl_ast_build_get_ctx(__isl_keep isl_ast_build *build); +__isl_give isl_ast_build *isl_ast_build_alloc(isl_ctx *ctx); __isl_give isl_ast_build *isl_ast_build_from_context(__isl_take isl_set *set); __isl_give isl_space *isl_ast_build_get_schedule_space( @@ -92,6 +94,10 @@ __isl_give isl_ast_expr *isl_ast_build_call_from_pw_multi_aff( __isl_give isl_ast_expr *isl_ast_build_call_from_multi_pw_aff( __isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa); +__isl_give isl_ast_node *isl_ast_build_node_from_schedule( + __isl_keep isl_ast_build *build, __isl_take isl_schedule *schedule); +__isl_give isl_ast_node *isl_ast_build_node_from_schedule_map( + __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule); __isl_give isl_ast_node *isl_ast_build_ast_from_schedule( __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule); diff --git a/polly/lib/External/isl/include/isl/ast_type.h b/polly/lib/External/isl/include/isl/ast_type.h index 19b14b3b7dc..f5a2374254c 100644 --- a/polly/lib/External/isl/include/isl/ast_type.h +++ b/polly/lib/External/isl/include/isl/ast_type.h @@ -58,6 +58,14 @@ enum isl_ast_node_type { isl_ast_node_user }; +enum isl_ast_loop_type { + isl_ast_loop_error = -1, + isl_ast_loop_default = 0, + isl_ast_loop_atomic, + isl_ast_loop_unroll, + isl_ast_loop_separate +}; + struct isl_ast_print_options; typedef struct isl_ast_print_options isl_ast_print_options; diff --git a/polly/lib/External/isl/include/isl/schedule.h b/polly/lib/External/isl/include/isl/schedule.h index cc4cacd6099..11d0bc41628 100644 --- a/polly/lib/External/isl/include/isl/schedule.h +++ b/polly/lib/External/isl/include/isl/schedule.h @@ -7,6 +7,7 @@ #include <isl/aff_type.h> #include <isl/band.h> #include <isl/space.h> +#include <isl/set_type.h> #include <isl/list.h> #if defined(__cplusplus) @@ -98,6 +99,8 @@ __isl_give isl_schedule *isl_schedule_map_schedule_node( __isl_give isl_schedule_node *(*fn)( __isl_take isl_schedule_node *node, void *user), void *user); +__isl_give isl_schedule *isl_schedule_insert_context( + __isl_take isl_schedule *schedule, __isl_take isl_set *context); __isl_give isl_schedule *isl_schedule_insert_partial_schedule( __isl_take isl_schedule *schedule, __isl_take isl_multi_union_pw_aff *partial); diff --git a/polly/lib/External/isl/include/isl/schedule_node.h b/polly/lib/External/isl/include/isl/schedule_node.h index f9f82a368bd..d9f7434478f 100644 --- a/polly/lib/External/isl/include/isl/schedule_node.h +++ b/polly/lib/External/isl/include/isl/schedule_node.h @@ -4,6 +4,7 @@ #include <isl/schedule_type.h> #include <isl/union_set_type.h> #include <isl/aff_type.h> +#include <isl/ast_type.h> #include <isl/val.h> #include <isl/space.h> @@ -70,12 +71,29 @@ __isl_give isl_schedule_node *isl_schedule_node_previous_sibling( __isl_give isl_schedule_node *isl_schedule_node_next_sibling( __isl_take isl_schedule_node *node); +int isl_schedule_node_is_subtree_anchored(__isl_keep isl_schedule_node *node); + __isl_give isl_space *isl_schedule_node_band_get_space( __isl_keep isl_schedule_node *node); __isl_give isl_multi_union_pw_aff *isl_schedule_node_band_get_partial_schedule( __isl_keep isl_schedule_node *node); __isl_give isl_union_map *isl_schedule_node_band_get_partial_schedule_union_map( __isl_keep isl_schedule_node *node); +enum isl_ast_loop_type isl_schedule_node_band_member_get_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos); +__isl_give isl_schedule_node *isl_schedule_node_band_member_set_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type); +enum isl_ast_loop_type isl_schedule_node_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos); +__isl_give isl_schedule_node * +isl_schedule_node_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type); +__isl_give isl_union_set *isl_schedule_node_band_get_ast_build_options( + __isl_keep isl_schedule_node *node); +__isl_give isl_schedule_node *isl_schedule_node_band_set_ast_build_options( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *options); unsigned isl_schedule_node_band_n_member(__isl_keep isl_schedule_node *node); int isl_schedule_node_band_member_get_coincident( __isl_keep isl_schedule_node *node, int pos); @@ -101,12 +119,16 @@ __isl_give isl_schedule_node *isl_schedule_node_band_sink( __isl_give isl_schedule_node *isl_schedule_node_band_split( __isl_take isl_schedule_node *node, int pos); +__isl_give isl_set *isl_schedule_node_context_get_context( + __isl_keep isl_schedule_node *node); __isl_give isl_union_set *isl_schedule_node_domain_get_domain( __isl_keep isl_schedule_node *node); __isl_give isl_union_set *isl_schedule_node_filter_get_filter( __isl_keep isl_schedule_node *node); int isl_schedule_node_get_schedule_depth(__isl_keep isl_schedule_node *node); +__isl_give isl_union_set *isl_schedule_node_get_domain( + __isl_keep isl_schedule_node *node); __isl_give isl_union_set *isl_schedule_node_get_universe_domain( __isl_keep isl_schedule_node *node); __isl_give isl_union_pw_multi_aff * @@ -117,6 +139,8 @@ __isl_give isl_union_map *isl_schedule_node_get_prefix_schedule_union_map( __isl_give isl_union_map *isl_schedule_node_get_subtree_schedule_union_map( __isl_keep isl_schedule_node *node); +__isl_give isl_schedule_node *isl_schedule_node_insert_context( + __isl_take isl_schedule_node *node, __isl_take isl_set *context); __isl_give isl_schedule_node *isl_schedule_node_insert_partial_schedule( __isl_take isl_schedule_node *node, __isl_take isl_multi_union_pw_aff *schedule); diff --git a/polly/lib/External/isl/include/isl/schedule_type.h b/polly/lib/External/isl/include/isl/schedule_type.h index d9003cdbbb0..f7ef2500a5a 100644 --- a/polly/lib/External/isl/include/isl/schedule_type.h +++ b/polly/lib/External/isl/include/isl/schedule_type.h @@ -8,6 +8,7 @@ extern "C" { enum isl_schedule_node_type { isl_schedule_node_error = -1, isl_schedule_node_band, + isl_schedule_node_context, isl_schedule_node_domain, isl_schedule_node_filter, isl_schedule_node_leaf, diff --git a/polly/lib/External/isl/isl_ast_build.c b/polly/lib/External/isl/isl_ast_build.c index 0fef62bf350..77d652f6db1 100644 --- a/polly/lib/External/isl/isl_ast_build.c +++ b/polly/lib/External/isl/isl_ast_build.c @@ -1,5 +1,5 @@ /* - * Copyright 2012 Ecole Normale Superieure + * Copyright 2012-2013 Ecole Normale Superieure * Copyright 2014 INRIA Rocquencourt * * Use of this software is governed by the MIT license @@ -66,10 +66,12 @@ static __isl_give isl_ast_build *isl_ast_build_init_derived( isl_multi_aff_free(build->offsets); build->offsets = isl_multi_aff_zero(isl_space_copy(space)); isl_multi_aff_free(build->values); - build->values = isl_multi_aff_identity(space); + build->values = isl_multi_aff_identity(isl_space_copy(space)); + isl_multi_aff_free(build->internal2input); + build->internal2input = isl_multi_aff_identity(space); if (!build->iterators || !build->domain || !build->generated || - !build->pending || !build->values || + !build->pending || !build->values || !build->internal2input || !build->strides || !build->offsets || !build->options) return isl_ast_build_free(build); @@ -146,6 +148,19 @@ error: return NULL; } +/* Create an isl_ast_build with a universe (parametric) context. + */ +__isl_give isl_ast_build *isl_ast_build_alloc(isl_ctx *ctx) +{ + isl_space *space; + isl_set *context; + + space = isl_space_params_alloc(ctx, 0); + context = isl_set_universe(space); + + return isl_ast_build_from_context(context); +} + __isl_give isl_ast_build *isl_ast_build_copy(__isl_keep isl_ast_build *build) { if (!build) @@ -176,6 +191,7 @@ __isl_give isl_ast_build *isl_ast_build_dup(__isl_keep isl_ast_build *build) dup->generated = isl_set_copy(build->generated); dup->pending = isl_set_copy(build->pending); dup->values = isl_multi_aff_copy(build->values); + dup->internal2input = isl_multi_aff_copy(build->internal2input); dup->value = isl_pw_aff_copy(build->value); dup->strides = isl_vec_copy(build->strides); dup->offsets = isl_multi_aff_copy(build->offsets); @@ -190,12 +206,26 @@ __isl_give isl_ast_build *isl_ast_build_dup(__isl_keep isl_ast_build *build) dup->after_each_for_user = build->after_each_for_user; dup->create_leaf = build->create_leaf; dup->create_leaf_user = build->create_leaf_user; + dup->node = isl_schedule_node_copy(build->node); + if (build->loop_type) { + int i; + + dup->n = build->n; + dup->loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, dup->n); + if (dup->n && !dup->loop_type) + return isl_ast_build_free(dup); + for (i = 0; i < dup->n; ++i) + dup->loop_type[i] = build->loop_type[i]; + } if (!dup->iterators || !dup->domain || !dup->generated || !dup->pending || !dup->values || !dup->strides || !dup->offsets || !dup->options || + (build->internal2input && !dup->internal2input) || (build->executed && !dup->executed) || - (build->value && !dup->value)) + (build->value && !dup->value) || + (build->node && !dup->node)) return isl_ast_build_free(dup); return dup; @@ -223,7 +253,15 @@ __isl_give isl_ast_build *isl_ast_build_align_params( isl_space_copy(model)); build->options = isl_union_map_align_params(build->options, isl_space_copy(model)); - isl_space_free(model); + if (build->internal2input) { + build->internal2input = + isl_multi_aff_align_params(build->internal2input, + model); + if (!build->internal2input) + return isl_ast_build_free(build); + } else { + isl_space_free(model); + } if (!build->domain || !build->values || !build->offsets || !build->options) @@ -260,12 +298,16 @@ __isl_null isl_ast_build *isl_ast_build_free( isl_set_free(build->generated); isl_set_free(build->pending); isl_multi_aff_free(build->values); + isl_multi_aff_free(build->internal2input); isl_pw_aff_free(build->value); isl_vec_free(build->strides); isl_multi_aff_free(build->offsets); isl_multi_aff_free(build->schedule_map); isl_union_map_free(build->executed); isl_union_map_free(build->options); + isl_schedule_node_free(build->node); + free(build->loop_type); + isl_set_free(build->isolated); free(build); @@ -586,6 +628,8 @@ void isl_ast_build_dump(__isl_keep isl_ast_build *build) isl_vec_dump(build->strides); fprintf(stderr, "offsets: "); isl_multi_aff_dump(build->offsets); + fprintf(stderr, "internal2input: "); + isl_multi_aff_dump(build->internal2input); } /* Initialize "build" for AST construction in schedule space "space" @@ -919,6 +963,95 @@ error: return NULL; } +/* Does "build" point to a band node? + * That is, are we currently handling a band node inside a schedule tree? + */ +int isl_ast_build_has_schedule_node(__isl_keep isl_ast_build *build) +{ + if (!build) + return -1; + return build->node != NULL; +} + +/* Return a copy of the band node that "build" refers to. + */ +__isl_give isl_schedule_node *isl_ast_build_get_schedule_node( + __isl_keep isl_ast_build *build) +{ + if (!build) + return NULL; + return isl_schedule_node_copy(build->node); +} + +/* Extract the loop AST generation types for the members of build->node + * and store them in build->loop_type. + */ +static __isl_give isl_ast_build *extract_loop_types( + __isl_take isl_ast_build *build) +{ + int i; + isl_ctx *ctx; + isl_schedule_node *node; + + if (!build) + return NULL; + ctx = isl_ast_build_get_ctx(build); + if (!build->node) + isl_die(ctx, isl_error_internal, "missing AST node", + return isl_ast_build_free(build)); + + free(build->loop_type); + build->n = isl_schedule_node_band_n_member(build->node); + build->loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, build->n); + if (build->n && !build->loop_type) + return isl_ast_build_free(build); + node = build->node; + for (i = 0; i < build->n; ++i) + build->loop_type[i] = + isl_schedule_node_band_member_get_ast_loop_type(node, i); + + return build; +} + +/* Replace the band node that "build" refers to by "node" and + * extract the corresponding loop AST generation types. + */ +__isl_give isl_ast_build *isl_ast_build_set_schedule_node( + __isl_take isl_ast_build *build, + __isl_take isl_schedule_node *node) +{ + build = isl_ast_build_cow(build); + if (!build || !node) + goto error; + + isl_schedule_node_free(build->node); + build->node = node; + + build = extract_loop_types(build); + + return build; +error: + isl_ast_build_free(build); + isl_schedule_node_free(node); + return NULL; +} + +/* Remove any reference to a band node from "build". + */ +__isl_give isl_ast_build *isl_ast_build_reset_schedule_node( + __isl_take isl_ast_build *build) +{ + build = isl_ast_build_cow(build); + if (!build) + return NULL; + + isl_schedule_node_free(build->node); + build->node = NULL; + + return build; +} + /* Return a copy of the current schedule domain. */ __isl_give isl_set *isl_ast_build_get_domain(__isl_keep isl_ast_build *build) @@ -942,6 +1075,15 @@ __isl_give isl_set *isl_ast_build_get_generated( return build ? isl_set_copy(build->generated) : NULL; } +/* Return a copy of the map from the internal schedule domain + * to the original input schedule domain. + */ +__isl_give isl_multi_aff *isl_ast_build_get_internal2input( + __isl_keep isl_ast_build *build) +{ + return build ? isl_multi_aff_copy(build->internal2input) : NULL; +} + /* Return the number of variables of the given type * in the (internal) schedule space. */ @@ -1428,9 +1570,9 @@ static __isl_give isl_map *construct_insertion_map(__isl_take isl_space *space, } static const char *option_str[] = { - [atomic] = "atomic", - [unroll] = "unroll", - [separate] = "separate" + [isl_ast_loop_atomic] = "atomic", + [isl_ast_loop_unroll] = "unroll", + [isl_ast_loop_separate] = "separate" }; /* Update the "options" to reflect the insertion of a dimension @@ -1459,7 +1601,7 @@ static __isl_give isl_union_map *options_insert_dim( { isl_map *map; isl_union_map *insertion; - enum isl_ast_build_domain_type type; + enum isl_ast_loop_type type; const char *name = "separation_class"; space = isl_space_map_from_set(space); @@ -1475,7 +1617,8 @@ static __isl_give isl_union_map *options_insert_dim( insertion = isl_union_map_empty(isl_union_map_get_space(options)); - for (type = atomic; type <= separate; ++type) { + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { isl_map *map_type = isl_map_copy(map); const char *name = option_str[type]; map_type = isl_map_set_tuple_name(map_type, isl_dim_in, name); @@ -1493,6 +1636,42 @@ static __isl_give isl_union_map *options_insert_dim( return options; } +/* If we are generating an AST from a schedule tree (build->node is set), + * then update the loop AST generation types + * to reflect the insertion of a dimension at (global) position "pos" + * in the schedule domain space. + * We do not need to adjust any isolate option since we would not be inserting + * any dimensions if there were any isolate option. + */ +static __isl_give isl_ast_build *node_insert_dim( + __isl_take isl_ast_build *build, int pos) +{ + int i; + int local_pos; + enum isl_ast_loop_type *loop_type; + isl_ctx *ctx; + + build = isl_ast_build_cow(build); + if (!build) + return NULL; + if (!build->node) + return build; + + ctx = isl_ast_build_get_ctx(build); + local_pos = pos - build->outer_pos; + loop_type = isl_realloc_array(ctx, build->loop_type, + enum isl_ast_loop_type, build->n + 1); + if (!loop_type) + return isl_ast_build_free(build); + build->loop_type = loop_type; + for (i = build->n - 1; i >= local_pos; --i) + loop_type[i + 1] = loop_type[i]; + loop_type[local_pos] = isl_ast_loop_default; + build->n++; + + return build; +} + /* Insert a single dimension in the schedule domain at position "pos". * The new dimension is given an isl_id with the empty string as name. * @@ -1504,6 +1683,12 @@ static __isl_give isl_union_map *options_insert_dim( * However, the original schedule domain space may be named and/or * structured, so we have to take this possibility into account * while performing the transformations. + * + * Since the inserted schedule dimension is used by the caller + * to differentiate between different domain spaces, there is + * no longer a uniform mapping from the internal schedule space + * to the input schedule space. The internal2input mapping is + * therefore removed. */ __isl_give isl_ast_build *isl_ast_build_insert_dim( __isl_take isl_ast_build *build, int pos) @@ -1519,7 +1704,8 @@ __isl_give isl_ast_build *isl_ast_build_insert_dim( ctx = isl_ast_build_get_ctx(build); id = isl_id_alloc(ctx, "", NULL); - space = isl_ast_build_get_space(build, 1); + if (!build->node) + space = isl_ast_build_get_space(build, 1); build->iterators = isl_id_list_insert(build->iterators, pos, id); build->domain = isl_set_insert_dims(build->domain, isl_dim_set, pos, 1); @@ -1537,13 +1723,17 @@ __isl_give isl_ast_build *isl_ast_build_insert_dim( build->offsets = isl_multi_aff_splice(build->offsets, pos, pos, ma); ma = isl_multi_aff_identity(ma_space); build->values = isl_multi_aff_splice(build->values, pos, pos, ma); - build->options = options_insert_dim(build->options, space, pos); + if (!build->node) + build->options = options_insert_dim(build->options, space, pos); + build->internal2input = isl_multi_aff_free(build->internal2input); if (!build->iterators || !build->domain || !build->generated || !build->pending || !build->values || !build->strides || !build->offsets || !build->options) return isl_ast_build_free(build); + build = node_insert_dim(build, pos); + return build; } @@ -1556,7 +1746,11 @@ __isl_give isl_ast_build *isl_ast_build_insert_dim( * This function is called right after the strides have been * detected, but before any constraints on the current dimension * have been included in build->domain. - * We therefore only need to update stride, offset and the options. + * We therefore only need to update stride, offset, the options and + * the mapping from internal schedule space to the original schedule + * space, if we are still keeping track of such a mapping. + * The latter mapping is updated by plugging in + * { [... i ...] -> [... m i ... ] }. */ __isl_give isl_ast_build *isl_ast_build_scale_down( __isl_take isl_ast_build *build, __isl_take isl_val *m, @@ -1572,6 +1766,23 @@ __isl_give isl_ast_build *isl_ast_build_scale_down( depth = build->depth; + if (build->internal2input) { + isl_space *space; + isl_multi_aff *ma; + isl_aff *aff; + + space = isl_multi_aff_get_space(build->internal2input); + space = isl_space_map_from_set(isl_space_domain(space)); + ma = isl_multi_aff_identity(space); + aff = isl_multi_aff_get_aff(ma, depth); + aff = isl_aff_scale_val(aff, isl_val_copy(m)); + ma = isl_multi_aff_set_aff(ma, depth, aff); + build->internal2input = + isl_multi_aff_pullback_multi_aff(build->internal2input, ma); + if (!build->internal2input) + goto error; + } + v = isl_vec_get_element_val(build->strides, depth); v = isl_val_div(v, isl_val_copy(m)); build->strides = isl_vec_set_element_val(build->strides, depth, v); @@ -1614,7 +1825,7 @@ static __isl_give isl_id_list *generate_names(isl_ctx *ctx, int n, int first, /* Embed "options" into the given isl_ast_build space. * * This function is called from within a nested call to - * isl_ast_build_ast_from_schedule. + * isl_ast_build_node_from_schedule_map. * "options" refers to the additional schedule, * while space refers to both the space of the outer isl_ast_build and * that of the additional schedule. @@ -1716,7 +1927,18 @@ __isl_give isl_ast_build *isl_ast_build_product( build->values = isl_multi_aff_align_params(build->values, isl_space_copy(space)); embedding = isl_multi_aff_identity(space); - build->values = isl_multi_aff_product(build->values, embedding); + build->values = isl_multi_aff_product(build->values, + isl_multi_aff_copy(embedding)); + if (build->internal2input) { + build->internal2input = + isl_multi_aff_product(build->internal2input, embedding); + build->internal2input = + isl_multi_aff_flatten_range(build->internal2input); + if (!build->internal2input) + return isl_ast_build_free(build); + } else { + isl_multi_aff_free(embedding); + } space = isl_ast_build_get_space(build, 1); build->options = embed_options(build->options, space); @@ -2020,8 +2242,7 @@ error: * but the position is still that within the current code generation. */ __isl_give isl_set *isl_ast_build_get_option_domain( - __isl_keep isl_ast_build *build, - enum isl_ast_build_domain_type type) + __isl_keep isl_ast_build *build, enum isl_ast_loop_type type) { const char *name; isl_space *space; @@ -2049,6 +2270,145 @@ __isl_give isl_set *isl_ast_build_get_option_domain( return domain; } +/* How does the user want the current schedule dimension to be generated? + * These choices have been extracted from the schedule node + * in extract_loop_types and stored in build->loop_type. + * They have been updated to reflect any dimension insertion in + * node_insert_dim. + * Return isl_ast_domain_error on error. + * + * If "isolated" is set, then we get the loop AST generation type + * directly from the band node since node_insert_dim cannot have been + * called on a band with the isolate option. + */ +enum isl_ast_loop_type isl_ast_build_get_loop_type( + __isl_keep isl_ast_build *build, int isolated) +{ + int local_pos; + isl_ctx *ctx; + + if (!build) + return isl_ast_loop_error; + ctx = isl_ast_build_get_ctx(build); + if (!build->node) + isl_die(ctx, isl_error_internal, + "only works for schedule tree based AST generation", + return isl_ast_loop_error); + + local_pos = build->depth - build->outer_pos; + if (!isolated) + return build->loop_type[local_pos]; + return isl_schedule_node_band_member_get_isolate_ast_loop_type( + build->node, local_pos); +} + +/* Extract the isolated set from the isolate option, if any, + * and store in the build. + * If there is no isolate option, then the isolated set is + * set to the empty set. + * + * The isolate option is of the form + * + * isolate[[outer bands] -> current_band] + * + * We flatten this set and then map it back to the internal + * schedule space. + * + * If we have already extracted the isolated set + * or if internal2input is no longer set, then we do not + * need to do anything. In the latter case, we know + * that the current band cannot have any isolate option. + */ +__isl_give isl_ast_build *isl_ast_build_extract_isolated( + __isl_take isl_ast_build *build) +{ + isl_space *space, *space2; + isl_union_set *options; + int n, n2; + isl_set *isolated; + + if (!build) + return NULL; + if (!build->internal2input) + return build; + if (build->isolated) + return build; + + build = isl_ast_build_cow(build); + if (!build) + return NULL; + + options = isl_schedule_node_band_get_ast_build_options(build->node); + + space = isl_multi_aff_get_space(build->internal2input); + space = isl_space_range(space); + space2 = isl_set_get_space(build->domain); + if (isl_space_is_wrapping(space2)) + space2 = isl_space_range(isl_space_unwrap(space2)); + n2 = isl_space_dim(space2, isl_dim_set); + n = isl_space_dim(space, isl_dim_set); + if (n < n2) + isl_die(isl_ast_build_get_ctx(build), isl_error_internal, + "total input space dimension cannot be smaller " + "than dimension of innermost band", + space = isl_space_free(space)); + space = isl_space_drop_dims(space, isl_dim_set, n - n2, n2); + space = isl_space_map_from_domain_and_range(space, space2); + space = isl_space_wrap(space); + space = isl_space_set_tuple_name(space, isl_dim_set, "isolate"); + isolated = isl_union_set_extract_set(options, space); + isl_union_set_free(options); + + isolated = isl_set_flatten(isolated); + isolated = isl_set_preimage_multi_aff(isolated, + isl_multi_aff_copy(build->internal2input)); + + build->isolated = isolated; + if (!build->isolated) + return isl_ast_build_free(build); + + return build; +} + +/* Does "build" have a non-empty isolated set? + * + * The caller is assumed to have called isl_ast_build_extract_isolated first. + */ +int isl_ast_build_has_isolated(__isl_keep isl_ast_build *build) +{ + int empty; + + if (!build) + return -1; + if (!build->internal2input) + return 0; + if (!build->isolated) + isl_die(isl_ast_build_get_ctx(build), isl_error_internal, + "isolated set not extracted yet", return -1); + + empty = isl_set_plain_is_empty(build->isolated); + return empty < 0 ? -1 : !empty; +} + +/* Return a copy of the isolated set of "build". + * + * The caller is assume to have called isl_ast_build_has_isolated first, + * with this function returning true. + * In particular, this function should not be called if we are no + * longer keeping track of internal2input (and there therefore could + * not possibly be any isolated set). + */ +__isl_give isl_set *isl_ast_build_get_isolated(__isl_keep isl_ast_build *build) +{ + if (!build) + return NULL; + if (!build->internal2input) + isl_die(isl_ast_build_get_ctx(build), isl_error_internal, + "build cannot have isolated set", return NULL); + + return isl_set_copy(build->isolated); +} + /* Extract the separation class mapping at the current depth. * * In particular, find and return the subset of build->options that is of diff --git a/polly/lib/External/isl/isl_ast_build_private.h b/polly/lib/External/isl/isl_ast_build_private.h index 62c66b8263c..f7f921fddf6 100644 --- a/polly/lib/External/isl/isl_ast_build_private.h +++ b/polly/lib/External/isl/isl_ast_build_private.h @@ -6,12 +6,7 @@ #include <isl/ast_build.h> #include <isl/set.h> #include <isl/list.h> - -enum isl_ast_build_domain_type { - atomic, - unroll, - separate -}; +#include <isl/schedule_node.h> /* An isl_ast_build represents the context in which AST is being * generated. That is, it (mostly) contains information about outer @@ -89,6 +84,17 @@ enum isl_ast_build_domain_type { * domain. It may be NULL if it hasn't been computed yet. * See isl_ast_build_get_schedule_map_multi_aff. * + * "internal2input" maps the internal schedule domain to the original + * input schedule domain. In case of a schedule tree input, the original + * input schedule domain consist of the flat product of all outer + * band node spaces, including the current band node. + * It may be NULL if there no longer is such a uniform mapping + * (because different iterations have been rescheduled differently). + * + * "options" contains the AST build options in case we are generating + * an AST from a flat schedule map. When creating an AST from a schedule + * tree, this field is ignored. + * * The "create_leaf" callback is called for every leaf in the generated AST. * The callback is responsible for creating the node to be placed at those * leaves. If this callback is not set, then isl will generated user @@ -116,6 +122,19 @@ enum isl_ast_build_domain_type { * is extended to a single valued inverse schedule. This is mainly used * to avoid an infinite recursion when we fail to detect later on that * the extended inverse schedule is single valued. + * + * "node" points to the current band node in case we are generating + * an AST from a schedule tree. It may be NULL if we are not generating + * an AST from a schedule tree or if we are not inside a band node. + * + * "loop_type" originally constains loop AST generation types for + * the "n" members of "node" and it is updated (along with "n") when + * a schedule dimension is inserted. + * It is NULL if "node" is NULL. + * + * "isolated" is the piece of the schedule domain isolated by the isolate + * option on the current band. This set may be NULL if we have not checked + * for the isolate option yet. */ struct isl_ast_build { int ref; @@ -136,6 +155,7 @@ struct isl_ast_build { isl_multi_aff *offsets; isl_multi_aff *schedule_map; + isl_multi_aff *internal2input; isl_union_map *options; @@ -158,6 +178,11 @@ struct isl_ast_build { isl_union_map *executed; int single_valued; + + isl_schedule_node *node; + int n; + enum isl_ast_loop_type *loop_type; + isl_set *isolated; }; __isl_give isl_ast_build *isl_ast_build_clear_local_info( @@ -191,6 +216,8 @@ __isl_give isl_ast_build *isl_ast_build_set_executed( __isl_take isl_union_map *executed); __isl_give isl_ast_build *isl_ast_build_set_single_valued( __isl_take isl_ast_build *build, int sv); +__isl_give isl_multi_aff *isl_ast_build_get_internal2input( + __isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_get_domain( __isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_get_pending( @@ -214,6 +241,21 @@ int isl_ast_build_has_value(__isl_keep isl_ast_build *build); __isl_give isl_id *isl_ast_build_get_iterator_id( __isl_keep isl_ast_build *build, int pos); +int isl_ast_build_has_schedule_node(__isl_keep isl_ast_build *build); +__isl_give isl_schedule_node *isl_ast_build_get_schedule_node( + __isl_keep isl_ast_build *build); +__isl_give isl_ast_build *isl_ast_build_set_schedule_node( + __isl_take isl_ast_build *build, + __isl_take isl_schedule_node *node); +__isl_give isl_ast_build *isl_ast_build_reset_schedule_node( + __isl_take isl_ast_build *build); + +__isl_give isl_ast_build *isl_ast_build_extract_isolated( + __isl_take isl_ast_build *build); +int isl_ast_build_has_isolated(__isl_keep isl_ast_build *build); +__isl_give isl_set *isl_ast_build_get_isolated( + __isl_keep isl_ast_build *build); + __isl_give isl_basic_set *isl_ast_build_compute_gist_basic_set( __isl_keep isl_ast_build *build, __isl_take isl_basic_set *bset); __isl_give isl_set *isl_ast_build_specialize(__isl_keep isl_ast_build *build, @@ -248,8 +290,7 @@ __isl_give isl_multi_aff *isl_ast_build_get_stride_expansion( void isl_ast_build_dump(__isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_get_option_domain( - __isl_keep isl_ast_build *build, - enum isl_ast_build_domain_type type); + __isl_keep isl_ast_build *build, enum isl_ast_loop_type type); __isl_give isl_map *isl_ast_build_get_separation_class( __isl_keep isl_ast_build *build); __isl_give isl_set *isl_ast_build_eliminate( @@ -259,6 +300,9 @@ __isl_give isl_set *isl_ast_build_eliminate_inner( __isl_give isl_set *isl_ast_build_eliminate_divs( __isl_keep isl_ast_build *build, __isl_take isl_set *set); +enum isl_ast_loop_type isl_ast_build_get_loop_type( + __isl_keep isl_ast_build *build, int isolated); + __isl_give isl_map *isl_ast_build_map_to_iterator( __isl_keep isl_ast_build *build, __isl_take isl_set *set); diff --git a/polly/lib/External/isl/isl_ast_codegen.c b/polly/lib/External/isl/isl_ast_codegen.c index 84466f0ad6d..a2c1a380bc4 100644 --- a/polly/lib/External/isl/isl_ast_codegen.c +++ b/polly/lib/External/isl/isl_ast_codegen.c @@ -15,6 +15,7 @@ #include <isl/set.h> #include <isl/ilp.h> #include <isl/union_map.h> +#include <isl/schedule_node.h> #include <isl_sort.h> #include <isl_tarjan.h> #include <isl_ast_private.h> @@ -251,8 +252,15 @@ static __isl_give isl_ast_graft_list *call_create_leaf( return isl_ast_graft_list_from_ast_graft(graft); } +static __isl_give isl_ast_graft_list *build_ast_from_child( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed); + /* Generate an AST after having handled the complete schedule - * of this call to the code generator. + * of this call to the code generator or the complete band + * if we are generating an AST from a schedule tree. + * + * If we are inside a band node, then move on to the child of the band. * * If the user has specified a create_leaf callback, control * is passed to the user in call_create_leaf. @@ -269,6 +277,13 @@ static __isl_give isl_ast_graft_list *generate_inner_level( if (!build || !executed) goto error; + if (isl_ast_build_has_schedule_node(build)) { + isl_schedule_node *node; + node = isl_ast_build_get_schedule_node(build); + build = isl_ast_build_reset_schedule_node(build); + return build_ast_from_child(build, node, executed); + } + if (build->create_leaf) return call_create_leaf(executed, build); @@ -2497,43 +2512,10 @@ error: return isl_aff_free(data.lower); } -/* Data structure for storing the results and the intermediate objects - * of compute_domains. - * - * "list" is the main result of the function and contains a list - * of disjoint basic sets for which code should be generated. - * - * "executed" and "build" are inputs to compute_domains. - * "schedule_domain" is the domain of "executed". - * - * "option" constains the domains at the current depth that should by - * atomic, separated or unrolled. These domains are as specified by - * the user, except that inner dimensions have been eliminated and - * that they have been made pair-wise disjoint. - * - * "sep_class" contains the user-specified split into separation classes - * specialized to the current depth. - * "done" contains the union of the separation domains that have already - * been handled. - */ -struct isl_codegen_domains { - isl_basic_set_list *list; - - isl_union_map *executed; - isl_ast_build *build; - isl_set *schedule_domain; - - isl_set *option[3]; - - isl_map *sep_class; - isl_set *done; -}; - -/* Extend domains->list with a list of basic sets, one for each value - * of the current dimension in "domain" and remove the corresponding - * sets from the class domain. Return the updated class domain. - * The divs that involve the current dimension have not been projected out - * from this domain. +/* Call "fn" on each iteration of the current dimension of "domain". + * If "init" is not NULL, then it is called with the number of + * iterations before any call to "fn". + * Return -1 on failure. * * Since we are going to be iterating over the individual values, * we first check if there are any strides on the current dimension. @@ -2561,52 +2543,45 @@ struct isl_codegen_domains { * will be taken into account at the next level, as in the case of the * atomic option. * - * Finally, we map i' back to i and add each basic set to the list. - * Since we may have dropped some constraints, we intersect with - * the class domain again to ensure that each element in the list - * is disjoint from the other class domains. + * Finally, we map i' back to i and call "fn". */ -static __isl_give isl_set *do_unroll(struct isl_codegen_domains *domains, - __isl_take isl_set *domain, __isl_take isl_set *class_domain) +static int foreach_iteration(__isl_take isl_set *domain, + __isl_keep isl_ast_build *build, int (*init)(int n, void *user), + int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user) { int i, n; int depth; - isl_aff *lower; isl_multi_aff *expansion; isl_basic_map *bmap; - isl_set *unroll_domain; - isl_ast_build *build; + isl_aff *lower; + isl_ast_build *stride_build; - if (!domain) - return isl_set_free(class_domain); + depth = isl_ast_build_get_depth(build); - depth = isl_ast_build_get_depth(domains->build); - build = isl_ast_build_copy(domains->build); domain = isl_ast_build_eliminate_inner(build, domain); domain = isl_set_intersect(domain, isl_ast_build_get_domain(build)); - build = isl_ast_build_detect_strides(build, isl_set_copy(domain)); - expansion = isl_ast_build_get_stride_expansion(build); + stride_build = isl_ast_build_copy(build); + stride_build = isl_ast_build_detect_strides(stride_build, + isl_set_copy(domain)); + expansion = isl_ast_build_get_stride_expansion(stride_build); domain = isl_set_preimage_multi_aff(domain, isl_multi_aff_copy(expansion)); - domain = isl_ast_build_eliminate_divs(build, domain); - - isl_ast_build_free(build); + domain = isl_ast_build_eliminate_divs(stride_build, domain); + isl_ast_build_free(stride_build); bmap = isl_basic_map_from_multi_aff(expansion); - lower = find_unroll_lower_bound(domains->build, domain, depth, bmap, - &n); + lower = find_unroll_lower_bound(build, domain, depth, bmap, &n); if (!lower) - class_domain = isl_set_free(class_domain); - - unroll_domain = isl_set_empty(isl_set_get_space(domain)); + domain = isl_set_free(domain); - for (i = 0; class_domain && i < n; ++i) { + if (init && init(n, user) < 0) + domain = isl_set_free(domain); + for (i = 0; i < n; ++i) { isl_set *set; isl_basic_set *bset; isl_constraint *slice; - isl_basic_set_list *list; slice = at_offset(depth, lower, i); set = isl_set_copy(domain); @@ -2614,20 +2589,117 @@ static __isl_give isl_set *do_unroll(struct isl_codegen_domains *domains, bset = isl_set_unshifted_simple_hull(set); bset = isl_basic_set_add_constraint(bset, slice); bset = isl_basic_set_apply(bset, isl_basic_map_copy(bmap)); - set = isl_set_from_basic_set(bset); - unroll_domain = isl_set_union(unroll_domain, isl_set_copy(set)); - set = isl_set_intersect(set, isl_set_copy(class_domain)); - set = isl_set_make_disjoint(set); - list = isl_basic_set_list_from_set(set); - domains->list = isl_basic_set_list_concat(domains->list, list); - } - class_domain = isl_set_subtract(class_domain, unroll_domain); + if (fn(bset, user) < 0) + break; + } isl_aff_free(lower); isl_set_free(domain); isl_basic_map_free(bmap); + return i < n ? -1 : 0; +} + +/* Data structure for storing the results and the intermediate objects + * of compute_domains. + * + * "list" is the main result of the function and contains a list + * of disjoint basic sets for which code should be generated. + * + * "executed" and "build" are inputs to compute_domains. + * "schedule_domain" is the domain of "executed". + * + * "option" constains the domains at the current depth that should by + * atomic, separated or unrolled. These domains are as specified by + * the user, except that inner dimensions have been eliminated and + * that they have been made pair-wise disjoint. + * + * "sep_class" contains the user-specified split into separation classes + * specialized to the current depth. + * "done" contains the union of the separation domains that have already + * been handled. + */ +struct isl_codegen_domains { + isl_basic_set_list *list; + + isl_union_map *executed; + isl_ast_build *build; + isl_set *schedule_domain; + + isl_set *option[4]; + + isl_map *sep_class; + isl_set *done; +}; + +/* Internal data structure for do_unroll. + * + * "domains" stores the results of compute_domains. + * "class_domain" is the original class domain passed to do_unroll. + * "unroll_domain" collects the unrolled iterations. + */ +struct isl_ast_unroll_data { + struct isl_codegen_domains *domains; + isl_set *class_domain; + isl_set *unroll_domain; +}; + +/* Given an iteration of an unrolled domain represented by "bset", + * add it to data->domains->list. + * Since we may have dropped some constraints, we intersect with + * the class domain again to ensure that each element in the list + * is disjoint from the other class domains. + */ +static int do_unroll_iteration(__isl_take isl_basic_set *bset, void *user) +{ + struct isl_ast_unroll_data *data = user; + isl_set *set; + isl_basic_set_list *list; + + set = isl_set_from_basic_set(bset); + data->unroll_domain = isl_set_union(data->unroll_domain, + isl_set_copy(set)); + set = isl_set_intersect(set, isl_set_copy(data->class_domain)); + set = isl_set_make_disjoint(set); + list = isl_basic_set_list_from_set(set); + data->domains->list = isl_basic_set_list_concat(data->domains->list, + list); + + return 0; +} + +/* Extend domains->list with a list of basic sets, one for each value + * of the current dimension in "domain" and remove the corresponding + * sets from the class domain. Return the updated class domain. + * The divs that involve the current dimension have not been projected out + * from this domain. + * + * We call foreach_iteration to iterate over the individual values and + * in do_unroll_iteration we collect the individual basic sets in + * domains->list and their union in data->unroll_domain, which is then + * used to update the class domain. + */ +static __isl_give isl_set *do_unroll(struct isl_codegen_domains *domains, + __isl_take isl_set *domain, __isl_take isl_set *class_domain) +{ + struct isl_ast_unroll_data data; + + if (!domain) + return isl_set_free(class_domain); + if (!class_domain) + return isl_set_free(domain); + + data.domains = domains; + data.class_domain = class_domain; + data.unroll_domain = isl_set_empty(isl_set_get_space(domain)); + + if (foreach_iteration(domain, domains->build, NULL, + &do_unroll_iteration, &data) < 0) + data.unroll_domain = isl_set_free(data.unroll_domain); + + class_domain = isl_set_subtract(class_domain, data.unroll_domain); + return class_domain; } @@ -2655,13 +2727,13 @@ static __isl_give isl_set *compute_unroll_domains( int i, n; int empty; - empty = isl_set_is_empty(domains->option[unroll]); + empty = isl_set_is_empty(domains->option[isl_ast_loop_unroll]); if (empty < 0) return isl_set_free(class_domain); if (empty) return class_domain; - unroll_domain = isl_set_copy(domains->option[unroll]); + unroll_domain = isl_set_copy(domains->option[isl_ast_loop_unroll]); unroll_list = isl_basic_set_list_from_set(unroll_domain); n = isl_basic_set_list_n_basic_set(unroll_list); @@ -2714,7 +2786,7 @@ static __isl_give isl_set *compute_atomic_domain( isl_set *domain, *atomic_domain; int empty; - domain = isl_set_copy(domains->option[atomic]); + domain = isl_set_copy(domains->option[isl_ast_loop_atomic]); domain = isl_set_intersect(domain, isl_set_copy(class_domain)); domain = isl_set_intersect(domain, isl_set_copy(domains->schedule_domain)); @@ -2761,7 +2833,7 @@ static int compute_separate_domain(struct isl_codegen_domains *domains, isl_basic_set_list *list; int empty; - domain = isl_set_copy(domains->option[separate]); + domain = isl_set_copy(domains->option[isl_ast_loop_separate]); domain = isl_set_intersect(domain, isl_set_copy(class_domain)); executed = isl_union_map_copy(domains->executed); executed = isl_union_map_intersect_domain(executed, @@ -2837,7 +2909,7 @@ static int compute_partial_domains(struct isl_codegen_domains *domains, if (compute_separate_domain(domains, domain) < 0) goto error; domain = isl_set_subtract(domain, - isl_set_copy(domains->option[separate])); + isl_set_copy(domains->option[isl_ast_loop_separate])); domain = isl_set_intersect(domain, isl_set_copy(domains->schedule_domain)); @@ -2897,20 +2969,24 @@ static int compute_class_domains(__isl_take isl_point *pnt, void *user) * The domains specified by the user might overlap, so we make * them disjoint by subtracting earlier domains from later domains. */ -static void compute_domains_init_options(isl_set *option[3], +static void compute_domains_init_options(isl_set *option[4], __isl_keep isl_ast_build *build) { - enum isl_ast_build_domain_type type, type2; + enum isl_ast_loop_type type, type2; + isl_set *unroll; - for (type = atomic; type <= separate; ++type) { + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { option[type] = isl_ast_build_get_option_domain(build, type); - for (type2 = atomic; type2 < type; ++type2) + for (type2 = isl_ast_loop_atomic; type2 < type; ++type2) option[type] = isl_set_subtract(option[type], isl_set_copy(option[type2])); } - option[unroll] = isl_set_coalesce(option[unroll]); - option[unroll] = isl_set_make_disjoint(option[unroll]); + unroll = option[isl_ast_loop_unroll]; + unroll = isl_set_coalesce(unroll); + unroll = isl_set_make_disjoint(unroll); + option[isl_ast_loop_unroll] = unroll; } /* Split up the domain at the current depth into disjoint @@ -2944,7 +3020,7 @@ static __isl_give isl_basic_set_list *compute_domains( isl_set *classes; isl_space *space; int n_param; - enum isl_ast_build_domain_type type; + enum isl_ast_loop_type type; int empty; if (!executed) @@ -2989,20 +3065,20 @@ static __isl_give isl_basic_set_list *compute_domains( isl_set_free(domains.schedule_domain); isl_set_free(domains.done); isl_map_free(domains.sep_class); - for (type = atomic; type <= separate; ++type) + for (type = isl_ast_loop_atomic; type <= isl_ast_loop_separate; ++type) isl_set_free(domains.option[type]); return domains.list; } /* Generate code for a single component, after shifting (if any) - * has been applied. + * has been applied, in case the schedule was specified as a union map. * * We first split up the domain at the current depth into disjoint * basic sets based on the user-specified options. * Then we generated code for each of them and concatenate the results. */ -static __isl_give isl_ast_graft_list *generate_shifted_component( +static __isl_give isl_ast_graft_list *generate_shifted_component_flat( __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) { isl_basic_set_list *domain_list; @@ -3018,6 +3094,306 @@ static __isl_give isl_ast_graft_list *generate_shifted_component( return list; } +/* Generate code for a single component, after shifting (if any) + * has been applied, in case the schedule was specified as a schedule tree + * and the separate option was specified. + * + * We perform separation on the domain of "executed" and then generate + * an AST for each of the resulting disjoint basic sets. + */ +static __isl_give isl_ast_graft_list *generate_shifted_component_tree_separate( + __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) +{ + isl_space *space; + isl_set *domain; + isl_basic_set_list *domain_list; + isl_ast_graft_list *list; + + space = isl_ast_build_get_space(build, 1); + domain = separate_schedule_domains(space, + isl_union_map_copy(executed), build); + domain_list = isl_basic_set_list_from_set(domain); + + list = generate_parallel_domains(domain_list, executed, build); + + isl_basic_set_list_free(domain_list); + isl_union_map_free(executed); + isl_ast_build_free(build); + + return list; +} + +/* Internal data structure for generate_shifted_component_tree_unroll. + * + * "executed" and "build" are inputs to generate_shifted_component_tree_unroll. + * "list" collects the constructs grafts. + */ +struct isl_ast_unroll_tree_data { + isl_union_map *executed; + isl_ast_build *build; + isl_ast_graft_list *list; +}; + +/* Initialize data->list to a list of "n" elements. + */ +static int init_unroll_tree(int n, void *user) +{ + struct isl_ast_unroll_tree_data *data = user; + isl_ctx *ctx; + + ctx = isl_ast_build_get_ctx(data->build); + data->list = isl_ast_graft_list_alloc(ctx, n); + + return 0; +} + +/* Given an iteration of an unrolled domain represented by "bset", + * generate the corresponding AST and add the result to data->list. + */ +static int do_unroll_tree_iteration(__isl_take isl_basic_set *bset, void *user) +{ + struct isl_ast_unroll_tree_data *data = user; + + data->list = add_node(data->list, isl_union_map_copy(data->executed), + bset, isl_ast_build_copy(data->build)); + + return 0; +} + +/* Generate code for a single component, after shifting (if any) + * has been applied, in case the schedule was specified as a schedule tree + * and the unroll option was specified. + * + * We call foreach_iteration to iterate over the individual values and + * construct and collect the corresponding grafts in do_unroll_tree_iteration. + */ +static __isl_give isl_ast_graft_list *generate_shifted_component_tree_unroll( + __isl_take isl_union_map *executed, __isl_take isl_set *domain, + __isl_take isl_ast_build *build) +{ + struct isl_ast_unroll_tree_data data = { executed, build, NULL }; + + if (foreach_iteration(domain, build, &init_unroll_tree, + &do_unroll_tree_iteration, &data) < 0) + data.list = isl_ast_graft_list_free(data.list); + + isl_union_map_free(executed); + isl_ast_build_free(build); + + return data.list; +} + +/* 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 + * set or we are within the isolated set (in which case "isolated" is set) + * or the iterations that precede or follow the isolated set. + * + * The schedule domain is broken up or combined into basic sets + * according to the AST generation option specified in the current + * schedule node, which may be either atomic, separate, unroll or + * unspecified. If the option is unspecified, then we currently simply + * split the schedule domain into disjoint basic sets. + * + * In case the separate option is specified, the AST generation is + * handled by generate_shifted_component_tree_separate. + * In the other cases, we need the global schedule domain. + * In the unroll case, the AST generation is then handled by + * generate_shifted_component_tree_unroll which needs the actual + * schedule domain (with divs that may refer to the current dimension) + * so that stride detection can be performed. + * In the atomic or unspecified case, inner dimensions and divs involving + * the current dimensions should be eliminated. + * The result is then either combined into a single basic set or + * split up into disjoint basic sets. + * Finally an AST is generated for each basic set and the results are + * concatenated. + */ +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_union_set *schedule_domain; + isl_set *domain; + isl_basic_set_list *domain_list; + isl_ast_graft_list *list; + enum isl_ast_loop_type type; + + type = isl_ast_build_get_loop_type(build, isolated); + if (type < 0) + goto error; + + if (type == isl_ast_loop_separate) + return generate_shifted_component_tree_separate(executed, + build); + + schedule_domain = isl_union_map_domain(isl_union_map_copy(executed)); + domain = isl_set_from_union_set(schedule_domain); + + if (type == isl_ast_loop_unroll) + return generate_shifted_component_tree_unroll(executed, domain, + build); + + domain = isl_ast_build_eliminate(build, domain); + domain = isl_set_coalesce(domain); + + if (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); + } else { + domain = isl_set_make_disjoint(domain); + domain_list = isl_basic_set_list_from_set(domain); + } + + list = generate_parallel_domains(domain_list, executed, build); + + isl_basic_set_list_free(domain_list); + isl_union_map_free(executed); + isl_ast_build_free(build); + + return list; +error: + isl_union_map_free(executed); + isl_ast_build_free(build); + return NULL; +} + +/* 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, do so for the specified subset of the schedule domsain. + */ +static __isl_give isl_ast_graft_list *generate_shifted_component_tree_part( + __isl_keep isl_union_map *executed, __isl_take isl_set *domain, + __isl_keep isl_ast_build *build, int isolated) +{ + isl_union_set *uset; + int empty; + + uset = isl_union_set_from_set(domain); + executed = isl_union_map_copy(executed); + executed = isl_union_map_intersect_domain(executed, uset); + empty = isl_union_map_is_empty(executed); + if (empty < 0) + goto error; + if (empty) { + isl_ctx *ctx; + isl_union_map_free(executed); + ctx = isl_ast_build_get_ctx(build); + return isl_ast_graft_list_alloc(ctx, 0); + } + + build = isl_ast_build_copy(build); + return generate_shifted_component_tree_base(executed, build, isolated); +error: + isl_union_map_free(executed); + return NULL; +} + +/* Generate code for a single component, after shifting (if any) + * has been applied, in case the schedule was specified as a schedule tree. + * + * We first check if the user has specified a (non-empty) isolated + * schedule domain. + * If so, we break up the schedule domain into iterations that + * precede the isolated domain, the isolated domain itself, + * the iterations that follow the isolated domain and + * the remaining iterations (those that are incomparable + * to the isolated domain). + * We generate an AST for each piece and concatenate the results. + * If no isolated set has been specified, then we generate an + * AST for the entire inverse schedule. + */ +static __isl_give isl_ast_graft_list *generate_shifted_component_tree( + __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) +{ + int i, depth; + int empty, has_isolate; + isl_space *space; + isl_union_set *schedule_domain; + isl_set *domain; + isl_basic_set *hull; + isl_set *isolated, *before, *after; + isl_map *gt, *lt; + isl_ast_graft_list *list, *res; + + build = isl_ast_build_extract_isolated(build); + has_isolate = isl_ast_build_has_isolated(build); + if (has_isolate < 0) + executed = isl_union_map_free(executed); + else if (!has_isolate) + return generate_shifted_component_tree_base(executed, build, 0); + + schedule_domain = isl_union_map_domain(isl_union_map_copy(executed)); + domain = isl_set_from_union_set(schedule_domain); + + isolated = isl_ast_build_get_isolated(build); + isolated = isl_set_intersect(isolated, isl_set_copy(domain)); + empty = isl_set_is_empty(isolated); + if (empty < 0) + goto error; + if (empty) { + isl_set_free(isolated); + isl_set_free(domain); + return generate_shifted_component_tree_base(executed, build, 0); + } + isolated = isl_ast_build_eliminate(build, isolated); + hull = isl_set_unshifted_simple_hull(isolated); + isolated = isl_set_from_basic_set(hull); + + depth = isl_ast_build_get_depth(build); + space = isl_space_map_from_set(isl_set_get_space(isolated)); + gt = isl_map_universe(space); + for (i = 0; i < depth; ++i) + gt = isl_map_equate(gt, isl_dim_in, i, isl_dim_out, i); + gt = isl_map_order_gt(gt, isl_dim_in, depth, isl_dim_out, depth); + lt = isl_map_reverse(isl_map_copy(gt)); + before = isl_set_apply(isl_set_copy(isolated), gt); + after = isl_set_apply(isl_set_copy(isolated), lt); + + domain = isl_set_subtract(domain, isl_set_copy(isolated)); + domain = isl_set_subtract(domain, isl_set_copy(before)); + domain = isl_set_subtract(domain, isl_set_copy(after)); + after = isl_set_subtract(after, isl_set_copy(isolated)); + after = isl_set_subtract(after, isl_set_copy(before)); + before = isl_set_subtract(before, isl_set_copy(isolated)); + + res = generate_shifted_component_tree_part(executed, before, build, 0); + list = generate_shifted_component_tree_part(executed, isolated, + build, 1); + res = isl_ast_graft_list_concat(res, list); + list = generate_shifted_component_tree_part(executed, after, build, 0); + res = isl_ast_graft_list_concat(res, list); + list = generate_shifted_component_tree_part(executed, domain, build, 0); + res = isl_ast_graft_list_concat(res, list); + + isl_union_map_free(executed); + isl_ast_build_free(build); + + return res; +error: + isl_set_free(domain); + isl_set_free(isolated); + isl_union_map_free(executed); + isl_ast_build_free(build); + return NULL; +} + +/* Generate code for a single component, after shifting (if any) + * has been applied. + * + * Call generate_shifted_component_tree or generate_shifted_component_flat + * depending on whether the schedule was specified as a schedule tree. + */ +static __isl_give isl_ast_graft_list *generate_shifted_component( + __isl_take isl_union_map *executed, __isl_take isl_ast_build *build) +{ + if (isl_ast_build_has_schedule_node(build)) + return generate_shifted_component_tree(executed, build); + else + return generate_shifted_component_flat(executed, build); +} + struct isl_set_map_pair { isl_set *set; isl_map *map; @@ -3398,6 +3774,21 @@ error: return NULL; } +/* Does any node in the schedule tree rooted at the current schedule node + * of "build" depend on outer schedule nodes? + */ +static int has_anchored_subtree(__isl_keep isl_ast_build *build) +{ + isl_schedule_node *node; + int dependent = 0; + + node = isl_ast_build_get_schedule_node(build); + dependent = isl_schedule_node_is_subtree_anchored(node); + isl_schedule_node_free(node); + + return dependent; +} + /* Generate code for a single component. * * The component inverse schedule is specified as the "map" fields @@ -3429,11 +3820,15 @@ error: * a fixed value for almost all domains then there is nothing to be done. * In particular, we need at least two domains where the current schedule * dimension does not have a fixed value. - * Finally, if any of the options refer to the current schedule dimension, + * Finally, in case of a schedule map input, + * if any of the options refer to the current schedule dimension, * then we bail out as well. It would be possible to reformulate the options * in terms of the new schedule domain, but that would introduce constraints * that separate the domains in the options and that is something we would * like to avoid. + * In the case of a schedule tree input, we bail out if any of + * the descendants of the current schedule node refer to outer + * schedule nodes in any way. * * * To see if there is any shifted stride, we look at the differences @@ -3485,8 +3880,12 @@ static __isl_give isl_ast_graft_list *generate_component( skip = n == 1; if (skip >= 0 && !skip) skip = at_most_one_non_fixed(domain, order, n, depth); - if (skip >= 0 && !skip) - skip = isl_ast_build_options_involve_depth(build); + if (skip >= 0 && !skip) { + if (isl_ast_build_has_schedule_node(build)) + skip = has_anchored_subtree(build); + else + skip = isl_ast_build_options_involve_depth(build); + } if (skip < 0) goto error; if (skip) @@ -3578,8 +3977,339 @@ static int extract_domain(__isl_take isl_map *map, void *user) return 0; } +static int after_in_tree(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node); + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the child of "node"? + */ +static int after_in_child(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + isl_schedule_node *child; + int after; + + child = isl_schedule_node_get_child(node, 0); + after = after_in_tree(umap, child); + isl_schedule_node_free(child); + + return after; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the band node "node"? + * + * We first check if any domain element is scheduled after any + * of the corresponding image elements by the band node itself. + * If not, we restrict "map" to those pairs of element that + * are scheduled together by the band node and continue with + * the child of the band node. + * If there are no such pairs then the map passed to after_in_child + * will be empty causing it to return 0. + */ +static int after_in_band(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + isl_multi_union_pw_aff *mupa; + isl_union_map *partial, *test, *gt, *universe, *umap1, *umap2; + isl_union_set *domain, *range; + isl_space *space; + int empty; + int after; + + if (isl_schedule_node_band_n_member(node) == 0) + return after_in_child(umap, node); + + mupa = isl_schedule_node_band_get_partial_schedule(node); + space = isl_multi_union_pw_aff_get_space(mupa); + partial = isl_union_map_from_multi_union_pw_aff(mupa); + test = isl_union_map_copy(umap); + test = isl_union_map_apply_domain(test, isl_union_map_copy(partial)); + test = isl_union_map_apply_range(test, isl_union_map_copy(partial)); + gt = isl_union_map_from_map(isl_map_lex_gt(space)); + test = isl_union_map_intersect(test, gt); + empty = isl_union_map_is_empty(test); + isl_union_map_free(test); + + if (empty < 0 || !empty) { + isl_union_map_free(partial); + return empty < 0 ? -1 : 1; + } + + universe = isl_union_map_universe(isl_union_map_copy(umap)); + domain = isl_union_map_domain(isl_union_map_copy(universe)); + range = isl_union_map_range(universe); + umap1 = isl_union_map_copy(partial); + umap1 = isl_union_map_intersect_domain(umap1, domain); + umap2 = isl_union_map_intersect_domain(partial, range); + test = isl_union_map_apply_range(umap1, isl_union_map_reverse(umap2)); + test = isl_union_map_intersect(test, isl_union_map_copy(umap)); + after = after_in_child(test, node); + isl_union_map_free(test); + return after; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the context node "node"? + * + * The context constraints apply to the schedule domain, + * so we cannot apply them directly to "umap", which contains + * pairs of statement instances. Instead, we add them + * to the range of the prefix schedule for both domain and + * range of "umap". + */ +static int after_in_context(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + isl_union_map *prefix, *universe, *umap1, *umap2; + isl_union_set *domain, *range; + isl_set *context; + int after; + + umap = isl_union_map_copy(umap); + context = isl_schedule_node_context_get_context(node); + prefix = isl_schedule_node_get_prefix_schedule_union_map(node); + universe = isl_union_map_universe(isl_union_map_copy(umap)); + domain = isl_union_map_domain(isl_union_map_copy(universe)); + range = isl_union_map_range(universe); + umap1 = isl_union_map_copy(prefix); + umap1 = isl_union_map_intersect_domain(umap1, domain); + umap2 = isl_union_map_intersect_domain(prefix, range); + umap1 = isl_union_map_intersect_range(umap1, + isl_union_set_from_set(context)); + umap1 = isl_union_map_apply_range(umap1, isl_union_map_reverse(umap2)); + umap = isl_union_map_intersect(umap, umap1); + + after = after_in_child(umap, node); + + isl_union_map_free(umap); + + return after; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the filter node "node"? + * + * We intersect domain and range of "umap" with the filter and + * continue with its child. + */ +static int after_in_filter(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + isl_union_set *filter; + int after; + + umap = isl_union_map_copy(umap); + filter = isl_schedule_node_filter_get_filter(node); + umap = isl_union_map_intersect_domain(umap, isl_union_set_copy(filter)); + umap = isl_union_map_intersect_range(umap, filter); + + after = after_in_child(umap, node); + + isl_union_map_free(umap); + + return after; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the set node "node"? + * + * This is only the case if this condition holds in any + * of the (filter) children of the set node. + * In particular, if the domain and the range of "umap" + * are contained in different children, then the condition + * does not hold. + */ +static int after_in_set(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + int i, n; + + n = isl_schedule_node_n_children(node); + for (i = 0; i < n; ++i) { + isl_schedule_node *child; + int after; + + child = isl_schedule_node_get_child(node, i); + after = after_in_tree(umap, child); + isl_schedule_node_free(child); + + if (after < 0 || after) + return after; + } + + return 0; +} + +/* Return the filter of child "i" of "node". + */ +static __isl_give isl_union_set *child_filter( + __isl_keep isl_schedule_node *node, int i) +{ + isl_schedule_node *child; + isl_union_set *filter; + + child = isl_schedule_node_get_child(node, i); + filter = isl_schedule_node_filter_get_filter(child); + isl_schedule_node_free(child); + + return filter; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at + * the sequence node "node"? + * + * This happens in particular if any domain element is + * contained in a later child than one containing a range element or + * if the condition holds within a given child in the sequence. + * The later part of the condition is checked by after_in_set. + */ +static int after_in_sequence(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + int i, j, n; + isl_union_map *umap_i; + int empty, after = 0; + + n = isl_schedule_node_n_children(node); + for (i = 1; i < n; ++i) { + isl_union_set *filter_i; + + umap_i = isl_union_map_copy(umap); + filter_i = child_filter(node, i); + umap_i = isl_union_map_intersect_domain(umap_i, filter_i); + empty = isl_union_map_is_empty(umap_i); + if (empty < 0) + goto error; + if (empty) { + isl_union_map_free(umap_i); + continue; + } + + for (j = 0; j < i; ++j) { + isl_union_set *filter_j; + isl_union_map *umap_ij; + + umap_ij = isl_union_map_copy(umap_i); + filter_j = child_filter(node, j); + umap_ij = isl_union_map_intersect_range(umap_ij, + filter_j); + empty = isl_union_map_is_empty(umap_ij); + isl_union_map_free(umap_ij); + + if (empty < 0) + goto error; + if (!empty) + after = 1; + if (after) + break; + } + + isl_union_map_free(umap_i); + if (after) + break; + } + + if (after < 0 || after) + return after; + + return after_in_set(umap, node); +error: + isl_union_map_free(umap_i); + return -1; +} + +/* Is any domain element of "umap" scheduled after any of + * the corresponding image elements by the tree rooted at "node"? + * + * If "umap" is empty, then clearly there is no such element. + * Otherwise, consider the different types of nodes separately. + */ +static int after_in_tree(__isl_keep isl_union_map *umap, + __isl_keep isl_schedule_node *node) +{ + int empty; + enum isl_schedule_node_type type; + + empty = isl_union_map_is_empty(umap); + if (empty < 0) + return -1; + if (empty) + return 0; + if (!node) + return -1; + + type = isl_schedule_node_get_type(node); + switch (type) { + case isl_schedule_node_error: + return -1; + case isl_schedule_node_leaf: + return 0; + case isl_schedule_node_band: + return after_in_band(umap, node); + case isl_schedule_node_domain: + isl_die(isl_schedule_node_get_ctx(node), isl_error_internal, + "unexpected internal domain node", return -1); + case isl_schedule_node_context: + return after_in_context(umap, node); + case isl_schedule_node_filter: + return after_in_filter(umap, node); + case isl_schedule_node_set: + return after_in_set(umap, node); + case isl_schedule_node_sequence: + return after_in_sequence(umap, node); + } + + return 1; +} + +/* Is any domain element of "map1" scheduled after any domain + * element of "map2" by the subtree underneath the current band node, + * while at the same time being scheduled together by the current + * band node, i.e., by "map1" and "map2? + * + * If the child of the current band node is a leaf, then + * no element can be scheduled after any other element. + * + * Otherwise, we construct a relation between domain elements + * of "map1" and domain elements of "map2" that are scheduled + * together and then check if the subtree underneath the current + * band node determines their relative order. + */ +static int after_in_subtree(__isl_keep isl_ast_build *build, + __isl_keep isl_map *map1, __isl_keep isl_map *map2) +{ + isl_schedule_node *node; + isl_map *map; + isl_union_map *umap; + int after; + + node = isl_ast_build_get_schedule_node(build); + if (!node) + return -1; + node = isl_schedule_node_child(node, 0); + if (isl_schedule_node_get_type(node) == isl_schedule_node_leaf) { + isl_schedule_node_free(node); + return 0; + } + map = isl_map_copy(map2); + map = isl_map_apply_domain(map, isl_map_copy(map1)); + umap = isl_union_map_from_map(map); + after = after_in_tree(umap, node); + isl_union_map_free(umap); + isl_schedule_node_free(node); + return after; +} + /* Internal data for any_scheduled_after. * + * "build" is the build in which the AST is constructed. * "depth" is the number of loops that have already been generated * "group_coscheduled" is a local copy of options->ast_build_group_coscheduled * "domain" is an array of set-map pairs corresponding to the different @@ -3587,6 +4317,7 @@ static int extract_domain(__isl_take isl_map *map, void *user) * of the inverse schedule, while the map is the inverse schedule itself. */ struct isl_any_scheduled_after_data { + isl_ast_build *build; int depth; int group_coscheduled; struct isl_set_map_pair *domain; @@ -3598,6 +4329,11 @@ struct isl_any_scheduled_after_data { * data->domain[i].set contains the domain of the inverse schedule * for domain "i", i.e., elements in the schedule domain. * + * If we are inside a band of a schedule tree and there is a pair + * of elements in the two domains that is schedule together by + * the current band, then we check if any element of "i" may be schedule + * after element of "j" by the descendants of the band node. + * * If data->group_coscheduled is set, then we also return 1 if there * is any pair of elements in the two domains that are scheduled together. */ @@ -3621,6 +4357,15 @@ static int any_scheduled_after(int i, int j, void *user) return 0; } + if (isl_ast_build_has_schedule_node(data->build)) { + int after; + + after = after_in_subtree(data->build, data->domain[i].map, + data->domain[j].map); + if (after < 0 || after) + return after; + } + return data->group_coscheduled; } @@ -3667,6 +4412,7 @@ static __isl_give isl_ast_graft_list *generate_components( if (!build) goto error; + data.build = build; data.depth = isl_ast_build_get_depth(build); data.group_coscheduled = isl_options_get_ast_build_group_coscheduled(ctx); g = isl_tarjan_graph_init(ctx, n, &any_scheduled_after, &data); @@ -3753,7 +4499,7 @@ error: return NULL; } -/* Internal data structure used by isl_ast_build_ast_from_schedule. +/* Internal data structure used by isl_ast_build_node_from_schedule_map. * internal, executed and build are the inputs to generate_code. * list collects the output. */ @@ -3811,7 +4557,8 @@ static __isl_give isl_union_map *internal_executed( * It is equal to the space of "set" if build->domain is parametric. * Otherwise, it is equal to the range of the wrapped space of "set". * - * If the build space is not parametric and if isl_ast_build_ast_from_schedule + * If the build space is not parametric and + * if isl_ast_build_node_from_schedule_map * was called from an outside user (data->internal not set), then * the (inverse) schedule refers to the external build domain and needs to * be transformed to refer to the internal build domain. @@ -4012,7 +4759,7 @@ error: * the schedule domain in the domain and the elements to be executed * in the range) called "executed". */ -__isl_give isl_ast_node *isl_ast_build_ast_from_schedule( +__isl_give isl_ast_node *isl_ast_build_node_from_schedule_map( __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule) { isl_ast_graft_list *list; @@ -4030,3 +4777,463 @@ __isl_give isl_ast_node *isl_ast_build_ast_from_schedule( return node; } + +/* The old name for isl_ast_build_node_from_schedule_map. + * It is being kept for backward compatibility, but + * it will be removed in the future. + */ +__isl_give isl_ast_node *isl_ast_build_ast_from_schedule( + __isl_keep isl_ast_build *build, __isl_take isl_union_map *schedule) +{ + return isl_ast_build_node_from_schedule_map(build, schedule); +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the band node "node" and its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * If the band is empty, we continue with its descendants. + * Otherwise, we extend the build and the inverse schedule with + * the additional space/partial schedule and continue generating + * an AST in generate_next_level. + * As soon as we have extended the inverse schedule with the additional + * partial schedule, we look for equalities that may exists between + * the old and the new part. + */ +static __isl_give isl_ast_graft_list *build_ast_from_band( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + isl_space *space; + isl_multi_union_pw_aff *extra; + isl_union_map *extra_umap; + isl_ast_graft_list *list; + unsigned n1, n2; + + if (!build || !node || !executed) + goto error; + + if (isl_schedule_node_band_n_member(node) == 0) + return build_ast_from_child(build, node, executed); + + extra = isl_schedule_node_band_get_partial_schedule(node); + extra = isl_multi_union_pw_aff_align_params(extra, + isl_ast_build_get_space(build, 1)); + space = isl_multi_union_pw_aff_get_space(extra); + + extra_umap = isl_union_map_from_multi_union_pw_aff(extra); + extra_umap = isl_union_map_reverse(extra_umap); + + executed = isl_union_map_domain_product(executed, extra_umap); + executed = isl_union_map_detect_equalities(executed); + + n1 = isl_ast_build_dim(build, isl_dim_param); + build = isl_ast_build_product(build, space); + n2 = isl_ast_build_dim(build, isl_dim_param); + if (n2 > n1) + isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, + "band node is not allowed to introduce new parameters", + build = isl_ast_build_free(build)); + build = isl_ast_build_set_schedule_node(build, node); + + list = generate_next_level(executed, build); + + list = isl_ast_graft_list_unembed(list, 1); + + return list; +error: + isl_schedule_node_free(node); + isl_union_map_free(executed); + isl_ast_build_free(build); + return NULL; +} + +/* Hoist a list of grafts (in practice containing a single graft) + * from "sub_build" (which includes extra context information) + * to "build". + * + * In particular, project out all additional parameters introduced + * by the context node from the enforced constraints and the guard + * of the single graft. + */ +static __isl_give isl_ast_graft_list *hoist_out_of_context( + __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build, + __isl_keep isl_ast_build *sub_build) +{ + isl_ast_graft *graft; + isl_basic_set *enforced; + isl_set *guard; + unsigned n_param, extra_param; + + if (!build || !sub_build) + return isl_ast_graft_list_free(list); + + n_param = isl_ast_build_dim(build, isl_dim_param); + extra_param = isl_ast_build_dim(sub_build, isl_dim_param); + + if (extra_param == n_param) + return list; + + extra_param -= n_param; + enforced = isl_ast_graft_list_extract_shared_enforced(list, sub_build); + enforced = isl_basic_set_project_out(enforced, isl_dim_param, + n_param, extra_param); + enforced = isl_basic_set_remove_unknown_divs(enforced); + guard = isl_ast_graft_list_extract_hoistable_guard(list, sub_build); + guard = isl_set_remove_divs_involving_dims(guard, isl_dim_param, + n_param, extra_param); + guard = isl_set_project_out(guard, isl_dim_param, n_param, extra_param); + guard = isl_set_compute_divs(guard); + graft = isl_ast_graft_alloc_from_children(list, guard, enforced, + build, sub_build); + list = isl_ast_graft_list_from_ast_graft(graft); + + return list; +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the context node "node" + * and its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * The context node may introduce additional parameters as well as + * constraints on the outer schedule dimenions or original parameters. + * + * We add the extra parameters to a new build and the context + * constraints to both the build and (as a single disjunct) + * to the domain of "executed". Since the context constraints + * are specified in terms of the input schedule, we first need + * to map them to the internal schedule domain. + * + * After constructing the AST from the descendants of "node", + * we combine the list of grafts into a single graft within + * the new build, in order to be able to exploit the additional + * context constraints during this combination. + * + * Additionally, if the current node is the outermost node in + * the schedule tree (apart from the root domain node), we generate + * all pending guards, again to be able to exploit the additional + * context constraints. We currently do not do this for internal + * context nodes since we may still want to hoist conditions + * to outer AST nodes. + * + * If the context node introduced any new parameters, then they + * are removed from the set of enforced constraints and guard + * in hoist_out_of_context. + */ +static __isl_give isl_ast_graft_list *build_ast_from_context( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + isl_set *context; + isl_space *space; + isl_multi_aff *internal2input; + isl_ast_build *sub_build; + isl_ast_graft_list *list; + int n, depth; + + depth = isl_schedule_node_get_tree_depth(node); + space = isl_ast_build_get_space(build, 1); + context = isl_schedule_node_context_get_context(node); + context = isl_set_align_params(context, space); + sub_build = isl_ast_build_copy(build); + space = isl_set_get_space(context); + sub_build = isl_ast_build_align_params(sub_build, space); + internal2input = isl_ast_build_get_internal2input(sub_build); + context = isl_set_preimage_multi_aff(context, internal2input); + sub_build = isl_ast_build_restrict_generated(sub_build, + isl_set_copy(context)); + context = isl_set_from_basic_set(isl_set_simple_hull(context)); + executed = isl_union_map_intersect_domain(executed, + isl_union_set_from_set(context)); + + list = build_ast_from_child(isl_ast_build_copy(sub_build), + node, executed); + n = isl_ast_graft_list_n_ast_graft(list); + if (n < 0) + list = isl_ast_graft_list_free(list); + + list = isl_ast_graft_list_fuse(list, sub_build); + if (depth == 1) + list = isl_ast_graft_list_insert_pending_guard_nodes(list, + sub_build); + if (n >= 1) + list = hoist_out_of_context(list, build, sub_build); + + isl_ast_build_free(build); + isl_ast_build_free(sub_build); + + return list; +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the filter node "node" and + * its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * We simply intersect the iteration domain (i.e., the range of "executed") + * with the filter and continue with the descendants of the node, + * unless the resulting inverse schedule is empty, in which + * case we return an empty list. + */ +static __isl_give isl_ast_graft_list *build_ast_from_filter( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + isl_ctx *ctx; + isl_union_set *filter; + isl_ast_graft_list *list; + int empty; + unsigned n1, n2; + + if (!build || !node || !executed) + goto error; + + filter = isl_schedule_node_filter_get_filter(node); + filter = isl_union_set_align_params(filter, + isl_union_map_get_space(executed)); + n1 = isl_union_map_dim(executed, isl_dim_param); + executed = isl_union_map_intersect_range(executed, filter); + n2 = isl_union_map_dim(executed, isl_dim_param); + if (n2 > n1) + isl_die(isl_ast_build_get_ctx(build), isl_error_invalid, + "filter node is not allowed to introduce " + "new parameters", goto error); + + empty = isl_union_map_is_empty(executed); + if (empty < 0) + goto error; + if (!empty) + return build_ast_from_child(build, node, executed); + + ctx = isl_ast_build_get_ctx(build); + list = isl_ast_graft_list_alloc(ctx, 0); + isl_ast_build_free(build); + isl_schedule_node_free(node); + isl_union_map_free(executed); + return list; +error: + isl_ast_build_free(build); + isl_schedule_node_free(node); + isl_union_map_free(executed); + return NULL; +} + +static __isl_give isl_ast_graft_list *build_ast_from_schedule_node( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed); + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the sequence (or set) node "node" and + * its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * We simply generate an AST for each of the children and concatenate + * the results. + */ +static __isl_give isl_ast_graft_list *build_ast_from_sequence( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + int i, n; + isl_ctx *ctx; + isl_ast_graft_list *list; + + ctx = isl_ast_build_get_ctx(build); + list = isl_ast_graft_list_alloc(ctx, 0); + + n = isl_schedule_node_n_children(node); + for (i = 0; i < n; ++i) { + isl_schedule_node *child; + isl_ast_graft_list *list_i; + + child = isl_schedule_node_get_child(node, i); + list_i = build_ast_from_schedule_node(isl_ast_build_copy(build), + child, isl_union_map_copy(executed)); + list = isl_ast_graft_list_concat(list, list_i); + } + isl_ast_build_free(build); + isl_schedule_node_free(node); + isl_union_map_free(executed); + + return list; +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the node "node" and its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * If the node is a leaf, then we pass control to generate_inner_level. + * Note that the current build does not refer to any band node, so + * that generate_inner_level will not try to visit the child of + * the leaf node. + * + * The other node types are handled in separate functions. + * Set nodes are currently treated in the same way as sequence nodes. + * The children of a set node may be executed in any order, + * including the order of the children. + */ +static __isl_give isl_ast_graft_list *build_ast_from_schedule_node( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + enum isl_schedule_node_type type; + + type = isl_schedule_node_get_type(node); + + switch (type) { + case isl_schedule_node_error: + goto error; + case isl_schedule_node_leaf: + isl_schedule_node_free(node); + return generate_inner_level(executed, build); + case isl_schedule_node_band: + return build_ast_from_band(build, node, executed); + case isl_schedule_node_context: + return build_ast_from_context(build, node, executed); + case isl_schedule_node_domain: + isl_die(isl_schedule_node_get_ctx(node), isl_error_unsupported, + "unexpected internal domain node", goto error); + case isl_schedule_node_filter: + return build_ast_from_filter(build, node, executed); + case isl_schedule_node_sequence: + case isl_schedule_node_set: + return build_ast_from_sequence(build, node, executed); + } + + isl_die(isl_ast_build_get_ctx(build), isl_error_internal, + "unhandled type", goto error); +error: + isl_union_map_free(executed); + isl_schedule_node_free(node); + isl_ast_build_free(build); + + return NULL; +} + +/* Generate an AST that visits the elements in the domain of "executed" + * in the relative order specified by the (single) child of "node" and + * its descendants. + * + * The relation "executed" maps the outer generated loop iterators + * to the domain elements executed by those iterations. + * + * This function is never called on a leaf, set or sequence node, + * so the node always has exactly one child. + */ +static __isl_give isl_ast_graft_list *build_ast_from_child( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node, + __isl_take isl_union_map *executed) +{ + node = isl_schedule_node_child(node, 0); + return build_ast_from_schedule_node(build, node, executed); +} + +/* Generate an AST that visits the elements in the domain of the domain + * node "node" in the relative order specified by its descendants. + * + * An initial inverse schedule is created that maps a zero-dimensional + * schedule space to the node domain. + * The input "build" is assumed to have a parametric domain and + * is replaced by the same zero-dimensional schedule space. + * + * We also add some of the parameter constraints in the build domain + * to the executed relation. Adding these constraints + * allows for an earlier detection of conflicts in some cases. + * However, we do not want to divide the executed relation into + * more disjuncts than necessary. We therefore approximate + * the constraints on the parameters by a single disjunct set. + */ +static __isl_give isl_ast_node *build_ast_from_domain( + __isl_take isl_ast_build *build, __isl_take isl_schedule_node *node) +{ + isl_ctx *ctx; + isl_union_set *domain, *schedule_domain; + isl_union_map *executed; + isl_space *space; + isl_set *set; + isl_ast_graft_list *list; + isl_ast_node *ast; + int is_params; + + if (!build) + goto error; + + ctx = isl_ast_build_get_ctx(build); + space = isl_ast_build_get_space(build, 1); + is_params = isl_space_is_params(space); + isl_space_free(space); + if (is_params < 0) + goto error; + if (!is_params) + isl_die(ctx, isl_error_unsupported, + "expecting parametric initial context", goto error); + + domain = isl_schedule_node_domain_get_domain(node); + domain = isl_union_set_coalesce(domain); + + space = isl_union_set_get_space(domain); + space = isl_space_set_from_params(space); + build = isl_ast_build_product(build, space); + + set = isl_ast_build_get_domain(build); + set = isl_set_from_basic_set(isl_set_simple_hull(set)); + schedule_domain = isl_union_set_from_set(set); + + executed = isl_union_map_from_domain_and_range(schedule_domain, domain); + list = build_ast_from_child(isl_ast_build_copy(build), node, executed); + ast = isl_ast_node_from_graft_list(list, build); + isl_ast_build_free(build); + + return ast; +error: + isl_schedule_node_free(node); + isl_ast_build_free(build); + return NULL; +} + +/* Generate an AST that visits the elements in the domain of "schedule" + * in the relative order specified by the schedule tree. + * + * "build" is an isl_ast_build that has been created using + * isl_ast_build_alloc or isl_ast_build_from_context based + * on a parametric set. + * + * The construction starts at the root node of the schedule, + * which is assumed to be a domain node. + */ +__isl_give isl_ast_node *isl_ast_build_node_from_schedule( + __isl_keep isl_ast_build *build, __isl_take isl_schedule *schedule) +{ + isl_ctx *ctx; + isl_schedule_node *node; + + if (!build || !schedule) + goto error; + + ctx = isl_ast_build_get_ctx(build); + + node = isl_schedule_get_root(schedule); + isl_schedule_free(schedule); + + build = isl_ast_build_copy(build); + build = isl_ast_build_set_single_valued(build, 0); + if (isl_schedule_node_get_type(node) != isl_schedule_node_domain) + isl_die(ctx, isl_error_unsupported, + "expecting root domain node", + build = isl_ast_build_free(build)); + return build_ast_from_domain(build, node); +error: + isl_schedule_free(schedule); + return NULL; +} diff --git a/polly/lib/External/isl/isl_ast_graft.c b/polly/lib/External/isl/isl_ast_graft.c index c8d22725ee0..4b3bd1117ca 100644 --- a/polly/lib/External/isl/isl_ast_graft.c +++ b/polly/lib/External/isl/isl_ast_graft.c @@ -114,7 +114,11 @@ static int equal_independent_guards(__isl_keep isl_ast_graft_list *list, return -1; depth = isl_ast_build_get_depth(build); - skip = isl_set_involves_dims(graft_0->guard, isl_dim_set, depth, 1); + if (isl_set_dim(graft_0->guard, isl_dim_set) <= depth) + skip = 0; + else + skip = isl_set_involves_dims(graft_0->guard, + isl_dim_set, depth, 1); if (skip < 0 || skip) { isl_ast_graft_free(graft_0); return skip < 0 ? -1 : 0; @@ -649,6 +653,42 @@ static __isl_give isl_ast_graft_list *insert_pending_guard_nodes( return res; } +/* For each graft in "list", + * insert an if node around graft->node testing the condition encoded + * in graft->guard, assuming graft->guard involves any conditions. + * Subsequently remove the guards from the grafts. + */ +__isl_give isl_ast_graft_list *isl_ast_graft_list_insert_pending_guard_nodes( + __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build) +{ + int i, n; + isl_set *universe; + + list = insert_pending_guard_nodes(list, build); + if (!list) + return NULL; + + universe = isl_set_universe(isl_ast_build_get_space(build, 1)); + n = isl_ast_graft_list_n_ast_graft(list); + for (i = 0; i < n; ++i) { + isl_ast_graft *graft; + + graft = isl_ast_graft_list_get_ast_graft(list, i); + if (!graft) + break; + isl_set_free(graft->guard); + graft->guard = isl_set_copy(universe); + if (!graft->guard) + graft = isl_ast_graft_free(graft); + list = isl_ast_graft_list_set_ast_graft(list, i, graft); + } + isl_set_free(universe); + if (i < n) + return isl_ast_graft_list_free(list); + + return list; +} + /* Collect the nodes contained in the grafts in "list" in a node list. */ static __isl_give isl_ast_node_list *extract_node_list( diff --git a/polly/lib/External/isl/isl_ast_graft_private.h b/polly/lib/External/isl/isl_ast_graft_private.h index 82b1c1ccaa0..5dc141e275b 100644 --- a/polly/lib/External/isl/isl_ast_graft_private.h +++ b/polly/lib/External/isl/isl_ast_graft_private.h @@ -80,6 +80,8 @@ __isl_give isl_ast_graft_list *isl_ast_graft_list_unembed( __isl_take isl_ast_graft_list *list, int product); __isl_give isl_ast_graft_list *isl_ast_graft_list_preimage_multi_aff( __isl_take isl_ast_graft_list *list, __isl_take isl_multi_aff *ma); +__isl_give isl_ast_graft_list *isl_ast_graft_list_insert_pending_guard_nodes( + __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build); __isl_give isl_ast_node *isl_ast_node_from_graft_list( __isl_take isl_ast_graft_list *list, __isl_keep isl_ast_build *build); diff --git a/polly/lib/External/isl/isl_schedule.c b/polly/lib/External/isl/isl_schedule.c index 41abeea5ce1..4acc33887ed 100644 --- a/polly/lib/External/isl/isl_schedule.c +++ b/polly/lib/External/isl/isl_schedule.c @@ -728,6 +728,9 @@ static __isl_give isl_band_list *construct_band_list( switch (type) { case isl_schedule_node_error: goto error; + case isl_schedule_node_context: + isl_die(isl_schedule_node_get_ctx(node), isl_error_unsupported, + "context nodes not supported", goto error); case isl_schedule_node_domain: isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, "internal domain nodes not allowed", goto error); @@ -849,12 +852,16 @@ static __isl_give isl_printer *print_band_list(__isl_take isl_printer *p, /* Insert a band node with partial schedule "partial" between the domain * root node of "schedule" and its single child. * Return a pointer to the updated schedule. + * + * If any of the nodes in the tree depend on the set of outer band nodes + * then we refuse to insert the band node. */ __isl_give isl_schedule *isl_schedule_insert_partial_schedule( __isl_take isl_schedule *schedule, __isl_take isl_multi_union_pw_aff *partial) { isl_schedule_node *node; + int anchored; node = isl_schedule_get_root(schedule); isl_schedule_free(schedule); @@ -865,6 +872,13 @@ __isl_give isl_schedule *isl_schedule_insert_partial_schedule( "root node not a domain node", goto error); node = isl_schedule_node_child(node, 0); + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + goto error; + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot insert band node in anchored subtree", + goto error); node = isl_schedule_node_insert_partial_schedule(node, partial); schedule = isl_schedule_node_get_schedule(node); @@ -877,6 +891,25 @@ error: return NULL; } +/* Insert a context node with constraints "context" between the domain + * root node of "schedule" and its single child. + * Return a pointer to the updated schedule. + */ +__isl_give isl_schedule *isl_schedule_insert_context( + __isl_take isl_schedule *schedule, __isl_take isl_set *context) +{ + isl_schedule_node *node; + + node = isl_schedule_get_root(schedule); + isl_schedule_free(schedule); + node = isl_schedule_node_child(node, 0); + node = isl_schedule_node_insert_context(node, context); + schedule = isl_schedule_node_get_schedule(node); + isl_schedule_node_free(node); + + return schedule; +} + /* Return a tree with as top-level node a filter corresponding to "filter" and * as child, the (single) child of "tree". * However, if this single child is of type "type", then the filter is inserted diff --git a/polly/lib/External/isl/isl_schedule_band.c b/polly/lib/External/isl/isl_schedule_band.c index 6c0b391e3ac..77808be4fa3 100644 --- a/polly/lib/External/isl/isl_schedule_band.c +++ b/polly/lib/External/isl/isl_schedule_band.c @@ -10,6 +10,8 @@ * B.P. 105 - 78153 Le Chesnay, France */ +#include <string.h> +#include <isl/map.h> #include <isl/schedule_node.h> #include <isl_schedule_band.h> #include <isl_schedule_private.h> @@ -37,14 +39,16 @@ static __isl_give isl_schedule_band *isl_schedule_band_alloc(isl_ctx *ctx) /* Return a new isl_schedule_band with partial schedule "mupa". * First replace "mupa" by its greatest integer part to ensure * that the schedule is always integral. - * The band is not marked permutable and the dimensions are not - * marked coincident. + * The band is not marked permutable, the dimensions are not + * marked coincident and the AST build options are empty. + * Since there are no build options, the node is not anchored. */ __isl_give isl_schedule_band *isl_schedule_band_from_multi_union_pw_aff( __isl_take isl_multi_union_pw_aff *mupa) { isl_ctx *ctx; isl_schedule_band *band; + isl_space *space; mupa = isl_multi_union_pw_aff_floor(mupa); if (!mupa) @@ -57,8 +61,11 @@ __isl_give isl_schedule_band *isl_schedule_band_from_multi_union_pw_aff( band->n = isl_multi_union_pw_aff_dim(mupa, isl_dim_set); band->coincident = isl_calloc_array(ctx, int, band->n); band->mupa = mupa; + space = isl_space_params_alloc(ctx, 0); + band->ast_build_options = isl_union_set_empty(space); + band->anchored = 0; - if (band->n && !band->coincident) + if ((band->n && !band->coincident) || !band->ast_build_options) return isl_schedule_band_free(band); return band; @@ -94,9 +101,27 @@ __isl_give isl_schedule_band *isl_schedule_band_dup( dup->permutable = band->permutable; dup->mupa = isl_multi_union_pw_aff_copy(band->mupa); - if (!dup->mupa) + dup->ast_build_options = isl_union_set_copy(band->ast_build_options); + if (!dup->mupa || !dup->ast_build_options) return isl_schedule_band_free(dup); + if (band->loop_type) { + dup->loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !dup->loop_type) + return isl_schedule_band_free(dup); + for (i = 0; i < band->n; ++i) + dup->loop_type[i] = band->loop_type[i]; + } + if (band->isolate_loop_type) { + dup->isolate_loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !dup->isolate_loop_type) + return isl_schedule_band_free(dup); + for (i = 0; i < band->n; ++i) + dup->isolate_loop_type[i] = band->isolate_loop_type[i]; + } + return dup; } @@ -139,6 +164,9 @@ __isl_null isl_schedule_band *isl_schedule_band_free( return NULL; isl_multi_union_pw_aff_free(band->mupa); + isl_union_set_free(band->ast_build_options); + free(band->loop_type); + free(band->isolate_loop_type); free(band->coincident); free(band); @@ -151,6 +179,7 @@ int isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *band1, __isl_keep isl_schedule_band *band2) { int i; + int equal; if (!band1 || !band2) return -1; @@ -165,7 +194,27 @@ int isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *band1, if (band1->permutable != band2->permutable) return 0; - return isl_multi_union_pw_aff_plain_is_equal(band1->mupa, band2->mupa); + equal = isl_multi_union_pw_aff_plain_is_equal(band1->mupa, band2->mupa); + if (equal < 0 || !equal) + return equal; + + if (!band1->loop_type != !band2->loop_type) + return 0; + if (band1->loop_type) + for (i = 0; i < band1->n; ++i) + if (band1->loop_type[i] != band2->loop_type[i]) + return 0; + + if (!band1->isolate_loop_type != !band2->isolate_loop_type) + return 0; + if (band1->isolate_loop_type) + for (i = 0; i < band1->n; ++i) + if (band1->isolate_loop_type[i] != + band2->isolate_loop_type[i]) + return 0; + + return isl_union_set_is_equal(band1->ast_build_options, + band2->ast_build_options); } /* Return the number of scheduling dimensions in the band. @@ -242,6 +291,14 @@ __isl_give isl_schedule_band *isl_schedule_band_set_permutable( return band; } +/* Is the band node "node" anchored? That is, does it reference + * the outer band nodes? + */ +int isl_schedule_band_is_anchored(__isl_keep isl_schedule_band *band) +{ + return band ? band->anchored : -1; +} + /* Return the schedule space of the band. */ __isl_give isl_space *isl_schedule_band_get_space( @@ -260,6 +317,555 @@ __isl_give isl_multi_union_pw_aff *isl_schedule_band_get_partial_schedule( return band ? isl_multi_union_pw_aff_copy(band->mupa) : NULL; } +/* Return the loop AST generation type for the band member of "band" + * at position "pos". + */ +enum isl_ast_loop_type isl_schedule_band_member_get_ast_loop_type( + __isl_keep isl_schedule_band *band, int pos) +{ + if (!band) + return isl_ast_loop_error; + + if (pos < 0 || pos >= band->n) + isl_die(isl_schedule_band_get_ctx(band), isl_error_invalid, + "invalid member position", return -1); + + if (!band->loop_type) + return isl_ast_loop_default; + + return band->loop_type[pos]; +} + +/* Set the loop AST generation type for the band member of "band" + * at position "pos" to "type". + */ +__isl_give isl_schedule_band *isl_schedule_band_member_set_ast_loop_type( + __isl_take isl_schedule_band *band, int pos, + enum isl_ast_loop_type type) +{ + if (!band) + return NULL; + if (isl_schedule_band_member_get_ast_loop_type(band, pos) == type) + return band; + + if (pos < 0 || pos >= band->n) + isl_die(isl_schedule_band_get_ctx(band), isl_error_invalid, + "invalid member position", + isl_schedule_band_free(band)); + + band = isl_schedule_band_cow(band); + if (!band) + return isl_schedule_band_free(band); + + if (!band->loop_type) { + isl_ctx *ctx; + + ctx = isl_schedule_band_get_ctx(band); + band->loop_type = isl_calloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !band->loop_type) + return isl_schedule_band_free(band); + } + + band->loop_type[pos] = type; + + return band; +} + +/* Return the loop AST generation type for the band member of "band" + * at position "pos" for the part that has been isolated by the isolate option. + */ +enum isl_ast_loop_type isl_schedule_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_band *band, int pos) +{ + if (!band) + return isl_ast_loop_error; + + if (pos < 0 || pos >= band->n) + isl_die(isl_schedule_band_get_ctx(band), isl_error_invalid, + "invalid member position", return -1); + + if (!band->isolate_loop_type) + return isl_ast_loop_default; + + return band->isolate_loop_type[pos]; +} + +/* Set the loop AST generation type for the band member of "band" + * at position "pos" to "type" for the part that has been isolated + * by the isolate option. + */ +__isl_give isl_schedule_band * +isl_schedule_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_band *band, int pos, + enum isl_ast_loop_type type) +{ + if (!band) + return NULL; + if (isl_schedule_band_member_get_isolate_ast_loop_type(band, pos) == + type) + return band; + + if (pos < 0 || pos >= band->n) + isl_die(isl_schedule_band_get_ctx(band), isl_error_invalid, + "invalid member position", + isl_schedule_band_free(band)); + + band = isl_schedule_band_cow(band); + if (!band) + return isl_schedule_band_free(band); + + if (!band->isolate_loop_type) { + isl_ctx *ctx; + + ctx = isl_schedule_band_get_ctx(band); + band->isolate_loop_type = isl_calloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !band->isolate_loop_type) + return isl_schedule_band_free(band); + } + + band->isolate_loop_type[pos] = type; + + return band; +} + +static const char *option_str[] = { + [isl_ast_loop_atomic] = "atomic", + [isl_ast_loop_unroll] = "unroll", + [isl_ast_loop_separate] = "separate" +}; + +/* Given a parameter space "space", extend it to a set space + * + * { type[x] } + * + * or + * + * { [isolate[] -> type[x]] } + * + * depending on whether "isolate" is set. + * These can be used to encode loop AST generation options of the given type. + */ +static __isl_give isl_space *loop_type_space(__isl_take isl_space *space, + enum isl_ast_loop_type type, int isolate) +{ + const char *name; + + name = option_str[type]; + space = isl_space_set_from_params(space); + space = isl_space_add_dims(space, isl_dim_set, 1); + space = isl_space_set_tuple_name(space, isl_dim_set, name); + if (!isolate) + return space; + space = isl_space_from_range(space); + space = isl_space_set_tuple_name(space, isl_dim_in, "isolate"); + space = isl_space_wrap(space); + + return space; +} + +/* Add encodings of the "n" loop AST generation options "type" to "options". + * If "isolate" is set, then these options refer to the isolated part. + * + * In particular, for each sequence of consecutive identical types "t", + * different from the default, add an option + * + * { t[x] : first <= x <= last } + * + * or + * + * { [isolate[] -> t[x]] : first <= x <= last } + */ +static __isl_give isl_union_set *add_loop_types( + __isl_take isl_union_set *options, int n, enum isl_ast_loop_type *type, + int isolate) +{ + int i; + isl_ctx *ctx; + + if (!type) + return options; + if (!options) + return NULL; + + ctx = isl_union_set_get_ctx(options); + for (i = 0; i < n; ++i) { + int first; + isl_space *space; + isl_set *option; + + if (type[i] == isl_ast_loop_default) + continue; + + first = i; + while (i + 1 < n && type[i + 1] == type[i]) + ++i; + + space = isl_union_set_get_space(options); + space = loop_type_space(space, type[i], isolate); + option = isl_set_universe(space); + option = isl_set_lower_bound_si(option, isl_dim_set, 0, first); + option = isl_set_upper_bound_si(option, isl_dim_set, 0, i); + options = isl_union_set_add_set(options, option); + } + + return options; +} + +/* Return the AST build options associated to "band". + */ +__isl_give isl_union_set *isl_schedule_band_get_ast_build_options( + __isl_keep isl_schedule_band *band) +{ + isl_union_set *options; + + if (!band) + return NULL; + + options = isl_union_set_copy(band->ast_build_options); + options = add_loop_types(options, band->n, band->loop_type, 0); + options = add_loop_types(options, band->n, band->isolate_loop_type, 1); + + return options; +} + +/* Does "uset" contain any set that satisfies "is"? + * "is" is assumed to set its integer argument to 1 if it is satisfied. + */ +static int has_any(__isl_keep isl_union_set *uset, + int (*is)(__isl_take isl_set *set, void *user)) +{ + int found = 0; + + if (isl_union_set_foreach_set(uset, is, &found) < 0 && !found) + return -1; + + return found; +} + +/* Does "set" live in a space of the form + * + * isolate[[...] -> [...]] + * + * ? + * + * If so, set *found and abort the search. + */ +static int is_isolate(__isl_take isl_set *set, void *user) +{ + int *found = user; + + if (isl_set_has_tuple_name(set)) { + const char *name; + name = isl_set_get_tuple_name(set); + if (isl_set_is_wrapping(set) && !strcmp(name, "isolate")) + *found = 1; + } + isl_set_free(set); + + return *found ? -1 : 0; +} + +/* Does "options" include an option of the ofrm + * + * isolate[[...] -> [...]] + * + * ? + */ +static int has_isolate_option(__isl_keep isl_union_set *options) +{ + return has_any(options, &is_isolate); +} + +/* Does "set" encode a loop AST generation option? + */ +static int is_loop_type_option(__isl_take isl_set *set, void *user) +{ + int *found = user; + + if (isl_set_dim(set, isl_dim_set) == 1 && + isl_set_has_tuple_name(set)) { + const char *name; + enum isl_ast_loop_type type; + name = isl_set_get_tuple_name(set); + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { + if (strcmp(name, option_str[type])) + continue; + *found = 1; + break; + } + } + isl_set_free(set); + + return *found ? -1 : 0; +} + +/* Does "set" encode a loop AST generation option for the isolated part? + * That is, is of the form + * + * { [isolate[] -> t[x]] } + * + * with t equal to "atomic", "unroll" or "separate"? + */ +static int is_isolate_loop_type_option(__isl_take isl_set *set, void *user) +{ + int *found = user; + const char *name; + enum isl_ast_loop_type type; + isl_map *map; + + if (!isl_set_is_wrapping(set)) { + isl_set_free(set); + return 0; + } + map = isl_set_unwrap(set); + if (!isl_map_has_tuple_name(map, isl_dim_in) || + !isl_map_has_tuple_name(map, isl_dim_out)) { + isl_map_free(map); + return 0; + } + name = isl_map_get_tuple_name(map, isl_dim_in); + if (!strcmp(name, "isolate")) { + name = isl_map_get_tuple_name(map, isl_dim_out); + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { + if (strcmp(name, option_str[type])) + continue; + *found = 1; + break; + } + } + isl_map_free(map); + + return *found ? -1 : 0; +} + +/* Does "options" encode any loop AST generation options + * for the isolated part? + */ +static int has_isolate_loop_type_options(__isl_keep isl_union_set *options) +{ + return has_any(options, &is_isolate_loop_type_option); +} + +/* Does "options" encode any loop AST generation options? + */ +static int has_loop_type_options(__isl_keep isl_union_set *options) +{ + return has_any(options, &is_loop_type_option); +} + +/* Extract the loop AST generation type for the band member + * at position "pos" from "options". + * If "isolate" is set, then extract the loop types for the isolated part. + */ +static enum isl_ast_loop_type extract_loop_type( + __isl_keep isl_union_set *options, int pos, int isolate) +{ + isl_ctx *ctx; + enum isl_ast_loop_type type, res = isl_ast_loop_default; + + ctx = isl_union_set_get_ctx(options); + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { + isl_space *space; + isl_set *option; + int empty; + + space = isl_union_set_get_space(options); + space = loop_type_space(space, type, isolate); + option = isl_union_set_extract_set(options, space); + option = isl_set_fix_si(option, isl_dim_set, 0, pos); + empty = isl_set_is_empty(option); + isl_set_free(option); + + if (empty < 0) + return isl_ast_loop_error; + if (empty) + continue; + if (res != isl_ast_loop_default) + isl_die(ctx, isl_error_invalid, + "conflicting loop type options", + return isl_ast_loop_error); + res = type; + } + + return res; +} + +/* Extract the loop AST generation types for the members of "band" + * from "options" and store them in band->loop_type. + * Return -1 on error. + */ +static int extract_loop_types(__isl_keep isl_schedule_band *band, + __isl_keep isl_union_set *options) +{ + int i; + + if (!band->loop_type) { + isl_ctx *ctx = isl_schedule_band_get_ctx(band); + band->loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !band->loop_type) + return -1; + } + for (i = 0; i < band->n; ++i) { + band->loop_type[i] = extract_loop_type(options, i, 0); + if (band->loop_type[i] == isl_ast_loop_error) + return -1; + } + + return 0; +} + +/* Extract the loop AST generation types for the members of "band" + * from "options" for the isolated part and + * store them in band->isolate_loop_type. + * Return -1 on error. + */ +static int extract_isolate_loop_types(__isl_keep isl_schedule_band *band, + __isl_keep isl_union_set *options) +{ + int i; + + if (!band->isolate_loop_type) { + isl_ctx *ctx = isl_schedule_band_get_ctx(band); + band->isolate_loop_type = isl_alloc_array(ctx, + enum isl_ast_loop_type, band->n); + if (band->n && !band->isolate_loop_type) + return -1; + } + for (i = 0; i < band->n; ++i) { + band->isolate_loop_type[i] = extract_loop_type(options, i, 1); + if (band->isolate_loop_type[i] == isl_ast_loop_error) + return -1; + } + + return 0; +} + +/* Construct universe sets of the spaces that encode loop AST generation + * types (for the isolated part if "isolate" is set). That is, construct + * + * { atomic[x]; separate[x]; unroll[x] } + * + * or + * + * { [isolate[] -> atomic[x]]; [isolate[] -> separate[x]]; + * [isolate[] -> unroll[x]] } + */ +static __isl_give isl_union_set *loop_types(__isl_take isl_space *space, + int isolate) +{ + enum isl_ast_loop_type type; + isl_union_set *types; + + types = isl_union_set_empty(space); + for (type = isl_ast_loop_atomic; + type <= isl_ast_loop_separate; ++type) { + isl_set *set; + + space = isl_union_set_get_space(types); + space = loop_type_space(space, type, isolate); + set = isl_set_universe(space); + types = isl_union_set_add_set(types, set); + } + + return types; +} + +/* Remove all elements from spaces that encode loop AST generation types + * from "options". + */ +static __isl_give isl_union_set *clear_loop_types( + __isl_take isl_union_set *options) +{ + isl_union_set *types; + + types = loop_types(isl_union_set_get_space(options), 0); + options = isl_union_set_subtract(options, types); + + return options; +} + +/* Remove all elements from spaces that encode loop AST generation types + * for the isolated part from "options". + */ +static __isl_give isl_union_set *clear_isolate_loop_types( + __isl_take isl_union_set *options) +{ + isl_union_set *types; + + types = loop_types(isl_union_set_get_space(options), 1); + options = isl_union_set_subtract(options, types); + + return options; +} + +/* Replace the AST build options associated to "band" by "options". + * If there are any loop AST generation type options, then they + * are extracted and stored in band->loop_type. Otherwise, + * band->loop_type is removed to indicate that the default applies + * to all members. Similarly for the loop AST generation type options + * for the isolated part, which are stored in band->isolate_loop_type. + * The remaining options are stored in band->ast_build_options. + * + * Set anchored if the options include an isolate option since the + * domain of the wrapped map references the outer band node schedules. + */ +__isl_give isl_schedule_band *isl_schedule_band_set_ast_build_options( + __isl_take isl_schedule_band *band, __isl_take isl_union_set *options) +{ + int has_isolate, has_loop_type, has_isolate_loop_type; + + band = isl_schedule_band_cow(band); + if (!band || !options) + goto error; + has_isolate = has_isolate_option(options); + if (has_isolate < 0) + goto error; + has_loop_type = has_loop_type_options(options); + if (has_loop_type < 0) + goto error; + has_isolate_loop_type = has_isolate_loop_type_options(options); + if (has_isolate_loop_type < 0) + goto error; + + if (!has_loop_type) { + free(band->loop_type); + band->loop_type = NULL; + } else { + if (extract_loop_types(band, options) < 0) + goto error; + options = clear_loop_types(options); + if (!options) + goto error; + } + + if (!has_isolate_loop_type) { + free(band->isolate_loop_type); + band->isolate_loop_type = NULL; + } else { + if (extract_isolate_loop_types(band, options) < 0) + goto error; + options = clear_isolate_loop_types(options); + if (!options) + goto error; + } + + isl_union_set_free(band->ast_build_options); + band->ast_build_options = options; + band->anchored = has_isolate; + + return band; +error: + isl_schedule_band_free(band); + isl_union_set_free(options); + return NULL; +} + /* Multiply the partial schedule of "band" with the factors in "mv". * Replace the result by its greatest integer part to ensure * that the schedule is always integral. @@ -414,6 +1020,9 @@ error: * * We apply the transformation even if "n" is zero to ensure consistent * behavior with respect to changes in the schedule space. + * + * The loop AST generation types for the isolated part become + * meaningless after dropping dimensions, so we remove them. */ __isl_give isl_schedule_band *isl_schedule_band_drop( __isl_take isl_schedule_band *band, int pos, int n) @@ -436,6 +1045,11 @@ __isl_give isl_schedule_band *isl_schedule_band_drop( for (i = pos + n; i < band->n; ++i) band->coincident[i - n] = band->coincident[i]; + if (band->loop_type) + for (i = pos + n; i < band->n; ++i) + band->loop_type[i - n] = band->loop_type[i]; + free(band->isolate_loop_type); + band->isolate_loop_type = NULL; band->n -= n; @@ -453,7 +1067,9 @@ __isl_give isl_schedule_band *isl_schedule_band_reset_user( return NULL; band->mupa = isl_multi_union_pw_aff_reset_user(band->mupa); - if (!band->mupa) + band->ast_build_options = + isl_union_set_reset_user(band->ast_build_options); + if (!band->mupa || !band->ast_build_options) return isl_schedule_band_free(band); return band; @@ -468,8 +1084,11 @@ __isl_give isl_schedule_band *isl_schedule_band_align_params( if (!band || !space) goto error; - band->mupa = isl_multi_union_pw_aff_align_params(band->mupa, space); - if (!band->mupa) + band->mupa = isl_multi_union_pw_aff_align_params(band->mupa, + isl_space_copy(space)); + band->ast_build_options = + isl_union_set_align_params(band->ast_build_options, space); + if (!band->mupa || !band->ast_build_options) return isl_schedule_band_free(band); return band; diff --git a/polly/lib/External/isl/isl_schedule_band.h b/polly/lib/External/isl/isl_schedule_band.h index 5cf30d41971..8ac5e7da982 100644 --- a/polly/lib/External/isl/isl_schedule_band.h +++ b/polly/lib/External/isl/isl_schedule_band.h @@ -2,6 +2,7 @@ #define ISL_SCHEDULE_BAND_H #include <isl/aff.h> +#include <isl/ast_type.h> #include <isl/union_map.h> /* Information about a band within a schedule. @@ -13,6 +14,17 @@ * permutable is set if the band is permutable. * mupa is the partial schedule corresponding to this band. The dimension * of mupa is equal to n. + * loop_type contains the loop AST generation types for the members + * in the band. It may be NULL, if all members are + * of type isl_ast_loop_default. + * isolate_loop_type contains the loop AST generation types for the members + * in the band for the isolated part. It may be NULL, if all members are + * of type isl_ast_loop_default. + * ast_build_options are the remaining AST build options associated + * to the band. + * anchored is set if the node depends on its position in the schedule tree. + * In particular, it is set if the AST build options include + * an isolate option. */ struct isl_schedule_band { int ref; @@ -22,6 +34,11 @@ struct isl_schedule_band { int permutable; isl_multi_union_pw_aff *mupa; + + int anchored; + isl_union_set *ast_build_options; + enum isl_ast_loop_type *loop_type; + enum isl_ast_loop_type *isolate_loop_type; }; typedef struct isl_schedule_band isl_schedule_band; @@ -37,10 +54,27 @@ isl_ctx *isl_schedule_band_get_ctx(__isl_keep isl_schedule_band *band); int isl_schedule_band_plain_is_equal(__isl_keep isl_schedule_band *band1, __isl_keep isl_schedule_band *band2); +int isl_schedule_band_is_anchored(__isl_keep isl_schedule_band *band); + __isl_give isl_space *isl_schedule_band_get_space( __isl_keep isl_schedule_band *band); __isl_give isl_multi_union_pw_aff *isl_schedule_band_get_partial_schedule( __isl_keep isl_schedule_band *band); +enum isl_ast_loop_type isl_schedule_band_member_get_ast_loop_type( + __isl_keep isl_schedule_band *band, int pos); +__isl_give isl_schedule_band *isl_schedule_band_member_set_ast_loop_type( + __isl_take isl_schedule_band *band, int pos, + enum isl_ast_loop_type type); +enum isl_ast_loop_type isl_schedule_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_band *band, int pos); +__isl_give isl_schedule_band * +isl_schedule_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_band *band, int pos, + enum isl_ast_loop_type type); +__isl_give isl_union_set *isl_schedule_band_get_ast_build_options( + __isl_keep isl_schedule_band *band); +__isl_give isl_schedule_band *isl_schedule_band_set_ast_build_options( + __isl_take isl_schedule_band *band, __isl_take isl_union_set *options); int isl_schedule_band_n_member(__isl_keep isl_schedule_band *band); int isl_schedule_band_member_get_coincident( diff --git a/polly/lib/External/isl/isl_schedule_node.c b/polly/lib/External/isl/isl_schedule_node.c index 38f65be650d..3fe0924bd96 100644 --- a/polly/lib/External/isl/isl_schedule_node.c +++ b/polly/lib/External/isl/isl_schedule_node.c @@ -280,6 +280,8 @@ int isl_schedule_node_get_schedule_depth(__isl_keep isl_schedule_node *node) * isl_schedule_node_get_prefix_schedule_union_pw_multi_aff * * "initialized" is set if the filter field has been initialized. + * If "universe_domain" is not set, then the collected filter is intersected + * with the the domain of the root domain node. * "universe_filter" is set if we are only collecting the universes of filters * "collect_prefix" is set if we are collecting prefixes. * "filter" collects all outer filters and is NULL until "initialized" is set. @@ -289,6 +291,7 @@ int isl_schedule_node_get_schedule_depth(__isl_keep isl_schedule_node *node) */ struct isl_schedule_node_get_filter_prefix_data { int initialized; + int universe_domain; int universe_filter; int collect_prefix; isl_union_set *filter; @@ -304,7 +307,8 @@ struct isl_schedule_node_get_filter_prefix_data { * (or its universe). * If "tree" is a domain, then this means we have reached the root * of the schedule tree without being able to extract any information. - * We therefore initialize data->filter to the universe of the domain. + * We therefore initialize data->filter to the universe of the domain, + * or the domain itself if data->universe_domain is not set. * If "tree" is a band with at least one member, then we set data->filter * to the universe of the schedule domain and replace the zero-dimensional * data->prefix by the band schedule (if data->collect_prefix is set). @@ -320,13 +324,15 @@ static int collect_filter_prefix_init(__isl_keep isl_schedule_tree *tree, switch (type) { case isl_schedule_node_error: return -1; + case isl_schedule_node_context: case isl_schedule_node_leaf: case isl_schedule_node_sequence: case isl_schedule_node_set: return 0; case isl_schedule_node_domain: filter = isl_schedule_tree_domain_get_domain(tree); - filter = isl_union_set_universe(filter); + if (data->universe_domain) + filter = isl_union_set_universe(filter); data->filter = filter; break; case isl_schedule_node_band: @@ -364,6 +370,8 @@ static int collect_filter_prefix_init(__isl_keep isl_schedule_tree *tree, * * Return 0 on success and -1 on error. * + * If "tree" is a domain and data->universe_domain is not set, then + * intersect data->filter with the domain. * If "tree" is a filter, then we intersect data->filter with this filter * (or its universe). * If "tree" is a band with at least one member and data->collect_prefix @@ -380,11 +388,17 @@ static int collect_filter_prefix_update(__isl_keep isl_schedule_tree *tree, switch (type) { case isl_schedule_node_error: return -1; - case isl_schedule_node_domain: + case isl_schedule_node_context: case isl_schedule_node_leaf: case isl_schedule_node_sequence: case isl_schedule_node_set: break; + case isl_schedule_node_domain: + if (data->universe_domain) + break; + filter = isl_schedule_tree_domain_get_domain(tree); + data->filter = isl_union_set_intersect(data->filter, filter); + break; case isl_schedule_node_band: if (isl_schedule_tree_band_n_member(tree) == 0) break; @@ -485,6 +499,7 @@ isl_schedule_node_get_prefix_schedule_union_pw_multi_aff( return isl_union_pw_multi_aff_empty(space); space = isl_space_set_from_params(space); + data.universe_domain = 1; data.universe_filter = 0; data.collect_prefix = 1; data.prefix = isl_multi_union_pw_aff_zero(space); @@ -519,6 +534,41 @@ __isl_give isl_union_map *isl_schedule_node_get_prefix_schedule_union_map( return isl_union_map_from_union_pw_multi_aff(upma); } +/* Return the domain elements that reach "node". + * + * If "node" is pointing at the root of the schedule tree, then + * there are no domain elements reaching the current node, so + * we return an empty result. + * + * Otherwise, we collect all filters reaching the node, + * intersected with the root domain in collect_filter_prefix. + */ +__isl_give isl_union_set *isl_schedule_node_get_domain( + __isl_keep isl_schedule_node *node) +{ + struct isl_schedule_node_get_filter_prefix_data data; + + if (!node) + return NULL; + + if (node->tree == node->schedule->root) { + isl_space *space; + + space = isl_schedule_get_space(node->schedule); + return isl_union_set_empty(space); + } + + data.universe_domain = 0; + data.universe_filter = 0; + data.collect_prefix = 0; + data.prefix = NULL; + + if (collect_filter_prefix(node->ancestors, &data) < 0) + data.filter = isl_union_set_free(data.filter); + + return data.filter; +} + /* Return the union of universe sets of the domain elements that reach "node". * * If "node" is pointing at the root of the schedule tree, then @@ -543,6 +593,7 @@ __isl_give isl_union_set *isl_schedule_node_get_universe_domain( return isl_union_set_empty(space); } + data.universe_domain = 1; data.universe_filter = 1; data.collect_prefix = 0; data.prefix = NULL; @@ -1102,6 +1153,16 @@ int isl_schedule_node_foreach_ancestor_top_down( return 0; } +/* Is any node in the subtree rooted at "node" anchored? + * That is, do any of these nodes reference the outer band nodes? + */ +int isl_schedule_node_is_subtree_anchored(__isl_keep isl_schedule_node *node) +{ + if (!node) + return -1; + return isl_schedule_tree_is_subtree_anchored(node->tree); +} + /* Return the number of members in the given band node. */ unsigned isl_schedule_node_band_n_member(__isl_keep isl_schedule_node *node) @@ -1224,6 +1285,97 @@ __isl_give isl_union_map *isl_schedule_node_band_get_partial_schedule_union_map( return isl_union_map_from_multi_union_pw_aff(mupa); } +/* Return the loop AST generation type for the band member of band node "node" + * at position "pos". + */ +enum isl_ast_loop_type isl_schedule_node_band_member_get_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos) +{ + if (!node) + return isl_ast_loop_error; + + return isl_schedule_tree_band_member_get_ast_loop_type(node->tree, pos); +} + +/* Set the loop AST generation type for the band member of band node "node" + * at position "pos" to "type". + */ +__isl_give isl_schedule_node *isl_schedule_node_band_member_set_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type) +{ + isl_schedule_tree *tree; + + if (!node) + return NULL; + + tree = isl_schedule_tree_copy(node->tree); + tree = isl_schedule_tree_band_member_set_ast_loop_type(tree, pos, type); + return isl_schedule_node_graft_tree(node, tree); +} + +/* Return the loop AST generation type for the band member of band node "node" + * at position "pos" for the isolated part. + */ +enum isl_ast_loop_type isl_schedule_node_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_node *node, int pos) +{ + if (!node) + return isl_ast_loop_error; + + return isl_schedule_tree_band_member_get_isolate_ast_loop_type( + node->tree, pos); +} + +/* Set the loop AST generation type for the band member of band node "node" + * at position "pos" for the isolated part to "type". + */ +__isl_give isl_schedule_node * +isl_schedule_node_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_node *node, int pos, + enum isl_ast_loop_type type) +{ + isl_schedule_tree *tree; + + if (!node) + return NULL; + + tree = isl_schedule_tree_copy(node->tree); + tree = isl_schedule_tree_band_member_set_isolate_ast_loop_type(tree, + pos, type); + return isl_schedule_node_graft_tree(node, tree); +} + +/* Return the AST build options associated to band node "node". + */ +__isl_give isl_union_set *isl_schedule_node_band_get_ast_build_options( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_band_get_ast_build_options(node->tree); +} + +/* Replace the AST build options associated to band node "node" by "options". + */ +__isl_give isl_schedule_node *isl_schedule_node_band_set_ast_build_options( + __isl_take isl_schedule_node *node, __isl_take isl_union_set *options) +{ + isl_schedule_tree *tree; + + if (!node || !options) + goto error; + + tree = isl_schedule_tree_copy(node->tree); + tree = isl_schedule_tree_band_set_ast_build_options(tree, options); + return isl_schedule_node_graft_tree(node, tree); +error: + isl_schedule_node_free(node); + isl_union_set_free(options); + return NULL; +} + /* Make sure that that spaces of "node" and "mv" are the same. * Return -1 on error, reporting the error to the user. */ @@ -1255,11 +1407,19 @@ __isl_give isl_schedule_node *isl_schedule_node_band_scale( __isl_take isl_schedule_node *node, __isl_take isl_multi_val *mv) { isl_schedule_tree *tree; + int anchored; if (!node || !mv) goto error; if (check_space_multi_val(node, mv) < 0) goto error; + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + goto error; + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot scale band node with anchored subtree", + goto error); tree = isl_schedule_node_get_tree(node); tree = isl_schedule_tree_band_scale(tree, mv); @@ -1277,11 +1437,19 @@ __isl_give isl_schedule_node *isl_schedule_node_band_scale_down( __isl_take isl_schedule_node *node, __isl_take isl_multi_val *mv) { isl_schedule_tree *tree; + int anchored; if (!node || !mv) goto error; if (check_space_multi_val(node, mv) < 0) goto error; + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + goto error; + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot scale down band node with anchored subtree", + goto error); tree = isl_schedule_node_get_tree(node); tree = isl_schedule_tree_band_scale_down(tree, mv); @@ -1299,6 +1467,9 @@ error: * * Return a pointer to the outer (tile) node. * + * If any of the descendants of "node" depend on the set of outer band nodes, + * then we refuse to tile the node. + * * If the scale tile loops option is set, then the tile loops * are scaled by the tile sizes. If the shift point loops option is set, * then the point loops are shifted to start at zero. @@ -1316,9 +1487,17 @@ __isl_give isl_schedule_node *isl_schedule_node_band_tile( __isl_take isl_schedule_node *node, __isl_take isl_multi_val *sizes) { isl_schedule_tree *tree; + int anchored; if (!node || !sizes) goto error; + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + goto error; + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot tile band node with anchored subtree", + goto error); if (check_space_multi_val(node, sizes) < 0) goto error; @@ -1341,12 +1520,16 @@ error: * Otherwise, the child of the node is removed and the result is * appended to all the leaves in the subtree rooted at the original child. * The original node is then replaced by the result of this operation. + * + * If any of the nodes in the subtree rooted at "node" depend on + * the set of outer band nodes then we refuse to sink the band node. */ __isl_give isl_schedule_node *isl_schedule_node_band_sink( __isl_take isl_schedule_node *node) { enum isl_schedule_node_type type; isl_schedule_tree *tree, *child; + int anchored; if (!node) return NULL; @@ -1355,6 +1538,13 @@ __isl_give isl_schedule_node *isl_schedule_node_band_sink( if (type != isl_schedule_node_band) isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, "not a band node", isl_schedule_node_free(node)); + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + return isl_schedule_node_free(node); + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot sink band node in anchored subtree", + isl_schedule_node_free(node)); if (isl_schedule_tree_n_children(node->tree) == 0) return node; @@ -1380,6 +1570,17 @@ __isl_give isl_schedule_node *isl_schedule_node_band_split( return isl_schedule_node_graft_tree(node, tree); } +/* Return the context of the context node "node". + */ +__isl_give isl_set *isl_schedule_node_context_get_context( + __isl_keep isl_schedule_node *node) +{ + if (!node) + return NULL; + + return isl_schedule_tree_context_get_context(node->tree); +} + /* Return the domain of the domain node "node". */ __isl_give isl_union_set *isl_schedule_node_domain_get_domain( @@ -1528,16 +1729,27 @@ static int check_insert(__isl_keep isl_schedule_node *node) /* Insert a band node with partial schedule "mupa" between "node" and * its parent. * Return a pointer to the new band node. + * + * If any of the nodes in the subtree rooted at "node" depend on + * the set of outer band nodes then we refuse to insert the band node. */ __isl_give isl_schedule_node *isl_schedule_node_insert_partial_schedule( __isl_take isl_schedule_node *node, __isl_take isl_multi_union_pw_aff *mupa) { + int anchored; isl_schedule_band *band; isl_schedule_tree *tree; if (check_insert(node) < 0) node = isl_schedule_node_free(node); + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + goto error; + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, + "cannot insert band node in anchored subtree", + goto error); tree = isl_schedule_node_get_tree(node); band = isl_schedule_band_from_multi_union_pw_aff(mupa); @@ -1545,6 +1757,28 @@ __isl_give isl_schedule_node *isl_schedule_node_insert_partial_schedule( node = isl_schedule_node_graft_tree(node, tree); return node; +error: + isl_schedule_node_free(node); + isl_multi_union_pw_aff_free(mupa); + return NULL; +} + +/* Insert a context node with context "context" between "node" and its parent. + * Return a pointer to the new context node. + */ +__isl_give isl_schedule_node *isl_schedule_node_insert_context( + __isl_take isl_schedule_node *node, __isl_take isl_set *context) +{ + isl_schedule_tree *tree; + + if (check_insert(node) < 0) + node = isl_schedule_node_free(node); + + tree = isl_schedule_node_get_tree(node); + tree = isl_schedule_tree_insert_context(tree, context); + node = isl_schedule_node_graft_tree(node, tree); + + return node; } /* Insert a filter node with filter "filter" between "node" and its parent. @@ -1669,7 +1903,8 @@ __isl_give isl_schedule_node *isl_schedule_node_cut( * Return a pointer to this former child or to the leaf the position * of the original node if there was no child. * It is not allowed to remove the root of a schedule tree, - * a set or sequence node or a child of a set or sequence node. + * a set or sequence node, a child of a set or sequence node or + * a band node with an anchored subtree. */ __isl_give isl_schedule_node *isl_schedule_node_delete( __isl_take isl_schedule_node *node) @@ -1695,6 +1930,18 @@ __isl_give isl_schedule_node *isl_schedule_node_delete( isl_die(isl_schedule_node_get_ctx(node), isl_error_invalid, "cannot delete child of set or sequence", return isl_schedule_node_free(node)); + if (isl_schedule_node_get_type(node) == isl_schedule_node_band) { + int anchored; + + anchored = isl_schedule_node_is_subtree_anchored(node); + if (anchored < 0) + return isl_schedule_node_free(node); + if (anchored) + isl_die(isl_schedule_node_get_ctx(node), + isl_error_invalid, + "cannot delete band node with anchored subtree", + return isl_schedule_node_free(node)); + } tree = isl_schedule_node_get_tree(node); if (!tree || isl_schedule_tree_has_children(tree)) { @@ -1786,6 +2033,7 @@ static __isl_give isl_schedule_node *gist_enter( case isl_schedule_node_error: return isl_schedule_node_free(node); case isl_schedule_node_band: + case isl_schedule_node_context: case isl_schedule_node_domain: case isl_schedule_node_leaf: case isl_schedule_node_sequence: @@ -1903,6 +2151,7 @@ static __isl_give isl_schedule_node *gist_leave( node = isl_schedule_node_insert_filter(node, filter); } break; + case isl_schedule_node_context: case isl_schedule_node_domain: case isl_schedule_node_leaf: break; diff --git a/polly/lib/External/isl/isl_schedule_read.c b/polly/lib/External/isl/isl_schedule_read.c index 95000aeca70..240120dc76a 100644 --- a/polly/lib/External/isl/isl_schedule_read.c +++ b/polly/lib/External/isl/isl_schedule_read.c @@ -12,9 +12,11 @@ enum isl_schedule_key { isl_schedule_key_error = -1, isl_schedule_key_child, isl_schedule_key_coincident, + isl_schedule_key_context, isl_schedule_key_domain, isl_schedule_key_filter, isl_schedule_key_leaf, + isl_schedule_key_options, isl_schedule_key_permutable, isl_schedule_key_schedule, isl_schedule_key_sequence, @@ -44,12 +46,16 @@ static enum isl_schedule_key extract_key(__isl_keep isl_stream *s, key = isl_schedule_key_child; else if (!strcmp(name, "coincident")) key = isl_schedule_key_coincident; + else if (!strcmp(name, "context")) + key = isl_schedule_key_context; else if (!strcmp(name, "domain")) key = isl_schedule_key_domain; else if (!strcmp(name, "filter")) key = isl_schedule_key_filter; else if (!strcmp(name, "leaf")) key = isl_schedule_key_leaf; + else if (!strcmp(name, "options")) + key = isl_schedule_key_options; else if (!strcmp(name, "schedule")) key = isl_schedule_key_schedule; else if (!strcmp(name, "sequence")) @@ -84,6 +90,57 @@ static enum isl_schedule_key get_key(__isl_keep isl_stream *s) static __isl_give isl_schedule_tree *isl_stream_read_schedule_tree( __isl_keep isl_stream *s); +/* Read a subtree with context root node from "s". + */ +static __isl_give isl_schedule_tree *read_context(__isl_keep isl_stream *s) +{ + isl_set *context = NULL; + isl_schedule_tree *tree; + isl_ctx *ctx; + struct isl_token *tok; + enum isl_schedule_key key; + char *str; + int more; + + ctx = isl_stream_get_ctx(s); + + key = get_key(s); + + if (isl_stream_yaml_next(s) < 0) + return NULL; + + tok = isl_stream_next_token(s); + if (!tok) { + isl_stream_error(s, NULL, "unexpected EOF"); + return NULL; + } + str = isl_token_get_str(ctx, tok); + context = isl_set_read_from_str(ctx, str); + free(str); + isl_token_free(tok); + + more = isl_stream_yaml_next(s); + if (more < 0) + goto error; + if (!more) { + tree = isl_schedule_tree_from_context(context); + } else { + key = get_key(s); + if (key != isl_schedule_key_child) + isl_die(ctx, isl_error_invalid, "expecting child", + goto error); + if (isl_stream_yaml_next(s) < 0) + goto error; + tree = isl_stream_read_schedule_tree(s); + tree = isl_schedule_tree_insert_context(tree, context); + } + + return tree; +error: + isl_set_free(context); + return NULL; +} + /* Read a subtree with domain root node from "s". */ static __isl_give isl_schedule_tree *read_domain(__isl_keep isl_stream *s) @@ -247,6 +304,7 @@ static __isl_give isl_schedule_tree *read_band(isl_stream *s) isl_multi_union_pw_aff *schedule = NULL; isl_schedule_tree *tree = NULL; isl_val_list *coincident = NULL; + isl_union_set *options = NULL; isl_ctx *ctx; isl_schedule_band *band; int permutable = 0; @@ -290,6 +348,16 @@ static __isl_give isl_schedule_tree *read_band(isl_stream *s) permutable = !isl_val_is_zero(v); isl_val_free(v); break; + case isl_schedule_key_options: + isl_union_set_free(options); + tok = isl_stream_next_token(s); + str = isl_token_get_str(ctx, tok); + options = isl_union_set_read_from_str(ctx, str); + free(str); + isl_token_free(tok); + if (!options) + goto error; + break; case isl_schedule_key_child: isl_schedule_tree_free(tree); tree = isl_stream_read_schedule_tree(s); @@ -312,6 +380,8 @@ static __isl_give isl_schedule_tree *read_band(isl_stream *s) band = isl_schedule_band_set_permutable(band, permutable); if (coincident) band = set_coincident(band, coincident); + if (options) + band = isl_schedule_band_set_ast_build_options(band, options); if (tree) tree = isl_schedule_tree_insert_band(tree, band); else @@ -320,6 +390,7 @@ static __isl_give isl_schedule_tree *read_band(isl_stream *s) return tree; error: isl_val_list_free(coincident); + isl_union_set_free(options); isl_schedule_tree_free(tree); isl_multi_union_pw_aff_free(schedule); return NULL; @@ -403,6 +474,9 @@ static __isl_give isl_schedule_tree *isl_stream_read_schedule_tree( if (key < 0) return NULL; switch (key) { + case isl_schedule_key_context: + tree = read_context(s); + break; case isl_schedule_key_domain: tree = read_domain(s); break; @@ -421,6 +495,7 @@ static __isl_give isl_schedule_tree *isl_stream_read_schedule_tree( break; case isl_schedule_key_schedule: case isl_schedule_key_coincident: + case isl_schedule_key_options: case isl_schedule_key_permutable: tree = read_band(s); break; diff --git a/polly/lib/External/isl/isl_schedule_tree.c b/polly/lib/External/isl/isl_schedule_tree.c index f675f64bffd..be2422c8c10 100644 --- a/polly/lib/External/isl/isl_schedule_tree.c +++ b/polly/lib/External/isl/isl_schedule_tree.c @@ -34,6 +34,9 @@ int isl_schedule_tree_is_leaf(__isl_keep isl_schedule_tree *tree) /* Create a new schedule tree of type "type". * The caller is responsible for filling in the type specific fields and * the children. + * + * By default, the single node tree does not have any anchored nodes. + * The caller is responsible for updating the anchored field if needed. */ static __isl_give isl_schedule_tree *isl_schedule_tree_alloc(isl_ctx *ctx, enum isl_schedule_node_type type) @@ -51,6 +54,7 @@ static __isl_give isl_schedule_tree *isl_schedule_tree_alloc(isl_ctx *ctx, tree->ctx = ctx; isl_ctx_ref(ctx); tree->type = type; + tree->anchored = 0; return tree; } @@ -81,6 +85,11 @@ __isl_take isl_schedule_tree *isl_schedule_tree_dup( if (!dup->band) return isl_schedule_tree_free(dup); break; + case isl_schedule_node_context: + dup->context = isl_set_copy(tree->context); + if (!dup->context) + return isl_schedule_tree_free(dup); + break; case isl_schedule_node_domain: dup->domain = isl_union_set_copy(tree->domain); if (!dup->domain) @@ -102,6 +111,7 @@ __isl_take isl_schedule_tree *isl_schedule_tree_dup( if (!dup->children) return isl_schedule_tree_free(dup); } + dup->anchored = tree->anchored; return dup; } @@ -164,6 +174,9 @@ __isl_null isl_schedule_tree *isl_schedule_tree_free( case isl_schedule_node_band: isl_schedule_band_free(tree->band); break; + case isl_schedule_node_context: + isl_set_free(tree->context); + break; case isl_schedule_node_domain: isl_union_set_free(tree->domain); break; @@ -208,6 +221,7 @@ __isl_give isl_schedule_tree *isl_schedule_tree_from_band( goto error; tree->band = band; + tree->anchored = isl_schedule_band_is_anchored(band); return tree; error: @@ -215,6 +229,33 @@ error: return NULL; } +/* Create a new context schedule tree with the given context and no children. + * Since the context references the outer schedule dimension, + * the tree is anchored. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_from_context( + __isl_take isl_set *context) +{ + isl_ctx *ctx; + isl_schedule_tree *tree; + + if (!context) + return NULL; + + ctx = isl_set_get_ctx(context); + tree = isl_schedule_tree_alloc(ctx, isl_schedule_node_context); + if (!tree) + goto error; + + tree->context = context; + tree->anchored = 1; + + return tree; +error: + isl_set_free(context); + return NULL; +} + /* Create a new domain schedule tree with the given domain and no children. */ __isl_give isl_schedule_tree *isl_schedule_tree_from_domain( @@ -263,6 +304,79 @@ error: return NULL; } +/* Does "tree" have any node that depends on its position + * in the complete schedule tree? + */ +int isl_schedule_tree_is_subtree_anchored(__isl_keep isl_schedule_tree *tree) +{ + return tree ? tree->anchored : -1; +} + +/* Does the root node of "tree" depend on its position in the complete + * schedule tree? + * Band nodes may be anchored depending on the associated AST build options. + * Context nodes are always anchored. + */ +int isl_schedule_tree_is_anchored(__isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return -1; + + switch (isl_schedule_tree_get_type(tree)) { + case isl_schedule_node_error: + return -1; + case isl_schedule_node_band: + return isl_schedule_band_is_anchored(tree->band); + case isl_schedule_node_context: + return 1; + case isl_schedule_node_domain: + case isl_schedule_node_filter: + case isl_schedule_node_leaf: + case isl_schedule_node_sequence: + case isl_schedule_node_set: + return 0; + } +} + +/* Update the anchored field of "tree" based on whether the root node + * itself in anchored and the anchored fields of the children. + * + * This function should be called whenever the children of a tree node + * are changed or the anchoredness of the tree root itself changes. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_update_anchored( + __isl_take isl_schedule_tree *tree) +{ + int i, n; + int anchored; + + if (!tree) + return NULL; + + anchored = isl_schedule_tree_is_anchored(tree); + if (anchored < 0) + return isl_schedule_tree_free(tree); + + n = isl_schedule_tree_list_n_schedule_tree(tree->children); + for (i = 0; !anchored && i < n; ++i) { + isl_schedule_tree *child; + + child = isl_schedule_tree_get_child(tree, i); + if (!child) + return isl_schedule_tree_free(tree); + anchored = child->anchored; + isl_schedule_tree_free(child); + } + + if (anchored == tree->anchored) + return tree; + tree = isl_schedule_tree_cow(tree); + if (!tree) + return NULL; + tree->anchored = anchored; + return tree; +} + /* Create a new tree of the given type (isl_schedule_node_sequence or * isl_schedule_node_set) with the given children. */ @@ -282,6 +396,7 @@ __isl_give isl_schedule_tree *isl_schedule_tree_from_children( goto error; tree->children = list; + tree = isl_schedule_tree_update_anchored(tree); return tree; error: @@ -365,6 +480,9 @@ int isl_schedule_tree_plain_is_equal(__isl_keep isl_schedule_tree *tree1, equal = isl_schedule_band_plain_is_equal(tree1->band, tree2->band); break; + case isl_schedule_node_context: + equal = isl_set_is_equal(tree1->context, tree2->context); + break; case isl_schedule_node_domain: equal = isl_union_set_is_equal(tree1->domain, tree2->domain); break; @@ -529,6 +647,7 @@ __isl_give isl_schedule_tree *isl_schedule_tree_replace_child( if (!tree->children) return isl_schedule_tree_free(tree); + tree = isl_schedule_tree_update_anchored(tree); return tree; error: @@ -567,6 +686,18 @@ __isl_give isl_schedule_tree *isl_schedule_tree_insert_band( return isl_schedule_tree_replace_child(res, 0, tree); } +/* Create a new context schedule tree with the given context and + * with "tree" as single child. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_insert_context( + __isl_take isl_schedule_tree *tree, __isl_take isl_set *context) +{ + isl_schedule_tree *res; + + res = isl_schedule_tree_from_context(context); + return isl_schedule_tree_replace_child(res, 0, tree); +} + /* Create a new domain schedule tree with the given domain and * with "tree" as single child. */ @@ -752,6 +883,148 @@ __isl_give isl_multi_union_pw_aff *isl_schedule_tree_band_get_partial_schedule( return isl_schedule_band_get_partial_schedule(tree->band); } +/* Return the loop AST generation type for the band member + * of the band tree root at position "pos". + */ +enum isl_ast_loop_type isl_schedule_tree_band_member_get_ast_loop_type( + __isl_keep isl_schedule_tree *tree, int pos) +{ + if (!tree) + return isl_ast_loop_error; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_ast_loop_error); + + return isl_schedule_band_member_get_ast_loop_type(tree->band, pos); +} + +/* Set the loop AST generation type for the band member of the band tree root + * at position "pos" to "type". + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_ast_loop_type( + __isl_take isl_schedule_tree *tree, int pos, + enum isl_ast_loop_type type) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_schedule_tree_free(tree)); + + tree->band = isl_schedule_band_member_set_ast_loop_type(tree->band, + pos, type); + if (!tree->band) + return isl_schedule_tree_free(tree); + + return tree; +} + +/* Return the loop AST generation type for the band member + * of the band tree root at position "pos" for the isolated part. + */ +enum isl_ast_loop_type isl_schedule_tree_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_tree *tree, int pos) +{ + if (!tree) + return isl_ast_loop_error; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_ast_loop_error); + + return isl_schedule_band_member_get_isolate_ast_loop_type(tree->band, + pos); +} + +/* Set the loop AST generation type for the band member of the band tree root + * at position "pos" for the isolated part to "type". + */ +__isl_give isl_schedule_tree * +isl_schedule_tree_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_tree *tree, int pos, + enum isl_ast_loop_type type) +{ + tree = isl_schedule_tree_cow(tree); + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return isl_schedule_tree_free(tree)); + + tree->band = isl_schedule_band_member_set_isolate_ast_loop_type( + tree->band, pos, type); + if (!tree->band) + return isl_schedule_tree_free(tree); + + return tree; +} + +/* Return the AST build options associated to the band tree root. + */ +__isl_give isl_union_set *isl_schedule_tree_band_get_ast_build_options( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", return NULL); + + return isl_schedule_band_get_ast_build_options(tree->band); +} + +/* Replace the AST build options associated to band tree root by "options". + * Updated the anchored field if the anchoredness of the root node itself + * changes. + */ +__isl_give isl_schedule_tree *isl_schedule_tree_band_set_ast_build_options( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *options) +{ + int was_anchored; + + tree = isl_schedule_tree_cow(tree); + if (!tree || !options) + goto error; + + if (tree->type != isl_schedule_node_band) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a band node", goto error); + + was_anchored = isl_schedule_tree_is_anchored(tree); + tree->band = isl_schedule_band_set_ast_build_options(tree->band, + options); + if (!tree->band) + return isl_schedule_tree_free(tree); + if (isl_schedule_tree_is_anchored(tree) != was_anchored) + tree = isl_schedule_tree_update_anchored(tree); + + return tree; +error: + isl_schedule_tree_free(tree); + isl_union_set_free(options); + return NULL; +} + +/* Return the context of the context tree root. + */ +__isl_give isl_set *isl_schedule_tree_context_get_context( + __isl_keep isl_schedule_tree *tree) +{ + if (!tree) + return NULL; + + if (tree->type != isl_schedule_node_context) + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_invalid, + "not a context node", return NULL); + + return isl_set_copy(tree->context); +} + /* Return the domain of the domain tree root. */ __isl_give isl_union_set *isl_schedule_tree_domain_get_domain( @@ -888,14 +1161,41 @@ static __isl_give isl_union_map *append_range(__isl_take isl_union_map *umap, return umap; } +/* Should we skip the root of "tree" while looking for the first + * descendant with schedule information? + * That is, is it impossible to derive any information about + * the iteration domain from this node? + * + * We do not want to skip leaf or error nodes because there is + * no point in looking any deeper from these nodes. + */ +static int domain_less(__isl_keep isl_schedule_tree *tree) +{ + enum isl_schedule_node_type type; + + type = isl_schedule_tree_get_type(tree); + switch (type) { + case isl_schedule_node_band: + return isl_schedule_tree_band_n_member(tree) == 0; + case isl_schedule_node_context: + return 1; + case isl_schedule_node_leaf: + case isl_schedule_node_error: + case isl_schedule_node_domain: + case isl_schedule_node_filter: + case isl_schedule_node_set: + case isl_schedule_node_sequence: + return 0; + } +} + /* Move down to the first descendant of "tree" that contains any schedule * information or return "leaf" if there is no such descendant. */ __isl_give isl_schedule_tree *isl_schedule_tree_first_schedule_descendant( __isl_take isl_schedule_tree *tree, __isl_keep isl_schedule_tree *leaf) { - while (isl_schedule_tree_get_type(tree) == isl_schedule_node_band && - isl_schedule_tree_band_n_member(tree) == 0) { + while (domain_less(tree)) { if (!isl_schedule_tree_has_children(tree)) { isl_schedule_tree_free(tree); return isl_schedule_tree_copy(leaf); @@ -1084,6 +1384,8 @@ static __isl_give isl_union_map *subtree_schedule_extend( switch (tree->type) { case isl_schedule_node_error: return isl_union_map_free(outer); + case isl_schedule_node_context: + return subtree_schedule_extend_child(tree, outer); case isl_schedule_node_band: if (isl_schedule_tree_band_n_member(tree) == 0) return subtree_schedule_extend_child(tree, outer); @@ -1171,6 +1473,10 @@ static __isl_give isl_union_set *initial_domain( switch (tree->type) { case isl_schedule_node_error: return NULL; + case isl_schedule_node_context: + isl_die(isl_schedule_tree_get_ctx(tree), isl_error_internal, + "context node should be handled by caller", + return NULL); case isl_schedule_node_band: if (isl_schedule_tree_band_n_member(tree) == 0) isl_die(isl_schedule_tree_get_ctx(tree), @@ -1416,6 +1722,11 @@ __isl_give isl_schedule_tree *isl_schedule_tree_reset_user( if (!tree->band) return isl_schedule_tree_free(tree); break; + case isl_schedule_node_context: + tree->context = isl_set_reset_user(tree->context); + if (!tree->context) + return isl_schedule_tree_free(tree); + break; case isl_schedule_node_domain: tree->domain = isl_union_set_reset_user(tree->domain); if (!tree->domain) @@ -1460,6 +1771,11 @@ __isl_give isl_schedule_tree *isl_schedule_tree_align_params( if (!tree->band) return isl_schedule_tree_free(tree); break; + case isl_schedule_node_context: + tree->context = isl_set_align_params(tree->context, space); + if (!tree->context) + return isl_schedule_tree_free(tree); + break; case isl_schedule_node_domain: tree->domain = isl_union_set_align_params(tree->domain, space); if (!tree->domain) @@ -1500,6 +1816,7 @@ static int involves_iteration_domain(__isl_keep isl_schedule_tree *tree) case isl_schedule_node_domain: case isl_schedule_node_filter: return 1; + case isl_schedule_node_context: case isl_schedule_node_leaf: case isl_schedule_node_sequence: case isl_schedule_node_set: @@ -1609,6 +1926,9 @@ static int any_coincident(__isl_keep isl_schedule_band *band) static __isl_give isl_printer *print_tree_band(__isl_take isl_printer *p, __isl_keep isl_schedule_band *band) { + isl_union_set *options; + int empty; + p = isl_printer_print_str(p, "schedule"); p = isl_printer_yaml_next(p); p = isl_printer_print_str(p, "\""); @@ -1639,6 +1959,19 @@ static __isl_give isl_printer *print_tree_band(__isl_take isl_printer *p, p = isl_printer_yaml_end_sequence(p); p = isl_printer_set_yaml_style(p, style); } + options = isl_schedule_band_get_ast_build_options(band); + empty = isl_union_set_is_empty(options); + if (empty < 0) + p = isl_printer_free(p); + if (!empty) { + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "options"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_union_set(p, options); + p = isl_printer_print_str(p, "\""); + } + isl_union_set_free(options); return p; } @@ -1685,6 +2018,13 @@ __isl_give isl_printer *isl_printer_print_schedule_tree_mark( p = isl_printer_print_str(p, "set"); sequence = 1; break; + case isl_schedule_node_context: + p = isl_printer_print_str(p, "context"); + p = isl_printer_yaml_next(p); + p = isl_printer_print_str(p, "\""); + p = isl_printer_print_set(p, tree->context); + p = isl_printer_print_str(p, "\""); + break; case isl_schedule_node_domain: p = isl_printer_print_str(p, "domain"); p = isl_printer_yaml_next(p); diff --git a/polly/lib/External/isl/isl_schedule_tree.h b/polly/lib/External/isl/isl_schedule_tree.h index a5c5486c511..fff89fad672 100644 --- a/polly/lib/External/isl/isl_schedule_tree.h +++ b/polly/lib/External/isl/isl_schedule_tree.h @@ -21,6 +21,9 @@ ISL_DECLARE_LIST(schedule_tree) * In this case, ref has a negative value. * * The "band" field is valid when type is isl_schedule_node_band. + * The "context" field is valid when type is isl_schedule_node_context + * and represents constraints on the flat product of the outer band nodes, + * possibly introducing additional parameters. * The "domain" field is valid when type is isl_schedule_node_domain * and introduces the statement instances scheduled by the tree. * The "filter" field is valid when type is isl_schedule_node_filter @@ -29,13 +32,18 @@ ISL_DECLARE_LIST(schedule_tree) * The "children" field is valid for all types except * isl_schedule_node_leaf. This field is NULL if there are * no children (except for the implicit leaves). + * + * anchored is set if the node or any of its descendants depends + * on its position in the schedule tree. */ struct isl_schedule_tree { int ref; isl_ctx *ctx; + int anchored; enum isl_schedule_node_type type; union { isl_schedule_band *band; + isl_set *context; isl_union_set *domain; isl_union_set *filter; }; @@ -59,6 +67,8 @@ __isl_null isl_schedule_tree *isl_schedule_tree_free( __isl_give isl_schedule_tree *isl_schedule_tree_from_band( __isl_take isl_schedule_band *band); +__isl_give isl_schedule_tree *isl_schedule_tree_from_context( + __isl_take isl_set *context); __isl_give isl_schedule_tree *isl_schedule_tree_from_domain( __isl_take isl_union_set *domain); __isl_give isl_schedule_tree *isl_schedule_tree_from_filter( @@ -70,10 +80,29 @@ __isl_give isl_schedule_tree *isl_schedule_tree_from_pair( enum isl_schedule_node_type type, __isl_take isl_schedule_tree *tree1, __isl_take isl_schedule_tree *tree2); +int isl_schedule_tree_is_subtree_anchored(__isl_keep isl_schedule_tree *tree); + __isl_give isl_space *isl_schedule_tree_band_get_space( __isl_keep isl_schedule_tree *tree); __isl_give isl_multi_union_pw_aff *isl_schedule_tree_band_get_partial_schedule( __isl_keep isl_schedule_tree *tree); +enum isl_ast_loop_type isl_schedule_tree_band_member_get_ast_loop_type( + __isl_keep isl_schedule_tree *tree, int pos); +__isl_give isl_schedule_tree *isl_schedule_tree_band_member_set_ast_loop_type( + __isl_take isl_schedule_tree *tree, int pos, + enum isl_ast_loop_type type); +enum isl_ast_loop_type isl_schedule_tree_band_member_get_isolate_ast_loop_type( + __isl_keep isl_schedule_tree *tree, int pos); +__isl_give isl_schedule_tree * +isl_schedule_tree_band_member_set_isolate_ast_loop_type( + __isl_take isl_schedule_tree *tree, int pos, + enum isl_ast_loop_type type); +__isl_give isl_union_set *isl_schedule_tree_band_get_ast_build_options( + __isl_keep isl_schedule_tree *tree); +__isl_give isl_schedule_tree *isl_schedule_tree_band_set_ast_build_options( + __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *options); +__isl_give isl_set *isl_schedule_tree_context_get_context( + __isl_keep isl_schedule_tree *tree); __isl_give isl_union_set *isl_schedule_tree_domain_get_domain( __isl_keep isl_schedule_tree *tree); __isl_give isl_schedule_tree *isl_schedule_tree_domain_set_domain( @@ -105,6 +134,8 @@ __isl_give isl_schedule_tree *isl_schedule_tree_get_child( __isl_give isl_schedule_tree *isl_schedule_tree_insert_band( __isl_take isl_schedule_tree *tree, __isl_take isl_schedule_band *band); +__isl_give isl_schedule_tree *isl_schedule_tree_insert_context( + __isl_take isl_schedule_tree *tree, __isl_take isl_set *context); __isl_give isl_schedule_tree *isl_schedule_tree_insert_domain( __isl_take isl_schedule_tree *tree, __isl_take isl_union_set *domain); __isl_give isl_schedule_tree *isl_schedule_tree_insert_filter( diff --git a/polly/lib/External/isl/isl_tab.c b/polly/lib/External/isl/isl_tab.c index a1258d0a8cd..47abea1f1d3 100644 --- a/polly/lib/External/isl/isl_tab.c +++ b/polly/lib/External/isl/isl_tab.c @@ -155,7 +155,7 @@ int isl_tab_extend_vars(struct isl_tab *tab, unsigned n_new) if (!var) return -1; tab->var = var; - tab->max_var += n_new; + tab->max_var = tab->n_var + n_new; } if (tab->mat->n_col < off + tab->n_col + n_new) { diff --git a/polly/lib/External/isl/isl_test.c b/polly/lib/External/isl/isl_test.c index ea8311da159..98e93375f93 100644 --- a/polly/lib/External/isl/isl_test.c +++ b/polly/lib/External/isl/isl_test.c @@ -4791,7 +4791,7 @@ static int test_ast_gen1(isl_ctx *ctx) &before_for, &data); build = isl_ast_build_set_after_each_for(build, &after_for, &data); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) return -1; @@ -4825,7 +4825,7 @@ static int test_ast_gen2(isl_ctx *ctx) str = "{ [i,j] -> atomic[1] : i + j = 1; [i,j] -> unroll[1] : i = j }"; options = isl_union_map_read_from_str(ctx, str); build = isl_ast_build_set_options(build, options); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) return -1; @@ -4871,7 +4871,7 @@ static int test_ast_gen3(isl_ctx *ctx) build = isl_ast_build_set_options(build, options); build = isl_ast_build_set_at_each_domain(build, &count_domains, &n_domain); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) return -1; @@ -4907,7 +4907,7 @@ static int test_ast_gen4(isl_ctx *ctx) schedule = isl_union_map_read_from_str(ctx, str); set = isl_set_universe(isl_space_params_alloc(ctx, 0)); build = isl_ast_build_from_context(set); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) return -1; @@ -4924,7 +4924,7 @@ static int test_ast_gen4(isl_ctx *ctx) schedule = isl_union_map_read_from_str(ctx, str); set = isl_set_universe(isl_space_params_alloc(ctx, 0)); build = isl_ast_build_from_context(set); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) return -1; @@ -4959,7 +4959,7 @@ static __isl_give isl_ast_node *create_leaf(__isl_take isl_ast_build *build, extra = isl_union_map_copy(schedule); extra = isl_union_map_from_domain(isl_union_map_domain(extra)); schedule = isl_union_map_range_product(schedule, extra); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); if (!tree) @@ -5002,7 +5002,7 @@ static int test_ast_gen5(isl_ctx *ctx) build = isl_ast_build_from_context(set); build = isl_ast_build_set_options(build, options); build = isl_ast_build_set_create_leaf(build, &create_leaf, NULL); - tree = isl_ast_build_ast_from_schedule(build, schedule); + tree = isl_ast_build_node_from_schedule_map(build, schedule); isl_ast_build_free(build); isl_ast_node_free(tree); if (!tree) diff --git a/polly/lib/External/isl/test_inputs/codegen/atomic.st b/polly/lib/External/isl/test_inputs/codegen/atomic.st new file mode 100644 index 00000000000..ca46e0eafcf --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/atomic.st @@ -0,0 +1,4 @@ +domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }" +child: + schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]" + options: "{ atomic[x] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/0D-1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/0D-1.in deleted file mode 100644 index 10e3e408a6d..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/0D-1.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[] -> [0] } -{ : } -{ [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/0D-1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/0D-1.st new file mode 100644 index 00000000000..d718258801b --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/0D-1.st @@ -0,0 +1,3 @@ +domain: "{ S1[] }" +child: + context: "{ [] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/0D-2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/0D-2.in deleted file mode 100644 index 3bbfd35cc2b..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/0D-2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[] -> [0] : M >= 0 } -[M] -> { : } -[M] -> { [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/0D-2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/0D-2.st new file mode 100644 index 00000000000..3ee60f687db --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/0D-2.st @@ -0,0 +1,3 @@ +domain: "[M] -> { S1[] : M >= 0 }" +child: + context: "[M] -> { [] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/0D-3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/0D-3.in deleted file mode 100644 index f99dd344e46..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/0D-3.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[] -> [0] : M >= 0 } -[M] -> { : M >= 0 } -[M] -> { [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/0D-3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/0D-3.st new file mode 100644 index 00000000000..97cd37ea47f --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/0D-3.st @@ -0,0 +1,3 @@ +domain: "[M] -> { S1[] : M >= 0 }" +child: + context: "[M] -> { [] : M >= 0 }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/1point-1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/1point-1.in deleted file mode 100644 index efd0a7ff827..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/1point-1.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[2M, M] -> [2M, M, 0] } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/1point-1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/1point-1.st new file mode 100644 index 00000000000..61948789002 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/1point-1.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[2M, M] }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/1point-2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/1point-2.in deleted file mode 100644 index de5157ceac6..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/1point-2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[2M, 2 + N] -> [2M, 2 + N, 0] } -[M, N] -> { : } -[M, N] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/1point-2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/1point-2.st new file mode 100644 index 00000000000..9e7adfa0309 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/1point-2.st @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[2M, 2 + N] }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/4-param.in b/polly/lib/External/isl/test_inputs/codegen/cloog/4-param.in deleted file mode 100644 index 7814076053b..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/4-param.in +++ /dev/null @@ -1,3 +0,0 @@ -[m, n, p, q] -> { S1[i0] -> [i0, 0] : i0 >= m and i0 <= n; S2[i0] -> [i0, 1] : i0 >= p and i0 <= q } -[m, n, p, q] -> { : } -[m, n, p, q] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/4-param.st b/polly/lib/External/isl/test_inputs/codegen/cloog/4-param.st new file mode 100644 index 00000000000..24335954184 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/4-param.st @@ -0,0 +1,10 @@ +domain: "[m, n, p, q] -> { S1[i0] : i0 >= m and i0 <= n; S2[i0] : i0 >= p and i0 <= q }" +child: + context: "[m, n, p, q] -> { [] }" + child: + schedule: "[m, n, p, q] -> [{ S2[i0] -> [(i0)]; S1[i0] -> [(i0)] }]" + options: "[m, n, p, q] -> { separate[i0] }" + child: + sequence: + - filter: "[m, n, p, q] -> { S1[i0] }" + - filter: "[m, n, p, q] -> { S2[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/backtrack.in b/polly/lib/External/isl/test_inputs/codegen/cloog/backtrack.in deleted file mode 100644 index b8ec466f559..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/backtrack.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[0] -> [0, 0] } -{ : } -{ [i, j] -> atomic[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/backtrack.st b/polly/lib/External/isl/test_inputs/codegen/cloog/backtrack.st new file mode 100644 index 00000000000..23fb152c8f6 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/backtrack.st @@ -0,0 +1,6 @@ +domain: "{ S1[0] }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-1.in deleted file mode 100644 index e5f8bfafd15..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-1.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0] -> [i0, 0] : i0 >= 0 and i0 <= 2 } -{ : } -{ [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-1.st new file mode 100644 index 00000000000..7c599e8dd16 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-1.st @@ -0,0 +1,6 @@ +domain: "{ S1[i0] : i0 >= 0 and i0 <= 2 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-2.in deleted file mode 100644 index 7eb48f2da74..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-2.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[0] -> [0, 0] } -{ : } -{ [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-2.st new file mode 100644 index 00000000000..23fb152c8f6 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-2.st @@ -0,0 +1,6 @@ +domain: "{ S1[0] }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-3.in deleted file mode 100644 index 59ce2c9249b..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-3.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0] -> [i0, 0] : i0 >= 0 and i0 <= M } -[M] -> { : M >= 0 } -[M] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-3.st new file mode 100644 index 00000000000..437f566f0c7 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-3.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0] : i0 >= 0 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 0 }" + child: + schedule: "[M] -> [{ S1[i0] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-4.in b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-4.in deleted file mode 100644 index 5f79acf698c..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-4.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0] -> [i0, 0] : i0 >= 0 and i0 <= 1 + M } -[M] -> { : M >= 0 } -[M] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-4.st b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-4.st new file mode 100644 index 00000000000..a5a0b1a06b3 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-4.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0] : i0 >= 0 and i0 <= 1 + M }" +child: + context: "[M] -> { [] : M >= 0 }" + child: + schedule: "[M] -> [{ S1[i0] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-5.in b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-5.in deleted file mode 100644 index 3a6f9085514..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-5.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[1, i1] -> [1, i1, 0] : 2i1 >= M and 2i1 <= 1 + M } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-5.st b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-5.st new file mode 100644 index 00000000000..e0bc58fbc2c --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-5.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[1, i1] : 2i1 >= M and 2i1 <= 1 + M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-6.c b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-6.c new file mode 100644 index 00000000000..da8a3fbcf9b --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-6.c @@ -0,0 +1 @@ +S1(-1); diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-6.st b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-6.st new file mode 100644 index 00000000000..a65f0880cfa --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/basic-bounds-6.st @@ -0,0 +1,6 @@ +domain: "{ S1[-1] }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/block.in b/polly/lib/External/isl/test_inputs/codegen/cloog/block.in deleted file mode 100644 index faf2af5f466..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/block.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S3[i0] -> [i0, 1] : i0 >= 0 and i0 <= 1; S1[] -> [0, 0]; S2[] -> [1, 0] } -{ : } -{ [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/block.st b/polly/lib/External/isl/test_inputs/codegen/cloog/block.st new file mode 100644 index 00000000000..0ab2d8854b1 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/block.st @@ -0,0 +1,10 @@ +domain: "{ S1[]; S3[i0] : i0 >= 0 and i0 <= 1; S2[] }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[] -> [(1)]; S3[i0] -> [(i0)]; S1[] -> [(0)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[]; S2[] }" + - filter: "{ S3[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/block2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/block2.in deleted file mode 100644 index d2b5db44039..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/block2.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0, 1] -> [i0, 1, 6] : i0 >= 0 and i0 <= 9; S2[i0, 1] -> [i0, 1, 11] : i0 >= 0 and i0 <= 9; S3[i0, 1] -> [i0, 1, 8] : i0 >= 0 and i0 <= 9 } -{ : } -{ [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/block2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/block2.st new file mode 100644 index 00000000000..b18ce927ea8 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/block2.st @@ -0,0 +1,11 @@ +domain: "{ S2[i0, 1] : i0 >= 0 and i0 <= 9; S1[i0, 1] : i0 >= 0 and i0 <= 9; S3[i0, 1] : i0 >= 0 and i0 <= 9 }" +child: + context: "{ [] }" + child: + schedule: "[{ S3[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S3[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1] }" + - filter: "{ S3[i0, i1] }" + - filter: "{ S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/block3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/block3.in deleted file mode 100644 index 39c0abb790d..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/block3.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S2[] -> [1]; S3[i0] -> [i0] : i0 >= 0 and i0 <= 1; S1[] -> [0] } -{ : } -{ [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/block3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/block3.st new file mode 100644 index 00000000000..85f197f3318 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/block3.st @@ -0,0 +1,6 @@ +domain: "{ S1[]; S3[i0] : i0 >= 0 and i0 <= 1; S2[] }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[] -> [(1)]; S3[i0] -> [(i0)]; S1[] -> [(0)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/byu98-1-2-3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/byu98-1-2-3.in deleted file mode 100644 index 9f98fb85990..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/byu98-1-2-3.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0, i1] -> [i0, i1, 0] : i1 >= 6 - i0 and i0 >= 2 and i1 >= 3 and i1 <= 6 and i1 >= -1 + i0; S2[i0, 9 - i0] -> [i0, 9 - i0, 1] : i0 <= 8 and i0 >= 4 } -{ : } -{ [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/byu98-1-2-3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/byu98-1-2-3.st new file mode 100644 index 00000000000..84d3791d33a --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/byu98-1-2-3.st @@ -0,0 +1,10 @@ +domain: "{ S2[i0, 9 - i0] : i0 <= 8 and i0 >= 4; S1[i0, i1] : i1 >= 6 - i0 and i0 >= 2 and i1 >= 3 and i1 <= 6 and i1 >= -1 + i0 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1] }" + - filter: "{ S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky.c b/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky.c index 20d4e4d0b9e..1cf61c20eff 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky.c @@ -1,12 +1,12 @@ for (int c0 = 1; c0 <= n; c0 += 1) { S1(c0); - for (int c2 = 1; c2 < c0; c2 += 1) - S2(c0, c2); + for (int c1 = 1; c1 < c0; c1 += 1) + S2(c0, c1); S3(c0); - for (int c2 = c0 + 1; c2 <= n; c2 += 1) { - S4(c0, c2); - for (int c4 = 1; c4 < c0; c4 += 1) - S5(c0, c2, c4); - S6(c0, c2); + for (int c1 = c0 + 1; c1 <= n; c1 += 1) { + S4(c0, c1); + for (int c2 = 1; c2 < c0; c2 += 1) + S5(c0, c1, c2); + S6(c0, c1); } } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky.in b/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky.in deleted file mode 100644 index 90b56c638b3..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S1[i0] -> [i0, 1, 0, 0, 0, 0] : i0 >= 1 and i0 <= n; S2[i0, i1] -> [i0, 2, i1, 1, 0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= -1 + i0; S6[i0, i1] -> [i0, 4, i1, 3, 0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S3[i0] -> [i0, 3, 0, 0, 0, 0] : i0 >= 1 and i0 <= n; S4[i0, i1] -> [i0, 4, i1, 1, 0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S5[i0, i1, i2] -> [i0, 4, i1, 2, i2, 1] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 and i2 <= -1 + i0 } -[n] -> { : } -[n] -> { [i, j, k, l, m, n'] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky.st b/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky.st new file mode 100644 index 00000000000..a6e910a5386 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky.st @@ -0,0 +1,26 @@ +domain: "[n] -> { S2[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= -1 + i0; S1[i0] : i0 >= 1 and i0 <= n; S4[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S5[i0, i1, i2] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 and i2 <= -1 + i0; S6[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S3[i0] : i0 >= 1 and i0 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i0] -> [(i0)]; S4[i0, i1] -> [(i0)]; S6[i0, i1] -> [(i0)]; S3[i0] -> [(i0)]; S5[i0, i1, i2] -> [(i0)]; S2[i0, i1] -> [(i0)] }]" + options: "[n] -> { separate[i0] }" + child: + sequence: + - filter: "[n] -> { S1[i0] }" + - filter: "[n] -> { S2[i0, i1] }" + child: + schedule: "[n] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[n] -> { separate[i0] }" + - filter: "[n] -> { S3[i0] }" + - filter: "[n] -> { S4[i0, i1]; S5[i0, i1, i2]; S6[i0, i1] }" + child: + schedule: "[n] -> [{ S4[i0, i1] -> [(i1)]; S6[i0, i1] -> [(i1)]; S5[i0, i1, i2] -> [(i1)] }]" + options: "[n] -> { separate[i0] }" + child: + sequence: + - filter: "[n] -> { S4[i0, i1] }" + - filter: "[n] -> { S5[i0, i1, i2] }" + child: + schedule: "[n] -> [{ S5[i0, i1, i2] -> [(i2)] }]" + options: "[n] -> { separate[i0] }" + - filter: "[n] -> { S6[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky2.in deleted file mode 100644 index b44b4568f71..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [3i1, i0, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0; S4[i0, i1] -> [0, i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S1[i0] -> [0, i0, 0] : i0 >= 1 and i0 <= M; S6[i0, i1] -> [-1 + 3i0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S3[i0] -> [-2 + 3i0, 0, 0] : i0 >= 1 and i0 <= M; S5[i0, i1, i2] -> [-1 + 3i2, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 and i2 <= -1 + i0 } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky2.st new file mode 100644 index 00000000000..d49ff85865a --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/cholesky2.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S4[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S5[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 and i2 <= -1 + i0; S6[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S3[i0] : i0 >= 1 and i0 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0; S1[i0] : i0 >= 1 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0] -> [(0)]; S3[i0] -> [(-2 + 3i0)]; S4[i0, i1] -> [(0)]; S5[i0, i1, i2] -> [(-1 + 3i2)]; S2[i0, i1] -> [(3i1)]; S6[i0, i1] -> [(-1 + 3i0)] }, { S1[i0] -> [(i0)]; S3[i0] -> [(0)]; S4[i0, i1] -> [(i0)]; S5[i0, i1, i2] -> [(i1)]; S2[i0, i1] -> [(i0)]; S6[i0, i1] -> [(i1)] }, { S1[i0] -> [(0)]; S3[i0] -> [(0)]; S4[i0, i1] -> [(i1)]; S5[i0, i1, i2] -> [(i2)]; S2[i0, i1] -> [(0)]; S6[i0, i1] -> [(0)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/christian.c b/polly/lib/External/isl/test_inputs/codegen/cloog/christian.c index 98b52d8d0fe..113249a124f 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/christian.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/christian.c @@ -1,6 +1,6 @@ for (int c0 = -N + 1; c0 <= N; c0 += 1) { - for (int c1 = max(0, c0 - 1); c1 < min(N, N + c0 - 1); c1 += 1) - S2(c1, -c0 + c1 + 1); for (int c1 = max(0, c0); c1 < min(N, N + c0); c1 += 1) S1(c1, -c0 + c1); + for (int c1 = max(0, c0 - 1); c1 < min(N, N + c0 - 1); c1 += 1) + S2(c1, -c0 + c1 + 1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/christian.in b/polly/lib/External/isl/test_inputs/codegen/cloog/christian.in deleted file mode 100644 index af3df07967f..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/christian.in +++ /dev/null @@ -1,3 +0,0 @@ -[N] -> { S1[i0, i1] -> [i0 - i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S2[i0, i1] -> [1 + i0 - i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N } -[N] -> { : } -[N] -> { [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/christian.st b/polly/lib/External/isl/test_inputs/codegen/cloog/christian.st new file mode 100644 index 00000000000..b4517743fd9 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/christian.st @@ -0,0 +1,6 @@ +domain: "[N] -> { S1[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S2[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N }" +child: + context: "[N] -> { [] }" + child: + schedule: "[N] -> [{ S1[i0, i1] -> [(i0 - i1)]; S2[i0, i1] -> [(1 + i0 - i1)] }]" + options: "[N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/classen.c b/polly/lib/External/isl/test_inputs/codegen/cloog/classen.c index 7ed3c45c9e8..d51254c00cc 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/classen.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/classen.c @@ -1,60 +1,86 @@ -for (int c0 = 0; c0 < 2 * m - 1; c0 += 1) { - if (2 * m >= c0 + 3 && c0 >= 1) { +if (m >= 1) { + if (m == 1) { + S1(0, 1, 1, 1); + S8(0, 1); + } else { + S1(0, 1, 1, 1); + S4(0, 1, 2, 2, 1, 1, 2, 2); + S3(0, 1, 1, 2, 1, 1, 1, 2); + S2(0, 1, 1, 1, 1, 1, 2, 1); + S8(0, 1); + } + for (int c0 = 1; c0 < 2 * m - 3; c0 += 1) { if (c0 + 1 == m) { S5(m - 2, 1, m - 1, 1, m - 1, 1, m, 1); S1(m - 1, 1, m, 1); S3(m - 1, 1, m, 2, m, 1, m, 2); - } else if (c0 >= m) { - S5(c0 - 1, -m + c0 + 2, c0, -m + c0 + 2, m - 1, -m + c0 + 2, m, -m + c0 + 2); - S6(c0 - 1, -m + c0 + 1, c0, -m + c0 + 2, m, -m + c0 + 1, m, -m + c0 + 2); - S1(c0, -m + c0 + 2, m, -m + c0 + 2); - S3(c0, -m + c0 + 2, c0 + 1, -m + c0 + 3, m, -m + c0 + 2, m, -m + c0 + 3); - } else { + } else if (m >= c0 + 2) { S5(c0 - 1, 1, c0, 1, c0, 1, c0 + 1, 1); S1(c0, 1, c0 + 1, 1); - S3(c0, 1, c0 + 1, 2, c0 + 1, 1, c0 + 1, 2); S4(c0, 1, c0 + 2, 2, c0 + 1, 1, c0 + 2, 2); S2(c0, 1, c0 + 1, 1, c0 + 1, 1, c0 + 2, 1); + S3(c0, 1, c0 + 1, 2, c0 + 1, 1, c0 + 1, 2); + } else { + S5(c0 - 1, -m + c0 + 2, c0, -m + c0 + 2, m - 1, -m + c0 + 2, m, -m + c0 + 2); + S6(c0 - 1, -m + c0 + 1, c0, -m + c0 + 2, m, -m + c0 + 1, m, -m + c0 + 2); + S1(c0, -m + c0 + 2, m, -m + c0 + 2); + S3(c0, -m + c0 + 2, c0 + 1, -m + c0 + 3, m, -m + c0 + 2, m, -m + c0 + 3); } - for (int c2 = max(2, -m + c0 + 3); c2 <= min(m - 1, c0); c2 += 1) { - S5(c0 - 1, c2, c0, c2, c0 - c2 + 1, c2, c0 - c2 + 2, c2); - S7(c0 - 1, c2 - 1, c0 + 1, c2, c0 - c2 + 2, c2 - 1, c0 - c2 + 3, c2); - S6(c0 - 1, c2 - 1, c0, c2, c0 - c2 + 2, c2 - 1, c0 - c2 + 2, c2); - S1(c0, c2, c0 - c2 + 2, c2); - S3(c0, c2, c0 + 1, c2 + 1, c0 - c2 + 2, c2, c0 - c2 + 2, c2 + 1); - S4(c0, c2, c0 + 2, c2 + 1, c0 - c2 + 2, c2, c0 - c2 + 3, c2 + 1); - S2(c0, c2, c0 + 1, c2, c0 - c2 + 2, c2, c0 - c2 + 3, c2); + for (int c1 = max(2, -m + c0 + 3); c1 <= min(m - 1, c0); c1 += 1) { + S5(c0 - 1, c1, c0, c1, c0 - c1 + 1, c1, c0 - c1 + 2, c1); + S6(c0 - 1, c1 - 1, c0, c1, c0 - c1 + 2, c1 - 1, c0 - c1 + 2, c1); + S7(c0 - 1, c1 - 1, c0 + 1, c1, c0 - c1 + 2, c1 - 1, c0 - c1 + 3, c1); + S1(c0, c1, c0 - c1 + 2, c1); + S4(c0, c1, c0 + 2, c1 + 1, c0 - c1 + 2, c1, c0 - c1 + 3, c1 + 1); + S2(c0, c1, c0 + 1, c1, c0 - c1 + 2, c1, c0 - c1 + 3, c1); + S3(c0, c1, c0 + 1, c1 + 1, c0 - c1 + 2, c1, c0 - c1 + 2, c1 + 1); } if (c0 + 1 == m) { S7(m - 2, m - 1, m, m, 1, m - 1, 2, m); S6(m - 2, m - 1, m - 1, m, 1, m - 1, 1, m); S1(m - 1, m, 1, m); S2(m - 1, m, m, m, 1, m, 2, m); - } else if (c0 >= m) { + } else if (m >= c0 + 2) { + S7(c0 - 1, c0, c0 + 1, c0 + 1, 1, c0, 2, c0 + 1); + S6(c0 - 1, c0, c0, c0 + 1, 1, c0, 1, c0 + 1); + S1(c0, c0 + 1, 1, c0 + 1); + S4(c0, c0 + 1, c0 + 2, c0 + 2, 1, c0 + 1, 2, c0 + 2); + S2(c0, c0 + 1, c0 + 1, c0 + 1, 1, c0 + 1, 2, c0 + 1); + S3(c0, c0 + 1, c0 + 1, c0 + 2, 1, c0 + 1, 1, c0 + 2); + } else { S5(c0 - 1, m, c0, m, -m + c0 + 1, m, -m + c0 + 2, m); S7(c0 - 1, m - 1, c0 + 1, m, -m + c0 + 2, m - 1, -m + c0 + 3, m); S6(c0 - 1, m - 1, c0, m, -m + c0 + 2, m - 1, -m + c0 + 2, m); S1(c0, m, -m + c0 + 2, m); S2(c0, m, c0 + 1, m, -m + c0 + 2, m, -m + c0 + 3, m); + } + for (int c2 = max(1, -m + c0 + 2); c2 <= min(m, c0 + 1); c2 += 1) + S8(c0, c2); + } + if (m >= 2) { + if (m >= 3) { + S5(2 * m - 4, m - 1, 2 * m - 3, m - 1, m - 1, m - 1, m, m - 1); + S6(2 * m - 4, m - 2, 2 * m - 3, m - 1, m, m - 2, m, m - 1); + S1(2 * m - 3, m - 1, m, m - 1); + S3(2 * m - 3, m - 1, 2 * m - 2, m, m, m - 1, m, m); + S5(2 * m - 4, m, 2 * m - 3, m, m - 2, m, m - 1, m); + S7(2 * m - 4, m - 1, 2 * m - 2, m, m - 1, m - 1, m, m); + S6(2 * m - 4, m - 1, 2 * m - 3, m, m - 1, m - 1, m - 1, m); + S1(2 * m - 3, m, m - 1, m); } else { - S7(c0 - 1, c0, c0 + 1, c0 + 1, 1, c0, 2, c0 + 1); - S6(c0 - 1, c0, c0, c0 + 1, 1, c0, 1, c0 + 1); - S1(c0, c0 + 1, 1, c0 + 1); - S3(c0, c0 + 1, c0 + 1, c0 + 2, 1, c0 + 1, 1, c0 + 2); - S4(c0, c0 + 1, c0 + 2, c0 + 2, 1, c0 + 1, 2, c0 + 2); - S2(c0, c0 + 1, c0 + 1, c0 + 1, 1, c0 + 1, 2, c0 + 1); + S5(0, 1, 1, 1, 1, 1, 2, 1); + S1(1, 1, 2, 1); + S3(1, 1, 2, 2, 2, 1, 2, 2); + S7(0, 1, 2, 2, 1, 1, 2, 2); + S6(0, 1, 1, 2, 1, 1, 1, 2); + S1(1, 2, 1, 2); } - } else if (m >= 2 && c0 == 0) { - S1(0, 1, 1, 1); - S3(0, 1, 1, 2, 1, 1, 1, 2); - S4(0, 1, 2, 2, 1, 1, 2, 2); - S2(0, 1, 1, 1, 1, 1, 2, 1); - } else if (m >= 2) { + S2(2 * m - 3, m, 2 * m - 2, m, m - 1, m, m, m); + for (int c2 = m - 1; c2 <= m; c2 += 1) + S8(2 * m - 3, c2); S5(2 * m - 3, m, 2 * m - 2, m, m - 1, m, m, m); S6(2 * m - 3, m - 1, 2 * m - 2, m, m, m - 1, m, m); S1(2 * m - 2, m, m, m); - } else - S1(0, 1, 1, 1); - for (int c8 = max(1, -m + c0 + 2); c8 <= min(m, c0 + 1); c8 += 1) - S8(c0, c8); + S8(2 * m - 2, m); + } } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/classen.in b/polly/lib/External/isl/test_inputs/codegen/cloog/classen.in deleted file mode 100644 index 8dc0b76a505..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/classen.in +++ /dev/null @@ -1,3 +0,0 @@ -[m] -> { S2[i0, i1, 1 + i0, i1, 2 + i0 - i1, i1, 3 + i0 - i1, i1] -> [i0, 0, i1, 2, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -3 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= m and i1 >= 3 - m + i0 and i1 >= 1; S4[i0, i1, 2 + i0, 1 + i1, 2 + i0 - i1, i1, 3 + i0 - i1, 1 + i1] -> [i0, 0, i1, 2, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -4 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= -1 + m and i1 >= 3 - m + i0 and i1 >= 1; S5[i0, i1, 1 + i0, i1, 2 + i0 - i1, i1, 3 + i0 - i1, i1] -> [1 + i0, 0, i1, 0, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -3 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= m and i1 >= 3 - m + i0 and i1 >= 1; S7[i0, i1, 2 + i0, 1 + i1, 2 + i0 - i1, i1, 3 + i0 - i1, 1 + i1] -> [1 + i0, 0, 1 + i1, 0, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -4 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= -1 + m and i1 >= 3 - m + i0 and i1 >= 1; S6[i0, i1, 1 + i0, 1 + i1, 2 + i0 - i1, i1, 2 + i0 - i1, 1 + i1] -> [1 + i0, 0, 1 + i1, 0, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -3 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= -1 + m and i1 >= 2 - m + i0 and i1 >= 1; S3[i0, i1, 1 + i0, 1 + i1, 2 + i0 - i1, i1, 2 + i0 - i1, 1 + i1] -> [i0, 0, i1, 2, 2 + i0 - i1, i1, 1] : m >= 1 and i0 <= -3 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= -1 + m and i1 >= 2 - m + i0 and i1 >= 1; S8[i0, i1] -> [i0, 1, 0, 0, 0, 0, 0] : i0 <= -2 + 2m and i0 >= 0 and i1 <= 1 + i0 and i1 <= m and i1 >= 2 - m + i0 and i1 >= 1; S1[i0, i1, 2 + i0 - i1, i1] -> [i0, 0, i1, 1, 0, 0, 0] : m >= 1 and i1 >= 2 - m + i0 and i1 <= 1 + i0 and i1 <= m and i1 >= 1 } -[m] -> { : m >= 0 } -[m] -> { [i, j, k, l, m', n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/classen.st b/polly/lib/External/isl/test_inputs/codegen/cloog/classen.st new file mode 100644 index 00000000000..e9d3baf611f --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/classen.st @@ -0,0 +1,24 @@ +domain: "[m] -> { S2[coordT1, coordP1, 1 + coordT1, coordP1, 2 + coordT1 - coordP1, coordP1, 3 + coordT1 - coordP1, coordP1] : m >= 1 and coordT1 <= -3 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= m and coordP1 >= 3 - m + coordT1 and coordP1 >= 1; S4[coordT1, coordP1, 2 + coordT1, 1 + coordP1, 2 + coordT1 - coordP1, coordP1, 3 + coordT1 - coordP1, 1 + coordP1] : m >= 1 and coordT1 <= -4 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= -1 + m and coordP1 >= 3 - m + coordT1 and coordP1 >= 1; S6[coordT1, coordP1, 1 + coordT1, 1 + coordP1, 2 + coordT1 - coordP1, coordP1, 2 + coordT1 - coordP1, 1 + coordP1] : m >= 1 and coordT1 <= -3 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= -1 + m and coordP1 >= 2 - m + coordT1 and coordP1 >= 1; S1[coordT1, coordP1, 2 + coordT1 - coordP1, coordP1] : m >= 1 and coordP1 >= 2 - m + coordT1 and coordP1 <= 1 + coordT1 and coordP1 <= m and coordP1 >= 1; S8[coordT1, coordP1] : coordT1 <= -2 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= m and coordP1 >= 2 - m + coordT1 and coordP1 >= 1; S5[coordT1, coordP1, 1 + coordT1, coordP1, 2 + coordT1 - coordP1, coordP1, 3 + coordT1 - coordP1, coordP1] : m >= 1 and coordT1 <= -3 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= m and coordP1 >= 3 - m + coordT1 and coordP1 >= 1; S7[coordT1, coordP1, 2 + coordT1, 1 + coordP1, 2 + coordT1 - coordP1, coordP1, 3 + coordT1 - coordP1, 1 + coordP1] : m >= 1 and coordT1 <= -4 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= -1 + m and coordP1 >= 3 - m + coordT1 and coordP1 >= 1; S3[coordT1, coordP1, 1 + coordT1, 1 + coordP1, 2 + coordT1 - coordP1, coordP1, 2 + coordT1 - coordP1, 1 + coordP1] : m >= 1 and coordT1 <= -3 + 2m and coordT1 >= 0 and coordP1 <= 1 + coordT1 and coordP1 <= -1 + m and coordP1 >= 2 - m + coordT1 and coordP1 >= 1 }" +child: + context: "[m] -> { [] : m >= 0 }" + child: + schedule: "[m] -> [{ S7[i0, i1, i2, i3, i4, i5, i6, i7] -> [(1 + i0)]; S4[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i0)]; S8[i0, i1] -> [(i0)]; S3[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i0)]; S1[i0, i1, i2, i3] -> [(i0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i0)]; S5[i0, i1, i2, i3, i4, i5, i6, i7] -> [(1 + i0)]; S6[i0, i1, i2, i3, i4, i5, i6, i7] -> [(1 + i0)] }]" + options: "[m] -> { separate[i0] }" + child: + sequence: + - filter: "[m] -> { S2[i0, i1, i2, i3, i4, i5, i6, i7]; S6[i0, i1, i2, i3, i4, i5, i6, i7]; S4[i0, i1, i2, i3, i4, i5, i6, i7]; S1[i0, i1, i2, i3]; S7[i0, i1, i2, i3, i4, i5, i6, i7]; S5[i0, i1, i2, i3, i4, i5, i6, i7]; S3[i0, i1, i2, i3, i4, i5, i6, i7] }" + child: + schedule: "[m] -> [{ S7[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i3)]; S4[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i1)]; S3[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i1)]; S1[i0, i1, i2, i3] -> [(i1)]; S2[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i1)]; S5[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i3)]; S6[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i3)] }]" + options: "[m] -> { separate[i0] }" + child: + sequence: + - filter: "[m] -> { S6[i0, i1, i2, i3, i4, i5, i6, i7]; S5[i0, i1, i2, i3, i4, i5, i6, i7]; S7[i0, i1, i2, i3, i4, i5, i6, i7] }" + child: + schedule: "[m] -> [{ S7[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)]; S5[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)]; S6[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)] }, { S7[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)]; S5[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)]; S6[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)] }]" + options: "[m] -> { separate[i0] }" + - filter: "[m] -> { S1[i0, i1, i2, i3] }" + - filter: "[m] -> { S2[i0, i1, i2, i3, i4, i5, i6, i7]; S4[i0, i1, i2, i3, i4, i5, i6, i7]; S3[i0, i1, i2, i3, i4, i5, i6, i7] }" + child: + schedule: "[m] -> [{ S4[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)]; S3[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)]; S2[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i4)] }, { S4[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)]; S3[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)]; S2[i0, i1, i2, i3, i4, i5, i6, i7] -> [(i5)] }]" + options: "[m] -> { separate[i0] }" + - filter: "[m] -> { S8[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/classen2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/classen2.in deleted file mode 100644 index 8a74eaa9728..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/classen2.in +++ /dev/null @@ -1,3 +0,0 @@ -[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { S1[i0, i1, i2, 2i0 + i1 + i2, 1 + i0 + i1 + i2, 1 + i0 + i1] -> [2i0 + i1 + i2, 1 + i0 + i1 + i2, 1 + i0 + i1] : N >= 3 and i2 <= 3 + 5outerProcTileScatter1 - i0 - i1 and i1 >= -1 + 5outerProcTileScatter2 - i0 and M >= 2 and i2 <= 4 + 5outerTimeTileScatter - 2i0 - i1 and i1 <= 3 + 5outerProcTileScatter2 - i0 and i2 >= 1 and i2 <= -2 + N and i1 >= 1 and i1 <= -2 + N and i0 >= 1 and i0 <= -1 + M and i2 >= 5outerTimeTileScatter - 2i0 - i1 and i2 >= -1 + 5outerProcTileScatter1 - i0 - i1 } -[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { : } -[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/classen2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/classen2.st new file mode 100644 index 00000000000..f7115ca6a4d --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/classen2.st @@ -0,0 +1,6 @@ +domain: "[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { S1[compIter1, compIter2, compIter3, 2compIter1 + compIter2 + compIter3, 1 + compIter1 + compIter2 + compIter3, 1 + compIter1 + compIter2] : N >= 3 and compIter3 <= 3 + 5outerProcTileScatter1 - compIter1 - compIter2 and compIter2 >= -1 + 5outerProcTileScatter2 - compIter1 and M >= 2 and compIter3 <= 4 + 5outerTimeTileScatter - 2compIter1 - compIter2 and compIter2 <= 3 + 5outerProcTileScatter2 - compIter1 and compIter3 >= 1 and compIter3 <= -2 + N and compIter2 >= 1 and compIter2 <= -2 + N and compIter1 >= 1 and compIter1 <= -1 + M and compIter3 >= 5outerTimeTileScatter - 2compIter1 - compIter2 and compIter3 >= -1 + 5outerProcTileScatter1 - compIter1 - compIter2 }" +child: + context: "[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { [] }" + child: + schedule: "[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> [{ S1[i0, i1, i2, i3, i4, i5] -> [(i3)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i4)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i5)] }]" + options: "[outerTimeTileScatter, outerProcTileScatter1, outerProcTileScatter2, M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/constant.in b/polly/lib/External/isl/test_inputs/codegen/cloog/constant.in deleted file mode 100644 index 7cd365a8967..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/constant.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S5[i0] -> [i0, 0, 1] : i0 >= 0 and i0 <= 1023 and i0 >= 1025 + M; S1[i0] -> [-1, i0, 0] : i0 >= 0 and i0 <= 1023 and i0 <= 1024 + M; S3[i0] -> [-1, i0, 2] : i0 >= 0 and i0 <= 1023; S2[i0] -> [-1, i0, 1] : i0 >= 0 and i0 <= 1023 and i0 >= 1025 + M; S4[i0] -> [i0, 0, 0] : i0 >= 0 and i0 <= 1023 and i0 <= 1024 + M; S6[i0] -> [i0, 0, 2] : i0 >= 0 and i0 <= 1023 } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/constant.st b/polly/lib/External/isl/test_inputs/codegen/cloog/constant.st new file mode 100644 index 00000000000..f4f85f742c1 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/constant.st @@ -0,0 +1,11 @@ +domain: "[M] -> { S4[i0] : i0 >= 0 and i0 <= 1023 and i0 <= 1024 + M; S5[i0] : i0 >= 0 and i0 <= 1023 and i0 >= 1025 + M; S3[i0] : i0 >= 0 and i0 <= 1023; S2[i0] : i0 >= 0 and i0 <= 1023 and i0 >= 1025 + M; S1[i0] : i0 >= 0 and i0 <= 1023 and i0 <= 1024 + M; S6[i0] : i0 >= 0 and i0 <= 1023 }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S2[i0] -> [(-1)]; S4[i0] -> [(i0)]; S1[i0] -> [(-1)]; S3[i0] -> [(-1)]; S6[i0] -> [(i0)]; S5[i0] -> [(i0)] }, { S2[i0] -> [(i0)]; S4[i0] -> [(0)]; S1[i0] -> [(i0)]; S3[i0] -> [(i0)]; S6[i0] -> [(0)]; S5[i0] -> [(0)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S4[i0]; S1[i0] }" + - filter: "[M] -> { S5[i0]; S2[i0] }" + - filter: "[M] -> { S3[i0]; S6[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/constbound.c b/polly/lib/External/isl/test_inputs/codegen/cloog/constbound.c index 219165dc8c9..7fbebe016da 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/constbound.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/constbound.c @@ -1,8 +1,8 @@ for (int c0 = 0; c0 <= 199; c0 += 1) { - for (int c2 = 50 * c0; c2 <= 50 * c0 + 24; c2 += 1) - for (int c3 = 0; c3 <= c2; c3 += 1) - S1(c0, c2, c3); - for (int c2 = 50 * c0 + 25; c2 <= 50 * c0 + 49; c2 += 1) - for (int c3 = 0; c3 <= c2; c3 += 1) - S2(c0, c2, c3); + for (int c1 = 50 * c0; c1 <= 50 * c0 + 24; c1 += 1) + for (int c2 = 0; c2 <= c1; c2 += 1) + S1(c0, c1, c2); + for (int c1 = 50 * c0 + 25; c1 <= 50 * c0 + 49; c1 += 1) + for (int c2 = 0; c2 <= c1; c2 += 1) + S2(c0, c1, c2); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/constbound.in b/polly/lib/External/isl/test_inputs/codegen/cloog/constbound.in deleted file mode 100644 index 24727a8737c..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/constbound.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S2[i0, i1, i2] -> [i0, 1, i1, i2] : i1 >= 0 and i1 <= 9999 and i2 >= 0 and i2 <= i1 and i1 >= 25 + 50i0 and i1 <= 49 + 50i0; S1[i0, i1, i2] -> [i0, 0, i1, i2] : i1 >= 0 and i1 <= 9999 and i2 >= 0 and i2 <= i1 and i1 >= 50i0 and i1 <= 24 + 50i0 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/constbound.st b/polly/lib/External/isl/test_inputs/codegen/cloog/constbound.st new file mode 100644 index 00000000000..1f6789e32e2 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/constbound.st @@ -0,0 +1,16 @@ +domain: "{ S2[i0, i1, i2] : i1 >= 0 and i1 <= 9999 and i2 >= 0 and i2 <= i1 and i1 >= 25 + 50i0 and i1 <= 49 + 50i0; S1[i0, i1, i2] : i1 >= 0 and i1 <= 9999 and i2 >= 0 and i2 <= i1 and i1 >= 50i0 and i1 <= 24 + 50i0 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1, i2] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" + - filter: "{ S2[i0, i1, i2] }" + child: + schedule: "[{ S2[i0, i1, i2] -> [(i1)] }, { S2[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/darte.in b/polly/lib/External/isl/test_inputs/codegen/cloog/darte.in deleted file mode 100644 index 55897a5a7e4..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/darte.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1, i2] -> [1 + i0 - i1, 2 + i0 + i1, i2] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= n and i2 >= 1 and i2 <= n; S1[i0, i1, i2] -> [i0 - i1, i0 + i1, i0 + i1 + 2i2] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= n and i2 >= 1 and i2 <= n } -[n] -> { : } -[n] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/darte.st b/polly/lib/External/isl/test_inputs/codegen/cloog/darte.st new file mode 100644 index 00000000000..33e9386bf89 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/darte.st @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i0, i1, i2] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= n and i2 >= 1 and i2 <= n; S2[i0, i1, i2] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= n and i2 >= 1 and i2 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i0, i1, i2] -> [(i0 - i1)]; S2[i0, i1, i2] -> [(1 + i0 - i1)] }, { S1[i0, i1, i2] -> [(i0 + i1)]; S2[i0, i1, i2] -> [(2 + i0 + i1)] }, { S1[i0, i1, i2] -> [(i0 + i1 + 2i2)]; S2[i0, i1, i2] -> [(i2)] }]" + options: "[n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/dealII.c b/polly/lib/External/isl/test_inputs/codegen/cloog/dealII.c index 7db605d5d5b..939a804a9c7 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/dealII.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/dealII.c @@ -1,12 +1,32 @@ { - for (int c0 = 0; c0 <= min(T_2 - 1, T_66); c0 += 1) { + if (T_67 == 0 && T_66 <= -1) { + S1(0); + } else if (T_2 >= 1 && T_67 >= 1 && T_66 <= -1) { + S1(0); + } else if (T_2 >= 1 && T_67 >= 1 && T_66 >= 0) { + S1(0); + S2(0); + } + for (int c0 = 1; c0 <= min(min(T_2 - 1, T_67 - 1), T_66); c0 += 1) { S1(c0); S2(c0); } - for (int c0 = T_2; c0 <= min(T_67 - 1, T_66); c0 += 1) + for (int c0 = max(1, T_66 + 1); c0 < min(T_2, T_67); c0 += 1) + S1(c0); + if (T_2 >= 1 && T_67 == 0 && T_66 >= 0) { + S1(0); + S2(0); + } + for (int c0 = max(1, T_67); c0 <= min(T_2 - 1, T_66); c0 += 1) { + S1(c0); S2(c0); - for (int c0 = max(0, T_66 + 1); c0 < T_2; c0 += 1) + } + for (int c0 = max(max(1, T_67), T_66 + 1); c0 < T_2; c0 += 1) S1(c0); - if (T_2 == 0 && T_67 == 0) + if (T_2 == 0 && T_67 >= 1 && T_66 >= 0) + S2(0); + for (int c0 = max(1, T_2); c0 <= min(T_67 - 1, T_66); c0 += 1) + S2(c0); + if (T_2 == 0 && T_67 == 0 && T_66 >= 0) S1(0); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/dealII.in b/polly/lib/External/isl/test_inputs/codegen/cloog/dealII.in deleted file mode 100644 index fc0310b638f..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/dealII.in +++ /dev/null @@ -1,3 +0,0 @@ -[T_2, T_67, T_66] -> { S1[scat_0] -> [scat_0, 0] : (scat_0 <= -1 + T_2 and scat_0 >= 0) or (scat_0 <= -T_67 and scat_0 >= 0); S2[scat_0] -> [scat_0, 1] : (scat_0 <= -1 + T_2 and scat_0 >= 0 and scat_0 <= T_66) or (scat_0 <= -1 + T_67 and scat_0 >= 0 and scat_0 <= T_66) } -[T_2, T_67, T_66] -> { : T_2 <= 4 and T_2 >= 0 and T_67 <= 4 and T_67 >= 0 } -[T_2, T_67, T_66] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/dealII.st b/polly/lib/External/isl/test_inputs/codegen/cloog/dealII.st new file mode 100644 index 00000000000..586e8fb166d --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/dealII.st @@ -0,0 +1,10 @@ +domain: "[T_2, T_67, T_66] -> { S1[scat_0] : (scat_0 >= 0 and scat_0 <= -1 + T_2) or (scat_0 <= -T_67 and scat_0 >= 0); S2[scat_0] : (scat_0 >= 0 and scat_0 <= T_66 and scat_0 <= -1 + T_2) or (scat_0 >= 0 and scat_0 <= T_66 and scat_0 <= -1 + T_67) }" +child: + context: "[T_2, T_67, T_66] -> { [] : T_2 <= 4 and T_2 >= 0 and T_67 <= 4 and T_67 >= 0 }" + child: + schedule: "[T_2, T_67, T_66] -> [{ S2[scat_0] -> [(scat_0)]; S1[scat_0] -> [(scat_0)] }]" + options: "[T_2, T_67, T_66] -> { separate[i0] }" + child: + sequence: + - filter: "[T_2, T_67, T_66] -> { S1[scat_0] }" + - filter: "[T_2, T_67, T_66] -> { S2[scat_0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/donotsimp.c b/polly/lib/External/isl/test_inputs/codegen/cloog/donotsimp.c index 4c482e2997e..6e2cfce802c 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/donotsimp.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/donotsimp.c @@ -1,6 +1,6 @@ -for (int c1 = 1; c1 <= 10; c1 += 1) { - for (int c3 = 1; c3 <= c1; c3 += 1) - S1(c1, c3); - for (int c3 = 11; c3 <= M; c3 += 1) - S2(c1, c3); +for (int c0 = 1; c0 <= 10; c0 += 1) { + for (int c1 = 1; c1 <= c0; c1 += 1) + S1(c0, c1); + for (int c1 = 11; c1 <= M; c1 += 1) + S2(c0, c1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/donotsimp.in b/polly/lib/External/isl/test_inputs/codegen/cloog/donotsimp.in deleted file mode 100644 index c1541ccff7e..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/donotsimp.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 1 and i0 <= 10 and i1 >= 11 and i1 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 1 and i0 <= 10 and i1 >= 1 and i1 <= i0 } -[M] -> { : M >= 20 } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/donotsimp.st b/polly/lib/External/isl/test_inputs/codegen/cloog/donotsimp.st new file mode 100644 index 00000000000..1dd72f41335 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/donotsimp.st @@ -0,0 +1,9 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= 10 and i1 >= 1 and i1 <= i0; S2[i0, i1] : i0 >= 1 and i0 <= 10 and i1 >= 11 and i1 <= M }" +child: + context: "[M] -> { [] : M >= 20 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/dot.in b/polly/lib/External/isl/test_inputs/codegen/cloog/dot.in deleted file mode 100644 index 37e1f14bad2..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/dot.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[0, i1] -> [0, i1, 0] : i1 <= M and N >= 0 and i1 >= 1; S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i1 <= M and i0 <= N and i1 >= 1 } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/dot.st b/polly/lib/External/isl/test_inputs/codegen/cloog/dot.st new file mode 100644 index 00000000000..a9ca44a3044 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/dot.st @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[0, i1] : i1 <= M and N >= 0 and i1 >= 1; S2[i0, i1] : i0 >= 1 and i1 <= M and i0 <= N and i1 >= 1 }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/dot2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/dot2.in deleted file mode 100644 index 8fa8381e20b..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/dot2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S1[i0] -> [i0, 0, 0] : i0 >= 1 and i0 <= M } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/dot2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/dot2.st new file mode 100644 index 00000000000..192d23c3471 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/dot2.st @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0] : i0 >= 1 and i0 <= M; S2[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i0)]; S1[i0] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0] -> [(0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/durbin_e_s.in b/polly/lib/External/isl/test_inputs/codegen/cloog/durbin_e_s.in deleted file mode 100644 index 77d32ad73f9..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/durbin_e_s.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S5[i0, i1, 3] -> [i0, i1, 3, 4] : i1 <= -1 + i0 and i0 <= 10 and i1 >= 1; S8[i0, 0, 3] -> [i0, 0, 3, 7] : i0 >= 1 and i0 <= 9; S2[i0, -7, 0] -> [i0, -7, 0, 1] : i0 >= 2 and i0 <= 10; S3[i0, i1, 1] -> [i0, i1, 1, 2] : i1 >= -7 and i0 <= 10 and i1 <= -9 + i0; S1[10, i1, 4] -> [10, i1, 4, 0] : i1 >= 1 and i1 <= 10; S7[1, 0, 0] -> [1, 0, 0, 6]; S4[1, 0, 0] -> [1, 0, 0, 3]; S6[i0, -9 + i0, 2] -> [i0, -9 + i0, 2, 5] : i0 >= 2 and i0 <= 10 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/durbin_e_s.st b/polly/lib/External/isl/test_inputs/codegen/cloog/durbin_e_s.st new file mode 100644 index 00000000000..8b08767070e --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/durbin_e_s.st @@ -0,0 +1,16 @@ +domain: "{ S2[i0, -7, 0] : i0 >= 2 and i0 <= 10; S4[1, 0, 0]; S6[i0, -9 + i0, 2] : i0 >= 2 and i0 <= 10; S1[10, i1, 4] : i1 >= 1 and i1 <= 10; S5[i0, i1, 3] : i1 <= -1 + i0 and i0 <= 10 and i1 >= 1; S7[1, 0, 0]; S8[i0, 0, 3] : i0 >= 1 and i0 <= 9; S3[i0, i1, 1] : i1 >= -7 and i0 <= 10 and i1 <= -9 + i0 }" +child: + context: "{ [] }" + child: + schedule: "[{ S6[i0, i1, i2] -> [(i0)]; S8[i0, i1, i2] -> [(i0)]; S5[i0, i1, i2] -> [(i0)]; S4[i0, i1, i2] -> [(i0)]; S7[i0, i1, i2] -> [(i0)]; S3[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)] }, { S6[i0, i1, i2] -> [(i1)]; S8[i0, i1, i2] -> [(i1)]; S5[i0, i1, i2] -> [(i1)]; S4[i0, i1, i2] -> [(i1)]; S7[i0, i1, i2] -> [(i1)]; S3[i0, i1, i2] -> [(i1)]; S1[i0, i1, i2] -> [(i1)]; S2[i0, i1, i2] -> [(i1)] }, { S6[i0, i1, i2] -> [(i2)]; S8[i0, i1, i2] -> [(i2)]; S5[i0, i1, i2] -> [(i2)]; S4[i0, i1, i2] -> [(i2)]; S7[i0, i1, i2] -> [(i2)]; S3[i0, i1, i2] -> [(i2)]; S1[i0, i1, i2] -> [(i2)]; S2[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1, i2] }" + - filter: "{ S2[i0, i1, i2] }" + - filter: "{ S3[i0, i1, i2] }" + - filter: "{ S4[i0, i1, i2] }" + - filter: "{ S5[i0, i1, i2] }" + - filter: "{ S6[i0, i1, i2] }" + - filter: "{ S7[i0, i1, i2] }" + - filter: "{ S8[i0, i1, i2] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/emploi.in b/polly/lib/External/isl/test_inputs/codegen/cloog/emploi.in deleted file mode 100644 index 57016623a25..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/emploi.in +++ /dev/null @@ -1,3 +0,0 @@ -[m, n] -> { S1[i0] -> [i0, 0, 0] : (i0 >= 1 and i0 <= n and i0 <= 2m) or (i0 >= 1 and i0 <= n and i0 >= m); S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= m } -[m, n] -> { : } -[m, n] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/emploi.st b/polly/lib/External/isl/test_inputs/codegen/cloog/emploi.st new file mode 100644 index 00000000000..a7f4c265f32 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/emploi.st @@ -0,0 +1,10 @@ +domain: "[m, n] -> { S1[i0] : (i0 >= 1 and i0 <= n and i0 <= 2m) or (i0 >= m and i0 >= 1 and i0 <= n); S2[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= m }" +child: + context: "[m, n] -> { [] }" + child: + schedule: "[m, n] -> [{ S1[i0] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0] -> [(0)]; S2[i0, i1] -> [(i1)] }]" + options: "[m, n] -> { separate[i0] }" + child: + sequence: + - filter: "[m, n] -> { S1[i0] }" + - filter: "[m, n] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/equality.in b/polly/lib/External/isl/test_inputs/codegen/cloog/equality.in deleted file mode 100644 index 677fa901324..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/equality.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0, 2i0] -> [i0, 2i0, 0] : i0 >= 0 and i0 <= 5; S2[i0, 4] -> [i0, 4, 1] : i0 >= 0 and i0 <= 5 } -{ : } -{ [i, j, k] -> atomic[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/equality.st b/polly/lib/External/isl/test_inputs/codegen/cloog/equality.st new file mode 100644 index 00000000000..084689c1e75 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/equality.st @@ -0,0 +1,10 @@ +domain: "{ S2[i0, 4] : i0 >= 0 and i0 <= 5; S1[i0, 2i0] : i0 >= 0 and i0 <= 5 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "{ atomic[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1] }" + - filter: "{ S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/equality2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/equality2.in deleted file mode 100644 index 95b3f793407..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/equality2.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0, i1, 1, 2, i0, i5, -999 + i1, i0, -999 + i1, i9, i10] -> [i0, i1, 1, 2, i0, n, -999 + i1, i0, -999 + i1, r, s, 0, 0, 0, 0, 0] : 2s = -998 + i1 and 2n = 2 + i1 and 2i10 = -998 + i1 and 2i5 = 2 + i1 and 2i9 = -998 + i1 and 2r = -998 + i1 and i0 >= 1 and i0 <= 10000 and i1 >= 1000 and i1 <= 1016; S2[i0, i1, -1999 + 2i1, 1, i0, -1000 + 2i1, 1, 2, i0, -499 + i1, -1999 + 2i1, i0, -1999 + 2i1, -999 + i1, -999 + i1] -> [i0, i1, -1999 + 2i1, 1, i0, -1000 + 2i1, 1, 2, i0, -499 + i1, -1999 + 2i1, i0, -1999 + 2i1, -999 + i1, -999 + i1, 1] : i0 >= 1 and i0 <= 10000 and i1 >= 1000 and i1 <= 1008 } -{ : } -{ [i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x] -> atomic[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/equality2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/equality2.st new file mode 100644 index 00000000000..bbcb3381e89 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/equality2.st @@ -0,0 +1,10 @@ +domain: "{ S1[i0, i1, 1, 2, i0, i5, -999 + i1, i0, -999 + i1, i9, i10] : 2i5 = 2 + i1 and 2i9 = -998 + i1 and 2i10 = -998 + i1 and i0 >= 1 and i0 <= 10000 and i1 >= 1000 and i1 <= 1016; S2[i0, i1, -1999 + 2i1, 1, i0, -1000 + 2i1, 1, 2, i0, -499 + i1, -1999 + 2i1, i0, -1999 + 2i1, -999 + i1, -999 + i1] : i0 >= 1 and i0 <= 10000 and i1 >= 1000 and i1 <= 1008 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i0)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i1)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i1)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i2)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i2)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i3)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i3)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i4)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i4)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i5)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i5)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i6)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i6)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i7)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i7)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i8)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i8)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i9)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i9)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(i10)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i10)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i11)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i12)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i13)] }, { S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] -> [(0)]; S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] -> [(i14)] }]" + options: "{ atomic[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10] }" + - filter: "{ S2[i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/esced.in b/polly/lib/External/isl/test_inputs/codegen/cloog/esced.in deleted file mode 100644 index 3bef6fd90f0..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/esced.in +++ /dev/null @@ -1,3 +0,0 @@ -[n, m] -> { S1[i0] -> [i0, 0, 0] : i0 >= 1 and i0 <= m; S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i0 <= m and i1 >= 1 and i1 <= n } -[n, m] -> { : } -[n, m] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/esced.st b/polly/lib/External/isl/test_inputs/codegen/cloog/esced.st new file mode 100644 index 00000000000..f48ccf6a295 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/esced.st @@ -0,0 +1,10 @@ +domain: "[n, m] -> { S1[i0] : i0 >= 1 and i0 <= m; S2[i0, i1] : i0 >= 1 and i0 <= m and i1 >= 1 and i1 <= n }" +child: + context: "[n, m] -> { [] }" + child: + schedule: "[n, m] -> [{ S2[i0, i1] -> [(i0)]; S1[i0] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0] -> [(0)] }]" + options: "[n, m] -> { separate[i0] }" + child: + sequence: + - filter: "[n, m] -> { S1[i0] }" + - filter: "[n, m] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/ex1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/ex1.in deleted file mode 100644 index 457b834afe2..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/ex1.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1] -> [i0, i1, 1] : i0 >= 15 and i0 <= n and i1 >= 10 and i1 <= n; S1[i0, i1] -> [i0, i1, 0] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= -15 + n } -[n] -> { : n >= 25 } -[n] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/ex1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/ex1.st new file mode 100644 index 00000000000..ea0253881a1 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/ex1.st @@ -0,0 +1,10 @@ +domain: "[n] -> { S1[i0, i1] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= -15 + n; S2[i0, i1] : i0 >= 15 and i0 <= n and i1 >= 10 and i1 <= n }" +child: + context: "[n] -> { [] : n >= 25 }" + child: + schedule: "[n] -> [{ S2[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)] }]" + options: "[n] -> { separate[i0] }" + child: + sequence: + - filter: "[n] -> { S1[i0, i1] }" + - filter: "[n] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/faber.c b/polly/lib/External/isl/test_inputs/codegen/cloog/faber.c index 4e553d84078..b100b7b34a5 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/faber.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/faber.c @@ -37,17 +37,16 @@ for (int c1 = 1; c1 <= 18; c1 += 1) { for (int c2 = -8 * c1; c2 <= min(6, -8 * c1 + 24); c2 += 1) S3(c0, c1, c2); - if (c1 == 2) { + if (c0 <= 34 && c1 == 1) { + S3(c0, 1, 7); + } else if (c1 == 2) { S3(c0, 2, 7); } else if (c0 >= 35 && c1 == 1) { S3(c0, 1, 7); S7(c0, 1, 7); - } else if (c0 <= 34 && c1 == 1) - S3(c0, 1, 7); + } for (int c2 = 8; c2 <= min(-8 * c1 + 24, c1 - (6 * c0 + 77) / 77 + 12); c2 += 1) S3(c0, c1, c2); - for (int c2 = max(-8 * c1 + 25, c1 - (6 * c0 + 77) / 77 + 13); c2 <= c1 + 12; c2 += 1) - S6(c0, c1, c2); if (c1 == 1) { for (int c2 = -((6 * c0 + 77) / 77) + 14; c2 <= 13; c2 += 1) { S3(c0, 1, c2); @@ -56,6 +55,8 @@ for (int c2 = 14; c2 <= 16; c2 += 1) S3(c0, 1, c2); } + for (int c2 = max(-8 * c1 + 25, c1 - (6 * c0 + 77) / 77 + 13); c2 <= c1 + 12; c2 += 1) + S6(c0, c1, c2); for (int c2 = c1 - (3 * c0 + 14) / 14 + 49; c2 <= c1 + 48; c2 += 1) S1(c0, c1, c2); } @@ -67,25 +68,32 @@ } } for (int c0 = 37; c0 <= 218; c0 += 1) { - if (c0 <= 148) { - for (int c1 = (c0 + 5) / 14 - 8; c1 < c0 / 14 - 5; c1 += 1) { - if (c0 <= 46 && c1 == -3) - S7(c0, -3, 6); - if (77 * ((3 * c1 + 18) / 5) + 216 >= 6 * c0) - S6(c0, c1, -((-2 * c1 + 3) / 5) + 9); - for (int c2 = c1 + 24; c2 <= -2 * c1 + 24; c2 += 1) - S2(c0, c1, c2); + for (int c1 = (c0 + 5) / 14 - 8; c1 < min(0, c0 / 14 - 5); c1 += 1) { + if (c0 <= 46 && c1 == -3) + S7(c0, -3, 6); + if (-77 * ((-3 * c1 + 1) / 5) + 447 >= 6 * c0) + S6(c0, c1, -((-2 * c1 + 3) / 5) + 9); + for (int c2 = c1 + 24; c2 <= -2 * c1 + 24; c2 += 1) + S2(c0, c1, c2); + for (int c2 = -2 * c1 + 30; c2 <= c1 - (3 * c0 + 17) / 14 + 56; c2 += 1) + S1(c0, c1, c2); + } + if (c0 <= 148) + for (int c1 = max(0, (c0 + 5) / 14 - 8); c1 < c0 / 14 - 5; c1 += 1) { + if (c1 == 0) + S2(c0, 0, 24); for (int c2 = max(c1 + 24, -2 * c1 + 30); c2 <= c1 - (3 * c0 + 17) / 14 + 56; c2 += 1) S1(c0, c1, c2); } - if (c0 % 14 >= 9) { - if (c0 <= 41) - S7(c0, -3, 6); - if (c0 <= 69) - S6(c0, c0 / 14 - 5, 8); - for (int c2 = max((c0 - 28) / 14 + 21, (c0 - 28) / 14 - (3 * c0 + 14) / 14 + 46); c2 <= (c0 - 28) / 14 - (3 * c0 + 17) / 14 + 53; c2 += 1) - S1(c0, c0 / 14 - 5, c2); - } + if (c0 >= 79 && c0 % 14 >= 9) { + for (int c2 = max((c0 - 70) / 14 + 24, (c0 - 70) / 14 - (3 * c0 + 14) / 14 + 49); c2 <= (c0 - 70) / 14 - (3 * c0 + 17) / 14 + 56; c2 += 1) + S1(c0, c0 / 14 - 5, c2); + } else if (c0 <= 69 && c0 % 14 >= 9) { + if (c0 <= 41) + S7(c0, -3, 6); + S6(c0, c0 / 14 - 5, 8); + for (int c2 = -((-c0 + 83) / 14) - (3 * c0 + 14) / 14 + 49; c2 <= -((-c0 + 83) / 14) - (3 * c0 + 17) / 14 + 56; c2 += 1) + S1(c0, c0 / 14 - 5, c2); } for (int c1 = (c0 + 5) / 14 - 5; c1 < 0; c1 += 1) { if (7 * c1 + 114 >= 2 * c0) @@ -96,9 +104,9 @@ S1(c0, c1, c2); } for (int c1 = max(0, (c0 + 5) / 14 - 5); c1 < c0 / 14 - 2; c1 += 1) { - for (int c2 = max(c1, -2 * c1 + 6); c2 <= min(-2 * c1 + 24, (2 * c0 - 7 * c1 - 10) / 21 + 1); c2 += 1) + for (int c2 = max(c1, -2 * c1 + 6); c2 <= min(min(-2 * c1 + 24, c1 - (6 * c0 + 91) / 77 + 15), (2 * c0 - 7 * c1 - 10) / 21 + 1); c2 += 1) S9(c0, c1, c2); - if (c1 >= 1 && c1 <= 6 && 14 * c1 + 46 >= c0) + if (c1 >= 1 && c1 <= 5 && 14 * c1 + 46 >= c0) S9(c0, c1, c1 + 5); for (int c2 = max(c1 + 6, (2 * c0 - 7 * c1 - 10) / 21 + 2); c2 <= (2 * c1 + 1) / 5 + 7; c2 += 1) { S7(c0, c1, c2); @@ -110,7 +118,7 @@ S6(c0, c1, c2); S9(c0, c1, c2); } - for (int c2 = max(max(c1 + 6, c1 - (6 * c0 + 91) / 77 + 16), (2 * c0 - 7 * c1 - 10) / 21 + 2); c2 <= -2 * c1 + 24; c2 += 1) + for (int c2 = c1 - (6 * c0 + 91) / 77 + 16; c2 <= -2 * c1 + 24; c2 += 1) S9(c0, c1, c2); for (int c2 = max(c1, -2 * c1 + 30); c2 <= min(c1 + 24, c1 - (3 * c0 + 17) / 14 + 47); c2 += 1) S8(c0, c1, c2); @@ -118,10 +126,10 @@ S1(c0, c1, c2); } for (int c1 = c0 / 14 - 2; c1 <= 18; c1 += 1) { - for (int c2 = c1 + 6; c2 <= min((2 * c1 + 1) / 5 + 7, (2 * c0 - 7 * c1 + 63) / 21 + 1); c2 += 1) - S7(c0, c1, c2); for (int c2 = max(6, (c0 + 5) / 14 + 1); c2 <= min(min(c1, c0 / 14 + 3), -c1 + c1 / 2 + 18); c2 += 1) S5(c0, c1, c2); + for (int c2 = c1 + 6; c2 <= min((2 * c1 + 1) / 5 + 7, (2 * c0 - 7 * c1 + 63) / 21 + 1); c2 += 1) + S7(c0, c1, c2); for (int c2 = max(max(c1 + 6, c1 - (6 * c0 + 77) / 77 + 13), (2 * c1 + 1) / 5 + 9); c2 <= c1 - (6 * c0 + 91) / 77 + 15; c2 += 1) S6(c0, c1, c2); for (int c2 = max(c1 + (3 * c0 + 3) / 14 - 40, -c1 + (c1 + 1) / 2 + 21); c2 <= min(c1, c1 + 3 * c0 / 14 - 33); c2 += 1) diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/faber.in b/polly/lib/External/isl/test_inputs/codegen/cloog/faber.in deleted file mode 100644 index 4f78a5561d0..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/faber.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S5[idx4, idx5, idx6] -> [idx4, idx5, idx6, 4] : 14idx6 <= 42 + idx4 and 14idx6 >= 6 + idx4 and idx6 <= idx5 and idx6 >= -12 + idx5 and idx6 >= 6 and idx6 <= 30 and 2idx6 <= 36 - idx5; S8[idx4, idx5, idx6] -> [idx4, idx5, idx6, 7] : 14idx6 >= 546 - 3idx4 + 14idx5 and 14idx6 <= 654 - 3idx4 + 14idx5 and idx6 >= idx5 and idx6 <= 24 + idx5 and idx5 >= 0 and idx5 <= 24 and idx6 >= 30 - 2idx5; S2[idx4, idx5, idx6] -> [idx4, idx5, idx6, 1] : 14idx5 <= -84 + idx4 and 14idx5 >= -120 + idx4 and idx6 >= 24 + idx5 and idx6 <= 48 + idx5 and idx5 >= -6 and idx5 <= 18 and idx6 <= 24 - 2idx5; S10[idx4, idx5, idx6] -> [idx4, idx5, idx6, 9] : 7idx6 <= idx4 - 28idx5 and 7idx6 >= -36 + idx4 - 28idx5 and idx6 >= idx5 and idx6 <= 24 + idx5 and idx5 >= 0 and idx5 <= 24 and idx6 <= -2idx5; S3[idx4, idx5, idx6] -> [idx4, idx5, idx6, 2] : idx4 >= 0 and idx4 <= 36 and idx6 >= -8idx5 and idx6 <= 24 - 8idx5 and idx5 >= 0 and idx5 <= 24; S1[idx4, idx5, idx6] -> [idx4, idx5, idx6, 0] : 14idx6 >= 672 - 3idx4 + 14idx5 and 14idx6 <= 780 - 3idx4 + 14idx5 and idx6 >= 24 + idx5 and idx6 <= 48 + idx5 and idx5 >= -6 and idx5 <= 18 and idx6 >= 30 - 2idx5; S7[idx4, idx5, idx6] -> [idx4, idx5, idx6, 6] : 21idx6 <= 84 + 2idx4 - 7idx5 and 21idx6 >= 12 + 2idx4 - 7idx5 and idx6 <= 12 + idx5 and idx6 >= 6 + idx5 and idx6 >= 6 and idx6 <= 30 and 5idx6 <= 36 + 2idx5; S9[idx4, idx5, idx6] -> [idx4, idx5, idx6, 8] : 14idx5 <= -42 + idx4 and 14idx5 >= -78 + idx4 and idx6 >= idx5 and idx6 <= 24 + idx5 and idx5 >= 0 and idx5 <= 24 and idx6 <= 24 - 2idx5 and idx6 >= 6 - 2idx5; S4[idx4, idx5, idx6] -> [idx4, idx5, idx6, 3] : 14idx6 <= -462 + 3idx4 + 14idx5 and 14idx6 >= -570 + 3idx4 + 14idx5 and idx6 <= idx5 and idx6 >= -12 + idx5 and idx6 >= 6 and idx6 <= 30 and 2idx6 >= 42 - idx5; S6[idx4, idx5, idx6] -> [idx4, idx5, idx6, 5] : 77idx6 >= 924 - 6idx4 + 77idx5 and 77idx6 <= 1140 - 6idx4 + 77idx5 and idx6 <= 12 + idx5 and idx6 >= 6 + idx5 and idx6 >= 6 and idx6 <= 30 and 5idx6 >= 42 + 2idx5 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/faber.st b/polly/lib/External/isl/test_inputs/codegen/cloog/faber.st new file mode 100644 index 00000000000..f8008946492 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/faber.st @@ -0,0 +1,18 @@ +domain: "{ S2[idx4, idx5, idx6] : 14idx5 <= -84 + idx4 and 14idx5 >= -120 + idx4 and idx6 >= 24 + idx5 and idx6 <= 48 + idx5 and idx5 >= -6 and idx5 <= 18 and idx6 <= 24 - 2idx5; S4[idx4, idx5, idx6] : 14idx6 <= -462 + 3idx4 + 14idx5 and 14idx6 >= -570 + 3idx4 + 14idx5 and idx6 <= idx5 and idx6 >= -12 + idx5 and idx6 >= 6 and idx6 <= 30 and 2idx6 >= 42 - idx5; S6[idx4, idx5, idx6] : 77idx6 >= 924 - 6idx4 + 77idx5 and 77idx6 <= 1140 - 6idx4 + 77idx5 and idx6 <= 12 + idx5 and idx6 >= 6 + idx5 and idx6 >= 6 and idx6 <= 30 and 5idx6 >= 42 + 2idx5; S1[idx4, idx5, idx6] : 14idx6 >= 672 - 3idx4 + 14idx5 and 14idx6 <= 780 - 3idx4 + 14idx5 and idx6 >= 24 + idx5 and idx6 <= 48 + idx5 and idx5 >= -6 and idx5 <= 18 and idx6 >= 30 - 2idx5; S5[idx4, idx5, idx6] : 14idx6 <= 42 + idx4 and 14idx6 >= 6 + idx4 and idx6 <= idx5 and idx6 >= -12 + idx5 and idx6 >= 6 and idx6 <= 30 and 2idx6 <= 36 - idx5; S7[idx4, idx5, idx6] : 21idx6 <= 84 + 2idx4 - 7idx5 and 21idx6 >= 12 + 2idx4 - 7idx5 and idx6 <= 12 + idx5 and idx6 >= 6 + idx5 and idx6 >= 6 and idx6 <= 30 and 5idx6 <= 36 + 2idx5; S8[idx4, idx5, idx6] : 14idx6 >= 546 - 3idx4 + 14idx5 and 14idx6 <= 654 - 3idx4 + 14idx5 and idx6 >= idx5 and idx6 <= 24 + idx5 and idx5 >= 0 and idx5 <= 24 and idx6 >= 30 - 2idx5; S3[idx4, idx5, idx6] : idx4 >= 0 and idx4 <= 36 and idx6 >= -8idx5 and idx6 <= 24 - 8idx5 and idx5 >= 0 and idx5 <= 24; S9[idx4, idx5, idx6] : 14idx5 <= -42 + idx4 and 14idx5 >= -78 + idx4 and idx6 >= idx5 and idx6 <= 24 + idx5 and idx5 >= 0 and idx5 <= 24 and idx6 <= 24 - 2idx5 and idx6 >= 6 - 2idx5; S10[idx4, idx5, idx6] : 7idx6 <= idx4 - 28idx5 and 7idx6 >= -36 + idx4 - 28idx5 and idx6 >= idx5 and idx6 <= 24 + idx5 and idx5 >= 0 and idx5 <= 24 and idx6 <= -2idx5 }" +child: + context: "{ [] }" + child: + schedule: "[{ S6[idx4, idx5, idx6] -> [(idx4)]; S8[idx4, idx5, idx6] -> [(idx4)]; S5[idx4, idx5, idx6] -> [(idx4)]; S9[idx4, idx5, idx6] -> [(idx4)]; S4[idx4, idx5, idx6] -> [(idx4)]; S10[idx4, idx5, idx6] -> [(idx4)]; S7[idx4, idx5, idx6] -> [(idx4)]; S3[idx4, idx5, idx6] -> [(idx4)]; S1[idx4, idx5, idx6] -> [(idx4)]; S2[idx4, idx5, idx6] -> [(idx4)] }, { S6[idx4, idx5, idx6] -> [(idx5)]; S8[idx4, idx5, idx6] -> [(idx5)]; S5[idx4, idx5, idx6] -> [(idx5)]; S9[idx4, idx5, idx6] -> [(idx5)]; S4[idx4, idx5, idx6] -> [(idx5)]; S10[idx4, idx5, idx6] -> [(idx5)]; S7[idx4, idx5, idx6] -> [(idx5)]; S3[idx4, idx5, idx6] -> [(idx5)]; S1[idx4, idx5, idx6] -> [(idx5)]; S2[idx4, idx5, idx6] -> [(idx5)] }, { S6[idx4, idx5, idx6] -> [(idx6)]; S8[idx4, idx5, idx6] -> [(idx6)]; S5[idx4, idx5, idx6] -> [(idx6)]; S9[idx4, idx5, idx6] -> [(idx6)]; S4[idx4, idx5, idx6] -> [(idx6)]; S10[idx4, idx5, idx6] -> [(idx6)]; S7[idx4, idx5, idx6] -> [(idx6)]; S3[idx4, idx5, idx6] -> [(idx6)]; S1[idx4, idx5, idx6] -> [(idx6)]; S2[idx4, idx5, idx6] -> [(idx6)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[idx4, idx5, idx6] }" + - filter: "{ S2[idx4, idx5, idx6] }" + - filter: "{ S3[idx4, idx5, idx6] }" + - filter: "{ S4[idx4, idx5, idx6] }" + - filter: "{ S5[idx4, idx5, idx6] }" + - filter: "{ S6[idx4, idx5, idx6] }" + - filter: "{ S7[idx4, idx5, idx6] }" + - filter: "{ S8[idx4, idx5, idx6] }" + - filter: "{ S9[idx4, idx5, idx6] }" + - filter: "{ S10[idx4, idx5, idx6] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.in deleted file mode 100644 index ede8856d545..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [i0, i1, 1] : i1 <= -1 + i0 and i1 >= 2 and i0 <= M; S4[i0, i0] -> [i0, i0, 3] : M >= 3 and i0 <= M and i0 >= 2; S1[i0, 1] -> [i0, 1, 0] : M >= 3 and i0 <= M and i0 >= 2; S3[1, 1] -> [1, 1, 2] : M >= 3 } -[M] -> { : M >= 3 } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.st new file mode 100644 index 00000000000..152e6b00a7e --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-1-1-2.st @@ -0,0 +1,12 @@ +domain: "[M] -> { S4[i0, i0] : M >= 3 and i0 <= M and i0 >= 2; S1[i0, 1] : M >= 3 and i0 <= M and i0 >= 2; S3[1, 1] : M >= 3; S2[i0, i1] : i1 <= -1 + i0 and i1 >= 2 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 3 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S4[i0, i1] -> [(i0)]; S3[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S4[i0, i1] -> [(i1)]; S3[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" + - filter: "[M] -> { S3[i0, i1] }" + - filter: "[M] -> { S4[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.in deleted file mode 100644 index 57863cc5727..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[1, 1, i2] -> [1, 1, i2, 0] : M >= 3 and i2 <= M and i2 >= 2; S2[i0, 1, i2] -> [i0, 1, i2, 1] : i2 >= 1 + i0 and i0 >= 2 and i2 <= M; S4[i0, 0] -> [i0, 0, 0, 3] : i0 >= 2 and M >= 3 and i0 <= M; S3[1, 0] -> [1, 0, 0, 2] : M >= 3 } -[M] -> { : M >= 3 } -[M] -> { [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.st new file mode 100644 index 00000000000..76f08315cba --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-2-1-2-3.st @@ -0,0 +1,12 @@ +domain: "[M] -> { S4[i0, 0] : i0 >= 2 and M >= 3 and i0 <= M; S3[1, 0] : M >= 3; S2[i0, 1, i2] : i2 >= 1 + i0 and i0 >= 2 and i2 <= M; S1[1, 1, i2] : M >= 3 and i2 <= M and i2 >= 2 }" +child: + context: "[M] -> { [] : M >= 3 }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i0)]; S4[i0, i1] -> [(i0)]; S3[i0, i1] -> [(i0)]; S2[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)]; S4[i0, i1] -> [(i1)]; S3[i0, i1] -> [(i1)]; S2[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)]; S4[i0, i1] -> [(0)]; S3[i0, i1] -> [(0)]; S2[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1, i2] }" + - filter: "[M] -> { S2[i0, i1, i2] }" + - filter: "[M] -> { S3[i0, i1] }" + - filter: "[M] -> { S4[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.in deleted file mode 100644 index c40383d8b6e..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [i0, i1, 1] : 2i1 <= -1 + i0 and i1 >= 2 and i1 >= -M + i0; S4[i0, i1] -> [i0, j, 3] : 2j = i0 and 2i1 = i0 and M >= 3 and i0 <= 2M and i0 >= 4; S1[i0, 1] -> [i0, 1, 0] : M >= 3 and i0 <= 1 + M and i0 >= 3; S3[2, 1] -> [2, 1, 2] : M >= 3 } -[M] -> { : M >= 3 } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.st new file mode 100644 index 00000000000..35677b4e64f --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/forwardsub-3-1-2.st @@ -0,0 +1,12 @@ +domain: "[M] -> { S4[i0, i1] : 2i1 = i0 and M >= 3 and i0 <= 2M and i0 >= 4; S1[i0, 1] : M >= 3 and i0 <= 1 + M and i0 >= 3; S3[2, 1] : M >= 3; S2[i0, i1] : 2i1 <= -1 + i0 and i1 >= 2 and i1 >= -M + i0 }" +child: + context: "[M] -> { [] : M >= 3 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S4[i0, i1] -> [(i0)]; S3[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S4[i0, i1] -> [(i1)]; S3[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" + - filter: "[M] -> { S3[i0, i1] }" + - filter: "[M] -> { S4[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/gauss.c b/polly/lib/External/isl/test_inputs/codegen/cloog/gauss.c index 13a8e137173..4bbe42cb500 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/gauss.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/gauss.c @@ -1,7 +1,7 @@ for (int c0 = 1; c0 < M; c0 += 1) for (int c1 = c0 + 1; c1 <= M; c1 += 1) { - for (int c3 = c0 + 1; c3 <= M; c3 += 1) - S2(c0, c3, c1); for (int c3 = 1; c3 < c0; c3 += 1) S1(c0, c3, c1); + for (int c3 = c0 + 1; c3 <= M; c3 += 1) + S2(c0, c3, c1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/gauss.in b/polly/lib/External/isl/test_inputs/codegen/cloog/gauss.in deleted file mode 100644 index 439e72e7f34..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/gauss.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2] -> [i0, i2] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M; S2[i0, i1, i2] -> [i0, i2] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 + i0 and i2 <= M } -[M] -> { : } -[M] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/gauss.st b/polly/lib/External/isl/test_inputs/codegen/cloog/gauss.st new file mode 100644 index 00000000000..7173a4cdded --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/gauss.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S2[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 + i0 and i2 <= M; S1[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i2)]; S2[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/gesced.in b/polly/lib/External/isl/test_inputs/codegen/cloog/gesced.in deleted file mode 100644 index 6043f4b3fb9..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/gesced.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S3[i0, i1] -> [2N + i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S2[i0, i1] -> [N + i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S1[i0] -> [i0] : i0 >= 1 and i0 <= N } -[M, N] -> { : N <= M and M >= 2 and N >= 2 } -[M, N] -> { [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/gesced.st b/polly/lib/External/isl/test_inputs/codegen/cloog/gesced.st new file mode 100644 index 00000000000..3534f754bc2 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/gesced.st @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S3[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S1[i0] : i0 >= 1 and i0 <= N; S2[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M }" +child: + context: "[M, N] -> { [] : N <= M and M >= 2 and N >= 2 }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(N + i1)]; S3[i0, i1] -> [(2N + i1)]; S1[i0] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/gesced2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/gesced2.in deleted file mode 100644 index a5d5bd27e28..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/gesced2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [i0, i1] : i0 >= 1 and i0 <= M and i1 >= 5 and i1 <= -10 + M; S2[i0, i1] -> [i1, i0 - i1] : i0 >= 1 and i0 <= M and i1 >= 5 and i1 <= -10 + M } -[M] -> { : M >= 16 } -[M] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/gesced2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/gesced2.st new file mode 100644 index 00000000000..c5f41bf1434 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/gesced2.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 5 and i1 <= -10 + M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 5 and i1 <= -10 + M }" +child: + context: "[M] -> { [] : M >= 16 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i1)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i0 - i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/gesced3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/gesced3.in deleted file mode 100644 index 29f57f32176..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/gesced3.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0] -> [2M + i0] : i0 >= 1 and i0 <= N; S1[i0] -> [M + i0] : i0 >= 1 and i0 <= N } -[M, N] -> { : N >= M and M >= 2 } -[M, N] -> { [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/gesced3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/gesced3.st new file mode 100644 index 00000000000..cb0a28531f1 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/gesced3.st @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[i0] : i0 >= 1 and i0 <= N; S2[i0] : i0 >= 1 and i0 <= N }" +child: + context: "[M, N] -> { [] : N >= M and M >= 2 }" + child: + schedule: "[M, N] -> [{ S2[i0] -> [(2M + i0)]; S1[i0] -> [(M + i0)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/guide.in b/polly/lib/External/isl/test_inputs/codegen/cloog/guide.in deleted file mode 100644 index 38c418c6c65..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/guide.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0] -> [i0, 0] : (i0 >= 1 and i0 <= N and i0 <= 2M) or (i0 >= 1 and i0 <= N and i0 >= M); S2[i0] -> [i0, 1] : i0 >= 1 + N and i0 <= 2N } -[M, N] -> { : } -[M, N] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/guide.st b/polly/lib/External/isl/test_inputs/codegen/cloog/guide.st new file mode 100644 index 00000000000..3ca5c6eca27 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/guide.st @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0] : (i0 >= 1 and i0 <= N and i0 <= 2M) or (i0 >= M and i0 >= 1 and i0 <= N); S2[i0] : i0 >= 1 + N and i0 <= 2N }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S2[i0] -> [(i0)]; S1[i0] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0] }" + - filter: "[M, N] -> { S2[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/iftest.in b/polly/lib/External/isl/test_inputs/codegen/cloog/iftest.in deleted file mode 100644 index 741399d48a0..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/iftest.in +++ /dev/null @@ -1,3 +0,0 @@ -[m, n] -> { S1[i0] -> [i0, 0] : (i0 >= 1 and i0 <= n and i0 >= m) or (i0 >= 1 and i0 <= n and i0 <= 2m) } -[m, n] -> { : } -[m, n] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/iftest.st b/polly/lib/External/isl/test_inputs/codegen/cloog/iftest.st new file mode 100644 index 00000000000..cd26fab47b3 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/iftest.st @@ -0,0 +1,6 @@ +domain: "[m, n] -> { S1[i0] : (i0 >= m and i0 >= 1 and i0 <= n) or (i0 >= 1 and i0 <= n and i0 <= 2m) }" +child: + context: "[m, n] -> { [] }" + child: + schedule: "[m, n] -> [{ S1[i0] -> [(i0)] }]" + options: "[m, n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/iftest2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/iftest2.in deleted file mode 100644 index a2e3212ece3..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/iftest2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1] -> [i0, i1, 0] : (i0 >= 1 and i0 <= N and i0 >= M and i1 >= 1 and i1 <= M) or (i0 >= 1 and i0 <= N and i0 <= 2M and i1 >= 1 and i1 <= M) } -[M, N] -> { : } -[M, N] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/iftest2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/iftest2.st new file mode 100644 index 00000000000..f073f5cf5f4 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/iftest2.st @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[i0, i1] : (i0 >= M and i0 <= N and i1 >= 1 and i1 <= M) or (i0 >= 1 and i0 <= N and i0 <= 2M and i1 >= 1 and i1 <= M) }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/infinite2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/infinite2.in deleted file mode 100644 index 64fb5d55735..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/infinite2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S1[i0] -> [i0, 0, 0] : i0 >= 1 } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/infinite2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/infinite2.st new file mode 100644 index 00000000000..7bd85d37770 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/infinite2.st @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0] : i0 >= 1; S2[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i0)]; S1[i0] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0] -> [(0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/jacobi-shared.in b/polly/lib/External/isl/test_inputs/codegen/cloog/jacobi-shared.in deleted file mode 100644 index d6153244284..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/jacobi-shared.in +++ /dev/null @@ -1,3 +0,0 @@ -[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { S1[i0, i1] -> [1 - g1 + i0, 1 - g2 + i1, t0, t1] : exists (e0 = [(-1 + h0)/2], e1 = [(-2016b0 - g1)/2048], e2 = [(-992b1 - g2)/1024], e3 = [(-1 + t0 - i0)/16], e4 = [(-1 + t1 - i1)/32]: g0 = h0 and 2e0 = -1 + h0 and 2048e1 = -2016b0 - g1 and 1024e2 = -992b1 - g2 and 16e3 = -1 + t0 - i0 and 32e4 = -1 + t1 - i1 and h0 >= 1 and h0 <= -1 + 2T and i0 >= 2 and i0 <= -2 + N and i1 >= 2 and i1 <= -2 + N and b1 <= 31 and b1 >= 0 and b0 <= 63 and b0 >= 0 and i1 <= 31 + g2 and i1 >= g2 and N >= 4 and i0 >= g1 and i0 <= 31 + g1 and g2 <= -2 + N and g2 >= -29 and g1 <= -2 + N and g1 >= -29 and g1 >= 32b0 and g2 >= 32b1 and 32b0 <= -2 + N and 32b1 <= -2 + N and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 31) } -[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { : exists (e0 = [(-32b0 + g1)/2048], e1 = [(-32b1 + g2)/1024]: g0 = h0 and 2048e0 = -32b0 + g1 and 1024e1 = -32b1 + g2 and g2 <= -2 + N and g2 >= -29 and g1 <= -2 + N and g1 >= -29 and b1 >= 0 and b1 <= 31 and b0 <= 63 and 32b1 <= -2 + N and 32b0 <= -2 + N and b0 >= 0 and N >= 4 and h0 >= 0 and h0 <= -1 + 2T and g2 >= 32b1 and g1 >= 32b0 and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 31) } -[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { [i, j, k, l] -> separate[x] : x >= 3 } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/jacobi-shared.st b/polly/lib/External/isl/test_inputs/codegen/cloog/jacobi-shared.st new file mode 100644 index 00000000000..73f5dd8730e --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/jacobi-shared.st @@ -0,0 +1,6 @@ +domain: "[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { S1[i0, i1] : exists (e0 = floor((-1 + h0)/2), e1 = floor((-32b0 + g1)/2048), e2 = floor((-32b1 + g2)/1024), e3 = floor((-15 - t0 + i0)/16), e4 = floor((-31 - t1 + i1)/32): g0 = h0 and 2e0 = -1 + h0 and 2048e1 = -32b0 + g1 and 1024e2 = -32b1 + g2 and 16e3 = -15 - t0 + i0 and 32e4 = -31 - t1 + i1 and h0 >= 1 and h0 <= -1 + 2T and i0 >= 2 and i0 <= -2 + N and i1 >= 2 and i1 <= -2 + N and b1 <= 31 and b1 >= 0 and b0 <= 63 and b0 >= 0 and i1 <= 31 + g2 and i1 >= g2 and N >= 4 and i0 >= g1 and i0 <= 31 + g1 and g2 <= -2 + N and g2 >= -29 and g1 <= -2 + N and g1 >= -29 and g1 >= 32b0 and g2 >= 32b1 and 32b0 <= -2 + N and 32b1 <= -2 + N and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 31) }" +child: + context: "[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { [] : exists (e0 = floor((-32b0 + g1)/2048), e1 = floor((-32b1 + g2)/1024): g0 = h0 and 2048e0 = -32b0 + g1 and 1024e1 = -32b1 + g2 and g2 <= -2 + N and g2 >= -29 and g1 <= -2 + N and g1 >= -29 and b1 >= 0 and b1 <= 31 and b0 <= 63 and 32b1 <= -2 + N and 32b0 <= -2 + N and b0 >= 0 and N >= 4 and h0 >= 0 and h0 <= -1 + 2T and g2 >= 32b1 and g1 >= 32b0 and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 31) }" + child: + schedule: "[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> [{ S1[i0, i1] -> [(1 - g1 + i0)] }, { S1[i0, i1] -> [(1 - g2 + i1)] }, { S1[i0, i1] -> [(t0)] }, { S1[i0, i1] -> [(t1)] }]" + options: "[T, N, h0, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { separate[x] : x >= 3 }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/largeur.in b/polly/lib/External/isl/test_inputs/codegen/cloog/largeur.in deleted file mode 100644 index 3a25146b10f..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/largeur.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [i1, i0] : i0 >= 1 and i0 <= M and i1 >= i0 and i1 <= M } -[M] -> { : M >= 0 } -[M] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/largeur.st b/polly/lib/External/isl/test_inputs/codegen/cloog/largeur.st new file mode 100644 index 00000000000..bb29f2186aa --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/largeur.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= i0 and i1 <= M }" +child: + context: "[M] -> { [] : M >= 0 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }, { S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.in deleted file mode 100644 index dc9446410e6..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S8[i0, i1] -> [i0, i1, 7] : i0 >= 1 + N and 2i1 <= N + i0 and 2i1 >= -N + i0 and i0 <= -2 + 2M - N and N <= -2 + M and N >= 1; S1[0, 0] -> [0, 0, 0] : N <= -2 + M and N >= 1; S5[i0, i1] -> [i0, j, 4] : 2j = -N + i0 and 2i1 = -N + i0 and i0 >= 2 + N and i0 <= -2 + 2M - N and N >= 1; S7[i0, i1] -> [i0, i1, 6] : i0 >= 1 + N and 2i1 <= -1 - N + i0 and i0 <= -2 + 2M - N and 2i1 >= -2 - N + i0 and N <= -2 + M and N >= 1; S2[i0, 0] -> [i0, 0, 1] : i0 >= 1 and i0 <= N and N <= -2 + M; S3[i0, i0] -> [i0, i0, 2] : i0 >= 1 and i0 <= N and N <= -2 + M; S4[i0, i1] -> [i0, j, 3] : 2j = N + i0 and 2i1 = N + i0 and i0 >= 2 + N and i0 <= -2 + 2M - N and N >= 1; S6[i0, i1] -> [i0, i1, 5] : 2i1 <= -1 + N + i0 and i1 <= -1 + i0 and i1 >= 1 - M + i0 and 2i1 >= 1 - N + i0 and i1 >= 1 and i1 <= -1 + M and N <= -2 + M } -[M, N] -> { : N <= -2 + M and N >= 1 } -[M, N] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.st new file mode 100644 index 00000000000..9b1d7cbe637 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/levenshtein-1-2-3.st @@ -0,0 +1,16 @@ +domain: "[M, N] -> { S5[i0, i1] : 2i1 = -N + i0 and i0 >= 2 + N and i0 <= -2 + 2M - N and N >= 1; S3[i0, i0] : i0 >= 1 and i0 <= N and N <= -2 + M; S7[i0, i1] : i0 >= 1 + N and 2i1 <= -1 - N + i0 and i0 <= -2 + 2M - N and 2i1 >= -2 - N + i0 and N <= -2 + M and N >= 1; S6[i0, i1] : 2i1 <= -1 + N + i0 and i1 <= -1 + i0 and i1 >= 1 - M + i0 and 2i1 >= 1 - N + i0 and i1 >= 1 and i1 <= -1 + M and N <= -2 + M; S1[0, 0] : N <= -2 + M and N >= 1; S2[i0, 0] : i0 >= 1 and i0 <= N and N <= -2 + M; S4[i0, i1] : 2i1 = N + i0 and i0 >= 2 + N and i0 <= -2 + 2M - N and N >= 1; S8[i0, i1] : i0 >= 1 + N and 2i1 <= N + i0 and 2i1 >= -N + i0 and i0 <= -2 + 2M - N and N <= -2 + M and N >= 1 }" +child: + context: "[M, N] -> { [] : N <= -2 + M and N >= 1 }" + child: + schedule: "[M, N] -> [{ S7[i0, i1] -> [(i0)]; S5[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)]; S3[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)]; S4[i0, i1] -> [(i0)]; S8[i0, i1] -> [(i0)]; S6[i0, i1] -> [(i0)] }, { S7[i0, i1] -> [(i1)]; S5[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)]; S3[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)]; S4[i0, i1] -> [(i1)]; S8[i0, i1] -> [(i1)]; S6[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1] }" + - filter: "[M, N] -> { S2[i0, i1] }" + - filter: "[M, N] -> { S3[i0, i1] }" + - filter: "[M, N] -> { S4[i0, i1] }" + - filter: "[M, N] -> { S5[i0, i1] }" + - filter: "[M, N] -> { S6[i0, i1] }" + - filter: "[M, N] -> { S7[i0, i1] }" + - filter: "[M, N] -> { S8[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lex.in b/polly/lib/External/isl/test_inputs/codegen/cloog/lex.in deleted file mode 100644 index 7a268b605f0..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/lex.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S2[i0] -> [i0, -1, 0] : i0 >= 0 and i0 <= 10; S1[i0] -> [i0, 0, 0] : i0 >= 0 and i0 <= 10 } -{ : } -{ [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lex.st b/polly/lib/External/isl/test_inputs/codegen/cloog/lex.st new file mode 100644 index 00000000000..2d4d58df41e --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/lex.st @@ -0,0 +1,10 @@ +domain: "{ S1[i0] : i0 >= 0 and i0 <= 10; S2[i0] : i0 >= 0 and i0 <= 10 }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[i0] -> [(i0)]; S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S2[i0] }" + - filter: "{ S1[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-1-2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-1-2.in deleted file mode 100644 index b7d06d05953..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-1-2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i0] -> [i0, i0, 1] : i0 >= 1 and i0 <= M; S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i1 >= 1 and i0 <= M and i1 <= M } -[M] -> { : M >= 2 } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-1-2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-1-2.st new file mode 100644 index 00000000000..0d079b5e8ff --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-1-2.st @@ -0,0 +1,10 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i1 >= 1 and i0 <= M and i1 <= M; S2[i0, i0] : i0 >= 1 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 2 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-2-1-2.c b/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-2-1-2.c index 23f50d24818..97a4b045241 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-2-1-2.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-2-1-2.c @@ -1,12 +1,12 @@ for (int c0 = 1; c0 <= M; c0 += 1) { for (int c1 = 1; c1 <= min(M, c0 + 1); c1 += 1) S1(c0, c1); - if (c0 + 1 >= M) { - S2(c0, c0 + 2); - } else { + if (M >= c0 + 2) { S1(c0, c0 + 2); S2(c0, c0 + 2); } for (int c1 = c0 + 3; c1 <= M; c1 += 1) S1(c0, c1); + if (c0 + 1 >= M) + S2(c0, c0 + 2); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-2-1-2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-2-1-2.in deleted file mode 100644 index 6ed9040ab03..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-2-1-2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, 2 + i0] -> [i0, 2 + i0, 1] : i0 >= 1 and i0 <= M; S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i1 >= 1 and i0 <= M and i1 <= M } -[M] -> { : M >= 2 } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-2-1-2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-2-1-2.st new file mode 100644 index 00000000000..dbadca75cee --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/lineality-2-1-2.st @@ -0,0 +1,10 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i1 >= 1 and i0 <= M and i1 <= M; S2[i0, 2 + i0] : i0 >= 1 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 2 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/logo.in b/polly/lib/External/isl/test_inputs/codegen/cloog/logo.in deleted file mode 100644 index 33e2d88b540..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/logo.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [i0, i1, 1] : i0 >= 2 and i0 <= 6 and i1 >= 0 and i1 <= 4; S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i1 <= 7 and i1 >= -1 + i0 } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/logo.st b/polly/lib/External/isl/test_inputs/codegen/cloog/logo.st new file mode 100644 index 00000000000..89fe64953ab --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/logo.st @@ -0,0 +1,10 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i1 <= 7 and i1 >= -1 + i0; S2[i0, i1] : i0 >= 2 and i0 <= 6 and i1 >= 0 and i1 <= 4 }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/logopar.in b/polly/lib/External/isl/test_inputs/codegen/cloog/logopar.in deleted file mode 100644 index 48b70fde5b5..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/logopar.in +++ /dev/null @@ -1,3 +0,0 @@ -[m, n] -> { S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i1 <= m and i1 >= -1 + i0; S2[i0, i1] -> [i0, i1, 1] : i0 >= 2 and i0 <= n and i1 >= 0 and i1 <= n } -[m, n] -> { : n <= m and m >= 0 and n >= 2 } -[m, n] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/logopar.st b/polly/lib/External/isl/test_inputs/codegen/cloog/logopar.st new file mode 100644 index 00000000000..8ed609b4ae6 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/logopar.st @@ -0,0 +1,10 @@ +domain: "[m, n] -> { S1[i0, i1] : i0 >= 1 and i1 <= m and i1 >= -1 + i0; S2[i0, i1] : i0 >= 2 and i0 <= n and i1 >= 0 and i1 <= n }" +child: + context: "[m, n] -> { [] : n <= m and m >= 0 and n >= 2 }" + child: + schedule: "[m, n] -> [{ S2[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)] }]" + options: "[m, n] -> { separate[i0] }" + child: + sequence: + - filter: "[m, n] -> { S1[i0, i1] }" + - filter: "[m, n] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lu.in b/polly/lib/External/isl/test_inputs/codegen/cloog/lu.in deleted file mode 100644 index 49952ccc46e..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/lu.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1, i2] -> [i2, i1] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 + i0 and i2 <= n; S1[i0, i1] -> [i0, n] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n } -[n] -> { : } -[n] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lu.st b/polly/lib/External/isl/test_inputs/codegen/cloog/lu.st new file mode 100644 index 00000000000..6f9320c96da --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/lu.st @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S2[i0, i1, i2] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 + i0 and i2 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S2[i0, i1, i2] -> [(i2)]; S1[i0, i1] -> [(i0)] }, { S2[i0, i1, i2] -> [(i1)]; S1[i0, i1] -> [(n)] }]" + options: "[n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lu2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/lu2.in deleted file mode 100644 index 5c71fc0aacc..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/lu2.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S1[i0, n, i0, i3] -> [i0, n, i0, i3, 0, 0] : i0 >= 1 and i0 <= n and i3 >= 1 + i0 and i3 <= n; S2[i0, i1, i2, i1, i0] -> [i0, i1, i2, i1, i0, 1] : i2 >= 1 and i2 <= n and i2 <= -1 + i1 and i1 <= n and i2 <= -1 + i0 and i0 <= n } -[n] -> { : } -[n] -> { [i, j, k, l, m, n'] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lu2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/lu2.st new file mode 100644 index 00000000000..eb0ab21f758 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/lu2.st @@ -0,0 +1,10 @@ +domain: "[n] -> { S2[i0, i1, i2, i1, i0] : i2 >= 1 and i2 <= n and i2 <= -1 + i1 and i1 <= n and i2 <= -1 + i0 and i0 <= n; S1[i0, n, i0, i3] : i0 >= 1 and i0 <= n and i3 >= 1 + i0 and i3 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S2[i0, i1, i2, i3, i4] -> [(i0)]; S1[i0, i1, i2, i3] -> [(i0)] }, { S2[i0, i1, i2, i3, i4] -> [(i1)]; S1[i0, i1, i2, i3] -> [(i1)] }, { S2[i0, i1, i2, i3, i4] -> [(i2)]; S1[i0, i1, i2, i3] -> [(i2)] }, { S2[i0, i1, i2, i3, i4] -> [(i3)]; S1[i0, i1, i2, i3] -> [(i3)] }, { S2[i0, i1, i2, i3, i4] -> [(i4)]; S1[i0, i1, i2, i3] -> [(0)] }]" + options: "[n] -> { separate[i0] }" + child: + sequence: + - filter: "[n] -> { S1[i0, i1, i2, i3] }" + - filter: "[n] -> { S2[i0, i1, i2, i3, i4] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lux.in b/polly/lib/External/isl/test_inputs/codegen/cloog/lux.in deleted file mode 100644 index 75ed7e24000..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/lux.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i0, M, i3] -> [i0, i0, M, i3, 0, 0] : i0 >= 1 and i0 <= M and i3 >= 1 + i0 and i3 <= M; S2[i0, i1, i2, i2, i0] -> [i0, i1, i2, i2, i0, 1] : i1 >= 1 and i1 <= M and i2 >= 1 + i1 and i2 <= M and i1 <= -1 + i0 and i0 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/lux.st b/polly/lib/External/isl/test_inputs/codegen/cloog/lux.st new file mode 100644 index 00000000000..8c5bdb61220 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/lux.st @@ -0,0 +1,10 @@ +domain: "[M] -> { S1[i0, i0, M, i3] : i0 >= 1 and i0 <= M and i3 >= 1 + i0 and i3 <= M; S2[i0, i1, i2, i2, i0] : i1 >= 1 and i1 <= M and i2 >= 1 + i1 and i2 <= M and i1 <= -1 + i0 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i0)]; S2[i0, i1, i2, i3, i4] -> [(i0)] }, { S1[i0, i1, i2, i3] -> [(i1)]; S2[i0, i1, i2, i3, i4] -> [(i1)] }, { S1[i0, i1, i2, i3] -> [(i2)]; S2[i0, i1, i2, i3, i4] -> [(i2)] }, { S1[i0, i1, i2, i3] -> [(i3)]; S2[i0, i1, i2, i3, i4] -> [(i3)] }, { S1[i0, i1, i2, i3] -> [(0)]; S2[i0, i1, i2, i3, i4] -> [(i4)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1, i2, i3] }" + - filter: "[M] -> { S2[i0, i1, i2, i3, i4] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/merge.in b/polly/lib/External/isl/test_inputs/codegen/cloog/merge.in deleted file mode 100644 index 1747c44cf32..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/merge.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S3[i0] -> [i0, 2] : i0 >= 0 and i0 <= 10; S2[i0] -> [i0, 1] : i0 >= 2 and i0 <= 10; S1[0] -> [0, 0] } -{ : } -{ [i, j] -> atomic[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/merge.st b/polly/lib/External/isl/test_inputs/codegen/cloog/merge.st new file mode 100644 index 00000000000..d451317251f --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/merge.st @@ -0,0 +1,11 @@ +domain: "{ S3[i0] : i0 >= 0 and i0 <= 10; S1[0]; S2[i0] : i0 >= 2 and i0 <= 10 }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[i0] -> [(i0)]; S3[i0] -> [(i0)]; S1[i0] -> [(i0)] }]" + options: "{ atomic[i0] }" + child: + sequence: + - filter: "{ S1[i0] }" + - filter: "{ S2[i0] }" + - filter: "{ S3[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/min-1-1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/min-1-1.in deleted file mode 100644 index 76e511ff2fa..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/min-1-1.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i1 >= 0 and i1 <= M and i1 <= i0 and i1 <= N - i0 } -[M, N] -> { : } -[M, N] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/min-1-1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/min-1-1.st new file mode 100644 index 00000000000..cf3dc12dfe7 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/min-1-1.st @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[i0, i1] : i0 >= 1 and i1 >= 0 and i1 <= M and i1 <= i0 and i1 <= N - i0 }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/min-2-1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/min-2-1.in deleted file mode 100644 index aa0bcaefd86..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/min-2-1.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1, i2] -> [i0, i1, i2, 0] : i0 >= 1 and i1 >= 0 and i1 <= M and i1 <= i0 and i1 <= N - i0 and i2 >= 0 and i2 <= M and i2 <= i0 and i2 <= N - i0 } -[M, N] -> { : } -[M, N] -> { [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/min-2-1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/min-2-1.st new file mode 100644 index 00000000000..c2a48521cc0 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/min-2-1.st @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[i0, i1, i2] : i0 >= 1 and i1 >= 0 and i1 <= M and i1 <= i0 and i1 <= N - i0 and i2 >= 0 and i2 <= M and i2 <= i0 and i2 <= N - i0 }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/min-3-1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/min-3-1.in deleted file mode 100644 index 1676ac9318e..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/min-3-1.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [i0, i1, 0] : i0 >= 0 and i0 <= M and i0 <= 10 and i1 >= 0 and i1 <= M and i1 <= 10 } -[M] -> { : M >= 0 } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/min-3-1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/min-3-1.st new file mode 100644 index 00000000000..30dec04baf1 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/min-3-1.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 0 and i0 <= M and i0 <= 10 and i1 >= 0 and i1 <= M and i1 <= 10 }" +child: + context: "[M] -> { [] : M >= 0 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/min-4-1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/min-4-1.in deleted file mode 100644 index 72fd01269be..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/min-4-1.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N, O] -> { S1[i0] -> [i0, 0] : i0 >= -M and i0 >= -N and i0 <= N and i0 <= O } -[M, N, O] -> { : } -[M, N, O] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/min-4-1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/min-4-1.st new file mode 100644 index 00000000000..8c0fd869730 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/min-4-1.st @@ -0,0 +1,6 @@ +domain: "[M, N, O] -> { S1[i0] : i0 >= -M and i0 >= -N and i0 <= N and i0 <= O }" +child: + context: "[M, N, O] -> { [] }" + child: + schedule: "[M, N, O] -> [{ S1[i0] -> [(i0)] }]" + options: "[M, N, O] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mod.in b/polly/lib/External/isl/test_inputs/codegen/cloog/mod.in deleted file mode 100644 index 2759c0e506e..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/mod.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0] -> [i0, 0] : exists (e0 = [(1 + i0)/3]: i0 >= 0 and i0 <= 3 and 3e0 <= i0 and 3e0 >= -1 + i0) } -{ : } -{ [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mod.st b/polly/lib/External/isl/test_inputs/codegen/cloog/mod.st new file mode 100644 index 00000000000..cecdef112e0 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/mod.st @@ -0,0 +1,6 @@ +domain: "{ S1[i0] : exists (e0 = floor((1 + i0)/3): 3e0 <= i0 and 3e0 >= -1 + i0 and i0 >= 0 and i0 <= 3) }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0] -> [(i0)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mod2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/mod2.in deleted file mode 100644 index 58134bbbfe6..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/mod2.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i] -> [i, 0] : exists (e0 = [(i)/3]: i >= 0 and i <= 3 and 3e0 <= i and 3e0 >= -1 + i) } -{ : } -{ [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mod2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/mod2.st new file mode 100644 index 00000000000..3097bb7289a --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/mod2.st @@ -0,0 +1,6 @@ +domain: "{ S1[i] : exists (e0 = floor((1 + i)/3): 3e0 <= i and 3e0 >= -1 + i and i >= 0 and i <= 3) }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i] -> [(i)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mod3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/mod3.in deleted file mode 100644 index bd0713eeba3..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/mod3.in +++ /dev/null @@ -1,3 +0,0 @@ -[h0] -> { S1[i0, i1] -> [i0, i1, 0] : exists (e0 = [(32 + 32h0 - i0)/64]: i0 >= 0 and i0 <= 999 and i0 >= -2015 + 32h0 and 32e0 >= -999 + 32h0 - i0 and i1 >= 0 and i1 <= 999 and 64e0 >= -31 + 32h0 - i0 and 64e0 <= 31 + 32h0 - i0 and i0 <= 32 + 32h0) } -[h0] -> { : h0 <= 93 and h0 >= 0 } -[h0] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mod3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/mod3.st new file mode 100644 index 00000000000..eaad1706cfa --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/mod3.st @@ -0,0 +1,6 @@ +domain: "[h0] -> { S1[i0, i1] : exists (e0 = floor((32 + 32h0 - i0)/64): 64e0 <= 31 + 32h0 - i0 and 64e0 >= -31 + 32h0 - i0 and i0 >= 0 and i0 <= 999 and i0 >= -2015 + 32h0 and 32e0 >= -999 + 32h0 - i0 and i1 >= 0 and i1 <= 999 and i0 <= 32 + 32h0) }" +child: + context: "[h0] -> { [] : h0 <= 93 and h0 >= 0 }" + child: + schedule: "[h0] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[h0] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mod4.in b/polly/lib/External/isl/test_inputs/codegen/cloog/mod4.in deleted file mode 100644 index 2002cef3ed3..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/mod4.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S2[j, div41, div42, 2, mod6_a] -> [j, div41, k, 2, m, 1] : 3k = 1 + j and 3div42 = 1 + j and 3m = -2 + j and 3mod6_a = -2 + j and 3div41 >= 1 + j and 3div41 <= 2 + j and j >= 1 and j <= 10; S1[j, div41, div42, 2, mod6_a] -> [j, div41, div42, 2, m, 0] : 3m = -2 + j and 3mod6_a = -2 + j and j >= 1 and j <= 10 and 3div41 >= j and 3div42 >= -1 + j and 3div42 <= 1 + j and 3div41 <= 2 + j; S3[j, div41, div42, 2, mod6_a] -> [j, div41, div42, 2, m, 2] : 3m = -2 + j and 3mod6_a = -2 + j and j >= 1 and j <= 10 and 3div41 >= j and 3div42 >= -1 + j and 3div42 <= 1 + j and 3div41 <= 2 + j } -{ : } -{ [i, j, k, l, m, n] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mod4.st b/polly/lib/External/isl/test_inputs/codegen/cloog/mod4.st new file mode 100644 index 00000000000..99501a88e9a --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/mod4.st @@ -0,0 +1,11 @@ +domain: "{ S1[j, div41, div42, 2, mod6_a] : 3mod6_a = -2 + j and j >= 1 and j <= 10 and 3div41 >= j and 3div42 >= -1 + j and 3div42 <= 1 + j and 3div41 <= 2 + j; S2[j, div41, div42, 2, mod6_a] : 3div42 = 1 + j and 3mod6_a = -2 + j and 3div41 >= 1 + j and 3div41 <= 2 + j and j >= 1 and j <= 10; S3[j, div41, div42, 2, mod6_a] : 3mod6_a = -2 + j and j >= 1 and j <= 10 and 3div41 >= j and 3div42 >= -1 + j and 3div42 <= 1 + j and 3div41 <= 2 + j }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[j, div41, div42, mod6, mod6_a] -> [(j)]; S3[j, div41, div42, mod6, mod6_a] -> [(j)]; S2[j, div41, div42, mod6, mod6_a] -> [(j)] }, { S1[j, div41, div42, mod6, mod6_a] -> [(div41)]; S3[j, div41, div42, mod6, mod6_a] -> [(div41)]; S2[j, div41, div42, mod6, mod6_a] -> [(div41)] }, { S1[j, div41, div42, mod6, mod6_a] -> [(div42)]; S3[j, div41, div42, mod6, mod6_a] -> [(div42)]; S2[j, div41, div42, mod6, mod6_a] -> [(div42)] }, { S1[j, div41, div42, mod6, mod6_a] -> [(mod6)]; S3[j, div41, div42, mod6, mod6_a] -> [(mod6)]; S2[j, div41, div42, mod6, mod6_a] -> [(mod6)] }, { S1[j, div41, div42, mod6, mod6_a] -> [(mod6_a)]; S3[j, div41, div42, mod6, mod6_a] -> [(mod6_a)]; S2[j, div41, div42, mod6, mod6_a] -> [(mod6_a)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[j, div41, div42, mod6, mod6_a] }" + - filter: "{ S2[j, div41, div42, mod6, mod6_a] }" + - filter: "{ S3[j, div41, div42, mod6, mod6_a] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mode.in b/polly/lib/External/isl/test_inputs/codegen/cloog/mode.in deleted file mode 100644 index 914c37e642a..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/mode.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1] -> [i0, i1, 0] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= i0; S2[i0, i1] -> [i0, i1, 1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N } -[M, N] -> { : } -[M, N] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mode.st b/polly/lib/External/isl/test_inputs/codegen/cloog/mode.st new file mode 100644 index 00000000000..68ece148aff --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/mode.st @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= i0; S2[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/multi-mm-1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/multi-mm-1.in deleted file mode 100644 index 22bdd1b4234..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/multi-mm-1.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1] -> [i0, i1, 0] : i1 >= 0 and i1 <= i0 and i0 <= M; S2[i0, i1] -> [i0, i1, 1] : i1 >= 0 and i1 <= i0 and i0 <= M and i1 <= N } -[M, N] -> { : N <= M and N >= 1 } -[M, N] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/multi-mm-1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/multi-mm-1.st new file mode 100644 index 00000000000..de96851fa32 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/multi-mm-1.st @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0, i1] : i1 >= 0 and i1 <= i0 and i0 <= M; S2[i0, i1] : i1 >= 0 and i1 <= i0 and i0 <= M and i1 <= N }" +child: + context: "[M, N] -> { [] : N <= M and N >= 1 }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride.in b/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride.in deleted file mode 100644 index fdef8f90c2e..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0, i1, i2] -> [i0, j, k, 0] : 2i1 = -1 + i0 and 2j = -1 + i0 and 6k = -2 + i0 and 6i2 = -2 + i0 and i0 >= 0 and i0 <= 100 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride.st b/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride.st new file mode 100644 index 00000000000..2c7788b6bf2 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride.st @@ -0,0 +1,6 @@ +domain: "{ S1[i0, i1, i2] : 2i1 = -1 + i0 and 6i2 = -2 + i0 and i0 >= 0 and i0 <= 100 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride2.in deleted file mode 100644 index d2c4bbc965e..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride2.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0, i1, i2] -> [i0, j, k, 0] : 2i1 = -1 + i0 and 2j = -1 + i0 and 3k = -2 + i0 and 3i2 = -2 + i0 and i0 >= 0 and i0 <= 100 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride2.st new file mode 100644 index 00000000000..e3fc0bc7312 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/multi-stride2.st @@ -0,0 +1,6 @@ +domain: "{ S1[i0, i1, i2] : 2i1 = -1 + i0 and 3i2 = -2 + i0 and i0 >= 0 and i0 <= 100 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mxm-shared.in b/polly/lib/External/isl/test_inputs/codegen/cloog/mxm-shared.in deleted file mode 100644 index a525e9c0dd8..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/mxm-shared.in +++ /dev/null @@ -1,3 +0,0 @@ -[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { S1[g0 + t1, i1] -> [-g1 + i1, t1, t0, t1] : (exists (e0 = [(-g1)/128], e1 = [(128b1 + 31g1)/4096], e2 = [(t0 - i1)/16], e3 = [(-120b0 - g0)/128]: g4 = 0 and g2 = 8b0 and g3 = 128b1 and 128e0 = -g1 and 4096e1 = 128b1 + 31g1 and 16e2 = t0 - i1 and 128e3 = -120b0 - g0 and g1 >= 128b1 and t1 <= -1 + N - g0 and g0 >= 8b0 and i1 <= -1 + N and b0 <= 15 and b0 >= 0 and b1 <= 31 and b1 >= 0 and i1 <= 127 + g1 and t1 >= 0 and t1 <= 7 and i1 >= g1 and t0 >= 0 and t0 <= 15)) or (exists (e0 = [(-g1)/128], e1 = [(128b1 + 31g1)/4096], e2 = [(t0 - i1)/16], e3 = [(-120b0 - g0)/128]: g4 = 0 and g2 = 8b0 and g3 = 128b1 and 128e0 = -g1 and 4096e1 = 128b1 + 31g1 and 16e2 = t0 - i1 and 128e3 = -120b0 - g0 and g1 >= 128b1 and t1 <= -1 + N - g0 and g0 >= 8b0 and i1 <= -1 + N and b0 <= 15 and b0 >= 0 and b1 <= 31 and b1 >= 0 and i1 <= 127 + g1 and t1 >= 0 and t1 <= 7 and i1 >= g1 and t0 >= 0 and t0 <= 15 and N >= 1)) or (exists (e0 = [(-g1)/128], e1 = [(128b1 + 31g1)/4096], e2 = [(t0 - i1)/16], e3 = [(-120b0 - g0)/128]: g4 = 0 and g2 = 8b0 and g3 = 128b1 and 128e0 = -g1 and 4096e1 = 128b1 + 31g1 and 16e2 = t0 - i1 and 128e3 = -120b0 - g0 and g0 >= 8b0 and t1 <= -1 + N - g0 and g1 >= 128b1 and i1 <= -1 + N and N >= 1 and t1 <= 7 and b1 <= 31 and b1 >= 0 and b0 <= 15 and b0 >= 0 and t0 <= 15 and i1 <= 127 + g1 and i1 >= g1 and t1 >= 0 and t0 >= 0)); S1[g0 + t1, i1] -> [-g1 + i1, t1, t0, t1] : exists (e0 = [(g4)/4], e1 = [(-g1)/128], e2 = [(128b1 + 31g1)/4096], e3 = [(t0 - i1)/16], e4 = [(-120b0 - g0)/128]: g3 = 128b1 and g2 = 8b0 and 4e0 = g4 and 128e1 = -g1 and 4096e2 = 128b1 + 31g1 and 16e3 = t0 - i1 and 128e4 = -120b0 - g0 and g0 >= 8b0 and t1 <= -1 + N - g0 and g1 >= 128b1 and i1 <= -1 + N and g4 <= -1 + N and t1 <= 7 and b1 <= 31 and b1 >= 0 and b0 <= 15 and b0 >= 0 and g4 >= 0 and i1 <= 127 + g1 and i1 >= g1 and t1 >= 0 and t0 >= 0 and t0 <= 15) } -[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { : exists (e0 = [(g0)/8], e1 = [(-128b1 + g1)/4096], e2 = [(8b0 - g0)/128]: g2 = 8b0 and g3 = 128b1 and 8e0 = g0 and 4096e1 = -128b1 + g1 and 128e2 = 8b0 - g0 and b0 >= 0 and g4 <= -1 + N and b0 <= 15 and g1 <= -1 + N and g4 >= 0 and b1 <= 31 and g0 <= -1 + N and g1 >= 128b1 and b1 >= 0 and g0 >= 8b0 and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 15) } -[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/mxm-shared.st b/polly/lib/External/isl/test_inputs/codegen/cloog/mxm-shared.st new file mode 100644 index 00000000000..c86ed9c5f49 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/mxm-shared.st @@ -0,0 +1,6 @@ +domain: "[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { S1[g0 + t1, i1] : (exists (e0 = floor((g1)/128), e1 = floor((128b1 - g1)/4096), e2 = floor((-8b0 + g0)/128), e3 = floor((-t0 + i1)/16): g3 = 128b1 and g4 = 0 and g2 = 8b0 and 128e0 = g1 and 4096e1 = 128b1 - g1 and 128e2 = -8b0 + g0 and 16e3 = -t0 + i1 and b0 <= 15 and b0 >= 0 and b1 <= 31 and b1 >= 0 and g0 >= 8b0 and g1 >= 128b1 and t0 <= 15 and t0 >= 0 and t1 <= 7 and t1 >= 0 and t1 <= -1 + N - g0 and i1 >= g1 and i1 <= 127 + g1 and i1 <= -1 + N)) or (exists (e0 = floor((g1)/128), e1 = floor((128b1 - g1)/4096), e2 = floor((g4)/4), e3 = floor((-8b0 + g0)/128), e4 = floor((-t0 + i1)/16): g3 = 128b1 and g2 = 8b0 and 128e0 = g1 and 4096e1 = 128b1 - g1 and 4e2 = g4 and 128e3 = -8b0 + g0 and 16e4 = -t0 + i1 and b0 <= 15 and b0 >= 0 and b1 <= 31 and b1 >= 0 and g0 >= 8b0 and g1 >= 128b1 and g4 >= 0 and g4 <= -1 + N and t0 <= 15 and t0 >= 0 and t1 <= 7 and t1 >= 0 and t1 <= -1 + N - g0 and i1 >= g1 and i1 <= 127 + g1 and i1 <= -1 + N)) }" +child: + context: "[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { [] : exists (e0 = floor((g0)/8), e1 = floor((-128b1 + g1)/4096), e2 = floor((8b0 - g0)/128): g2 = 8b0 and g3 = 128b1 and 8e0 = g0 and 4096e1 = -128b1 + g1 and 128e2 = 8b0 - g0 and b0 >= 0 and g4 <= -1 + N and b0 <= 15 and g1 <= -1 + N and g4 >= 0 and b1 <= 31 and g0 <= -1 + N and g1 >= 128b1 and b1 >= 0 and g0 >= 8b0 and t0 >= 0 and t0 <= 15 and t1 >= 0 and t1 <= 15) }" + child: + schedule: "[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> [{ S1[i0, i1] -> [(-g1 + i1)] }, { S1[i0, i1] -> [(t1)] }, { S1[i0, i1] -> [(t0)] }, { S1[i0, i1] -> [(t1)] }]" + options: "[N, b0, b1, g0, g1, g2, g3, g4, t0, t1] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/no_lindep.in b/polly/lib/External/isl/test_inputs/codegen/cloog/no_lindep.in deleted file mode 100644 index 078992925f7..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/no_lindep.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[2 + N] -> [1 + M, N] } -[M, N] -> { : } -[M, N] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/no_lindep.st b/polly/lib/External/isl/test_inputs/codegen/cloog/no_lindep.st new file mode 100644 index 00000000000..da06c8dc0ff --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/no_lindep.st @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[2 + N] }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0] -> [(1 + M)] }, { S1[i0] -> [(N)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic1.in deleted file mode 100644 index e10488f68ef..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic1.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [i0, j, 0] : 2j = i0 and 2i1 = i0 and i0 >= 0 and i0 <= M } -[M] -> { : } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic1.st new file mode 100644 index 00000000000..d8a3201f47f --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic1.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : 2i1 = i0 and i0 >= 0 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic2.in deleted file mode 100644 index 54f9374a5d3..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic2.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1] -> [i0, j, 1] : 4j = i0 and 4i1 = i0 and i0 >= 1 and i0 <= n; S1[i0, i1] -> [i0, j, 0] : 2j = i0 and 2i1 = i0 and i0 >= 1 and i0 <= n } -[n] -> { : n >= 2 } -[n] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic2.st new file mode 100644 index 00000000000..3258c670881 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_basic2.st @@ -0,0 +1,10 @@ +domain: "[n] -> { S1[i0, i1] : 2i1 = i0 and i0 >= 1 and i0 <= n; S2[i0, i1] : 4i1 = i0 and i0 >= 1 and i0 <= n }" +child: + context: "[n] -> { [] : n >= 2 }" + child: + schedule: "[n] -> [{ S2[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)] }]" + options: "[n] -> { separate[i0] }" + child: + sequence: + - filter: "[n] -> { S1[i0, i1] }" + - filter: "[n] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_complex1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_complex1.in deleted file mode 100644 index 277e62ef171..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_complex1.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S1[i0, i1] -> [2i0 + 3i1, 2i0 + 2i1] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= n } -[n] -> { : } -[n] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_complex1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_complex1.st new file mode 100644 index 00000000000..93e3329fcad --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_complex1.st @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i0, i1] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i0, i1] -> [(2i0 + 3i1)] }, { S1[i0, i1] -> [(2i0 + 2i1)] }]" + options: "[n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_lcpc.in b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_lcpc.in deleted file mode 100644 index e3a4e99fcf3..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_lcpc.in +++ /dev/null @@ -1,3 +0,0 @@ -[m, n, p] -> { S1[i, k, j] -> [i, j', j, 0] : 2k = -1 + i and 2j' = -1 + i and i >= 1 and i <= m and j >= 1 and j <= p; S2[i, k, j] -> [i, j', j, 1] : 2k = -1 + i and 2j' = -1 + i and i >= 1 and i <= n and j >= 1 and j <= i } -[m, n, p] -> { : n = 6 and m >= 7 and p >= 7 } -[m, n, p] -> { [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/nul_lcpc.st b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_lcpc.st new file mode 100644 index 00000000000..4571d7846f3 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/nul_lcpc.st @@ -0,0 +1,10 @@ +domain: "[m, n, p] -> { S1[i, k, j] : 2k = -1 + i and i >= 1 and i <= m and j >= 1 and j <= p; S2[i, k, j] : 2k = -1 + i and i >= 1 and i <= n and j >= 1 and j <= i }" +child: + context: "[m, n, p] -> { [] : n = 6 and m >= 7 and p >= 7 }" + child: + schedule: "[m, n, p] -> [{ S1[i, k, j] -> [(i)]; S2[i, k, j] -> [(i)] }, { S1[i, k, j] -> [(k)]; S2[i, k, j] -> [(k)] }, { S1[i, k, j] -> [(j)]; S2[i, k, j] -> [(j)] }]" + options: "[m, n, p] -> { separate[i0] }" + child: + sequence: + - filter: "[m, n, p] -> { S1[i, k, j] }" + - filter: "[m, n, p] -> { S2[i, k, j] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/orc.c b/polly/lib/External/isl/test_inputs/codegen/cloog/orc.c index 8ad0162832c..40999440527 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/orc.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/orc.c @@ -1,16 +1,16 @@ { - for (int c1 = 0; c1 <= 2; c1 += 1) { - S1(c1); - for (int c2 = 0; c2 <= -c1 + 11; c2 += 1) { - S2(c1, c2); - S3(c1, c2); + for (int c0 = 0; c0 <= 2; c0 += 1) { + S1(c0); + for (int c1 = 0; c1 <= -c0 + 11; c1 += 1) { + S2(c0, c1); + S3(c0, c1); } - S4(c1); + S4(c0); } - for (int c1 = 0; c1 <= 14; c1 += 1) { - S5(c1); - for (int c2 = 0; c2 <= 9; c2 += 1) - S6(c1, c2); - S7(c1); + for (int c0 = 0; c0 <= 14; c0 += 1) { + S5(c0); + for (int c1 = 0; c1 <= 9; c1 += 1) + S6(c0, c1); + S7(c0); } } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/orc.in b/polly/lib/External/isl/test_inputs/codegen/cloog/orc.in deleted file mode 100644 index d81bf4728e9..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/orc.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S2[i0, i1] -> [0, 1 + 3i0, 2i1] : i0 >= 0 and i0 <= 2 and i1 >= 0 and i1 <= 11 - i0; S4[i0] -> [0, 2 + 3i0, 0] : i0 >= 0 and i0 <= 2; S5[i0] -> [2, 3i0, 0] : i0 >= 0 and i0 <= 14; S6[i0, i1] -> [2, 1 + 3i0, i1] : i0 >= 0 and i0 <= 14 and i1 >= 0 and i1 <= 9; S1[i0] -> [0, 3i0, 0] : i0 >= 0 and i0 <= 2; S7[i0] -> [2, 2 + 3i0, 0] : i0 >= 0 and i0 <= 14; S3[i0, i1] -> [0, 1 + 3i0, 1 + 2i1] : i0 >= 0 and i0 <= 2 and i1 >= 0 and i1 <= 11 - i0 } -{ : } -{ [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/orc.st b/polly/lib/External/isl/test_inputs/codegen/cloog/orc.st new file mode 100644 index 00000000000..a67a8801fde --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/orc.st @@ -0,0 +1,13 @@ +domain: "{ S5[i] : i >= 0 and i <= 14; S6[i, j] : i >= 0 and i <= 14 and j >= 0 and j <= 9; S7[i] : i >= 0 and i <= 14; S4[i] : i >= 0 and i <= 2; S2[i, j] : i >= 0 and i <= 2 and j >= 0 and j <= 11 - i; S1[i] : i >= 0 and i <= 2; S3[i, j] : i >= 0 and i <= 2 and j >= 0 and j <= 11 - i }" +child: + context: "{ [] }" + child: + sequence: + - filter: "{ S4[i0]; S2[i0, i1]; S1[i0]; S3[i0, i1] }" + child: + schedule: "[{ S3[i0, i1] -> [(1 + 3i0)]; S2[i0, i1] -> [(1 + 3i0)]; S1[i0] -> [(3i0)]; S4[i0] -> [(2 + 3i0)] }, { S3[i0, i1] -> [(1 + 2i1)]; S2[i0, i1] -> [(2i1)]; S1[i0] -> [(0)]; S4[i0] -> [(0)] }]" + options: "{ separate[i0] }" + - filter: "{ S5[i0]; S6[i0, i1]; S7[i0] }" + child: + schedule: "[{ S6[i0, i1] -> [(1 + 3i0)]; S7[i0] -> [(2 + 3i0)]; S5[i0] -> [(3i0)] }, { S6[i0, i1] -> [(i1)]; S7[i0] -> [(0)]; S5[i0] -> [(0)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/otl.in b/polly/lib/External/isl/test_inputs/codegen/cloog/otl.in deleted file mode 100644 index a6ad5d2fc58..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/otl.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1, i2, i3, i4, i2] -> [i0, i1, i2, i3, i4, i2] : 5i0 <= -7 + 2M + 2N and i4 >= i0 - i2 and 10i2 >= -2 - N + 5i0 and i2 >= -1 + i0 - i1 and 2i4 >= i0 and i0 >= 1 and i1 >= 1 and 2i1 >= i0 and i2 >= 0 and 5i2 >= 1 - M - N + 5i0 and 5i4 >= -1 - M + 5i0 and i3 >= i0 and 5i1 >= -2 - M + 5i0 and i3 >= 1 and 5i3 >= -3 - N + 5i1 + 5i2 and 5i2 <= 4 + N + 5i0 - 5i1 and i4 >= 1 and i2 <= i0 and 5i3 >= -2N + 10i1 and 5i1 <= -5 + M + 2N and 10i1 <= 1 + 2N + 5i0 and 5i2 >= -1 - N + 5i1 and i4 >= i1 and i3 >= i1 and i2 <= i1 and i1 <= i0 and 5i4 <= 4 + N - 5i2 + 5i3 and 5i4 <= 5 + N + 5i0 - 5i2 and 5i3 >= -2 - N + 10i2 and 5i2 <= -2 + M + N and 10i2 <= 3 + N + 5i0 and N >= 4 and i4 >= i2 and i3 >= i2 and M >= 3 and i4 <= i0 and 5i3 <= -6 + 2M + 2N and i4 >= -1 - i2 + i3 and 5i3 <= 3 + N + 10i2 and i3 <= 1 + i1 + i2 and i4 <= 1 + i1 and 2i4 >= i3 and 5i4 <= 2 + N + 5i2 and i3 <= 1 + 2i1 and i4 <= i3 and 5i3 <= M + N + 5i2 and 5i4 >= -2 - M + 5i3 and 10i4 <= 3 + 2N + 5i0 and i3 <= 1 + i0 and 5i3 <= 3 + M + 5i1 and 5i4 <= -4 + M + 2N and 10i4 <= 2 + 2N + 5i3 } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k, l, m, n] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/otl.st b/polly/lib/External/isl/test_inputs/codegen/cloog/otl.st new file mode 100644 index 00000000000..da706835052 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/otl.st @@ -0,0 +1,6 @@ +domain: "[M, N] -> { S1[outerTimeTileIter, outerProcTileIter1, outerProcTileIter2, innerTimeTileIter, innerProcTileIter1, outerProcTileIter2] : 5outerTimeTileIter <= -7 + 2M + 2N and innerProcTileIter1 >= outerTimeTileIter - outerProcTileIter2 and 10outerProcTileIter2 >= -2 - N + 5outerTimeTileIter and outerProcTileIter2 >= -1 + outerTimeTileIter - outerProcTileIter1 and 2innerProcTileIter1 >= outerTimeTileIter and outerTimeTileIter >= 1 and outerProcTileIter1 >= 1 and 2outerProcTileIter1 >= outerTimeTileIter and outerProcTileIter2 >= 0 and 5outerProcTileIter2 >= 1 - M - N + 5outerTimeTileIter and 5innerProcTileIter1 >= -1 - M + 5outerTimeTileIter and innerTimeTileIter >= outerTimeTileIter and 5outerProcTileIter1 >= -2 - M + 5outerTimeTileIter and innerTimeTileIter >= 1 and 5innerTimeTileIter >= -3 - N + 5outerProcTileIter1 + 5outerProcTileIter2 and 5outerProcTileIter2 <= 4 + N + 5outerTimeTileIter - 5outerProcTileIter1 and innerProcTileIter1 >= 1 and outerProcTileIter2 <= outerTimeTileIter and 5innerTimeTileIter >= -2N + 10outerProcTileIter1 and 5outerProcTileIter1 <= -5 + M + 2N and 10outerProcTileIter1 <= 1 + 2N + 5outerTimeTileIter and 5outerProcTileIter2 >= -1 - N + 5outerProcTileIter1 and innerProcTileIter1 >= outerProcTileIter1 and innerTimeTileIter >= outerProcTileIter1 and outerProcTileIter2 <= outerProcTileIter1 and outerProcTileIter1 <= outerTimeTileIter and 5innerProcTileIter1 <= 4 + N - 5outerProcTileIter2 + 5innerTimeTileIter and 5innerProcTileIter1 <= 5 + N + 5outerTimeTileIter - 5outerProcTileIter2 and 5innerTimeTileIter >= -2 - N + 10outerProcTileIter2 and 5outerProcTileIter2 <= -2 + M + N and 10outerProcTileIter2 <= 3 + N + 5outerTimeTileIter and N >= 4 and innerProcTileIter1 >= outerProcTileIter2 and innerTimeTileIter >= outerProcTileIter2 and M >= 3 and innerProcTileIter1 <= outerTimeTileIter and 5innerTimeTileIter <= -6 + 2M + 2N and innerProcTileIter1 >= -1 - outerProcTileIter2 + innerTimeTileIter and 5innerTimeTileIter <= 3 + N + 10outerProcTileIter2 and innerTimeTileIter <= 1 + outerProcTileIter1 + outerProcTileIter2 and innerProcTileIter1 <= 1 + outerProcTileIter1 and 2innerProcTileIter1 >= innerTimeTileIter and 5innerProcTileIter1 <= 2 + N + 5outerProcTileIter2 and innerTimeTileIter <= 1 + 2outerProcTileIter1 and innerProcTileIter1 <= innerTimeTileIter and 5innerTimeTileIter <= M + N + 5outerProcTileIter2 and 5innerProcTileIter1 >= -2 - M + 5innerTimeTileIter and 10innerProcTileIter1 <= 3 + 2N + 5outerTimeTileIter and innerTimeTileIter <= 1 + outerTimeTileIter and 5innerTimeTileIter <= 3 + M + 5outerProcTileIter1 and 5innerProcTileIter1 <= -4 + M + 2N and 10innerProcTileIter1 <= 2 + 2N + 5innerTimeTileIter }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2, i3, i4, i5] -> [(i0)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i1)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i2)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i3)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i4)] }, { S1[i0, i1, i2, i3, i4, i5] -> [(i5)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/param-split.in b/polly/lib/External/isl/test_inputs/codegen/cloog/param-split.in deleted file mode 100644 index 7b8a59e641e..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/param-split.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0] -> [i0, 0] : i0 >= 0 and i0 <= M; S2[0] -> [0, 1] } -[M] -> { : } -[M] -> { [i, j] -> atomic[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/param-split.st b/polly/lib/External/isl/test_inputs/codegen/cloog/param-split.st new file mode 100644 index 00000000000..371372f28e5 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/param-split.st @@ -0,0 +1,10 @@ +domain: "[M] -> { S2[0]; S1[i0] : i0 >= 0 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S2[i0] -> [(i0)]; S1[i0] -> [(i0)] }]" + options: "[M] -> { atomic[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0] }" + - filter: "[M] -> { S2[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/pouchet.in b/polly/lib/External/isl/test_inputs/codegen/cloog/pouchet.in deleted file mode 100644 index 95d59dc29da..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/pouchet.in +++ /dev/null @@ -1,3 +0,0 @@ -[Ny] -> { S1[i0, i1, 2i0, -2i0 + 2i1, i4] -> [i0 + i1, i1, i4, 2i0, -2i0 + 2i1, i4] : i0 >= 0 and i0 <= 1 and i1 >= 1 + i0 and 2i1 <= -1 + Ny + 2i0 and i4 >= 1 and i4 <= 2; S2[i0, i1, 2i0, -1 - 2i0 + 2i1, i4] -> [i0 + i1, i1, i4, 2i0, -2i0 + 2i1, 1 + i4] : i0 >= 0 and i0 <= 1 and i1 >= 1 + i0 and 2i1 <= Ny + 2i0 and i4 >= 1 and i4 <= 2 } -[Ny] -> { : } -[Ny] -> { [i, j, k, l, m, n] -> separate[x] : x >= 2 } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/pouchet.st b/polly/lib/External/isl/test_inputs/codegen/cloog/pouchet.st new file mode 100644 index 00000000000..8ba092889ec --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/pouchet.st @@ -0,0 +1,6 @@ +domain: "[Ny] -> { S1[i0, i1, 2i0, -2i0 + 2i1, i4] : i0 >= 0 and i0 <= 1 and i1 >= 1 + i0 and 2i1 <= -1 + Ny + 2i0 and i4 >= 1 and i4 <= 2; S2[i0, i1, 2i0, -1 - 2i0 + 2i1, i4] : i0 >= 0 and i0 <= 1 and i1 >= 1 + i0 and 2i1 <= Ny + 2i0 and i4 >= 1 and i4 <= 2 }" +child: + context: "[Ny] -> { [] }" + child: + schedule: "[Ny] -> [{ S1[i0, i1, i2, i3, i4] -> [(i0 + i1)]; S2[i0, i1, i2, i3, i4] -> [(i0 + i1)] }, { S1[i0, i1, i2, i3, i4] -> [(i1)]; S2[i0, i1, i2, i3, i4] -> [(i1)] }, { S1[i0, i1, i2, i3, i4] -> [(i4)]; S2[i0, i1, i2, i3, i4] -> [(i4)] }, { S1[i0, i1, i2, i3, i4] -> [(i2)]; S2[i0, i1, i2, i3, i4] -> [(i2)] }, { S1[i0, i1, i2, i3, i4] -> [(i3)]; S2[i0, i1, i2, i3, i4] -> [(1 + i3)] }, { S1[i0, i1, i2, i3, i4] -> [(i4)]; S2[i0, i1, i2, i3, i4] -> [(1 + i4)] }]" + options: "[Ny] -> { separate[x] : x >= 2 }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/rectangle.in b/polly/lib/External/isl/test_inputs/codegen/cloog/rectangle.in deleted file mode 100644 index fab0f945c37..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/rectangle.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S1[i0, i1] -> [i0 + i1] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= n } -[n] -> { : n >= 0 } -[n] -> { [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/rectangle.st b/polly/lib/External/isl/test_inputs/codegen/cloog/rectangle.st new file mode 100644 index 00000000000..a4a9e51f444 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/rectangle.st @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i0, i1] : i0 >= 0 and i0 <= n and i1 >= 0 and i1 <= n }" +child: + context: "[n] -> { [] : n >= 0 }" + child: + schedule: "[n] -> [{ S1[i0, i1] -> [(i0 + i1)] }]" + options: "[n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-QR.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-QR.c index 253791a50b0..fee61aa6673 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-QR.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-QR.c @@ -1,53 +1,53 @@ if (N >= 1) { S1(0); if (N == 1) { - for (int c3 = 0; c3 < M; c3 += 1) - S2(0, c3); + for (int c1 = 0; c1 < M; c1 += 1) + S2(0, c1); S3(0); - for (int c3 = 0; c3 < M; c3 += 1) - S4(0, c3); + for (int c1 = 0; c1 < M; c1 += 1) + S4(0, c1); S10(0); S5(0); } else { - for (int c3 = 0; c3 < M; c3 += 1) - S2(0, c3); + for (int c1 = 0; c1 < M; c1 += 1) + S2(0, c1); S3(0); - for (int c3 = 0; c3 < M; c3 += 1) - S4(0, c3); + for (int c1 = 0; c1 < M; c1 += 1) + S4(0, c1); S10(0); S1(1); S5(0); } - for (int c1 = 2; c1 < N; c1 += 1) { - for (int c3 = c1 - 1; c3 < N; c3 += 1) { - S6(c1 - 2, c3); - for (int c5 = c1 - 2; c5 < M; c5 += 1) - S7(c1 - 2, c3, c5); - S8(c1 - 2, c3); - for (int c5 = c1 - 2; c5 < M; c5 += 1) - S9(c1 - 2, c3, c5); + for (int c0 = 2; c0 < N; c0 += 1) { + for (int c1 = c0 - 1; c1 < N; c1 += 1) { + S6(c0 - 2, c1); + for (int c2 = c0 - 2; c2 < M; c2 += 1) + S7(c0 - 2, c1, c2); + S8(c0 - 2, c1); + for (int c2 = c0 - 2; c2 < M; c2 += 1) + S9(c0 - 2, c1, c2); } - for (int c3 = c1 - 1; c3 < M; c3 += 1) - S2(c1 - 1, c3); - S3(c1 - 1); - for (int c3 = c1 - 1; c3 < M; c3 += 1) - S4(c1 - 1, c3); - S10(c1 - 1); - S1(c1); - S5(c1 - 1); + for (int c1 = c0 - 1; c1 < M; c1 += 1) + S2(c0 - 1, c1); + S3(c0 - 1); + for (int c1 = c0 - 1; c1 < M; c1 += 1) + S4(c0 - 1, c1); + S10(c0 - 1); + S1(c0); + S5(c0 - 1); } if (N >= 2) { S6(N - 2, N - 1); - for (int c5 = N - 2; c5 < M; c5 += 1) - S7(N - 2, N - 1, c5); + for (int c2 = N - 2; c2 < M; c2 += 1) + S7(N - 2, N - 1, c2); S8(N - 2, N - 1); - for (int c5 = N - 2; c5 < M; c5 += 1) - S9(N - 2, N - 1, c5); - for (int c3 = N - 1; c3 < M; c3 += 1) - S2(N - 1, c3); + for (int c2 = N - 2; c2 < M; c2 += 1) + S9(N - 2, N - 1, c2); + for (int c1 = N - 1; c1 < M; c1 += 1) + S2(N - 1, c1); S3(N - 1); - for (int c3 = N - 1; c3 < M; c3 += 1) - S4(N - 1, c3); + for (int c1 = N - 1; c1 < M; c1 += 1) + S4(N - 1, c1); S10(N - 1); S5(N - 1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-QR.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-QR.in deleted file mode 100644 index b81c03d7252..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-QR.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0] -> [0, i0, 5, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N; S9[i0, i1, i2] -> [0, 2 + i0, 0, i1, 3, i2, 0] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N and i2 >= i0 and i2 <= -1 + M; S10[i0] -> [0, 1 + i0, 4, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N; S3[i0] -> [0, 1 + i0, 2, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N; S6[i0, i1] -> [0, 2 + i0, 0, i1, 0, 0, 0] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N; S8[i0, i1] -> [0, 2 + i0, 0, i1, 2, 0, 0] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N; S2[i0, i1] -> [0, 1 + i0, 1, i1, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N and i1 >= i0 and i1 <= -1 + M; S4[i0, i1] -> [0, 1 + i0, 3, i1, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N and i1 >= i0 and i1 <= -1 + M; S7[i0, i1, i2] -> [0, 2 + i0, 0, i1, 1, i2, 0] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N and i2 >= i0 and i2 <= -1 + M; S5[i0] -> [0, 1 + i0, 6, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N } -[M, N] -> { : } -[M, N] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-QR.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-QR.st new file mode 100644 index 00000000000..8be6a039a1e --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-QR.st @@ -0,0 +1,36 @@ +domain: "[M, N] -> { S5[i0] : i0 >= 0 and i0 <= -1 + N; S1[i0] : i0 >= 0 and i0 <= -1 + N; S3[i0] : i0 >= 0 and i0 <= -1 + N; S2[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= i0 and i1 <= -1 + M; S6[i0, i1] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N; S9[i0, i1, i2] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N and i2 >= i0 and i2 <= -1 + M; S4[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= i0 and i1 <= -1 + M; S8[i0, i1] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N; S10[i0] : i0 >= 0 and i0 <= -1 + N; S7[i0, i1, i2] : i0 >= 0 and i1 >= 1 + i0 and i1 <= -1 + N and i2 >= i0 and i2 <= -1 + M }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S3[i0] -> [(1 + i0)]; S10[i0] -> [(1 + i0)]; S5[i0] -> [(1 + i0)]; S7[i0, i1, i2] -> [(2 + i0)]; S9[i0, i1, i2] -> [(2 + i0)]; S2[i0, i1] -> [(1 + i0)]; S4[i0, i1] -> [(1 + i0)]; S8[i0, i1] -> [(2 + i0)]; S1[i0] -> [(i0)]; S6[i0, i1] -> [(2 + i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S6[i0, i1]; S9[i0, i1, i2]; S8[i0, i1]; S7[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2] -> [(i1)]; S9[i0, i1, i2] -> [(i1)]; S8[i0, i1] -> [(i1)]; S6[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S6[i0, i1] }" + - filter: "[M, N] -> { S7[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S8[i0, i1] }" + - filter: "[M, N] -> { S9[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S9[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S2[i0, i1] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S3[i0] }" + - filter: "[M, N] -> { S4[i0, i1] }" + child: + schedule: "[M, N] -> [{ S4[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S10[i0] }" + - filter: "[M, N] -> { S1[i0] }" + - filter: "[M, N] -> { S5[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-bastoul3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-bastoul3.in deleted file mode 100644 index a6a4ffc9297..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-bastoul3.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0, i1, i2] -> [i0, i1, k, 0] : 2k = i0 - i1 and 2i2 = i0 - i1 and i1 >= 1 and i1 <= 3 and i1 <= -2 + i0 and i1 >= -6 + i0 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-bastoul3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-bastoul3.st new file mode 100644 index 00000000000..66fe7a33d31 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-bastoul3.st @@ -0,0 +1,6 @@ +domain: "{ S1[i0, i1, i2] : 2i2 = i0 - i1 and i1 >= 1 and i1 <= 3 and i1 <= -2 + i0 and i1 >= -6 + i0 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-cholesky2.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-cholesky2.c index 4d1a9118bb9..0c17655b2fc 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-cholesky2.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-cholesky2.c @@ -1,9 +1,9 @@ -for (int c1 = 2; c1 < 3 * M; c1 += 1) { - if ((c1 - 2) % 3 == 0) - S1((c1 + 1) / 3); - for (int c3 = (c1 + 1) / 3 + 1; c3 <= min(M, c1 - 2); c3 += 1) - for (int c5 = -c3 + (c1 + c3 + 1) / 2 + 1; c5 <= min(c3, c1 - c3); c5 += 1) - S3(c1 - c3 - c5 + 1, c3, c5); - for (int c3 = -c1 + 2 * ((2 * c1 + 1) / 3) + 2; c3 <= min(M, c1); c3 += 2) - S2(((c1 - c3) / 2) + 1, c3); +for (int c0 = 2; c0 < 3 * M; c0 += 1) { + if ((c0 - 2) % 3 == 0) + S1((c0 + 1) / 3); + for (int c1 = (c0 + 1) / 3 + 1; c1 <= min(M, c0 - 2); c1 += 1) + for (int c2 = -c1 + (c0 + c1 + 1) / 2 + 1; c2 <= min(c1, c0 - c1); c2 += 1) + S3(c0 - c1 - c2 + 1, c1, c2); + for (int c1 = -c0 + 2 * ((2 * c0 + 1) / 3) + 2; c1 <= min(M, c0); c1 += 2) + S2(((c0 - c1) / 2) + 1, c1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-cholesky2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-cholesky2.in deleted file mode 100644 index 7f62b1f0264..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-cholesky2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S3[i0, i1, i2] -> [0, -1 + i0 + i1 + i2, 1, i1, 1, i2, 0] : i0 >= 1 and i1 <= M and i2 >= 1 + i0 and i2 <= i1; S2[i0, i1] -> [0, -2 + 2i0 + i1, 2, i1, 0, 0, 0] : i0 >= 1 and i1 >= 1 + i0 and i1 <= M; S1[i0] -> [0, -1 + 3i0, 0, 0, 0, 0, 0] : i0 >= 1 and i0 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-cholesky2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-cholesky2.st new file mode 100644 index 00000000000..4ae03d71f62 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-cholesky2.st @@ -0,0 +1,20 @@ +domain: "[M] -> { S3[i0, i1, i2] : i0 >= 1 and i1 <= M and i2 >= 1 + i0 and i2 <= i1; S2[i0, i1] : i0 >= 1 and i1 >= 1 + i0 and i1 <= M; S1[i0] : i0 >= 1 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0] -> [(-1 + 3i0)]; S3[i0, i1, i2] -> [(-1 + i0 + i1 + i2)]; S2[i0, i1] -> [(-2 + 2i0 + i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0] }" + - filter: "[M] -> { S3[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S3[i0, i1, i2] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion1.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion1.c index 201ffee0bc3..d586ebae9c0 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion1.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion1.c @@ -1,8 +1,8 @@ { - for (int c1 = 0; c1 <= M; c1 += 1) - S1(c1); - for (int c1 = 1; c1 <= M; c1 += 1) - S2(c1); - for (int c1 = 0; c1 <= M; c1 += 1) - S3(c1); + for (int c0 = 0; c0 <= M; c0 += 1) + S1(c0); + for (int c0 = 1; c0 <= M; c0 += 1) + S2(c0); + for (int c0 = 0; c0 <= M; c0 += 1) + S3(c0); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion1.in deleted file mode 100644 index ca4282e49b3..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion1.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0] -> [0, i0, 0] : i0 >= 0 and i0 <= M; S3[i0] -> [2, i0, 0] : i0 >= 0 and i0 <= M; S2[i0] -> [1, i0, 0] : i0 >= 1 and i0 <= M } -[M] -> { : M >= 1 } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion1.st new file mode 100644 index 00000000000..25c0cfd0740 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion1.st @@ -0,0 +1,17 @@ +domain: "[M] -> { S3[i0] : i0 >= 0 and i0 <= M; S2[i0] : i0 >= 1 and i0 <= M; S1[i0] : i0 >= 0 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 1 }" + child: + sequence: + - filter: "[M] -> { S1[i0] }" + child: + schedule: "[M] -> [{ S1[i0] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0] }" + child: + schedule: "[M] -> [{ S2[i0] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S3[i0] }" + child: + schedule: "[M] -> [{ S3[i0] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion2.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion2.c index 13c30301620..e31aaec1ced 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion2.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion2.c @@ -1,12 +1,12 @@ if (N >= 1) { - for (int c3 = 1; c3 <= M; c3 += 1) - S1(1, c3); - for (int c1 = 2; c1 <= N; c1 += 1) { - for (int c3 = 1; c3 <= M; c3 += 1) - S2(c1 - 1, c3); - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); + for (int c1 = 1; c1 <= M; c1 += 1) + S1(1, c1); + for (int c0 = 2; c0 <= N; c0 += 1) { + for (int c1 = 1; c1 <= M; c1 += 1) + S2(c0 - 1, c1); + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); } - for (int c3 = 1; c3 <= M; c3 += 1) - S2(N, c3); + for (int c1 = 1; c1 <= M; c1 += 1) + S2(N, c1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion2.in deleted file mode 100644 index 53905d8df35..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1] -> [0, 1 + i0, 0, i1, 0] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S1[i0, i1] -> [0, i0, 1, i1, 0] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M } -[M, N] -> { : } -[M, N] -> { [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion2.st new file mode 100644 index 00000000000..ee654244ae0 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-fusion2.st @@ -0,0 +1,16 @@ +domain: "[M, N] -> { S1[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S2[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(1 + i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S2[i0, i1] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S1[i0, i1] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi2.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi2.c index 407fc8b73e1..6a04045d13f 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi2.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi2.c @@ -1,3 +1,3 @@ -for (int c1 = 0; c1 < M; c1 += 1) - for (int c3 = 0; c3 < M; c3 += 1) - S1(c1, c3); +for (int c0 = 0; c0 < M; c0 += 1) + for (int c1 = 0; c1 < M; c1 += 1) + S1(c0, c1); diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi2.in deleted file mode 100644 index ea86283a7b7..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 0 and i0 <= -1 + M and i1 >= 0 and i1 <= -1 + M } -[M] -> { : M >= 1 } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi2.st new file mode 100644 index 00000000000..fe1230dbd38 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi2.st @@ -0,0 +1,9 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 0 and i0 <= -1 + M and i1 >= 0 and i1 <= -1 + M }" +child: + context: "[M] -> { [] : M >= 1 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi3.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi3.c index 1df9bb90c24..725357566a0 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi3.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi3.c @@ -1,8 +1,8 @@ -for (int c1 = 1; c1 <= M; c1 += 1) { - for (int c3 = 2; c3 < N; c3 += 1) - for (int c5 = 2; c5 < N; c5 += 1) - S1(c1, c3, c5); - for (int c3 = 2; c3 < N; c3 += 1) - for (int c5 = 2; c5 < N; c5 += 1) - S2(c1, c3, c5); +for (int c0 = 1; c0 <= M; c0 += 1) { + for (int c2 = 2; c2 < N; c2 += 1) + for (int c3 = 2; c3 < N; c3 += 1) + S1(c0, c2, c3); + for (int c2 = 2; c2 < N; c2 += 1) + for (int c3 = 2; c3 < N; c3 += 1) + S2(c0, c2, c3); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi3.in deleted file mode 100644 index 4f5cc77904a..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi3.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1, i2] -> [0, 1 + 2i0, 1, i1, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N; S1[i0, i1, i2] -> [0, 2i0, 0, i1, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N } -[M, N] -> { : } -[M, N] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi3.st new file mode 100644 index 00000000000..815ffe27c3c --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-jacobi3.st @@ -0,0 +1,22 @@ +domain: "[M, N] -> { S2[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N; S1[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(2i0)]; S2[i0, i1, i2] -> [(1 + 2i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.c index d8a80d66363..38277076411 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.c @@ -1,10 +1,10 @@ -for (int c1 = -99; c1 <= 100; c1 += 1) { - if (c1 <= 0) - S1(1, -c1 + 1); - for (int c3 = max(1, -2 * c1 + 3); c3 <= min(199, -2 * c1 + 199); c3 += 2) { - S2(((c3 - 1) / 2) + c1, (c3 + 1) / 2); - S1(((c3 + 1) / 2) + c1, (c3 + 1) / 2); +for (int c0 = -99; c0 <= 100; c0 += 1) { + if (c0 >= 1) + S2(c0, 1); + for (int c1 = max(1, -c0 + 1); c1 <= min(99, -c0 + 100); c1 += 1) { + S1(c0 + c1, c1); + S2(c0 + c1, c1 + 1); } - if (c1 >= 1) - S2(100, -c1 + 101); + if (c0 <= 0) + S1(c0 + 100, 100); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.in deleted file mode 100644 index b2338b0321b..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S2[i0, i1] -> [0, 1 + i0 - i1, 0, -1 + 2i1, 1] : i0 >= 1 and i0 <= 100 and i1 >= 1 and i1 <= 100; S1[i0, i1] -> [0, i0 - i1, 0, 2i1, 0] : i0 >= 1 and i0 <= 100 and i1 >= 1 and i1 <= 100 } -{ : } -{ [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.st new file mode 100644 index 00000000000..cf7efee1552 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam1.st @@ -0,0 +1,13 @@ +domain: "{ S2[i0, i1] : i0 >= 1 and i0 <= 100 and i1 >= 1 and i1 <= 100; S1[i0, i1] : i0 >= 1 and i0 <= 100 and i1 >= 1 and i1 <= 100 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1] -> [(i0 - i1)]; S2[i0, i1] -> [(1 + i0 - i1)] }]" + options: "{ separate[i0] }" + child: + schedule: "[{ S1[i0, i1] -> [(2i1)]; S2[i0, i1] -> [(-1 + 2i1)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1] }" + - filter: "{ S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.c index f3215bf69bd..483fe52bb0b 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.c @@ -1,10 +1,10 @@ { - for (int c1 = 1; c1 <= M; c1 += 1) - S1(c1); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 2; c3 <= N; c3 += 1) - S2(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - S3(c1, c3); + for (int c0 = 1; c0 <= M; c0 += 1) + S1(c0); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 2; c1 <= N; c1 += 1) + S2(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + S3(c0, c1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.in deleted file mode 100644 index eb62bb7d009..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0] -> [0, i0, 0, 0, 0] : i0 >= 1 and i0 <= M; S2[i0, i1] -> [1, i0, 1, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= N; S3[i0, i1] -> [2, i0, 2, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + N } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.st new file mode 100644 index 00000000000..b53558fe0db --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam2.st @@ -0,0 +1,23 @@ +domain: "[M, N] -> { S3[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + N; S1[i0] : i0 >= 1 and i0 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= N }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + sequence: + - filter: "[M, N] -> { S1[i0] }" + child: + schedule: "[M, N] -> [{ S1[i0] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S2[i0, i1] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S3[i0, i1] }" + child: + schedule: "[M, N] -> [{ S3[i0, i1] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S3[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.c index c786628d804..9d290b514f3 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.c @@ -1,11 +1,11 @@ -for (int c1 = 5; c1 <= 5 * M; c1 += 1) { - for (int c3 = max(2, floord(-M + c1, 4)); c3 < min(M, (c1 + 1) / 3 - 2); c3 += 1) - for (int c5 = max(1, -M - c3 + (M + c1) / 2 - 2); c5 < min(c3, -2 * c3 + (c1 + c3) / 2 - 2); c5 += 1) - S1(c1 - 2 * c3 - 2 * c5 - 5, c3, c5); - for (int c3 = max(1, floord(-M + c1, 4)); c3 < (c1 + 1) / 5; c3 += 1) - S2(c1 - 4 * c3 - 3, c3); - if (c1 % 5 == 0) - S4(c1 / 5); - for (int c3 = max(-3 * M - c1 + 3 * ((M + c1) / 2) + 1, -((c1 - 1) % 3) + 3); c3 < (c1 + 1) / 5; c3 += 3) - S3((c1 - 2 * c3 - 1) / 3, c3); +for (int c0 = 5; c0 <= 5 * M; c0 += 1) { + for (int c1 = max(2, floord(-M + c0, 4)); c1 < min(-((5 * M - c0 + 1) % 2) + M, (c0 + 1) / 3 - 2); c1 += 1) + for (int c2 = max(1, -M - c1 + (M + c0) / 2 - 2); c2 < min(c1, -2 * c1 + (c0 + c1) / 2 - 2); c2 += 1) + S1(c0 - 2 * c1 - 2 * c2 - 5, c1, c2); + for (int c1 = max(1, floord(-M + c0, 4)); c1 < (c0 + 1) / 5; c1 += 1) + S2(c0 - 4 * c1 - 3, c1); + if (c0 % 5 == 0) + S4(c0 / 5); + for (int c1 = max(-3 * M - c0 + 3 * ((M + c0) / 2) + 1, -((c0 - 1) % 3) + 3); c1 < (c0 + 1) / 5; c1 += 3) + S3((c0 - 2 * c1 - 1) / 3, c1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.in deleted file mode 100644 index ebf78ae0b6b..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2] -> [0, 5 + i0 + 2i1 + 2i2, 0, i1, 0, i2, 0] : i0 <= M and i1 <= -1 + i0 and i2 >= 1 and i2 <= -1 + i1; S3[i0, i1] -> [0, 1 + 3i0 + 2i1, 2, i1, 0, 0, 0] : i0 <= M and i1 >= 1 and i1 <= -1 + i0; S2[i0, i1] -> [0, 3 + i0 + 4i1, 1, i1, 1, 0, 0] : i0 <= M and i1 >= 1 and i1 <= -1 + i0; S4[i0] -> [0, 5i0, 2, 0, 0, 0, 0] : i0 >= 1 and i0 <= M } -[M] -> { : M >= 1 } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.st new file mode 100644 index 00000000000..cedd5e5da75 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam3.st @@ -0,0 +1,23 @@ +domain: "[M] -> { S4[i0] : i0 >= 1 and i0 <= M; S3[i0, i1] : i0 <= M and i1 >= 1 and i1 <= -1 + i0; S2[i0, i1] : i0 <= M and i1 >= 1 and i1 <= -1 + i0; S1[i0, i1, i2] : i0 <= M and i1 <= -1 + i0 and i2 >= 1 and i2 <= -1 + i1 }" +child: + context: "[M] -> { [] : M >= 1 }" + child: + schedule: "[M] -> [{ S4[i0] -> [(5i0)]; S1[i0, i1, i2] -> [(5 + i0 + 2i1 + 2i2)]; S3[i0, i1] -> [(1 + 3i0 + 2i1)]; S2[i0, i1] -> [(3 + i0 + 4i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S4[i0]; S3[i0, i1] }" + child: + schedule: "[M] -> [{ S4[i0] -> [(0)]; S3[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.c index 6a0b0badab6..ed00e997729 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.c @@ -1,10 +1,10 @@ -for (int c1 = 1; c1 < 2 * M - 1; c1 += 1) { - for (int c3 = max(-M + 1, -c1 + 1); c3 < 0; c3 += 1) { - for (int c7 = max(1, -M + c1 + 1); c7 <= min(M - 1, c1 + c3); c7 += 1) - S1(c7, c1 + c3 - c7, -c3); - for (int c5 = max(-M + c1 + 1, -c3); c5 < min(M, c1); c5 += 1) - S2(c1 - c5, c3 + c5, c5); +for (int c0 = 1; c0 < 2 * M - 1; c0 += 1) { + for (int c1 = max(-M + 1, -c0 + 1); c1 < 0; c1 += 1) { + for (int c3 = max(1, -M + c0 + 1); c3 <= min(M - 1, c0 + c1); c3 += 1) + S1(c3, c0 + c1 - c3, -c1); + for (int c2 = max(-M + c0 + 1, -c1); c2 < min(M, c0); c2 += 1) + S2(c0 - c2, c1 + c2, c2); } - for (int c7 = max(1, -M + c1 + 1); c7 <= min(M - 1, c1); c7 += 1) - S1(c7, c1 - c7, 0); + for (int c3 = max(1, -M + c0 + 1); c3 <= min(M - 1, c0); c3 += 1) + S1(c3, c0 - c3, 0); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.in deleted file mode 100644 index 1bb684f8e2b..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2] -> [0, i0 + i1 + i2, 0, -i2, 0, i2, 0] : i0 >= 1 and i0 <= -1 + M and i1 >= 0 and i2 >= 0 and i2 <= -1 + M - i1; S2[i0, i1, i2] -> [0, i0 + i2, 0, i1 - i2, 1, i2, 0] : i0 >= 1 and i0 <= -1 + M and i1 >= 0 and i2 >= 1 + i1 and i2 <= -1 + M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.st new file mode 100644 index 00000000000..14b0052e55d --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam4.st @@ -0,0 +1,19 @@ +domain: "[M] -> { S2[i0, i1, i2] : i0 >= 1 and i0 <= -1 + M and i1 >= 0 and i2 >= 1 + i1 and i2 <= -1 + M; S1[i0, i1, i2] : i0 >= 1 and i0 <= -1 + M and i1 >= 0 and i2 >= 0 and i2 <= -1 + M - i1 }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i0 + i1 + i2)]; S2[i0, i1, i2] -> [(i0 + i2)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(-i2)]; S2[i0, i1, i2] -> [(i1 - i2)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.c index f476185713c..05cbb742795 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.c @@ -1,11 +1,11 @@ { - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S2(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S3(c1, c3); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S2(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S3(c0, c1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.in deleted file mode 100644 index 2e2046f1db9..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [1, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S3[i0, i1] -> [2, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.st new file mode 100644 index 00000000000..5684455278c --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam5.st @@ -0,0 +1,26 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S3[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M }" +child: + context: "[M] -> { [] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S3[i0, i1] }" + child: + schedule: "[M] -> [{ S3[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S3[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.c index 2cc512261d6..39e45383715 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.c @@ -1,8 +1,8 @@ { - for (int c1 = 0; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); - for (int c1 = 0; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S2(c3, c1); + for (int c0 = 0; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); + for (int c0 = 0; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S2(c1, c0); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.in deleted file mode 100644 index 2699212b1df..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [1, i1, 0, i0, 0] : i0 >= 1 and i0 <= M and i1 >= 0 and i1 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 0 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.st new file mode 100644 index 00000000000..3119ef13fa8 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-lim-lam6.st @@ -0,0 +1,19 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 0 and i1 <= M }" +child: + context: "[M] -> { [] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c index dfc7d37d901..42547118e11 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.c @@ -1,17 +1,17 @@ if (M >= 0 && N >= 0) - for (int c1 = -4; c1 <= 3 * M + N; c1 += 1) { - if (3 * M + N >= c1 + 1 && c1 >= 3 * M) { - S2(M, -3 * M + c1); - } else if (3 * M >= c1 + 4 && (c1 - 2) % 3 == 0) - S1((c1 + 4) / 3, 0); - for (int c3 = max(-3 * M + c1 + 3, (c1 + 6) % 3); c3 <= min(N - 1, c1); c3 += 3) { - S2((c1 - c3) / 3, c3); - S1(((c1 - c3) / 3) + 1, c3 + 1); + for (int c0 = -4; c0 <= 3 * M + N; c0 += 1) { + if (c0 >= 0 && 3 * M + 1 >= c0 && (c0 + 1) % 3 >= 1 && N + 1 >= (c0 + 1) % 3) + S2((c0 + 1) / 3, ((c0 + 1) % 3) - 1); + for (int c1 = max(-3 * M + c0 - 2, (c0 + 4) % 3); c1 <= min(min(N - 2, c0 - 2), -3 * M + c0 + 3); c1 += 3) + S2((c0 - c1 - 2) / 3, c1 + 2); + for (int c1 = max(-3 * M + c0 + 4, (c0 + 4) % 3); c1 < min(N - 1, c0 - 1); c1 += 3) { + S1((c0 - c1 + 4) / 3, c1); + S2((c0 - c1 - 2) / 3, c1 + 2); } - if (c1 >= N && (N - c1) % 3 == 0) { - S2((-N + c1) / 3, N); - } else if (N >= c1 + 4 && c1 >= -3) - S1(0, c1 + 4); - for (int c3 = max(-3 * M + c1, (c1 + 6) % 3); c3 <= min(N, c1); c3 += 3) - S3((c1 - c3) / 3, c3); + if (3 * M + N >= c0 + 4 && c0 >= N + 1 && ((-N + c0) % 3) + N >= 2 && (-N + c0) % 3 >= 1) + S1((-N + c0 + 3) / 3 + 1, ((-N + c0) % 3) + N - 2); + for (int c1 = max(max(c0 + 1, -3 * M + c0 + 4), (c0 + 4) % 3); c1 <= min(N, c0 + 4); c1 += 3) + S1((c0 - c1 + 4) / 3, c1); + for (int c1 = max(-3 * M + c0, (c0 + 6) % 3); c1 <= min(N, c0); c1 += 3) + S3((c0 - c1) / 3, c1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.in deleted file mode 100644 index fd4dcc884f9..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1] -> [0, 3i0 + i1, 0, i1, 0] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N; S3[i0, i1] -> [0, 3i0 + i1, 1, i1, 0] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N; S1[i0, i1] -> [0, -4 + 3i0 + i1, 0, i1, 0] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N } -[M, N] -> { : } -[M, N] -> { [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.st new file mode 100644 index 00000000000..e915285f572 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-liu-zhuge1.st @@ -0,0 +1,16 @@ +domain: "[M, N] -> { S3[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N; S1[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N; S2[i0, i1] : i0 >= 0 and i0 <= M and i1 >= 0 and i1 <= N }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(-4 + 3i0 + i1)]; S2[i0, i1] -> [(3i0 + i1)]; S3[i0, i1] -> [(3i0 + i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1]; S2[i0, i1] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S3[i0, i1] }" + child: + schedule: "[M, N] -> [{ S3[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner3.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner3.c index d37df98b692..a164372c813 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner3.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner3.c @@ -1,4 +1,4 @@ -for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 2; c3 <= M + c1; c3 += 1) - for (int c5 = max(1, -c1 + c3); c5 <= min(M, c3 - 1); c5 += 1) - S1(c1, c5, c3 - c5); +for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 2; c1 <= M + c0; c1 += 1) + for (int c2 = max(1, -c0 + c1); c2 <= min(M, c1 - 1); c2 += 1) + S1(c0, c2, c1 - c2); diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner3.in deleted file mode 100644 index 03731713ff7..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner3.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2] -> [0, i0, 0, i1 + i2, 0, i1, 0] : i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= i0 } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner3.st new file mode 100644 index 00000000000..90b561a7b9d --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner3.st @@ -0,0 +1,12 @@ +domain: "[M] -> { S1[i0, i1, i2] : i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= i0 }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i1 + i2)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner4.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner4.c index 7a67212b2bb..cf9c7642e3f 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner4.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner4.c @@ -1,5 +1,5 @@ -for (int c1 = 2; c1 <= 2 * M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - for (int c5 = 1; c5 <= M; c5 += 1) - for (int c7 = max(1, -M + c1); c7 <= min(M, c1 - 1); c7 += 1) - S1(c5, c3, c7, c1 - c7); +for (int c0 = 2; c0 <= 2 * M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + for (int c2 = 1; c2 <= M; c2 += 1) + for (int c3 = max(1, -M + c0); c3 <= min(M, c0 - 1); c3 += 1) + S1(c2, c1, c3, c0 - c3); diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner4.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner4.in deleted file mode 100644 index 1a8070210cd..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner4.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2, i3] -> [0, i2 + i3, 0, i1, 0, i0, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M and i3 >= 1 and i3 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o, p, q] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner4.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner4.st new file mode 100644 index 00000000000..516da7ea868 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner4.st @@ -0,0 +1,15 @@ +domain: "[M] -> { S1[i0, i1, i2, i3] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M and i3 >= 1 and i3 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i2 + i3)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner5.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner5.c index c5f8fcc38e8..6193503d8d0 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner5.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner5.c @@ -1,5 +1,5 @@ -for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - for (int c5 = 1; c5 <= M; c5 += 1) - for (int c7 = 1; c7 <= M; c7 += 1) - S1(c3, c5, c1, c7); +for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + for (int c2 = 1; c2 <= M; c2 += 1) + for (int c3 = 1; c3 <= M; c3 += 1) + S1(c1, c2, c0, c3); diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner5.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner5.in deleted file mode 100644 index 9122fc0a626..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner5.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2, i3] -> [0, i2, 0, i0, 0, i1, 0, i3, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M and i3 >= 1 and i3 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o, p, q] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner5.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner5.st new file mode 100644 index 00000000000..691d924c5f4 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-loechner5.st @@ -0,0 +1,15 @@ +domain: "[M] -> { S1[i0, i1, i2, i3] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M and i3 >= 1 and i3 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2, i3] -> [(i3)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-long.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-long.c new file mode 100644 index 00000000000..e929c56428c --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-long.c @@ -0,0 +1,14 @@ +for (int c0 = 1; c0 < O; c0 += 1) { + for (int c1 = Q; c1 < N; c1 += 1) { + for (int c2 = P; c2 < M; c2 += 1) + S1(c0, c1, c2); + for (int c2 = 1; c2 < M; c2 += 1) + S2(c0, c1, c2); + } + for (int c1 = 1; c1 < N; c1 += 1) { + for (int c2 = P; c2 < M; c2 += 1) + S3(c0, c1, c2); + for (int c2 = 1; c2 < M; c2 += 1) + S4(c0, c1, c2); + } +} diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-long.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-long.st new file mode 100644 index 00000000000..5a292abdbe2 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-long.st @@ -0,0 +1,36 @@ +domain: "[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S3[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S4[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S2[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M }" +child: + context: "[M, N, O, P, Q, R, S, T, U] -> { [] : M >= 10 and N >= 10 and O >= 10 and P >= 1 and P <= 2 and Q >= 1 and Q <= 2 and R >= 1 and R <= 2 and S >= 0 and S <= 1 and T >= 0 and T <= 1 and U >= 0 and U <= 1 }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)]; S3[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2]; S2[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i1)]; S1[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S3[i0, i1, i2]; S4[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i1)]; S3[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S3[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S4[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp.c index cff8f1724e3..c5d7774abc8 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp.c @@ -1,85 +1,85 @@ { if (N >= 2) - for (int c1 = 1; c1 < O; c1 += 1) { - for (int c5 = 1; c5 <= M; c5 += 1) - S1(c1, 1, c5); - for (int c5 = 1; c5 < M; c5 += 1) { - S6(c1, 1, c5); - S7(c1, 1, c5); + for (int c0 = 1; c0 < O; c0 += 1) { + for (int c3 = 1; c3 <= M; c3 += 1) + S1(c0, 1, c3); + for (int c3 = 1; c3 < M; c3 += 1) { + S6(c0, 1, c3); + S7(c0, 1, c3); } if (N >= 3) { - for (int c5 = 1; c5 <= M; c5 += 1) - S3(c1, 1, c5); - for (int c5 = 1; c5 <= M; c5 += 1) - S1(c1, 2, c5); - for (int c5 = 1; c5 < M; c5 += 1) { - S6(c1, 2, c5); - S7(c1, 2, c5); + for (int c3 = 1; c3 <= M; c3 += 1) + S3(c0, 1, c3); + for (int c3 = 1; c3 <= M; c3 += 1) + S1(c0, 2, c3); + for (int c3 = 1; c3 < M; c3 += 1) { + S6(c0, 2, c3); + S7(c0, 2, c3); } - for (int c5 = 1; c5 < M; c5 += 1) - S11(c1, 1, c5); + for (int c3 = 1; c3 < M; c3 += 1) + S11(c0, 1, c3); } else { - for (int c5 = 1; c5 <= M; c5 += 1) - S3(c1, 1, c5); - for (int c5 = 1; c5 < M; c5 += 1) - S11(c1, 1, c5); + for (int c3 = 1; c3 <= M; c3 += 1) + S3(c0, 1, c3); + for (int c3 = 1; c3 < M; c3 += 1) + S11(c0, 1, c3); } - for (int c3 = 3; c3 < 2 * N - 4; c3 += 2) { - for (int c5 = 1; c5 < M; c5 += 1) - S10(c1, (c3 - 1) / 2, c5); - for (int c5 = 1; c5 <= M; c5 += 1) - S3(c1, (c3 + 1) / 2, c5); - for (int c5 = 1; c5 <= M; c5 += 1) - S1(c1, (c3 + 3) / 2, c5); - for (int c5 = 1; c5 < M; c5 += 1) { - S6(c1, (c3 + 3) / 2, c5); - S7(c1, (c3 + 3) / 2, c5); + for (int c1 = 3; c1 < 2 * N - 4; c1 += 2) { + for (int c3 = 1; c3 < M; c3 += 1) + S10(c0, (c1 - 1) / 2, c3); + for (int c3 = 1; c3 <= M; c3 += 1) + S3(c0, (c1 + 1) / 2, c3); + for (int c3 = 1; c3 <= M; c3 += 1) + S1(c0, (c1 + 3) / 2, c3); + for (int c3 = 1; c3 < M; c3 += 1) { + S6(c0, (c1 + 3) / 2, c3); + S7(c0, (c1 + 3) / 2, c3); } - for (int c5 = 1; c5 < M; c5 += 1) - S11(c1, (c3 + 1) / 2, c5); + for (int c3 = 1; c3 < M; c3 += 1) + S11(c0, (c1 + 1) / 2, c3); } if (N >= 3) { - for (int c5 = 1; c5 < M; c5 += 1) - S10(c1, N - 2, c5); - for (int c5 = 1; c5 <= M; c5 += 1) - S3(c1, N - 1, c5); - for (int c5 = 1; c5 < M; c5 += 1) - S11(c1, N - 1, c5); + for (int c3 = 1; c3 < M; c3 += 1) + S10(c0, N - 2, c3); + for (int c3 = 1; c3 <= M; c3 += 1) + S3(c0, N - 1, c3); + for (int c3 = 1; c3 < M; c3 += 1) + S11(c0, N - 1, c3); } - for (int c5 = 1; c5 < M; c5 += 1) - S10(c1, N - 1, c5); + for (int c3 = 1; c3 < M; c3 += 1) + S10(c0, N - 1, c3); } - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) { - for (int c5 = 1; c5 <= M; c5 += 1) - S2(c1, c3, c5); - for (int c5 = 1; c5 < M; c5 += 1) - S8(c1, c3, c5); - for (int c5 = 1; c5 < M; c5 += 1) - S9(c1, c3, c5); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) { + for (int c3 = 1; c3 <= M; c3 += 1) + S2(c0, c1, c3); + for (int c3 = 1; c3 < M; c3 += 1) + S8(c0, c1, c3); + for (int c3 = 1; c3 < M; c3 += 1) + S9(c0, c1, c3); } - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S4(c1, c3, c5); - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S5(c1, c3, c5); - for (int c1 = R; c1 < O; c1 += 1) - for (int c3 = Q; c3 < N; c3 += 1) - for (int c5 = P; c5 < M; c5 += 1) - S12(c1, c3, c5); - for (int c1 = R; c1 < O; c1 += 1) - for (int c3 = Q; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S13(c1, c3, c5); - for (int c1 = R; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = P; c5 < M; c5 += 1) - S14(c1, c3, c5); - for (int c1 = R; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S15(c1, c3, c5); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S4(c0, c1, c2); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S5(c0, c1, c2); + for (int c0 = R; c0 < O; c0 += 1) + for (int c1 = Q; c1 < N; c1 += 1) + for (int c2 = P; c2 < M; c2 += 1) + S12(c0, c1, c2); + for (int c0 = R; c0 < O; c0 += 1) + for (int c1 = Q; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S13(c0, c1, c2); + for (int c0 = R; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = P; c2 < M; c2 += 1) + S14(c0, c1, c2); + for (int c0 = R; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S15(c0, c1, c2); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp.in deleted file mode 100644 index b7fdb69788c..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N, O, P, Q, R, S, T, U] -> { S8[i0, i1, i2] -> [1, i0, 0, 2i1, 1, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S11[i0, i1, i2] -> [0, i0, 0, 2i1, 4, i2, 1] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S6[i0, i1, i2] -> [0, i0, 0, -2 + 2i1, 2, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S9[i0, i1, i2] -> [1, i0, 0, 1 + 2i1, 3, i2, 1] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S1[i0, i1, i2] -> [0, i0, 0, -3 + 2i1, 2, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S4[i0, i1, i2] -> [2, i0, 0, i1, 1, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S2[i0, i1, i2] -> [1, i0, 0, 2i1, 0, i2, 1] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S7[i0, i1, i2] -> [0, i0, 0, -2 + 2i1, 2, i2, 1] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S10[i0, i1, i2] -> [0, i0, 0, 1 + 2i1, 0, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S3[i0, i1, i2] -> [0, i0, 0, -1 + 2i1, 1, i2, 2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S15[i0, i1, i2] -> [7, i0, 1, i1, 1, i2, 0] : i0 >= R and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S5[i0, i1, i2] -> [3, i0, 0, i1, 1, i2, 1] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S13[i0, i1, i2] -> [5, i0, 0, i1, 1, i2, 0] : i0 >= R and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S12[i0, i1, i2] -> [4, i0, 0, i1, 0, i2, 0] : i0 >= R and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S14[i0, i1, i2] -> [6, i0, 1, i1, 0, i2, 0] : i0 >= R and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= P and i2 <= -1 + M } -[M, N, O, P, Q, R, S, T, U] -> { : } -[M, N, O, P, Q, R, S, T, U] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp.st new file mode 100644 index 00000000000..2d6301506f2 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp.st @@ -0,0 +1,115 @@ +domain: "[M, N, O, P, Q, R, S, T, U] -> { S8[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S12[i0, i1, i2] : i0 >= R and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S5[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S10[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S6[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S1[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S3[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S4[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S15[i0, i1, i2] : i0 >= R and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S11[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S2[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S7[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S9[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S14[i0, i1, i2] : i0 >= R and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S13[i0, i1, i2] : i0 >= R and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M }" +child: + context: "[M, N, O, P, Q, R, S, T, U] -> { [] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S10[i0, i1, i2]; S6[i0, i1, i2]; S3[i0, i1, i2]; S1[i0, i1, i2]; S11[i0, i1, i2]; S7[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S11[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)]; S6[i0, i1, i2] -> [(i0)]; S10[i0, i1, i2] -> [(i0)]; S3[i0, i1, i2] -> [(i0)]; S7[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S11[i0, i1, i2] -> [(2i1)]; S1[i0, i1, i2] -> [(-3 + 2i1)]; S6[i0, i1, i2] -> [(-2 + 2i1)]; S10[i0, i1, i2] -> [(1 + 2i1)]; S3[i0, i1, i2] -> [(-1 + 2i1)]; S7[i0, i1, i2] -> [(-2 + 2i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S10[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S10[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S3[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S6[i0, i1, i2]; S1[i0, i1, i2]; S7[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S1[i0, i1, i2] -> [(i2)]; S6[i0, i1, i2] -> [(i2)]; S7[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S6[i0, i1, i2]; S1[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S7[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S11[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S11[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S2[i0, i1, i2]; S9[i0, i1, i2]; S8[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i0)]; S8[i0, i1, i2] -> [(i0)]; S9[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(2i1)]; S8[i0, i1, i2] -> [(2i1)]; S9[i0, i1, i2] -> [(1 + 2i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S8[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S8[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S9[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S9[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S4[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S5[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S5[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S5[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S5[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S12[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S12[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S12[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S12[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S13[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S13[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S13[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S13[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S14[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S14[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S14[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S14[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S15[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S15[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S15[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S15[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.c index 98cd4b0707a..48c5dfdd9d1 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.c @@ -1,18 +1,18 @@ { - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = Q; c3 < N; c3 += 1) - for (int c5 = P; c5 < M; c5 += 1) - S1(c1, c3, c5); - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = Q; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S2(c1, c3, c5); - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = P; c5 < M; c5 += 1) - S3(c1, c3, c5); - for (int c1 = 1; c1 < O; c1 += 1) - for (int c3 = 1; c3 < N; c3 += 1) - for (int c5 = 1; c5 < M; c5 += 1) - S4(c1, c3, c5); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = Q; c1 < N; c1 += 1) + for (int c2 = P; c2 < M; c2 += 1) + S1(c0, c1, c2); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = Q; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S2(c0, c1, c2); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = P; c2 < M; c2 += 1) + S3(c0, c1, c2); + for (int c0 = 1; c0 < O; c0 += 1) + for (int c1 = 1; c1 < N; c1 += 1) + for (int c2 = 1; c2 < M; c2 += 1) + S4(c0, c1, c2); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.in deleted file mode 100644 index 8a5dfb12d5a..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2] -> [0, i0, 0, i1, 0, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S4[i0, i1, i2] -> [3, i0, 1, i1, 1, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S2[i0, i1, i2] -> [1, i0, 0, i1, 1, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S3[i0, i1, i2] -> [2, i0, 1, i1, 0, i2, 0] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= P and i2 <= -1 + M } -[M, N, O, P, Q, R, S, T, U] -> { : } -[M, N, O, P, Q, R, S, T, U] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.st new file mode 100644 index 00000000000..a2ea2b35eaf --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-interp2.st @@ -0,0 +1,45 @@ +domain: "[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S3[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= P and i2 <= -1 + M; S4[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= 1 and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M; S2[i0, i1, i2] : i0 >= 1 and i0 <= -1 + O and i1 >= Q and i1 <= -1 + N and i2 >= 1 and i2 <= -1 + M }" +child: + context: "[M, N, O, P, Q, R, S, T, U] -> { [] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S1[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S1[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S3[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S3[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S3[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R, S, T, U] -> { S4[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R, S, T, U] -> [{ S4[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R, S, T, U] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.c index e3a5deeb1e7..cfb4045b270 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.c @@ -1,9 +1,9 @@ -for (int c1 = 2; c1 < O; c1 += 1) - for (int c3 = 3; c3 < 2 * N - 2; c3 += 2) { - for (int c5 = 1; c5 <= M; c5 += 1) { - S1(c1, (c3 + 1) / 2, c5); - S2(c1, (c3 + 1) / 2, c5); +for (int c0 = 2; c0 < O; c0 += 1) + for (int c1 = 3; c1 < 2 * N - 2; c1 += 2) { + for (int c3 = 1; c3 <= M; c3 += 1) { + S1(c0, (c1 + 1) / 2, c3); + S2(c0, (c1 + 1) / 2, c3); } - for (int c5 = 2; c5 < M; c5 += 1) - S3(c1, (c3 + 1) / 2, c5); + for (int c3 = 2; c3 < M; c3 += 1) + S3(c0, (c1 + 1) / 2, c3); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.in deleted file mode 100644 index 835f81a4725..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N, O] -> { S1[i0, i1, i2] -> [0, i0, 0, -1 + 2i1, 0, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S2[i0, i1, i2] -> [0, i0, 0, -1 + 2i1, 0, i2, 1] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S3[i0, i1, i2] -> [0, i0, 0, 2i1, 1, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M } -[M, N, O] -> { : } -[M, N, O] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.st new file mode 100644 index 00000000000..c64638b4ea3 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-psinv.st @@ -0,0 +1,23 @@ +domain: "[M, N, O] -> { S3[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S2[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S1[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M }" +child: + context: "[M, N, O] -> { [] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(2i1)]; S2[i0, i1, i2] -> [(-1 + 2i1)]; S1[i0, i1, i2] -> [(-1 + 2i1)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O] -> { S2[i0, i1, i2]; S1[i0, i1, i2] }" + child: + schedule: "[M, N, O] -> [{ S2[i0, i1, i2] -> [(i2)]; S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O] -> { S1[i0, i1, i2] }" + - filter: "[M, N, O] -> { S2[i0, i1, i2] }" + - filter: "[M, N, O] -> { S3[i0, i1, i2] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-resid.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-resid.c index e3a5deeb1e7..cfb4045b270 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-resid.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-resid.c @@ -1,9 +1,9 @@ -for (int c1 = 2; c1 < O; c1 += 1) - for (int c3 = 3; c3 < 2 * N - 2; c3 += 2) { - for (int c5 = 1; c5 <= M; c5 += 1) { - S1(c1, (c3 + 1) / 2, c5); - S2(c1, (c3 + 1) / 2, c5); +for (int c0 = 2; c0 < O; c0 += 1) + for (int c1 = 3; c1 < 2 * N - 2; c1 += 2) { + for (int c3 = 1; c3 <= M; c3 += 1) { + S1(c0, (c1 + 1) / 2, c3); + S2(c0, (c1 + 1) / 2, c3); } - for (int c5 = 2; c5 < M; c5 += 1) - S3(c1, (c3 + 1) / 2, c5); + for (int c3 = 2; c3 < M; c3 += 1) + S3(c0, (c1 + 1) / 2, c3); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-resid.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-resid.in deleted file mode 100644 index 835f81a4725..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-resid.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N, O] -> { S1[i0, i1, i2] -> [0, i0, 0, -1 + 2i1, 0, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S2[i0, i1, i2] -> [0, i0, 0, -1 + 2i1, 0, i2, 1] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S3[i0, i1, i2] -> [0, i0, 0, 2i1, 1, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M } -[M, N, O] -> { : } -[M, N, O] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-resid.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-resid.st new file mode 100644 index 00000000000..c64638b4ea3 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-resid.st @@ -0,0 +1,23 @@ +domain: "[M, N, O] -> { S3[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S2[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M; S1[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 1 and i2 <= M }" +child: + context: "[M, N, O] -> { [] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(2i1)]; S2[i0, i1, i2] -> [(-1 + 2i1)]; S1[i0, i1, i2] -> [(-1 + 2i1)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O] -> { S2[i0, i1, i2]; S1[i0, i1, i2] }" + child: + schedule: "[M, N, O] -> [{ S2[i0, i1, i2] -> [(i2)]; S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O] -> { S1[i0, i1, i2] }" + - filter: "[M, N, O] -> { S2[i0, i1, i2] }" + - filter: "[M, N, O] -> { S3[i0, i1, i2] }" + child: + schedule: "[M, N, O] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.c index 992bfd53f02..e73ba5de5a5 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.c @@ -1,33 +1,35 @@ if (M >= 2 && N >= 3) - for (int c1 = 2; c1 < O; c1 += 1) { - for (int c5 = 2; c5 <= M; c5 += 1) - S1(c1, 2, c5); - for (int c3 = 3; c3 < N; c3 += 1) { - for (int c5 = 2; c5 <= M; c5 += 1) - S2(c1, c3 - 1, c5); + for (int c0 = 2; c0 < O; c0 += 1) { + for (int c2 = 2; c2 <= M; c2 += 1) + S1(c0, 2, c2); + for (int c1 = 3; c1 < N; c1 += 1) { + for (int c2 = 2; c2 <= M; c2 += 1) + S2(c0, c1 - 1, c2); + if (M >= 3) + S4(c0, c1 - 1, 2); + for (int c2 = 2; c2 < M - 1; c2 += 1) { + S3(c0, c1 - 1, c2); + S5(c0, c1 - 1, c2); + S4(c0, c1 - 1, c2 + 1); + } if (M >= 3) { - S4(c1, c3 - 1, 2); - for (int c5 = 2; c5 < M - 1; c5 += 1) { - S3(c1, c3 - 1, c5); - S5(c1, c3 - 1, c5); - S4(c1, c3 - 1, c5 + 1); - } - S3(c1, c3 - 1, M - 1); - S5(c1, c3 - 1, M - 1); + S3(c0, c1 - 1, M - 1); + S5(c0, c1 - 1, M - 1); } - for (int c5 = 2; c5 <= M; c5 += 1) - S1(c1, c3, c5); + for (int c2 = 2; c2 <= M; c2 += 1) + S1(c0, c1, c2); + } + for (int c2 = 2; c2 <= M; c2 += 1) + S2(c0, N - 1, c2); + if (M >= 3) + S4(c0, N - 1, 2); + for (int c2 = 2; c2 < M - 1; c2 += 1) { + S3(c0, N - 1, c2); + S5(c0, N - 1, c2); + S4(c0, N - 1, c2 + 1); } - for (int c5 = 2; c5 <= M; c5 += 1) - S2(c1, N - 1, c5); if (M >= 3) { - S4(c1, N - 1, 2); - for (int c5 = 2; c5 < M - 1; c5 += 1) { - S3(c1, N - 1, c5); - S5(c1, N - 1, c5); - S4(c1, N - 1, c5 + 1); - } - S3(c1, N - 1, M - 1); - S5(c1, N - 1, M - 1); + S3(c0, N - 1, M - 1); + S5(c0, N - 1, M - 1); } } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.in deleted file mode 100644 index 03f4134661f..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N, O, P, Q, R] -> { S1[i0, i1, i2] -> [0, i0, 0, i1, 2, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= M; S4[i0, i1, i2] -> [0, i0, 0, 1 + i1, 1, -1 + i2, 2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S3[i0, i1, i2] -> [0, i0, 0, 1 + i1, 1, i2, 0] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S5[i0, i1, i2] -> [0, i0, 0, 1 + i1, 1, i2, 1] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S2[i0, i1, i2] -> [0, i0, 0, 1 + i1, 0, i2, 1] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= M } -[M, N, O, P, Q, R] -> { : } -[M, N, O, P, Q, R] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.st new file mode 100644 index 00000000000..d330a83f5a6 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-mg-rprj3.st @@ -0,0 +1,28 @@ +domain: "[M, N, O, P, Q, R] -> { S2[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= M; S4[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S1[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= M; S5[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M; S3[i0, i1, i2] : i0 >= 2 and i0 <= -1 + O and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + M }" +child: + context: "[M, N, O, P, Q, R] -> { [] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S5[i0, i1, i2] -> [(i0)]; S3[i0, i1, i2] -> [(i0)]; S4[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S5[i0, i1, i2] -> [(1 + i1)]; S3[i0, i1, i2] -> [(1 + i1)]; S4[i0, i1, i2] -> [(1 + i1)]; S1[i0, i1, i2] -> [(i1)]; S2[i0, i1, i2] -> [(1 + i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S4[i0, i1, i2]; S5[i0, i1, i2]; S3[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S5[i0, i1, i2] -> [(i2)]; S3[i0, i1, i2] -> [(i2)]; S4[i0, i1, i2] -> [(-1 + i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S3[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S5[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S4[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali1.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali1.c index 7268c23d080..ddb1293be11 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali1.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali1.c @@ -1,7 +1,7 @@ -for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 < 2 * N; c3 += 1) { - for (int c5 = max(1, -N + c3); c5 < (c3 + 1) / 2; c5 += 1) - S1(c1, c3 - c5, c5); - if ((c3 - 1) % 2 == 0) - S2(c1, (c3 + 1) / 2); +for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 < 2 * N; c1 += 1) { + for (int c2 = max(1, -N + c1); c2 < (c1 + 1) / 2; c2 += 1) + S1(c0, c1 - c2, c2); + if ((c1 - 1) % 2 == 0) + S2(c0, (c1 + 1) / 2); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali1.in deleted file mode 100644 index ecbb320de01..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali1.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1, i2] -> [0, i0, 0, i1 + i2, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 <= N and i2 >= 1 and i2 <= -1 + i1; S2[i0, i1] -> [0, i0, 0, -1 + 2i1, 1, 0, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= N } -[M, N] -> { : } -[M, N] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali1.st new file mode 100644 index 00000000000..4ab2a651c55 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali1.st @@ -0,0 +1,16 @@ +domain: "[M, N] -> { S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= N; S1[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 <= N and i2 >= 1 and i2 <= -1 + i1 }" +child: + context: "[M, N] -> { [] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(i0)]; S1[i0, i1, i2] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1] -> [(-1 + 2i1)]; S1[i0, i1, i2] -> [(i1 + i2)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali2.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali2.c index a407cad52d2..195f15bbcda 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali2.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali2.c @@ -1,8 +1,8 @@ { - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S2(c1, c3); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S2(c0, c1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali2.in deleted file mode 100644 index 9ba248fb0fc..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [1, i0, 1, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali2.st new file mode 100644 index 00000000000..ff760349350 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali2.st @@ -0,0 +1,19 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M }" +child: + context: "[M] -> { [] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali3.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali3.c index c281b826e01..eede1429fa5 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali3.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali3.c @@ -1,9 +1,9 @@ { - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - for (int c5 = 1; c5 <= M; c5 += 1) - S2(c1, c3, c5); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + for (int c2 = 1; c2 <= M; c2 += 1) + S2(c0, c1, c2); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali3.in deleted file mode 100644 index 70da8ea5c11..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali3.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1, i2] -> [1, i0, 0, i1, 1, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0, 0, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali3.st new file mode 100644 index 00000000000..c3065a1e460 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali3.st @@ -0,0 +1,22 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M and i2 >= 1 and i2 <= M }" +child: + context: "[M] -> { [] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S2[i0, i1, i2] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1, i2] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali4.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali4.c index a407cad52d2..195f15bbcda 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali4.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali4.c @@ -1,8 +1,8 @@ { - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S1(c1, c3); - for (int c1 = 1; c1 <= M; c1 += 1) - for (int c3 = 1; c3 <= M; c3 += 1) - S2(c1, c3); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S1(c0, c1); + for (int c0 = 1; c0 <= M; c0 += 1) + for (int c1 = 1; c1 <= M; c1 += 1) + S2(c0, c1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali4.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali4.in deleted file mode 100644 index e975faef4c7..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali4.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [1, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S1[i0, i1] -> [0, i0, 0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : M >= 2 } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali4.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali4.st new file mode 100644 index 00000000000..0d724e9d28b --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali4.st @@ -0,0 +1,19 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M }" +child: + context: "[M] -> { [] : M >= 2 }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali5.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali5.c index 51f2f0c154e..0e9bcf43235 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali5.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali5.c @@ -1,10 +1,10 @@ -for (int c1 = 3; c1 < 2 * M; c1 += 1) { - for (int c3 = c1 / 2 + 2; c3 <= M; c3 += 1) - for (int c7 = c1 / 2 + 1; c7 < min(c1, c3); c7 += 1) - S1(c7, c1 - c7, c3); - for (int c3 = max(1, -M + c1); c3 < (c1 + 1) / 2; c3 += 1) - S2(c1 - c3, c3); - for (int c3 = c1 / 2 + 2; c3 <= M; c3 += 1) - for (int c7 = c1 / 2 + 1; c7 < min(c1, c3); c7 += 1) - S3(c7, c1 - c7, c3); +for (int c0 = 3; c0 < 2 * M; c0 += 1) { + for (int c1 = c0 / 2 + 2; c1 <= M; c1 += 1) + for (int c3 = c0 / 2 + 1; c3 < min(c0, c1); c3 += 1) + S1(c3, c0 - c3, c1); + for (int c1 = max(1, -M + c0); c1 < (c0 + 1) / 2; c1 += 1) + S2(c0 - c1, c1); + for (int c1 = c0 / 2 + 2; c1 <= M; c1 += 1) + for (int c3 = c0 / 2 + 1; c3 < min(c0, c1); c3 += 1) + S3(c3, c0 - c3, c1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali5.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali5.in deleted file mode 100644 index 1b77acdc8d6..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali5.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1, i2] -> [0, i0 + i1, 0, i2, 0, i2, 0] : i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M; S3[i0, i1, i2] -> [0, i0 + i1, 2, i2, 2, i2, 0] : i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M; S2[i0, i1] -> [0, i0 + i1, 1, i1, 1, 0, 0] : i0 <= M and i1 >= 1 and i1 <= -1 + i0 } -[M] -> { : } -[M] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali5.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali5.st new file mode 100644 index 00000000000..d83eb55ece0 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali5.st @@ -0,0 +1,26 @@ +domain: "[M] -> { S3[i0, i1, i2] : i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M; S2[i0, i1] : i0 <= M and i1 >= 1 and i1 <= -1 + i0; S1[i0, i1, i2] : i1 >= 1 and i1 <= -1 + i0 and i2 >= 1 + i0 and i2 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i0 + i1)]; S3[i0, i1, i2] -> [(i0 + i1)]; S2[i0, i1] -> [(i0 + i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S2[i0, i1] }" + child: + schedule: "[M] -> [{ S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + - filter: "[M] -> { S3[i0, i1, i2] }" + child: + schedule: "[M] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" + child: + schedule: "[M] -> [{ S3[i0, i1, i2] -> [(i2)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali6.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali6.c index 1df9bb90c24..725357566a0 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali6.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali6.c @@ -1,8 +1,8 @@ -for (int c1 = 1; c1 <= M; c1 += 1) { - for (int c3 = 2; c3 < N; c3 += 1) - for (int c5 = 2; c5 < N; c5 += 1) - S1(c1, c3, c5); - for (int c3 = 2; c3 < N; c3 += 1) - for (int c5 = 2; c5 < N; c5 += 1) - S2(c1, c3, c5); +for (int c0 = 1; c0 <= M; c0 += 1) { + for (int c2 = 2; c2 < N; c2 += 1) + for (int c3 = 2; c3 < N; c3 += 1) + S1(c0, c2, c3); + for (int c2 = 2; c2 < N; c2 += 1) + for (int c3 = 2; c3 < N; c3 += 1) + S2(c0, c2, c3); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali6.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali6.in deleted file mode 100644 index 7a08ca76e8e..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali6.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S2[i0, i1, i2] -> [0, 1 + 2i0, 1, i1, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N; S1[i0, i1, i2] -> [0, 2i0, 0, i1, 0, i2, 0] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N } -[M, N] -> { : M >= 1 and N >= 1 } -[M, N] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali6.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali6.st new file mode 100644 index 00000000000..3cf78bff859 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-pingali6.st @@ -0,0 +1,22 @@ +domain: "[M, N] -> { S2[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N; S1[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 2 and i1 <= -1 + N and i2 >= 2 and i2 <= -1 + N }" +child: + context: "[M, N] -> { [] : M >= 1 and N >= 1 }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(2i0)]; S2[i0, i1, i2] -> [(1 + 2i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S1[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + - filter: "[M, N] -> { S2[i0, i1, i2] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride.c index 104e2620fdd..6a970d48be7 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride.c @@ -1,2 +1,2 @@ -for (int c1 = 2; c1 <= M; c1 += 7) - S1(c1, (c1 - 2) / 7); +for (int c0 = 2; c0 <= M; c0 += 7) + S1(c0, (c0 - 2) / 7); diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride.in deleted file mode 100644 index 46a1c35375e..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [0, i0, 0, 0, 0] : 7i1 = -2 + i0 and i0 >= 2 and i0 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride.st new file mode 100644 index 00000000000..135c90cdee7 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : 7i1 = -2 + i0 and i0 >= 2 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride2.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride2.c index 104e2620fdd..6a970d48be7 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride2.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride2.c @@ -1,2 +1,2 @@ -for (int c1 = 2; c1 <= M; c1 += 7) - S1(c1, (c1 - 2) / 7); +for (int c0 = 2; c0 <= M; c0 += 7) + S1(c0, (c0 - 2) / 7); diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride2.in deleted file mode 100644 index be6b1978a4b..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0, i1] -> [0, i0, 0, 0, 0] : 7i1 = -2 + i0 and i0 >= 0 and i0 <= M } -[M] -> { : } -[M] -> { [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride2.st new file mode 100644 index 00000000000..0600029d186 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-stride2.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0, i1] : 7i1 = -2 + i0 and i0 >= 0 and i0 <= M }" +child: + context: "[M] -> { [] }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.c b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.c index 8874eabfceb..2a0f8759f37 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.c @@ -1,5 +1,5 @@ -for (int c1 = 0; c1 <= 9; c1 += 2) - for (int c3 = 0; c3 <= min(4, c1 + 3); c3 += 2) - for (int c5 = max(1, c1); c5 <= min(c1 + 1, c1 - c3 + 4); c5 += 1) - for (int c7 = max(1, -c1 + c3 + c5); c7 <= min(4, -c1 + c3 + c5 + 1); c7 += 1) - S1(c1 / 2, (-c1 + c3) / 2, -c1 + c5, -c3 + c7); +for (int c0 = 0; c0 <= 9; c0 += 2) + for (int c1 = 0; c1 <= min(4, c0 + 3); c1 += 2) + for (int c2 = max(1, c0); c2 <= min(c0 + 1, c0 - c1 + 4); c2 += 1) + for (int c3 = max(1, -c0 + c1 + c2); c3 <= min(4, -c0 + c1 + c2 + 1); c3 += 1) + S1(c0 / 2, (-c0 + c1) / 2, -c0 + c2, -c1 + c3); diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.in deleted file mode 100644 index 0c9ffc9f77f..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0, i1, i2, i3] -> [0, 2i0, 0, 2i0 + 2i1, 0, 2i0 + i2, 0, 2i0 + 2i1 + i3, 0] : i3 <= 4 - 2i0 - 2i1 and i3 >= i2 and i2 <= 9 - 2i0 and i2 >= 0 and i2 >= 1 - 2i0 and i3 <= 1 + i2 and i2 <= 1 and i3 >= 1 - 2i0 - 2i1 } -{ : } -{ [i, j, k, l, m, n, o, p, q] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.st new file mode 100644 index 00000000000..89d8b72515b --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-tang-xue1.st @@ -0,0 +1,15 @@ +domain: "{ S1[i0, i1, i2, i3] : i3 <= 4 - 2i0 - 2i1 and i3 >= i2 and i2 <= 9 - 2i0 and i2 >= 0 and i2 >= 1 - 2i0 and i3 <= 1 + i2 and i2 <= 1 and i3 >= 1 - 2i0 - 2i1 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2, i3] -> [(2i0)] }]" + options: "{ separate[i0] }" + child: + schedule: "[{ S1[i0, i1, i2, i3] -> [(2i0 + 2i1)] }]" + options: "{ separate[i0] }" + child: + schedule: "[{ S1[i0, i1, i2, i3] -> [(2i0 + i2)] }]" + options: "{ separate[i0] }" + child: + schedule: "[{ S1[i0, i1, i2, i3] -> [(2i0 + 2i1 + i3)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-two.in b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-two.in deleted file mode 100644 index a7eb204753b..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-two.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0, i1, i2] -> [i0, j, k, 0] : 2i1 = 3 - i0 and 2j = 3 - i0 and 2k = 9 + i0 and 2i2 = 9 + i0 and i0 >= 0 and i0 <= 1 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-two.st b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-two.st new file mode 100644 index 00000000000..c780ca22a99 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/reservoir-two.st @@ -0,0 +1,6 @@ +domain: "{ S1[i0, i1, i2] : 2i1 = 3 - i0 and 2i2 = 9 + i0 and i0 >= 0 and i0 <= 1 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i0, i1, i2] -> [(i0)] }, { S1[i0, i1, i2] -> [(i1)] }, { S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/singleton.in b/polly/lib/External/isl/test_inputs/codegen/cloog/singleton.in deleted file mode 100644 index a0a5a8a1dde..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/singleton.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S2[] -> [-1]; S1[] -> [0] } -{ : } -{ [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/singleton.st b/polly/lib/External/isl/test_inputs/codegen/cloog/singleton.st new file mode 100644 index 00000000000..a38487be53a --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/singleton.st @@ -0,0 +1,7 @@ +domain: "{ S1[]; S2[] }" +child: + context: "{ [] }" + child: + sequence: + - filter: "{ S2[] }" + - filter: "{ S1[] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/sor1d.c b/polly/lib/External/isl/test_inputs/codegen/cloog/sor1d.c new file mode 100644 index 00000000000..92c6b33aa6d --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/sor1d.c @@ -0,0 +1,13 @@ +if (M >= 1 && N >= 3) + for (int c0 = -1; c0 <= (3 * M + N - 5) / 100; c0 += 1) { + for (int c1 = max(max(0, c0 - (2 * M + N + 95) / 100 + 1), floord(-N + 100 * c0 + 106, 300)); c1 <= min(min(c0, M / 100), (c0 + 1) / 3); c1 += 1) + for (int c2 = max(200 * c1 - 3, 100 * c0 - 100 * c1); c2 <= min(min(2 * M + N - 5, 100 * c0 - 100 * c1 + 99), N + 200 * c1 + 193); c2 += 1) { + if (c1 >= 1 && N + 200 * c1 >= c2 + 7) + S3(c0 - c1, c1 - 1, c1, 100 * c1 - 1, -200 * c1 + c2 + 6); + for (int c3 = max(max(1, 100 * c1), -N + (N + c2) / 2 + 3); c3 <= min(min(M, 100 * c1 + 99), c2 / 2 + 1); c3 += 1) + S1(c0 - c1, c1, c3, c2 - 2 * c3 + 4); + if (M >= 100 * c1 + 100 && c2 >= 200 * c1 + 197) + S2(c0 - c1, c1, c1 + 1, 100 * c1 + 99, -200 * c1 + c2 - 194); + } + S4(c0); + } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/sor1d.st b/polly/lib/External/isl/test_inputs/codegen/cloog/sor1d.st new file mode 100644 index 00000000000..bdde2e51f3a --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/sor1d.st @@ -0,0 +1,24 @@ +domain: "[M, N] -> { S2[i0, i1, 1 + i1, 99 + 100i1, i4] : i4 >= 3 and i4 >= -193 - 200i1 and i4 >= -194 + 100i0 - 200i1 and 100i0 >= -284 - 3N and i4 <= -1 + N and i4 <= -201 + 2M + N - 200i1 and i4 <= -95 + 100i0 - 200i1 and 100i0 >= -94 - N and 50i0 >= -45 - N and 3N >= -134 - M and i1 >= 0 and N >= 4 and 200i1 >= -192 - N and 200i1 >= -193 - N + 100i0 and 100i0 <= -7 + 2M + N and 7N >= -463 - 2M and 100i1 <= -100 + M and i0 >= 0 and 200i1 <= -204 + 2M + N and 2i1 <= -1 + i0 and 5N >= -75 - 2M and N >= 8 - 2M and 50i0 <= -6 + M + N and 50i0 <= 89 + M + 2N and 100i0 <= -15 + 2M + 3N and M >= 2 and 100i1 <= -5 + M + N and 2N >= -39 - M and 200i1 <= 96 + N + 100i0 and 3N >= 16 - 2M and 100i1 >= -94 - N + 50i0 and N >= 6 - M and 100i1 >= -94 - N; S3[i0, i1, 1 + i1, 99 + 100i1, i4] : i4 >= 3 and i4 >= -193 - 200i1 and i4 >= -194 + 100i0 - 200i1 and 100i0 >= -284 - 3N and i4 <= -1 + N and i4 <= -201 + 2M + N - 200i1 and i4 <= -95 + 100i0 - 200i1 and 100i0 >= -94 - N and 50i0 >= -45 - N and 3N >= -134 - M and i1 >= 0 and N >= 4 and 200i1 >= -192 - N and 200i1 >= -193 - N + 100i0 and 100i0 <= -7 + 2M + N and 7N >= -463 - 2M and 100i1 <= -100 + M and i0 >= 0 and 200i1 <= -204 + 2M + N and 2i1 <= -1 + i0 and 5N >= -75 - 2M and N >= 8 - 2M and 50i0 <= -6 + M + N and 50i0 <= 89 + M + 2N and 100i0 <= -15 + 2M + 3N and M >= 2 and 100i1 <= -5 + M + N and 2N >= -39 - M and 200i1 <= 96 + N + 100i0 and 3N >= 16 - 2M and 100i1 >= -94 - N + 50i0 and N >= 6 - M and 100i1 >= -94 - N; S4[i0] : 200i0 >= -781 - 3N and 200i0 >= -391 - N and 50i0 >= -268 - N and 100i0 >= -392 - N and i0 >= -1 and 200i0 <= 377 + 6M + 5N and 100i0 <= 335 + 3M + 3N and 100i0 <= 190 + 3M + 2N and 200i0 <= -13 + 6M + 3N and 100i0 <= -5 + 3M + N and 3N >= -484 - 2M and N >= -95 - M and N >= -192 - 3M and 5N >= -873 - 3M and 2N >= -189 - 3M and 7N >= -1062 - 6M and 5N >= -771 - 6M and 4N >= -579 - 3M and N >= 3 and N >= 5 - 2M and M >= 1; S1[i0, i1, i2, i3] : i3 >= 4 + 100i0 - 2i2 and i3 >= 2 and i3 <= 103 + 100i0 - 2i2 and i3 <= -1 + N and i2 >= 1 and i2 >= 100i1 and 2i2 >= 5 - N + 100i0 and i2 <= M and i2 <= 99 + 100i1 and i2 <= 50 + 50i0 and i1 >= 0 and 200i1 >= -193 - N + 100i0 and 100i1 <= M and 2i1 <= 1 + i0 and i0 >= 0 and 100i0 <= -5 + 2M + N and N >= 3 and N >= -94 - 2M and M >= 1 }" +child: + context: "[M, N] -> { [] : M >= 0 and N >= 0 }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2, i3, i4] -> [(i0 + i1)]; S1[i0, i1, i2, i3] -> [(i0 + i1)]; S3[i0, i1, i2, i3, i4] -> [(1 + i0 + i1)]; S4[i0] -> [(i0)] }]" + options: "[M, N] -> { atomic[i0] }" + child: + sequence: + - filter: "[M, N] -> { S2[i0, i1, i2, i3, i4]; S3[i0, i1, i2, i3, i4]; S1[i0, i1, i2, i3] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2, i3, i4] -> [(i1)]; S1[i0, i1, i2, i3] -> [(i1)]; S3[i0, i1, i2, i3, i4] -> [(i2)] }, { S2[i0, i1, i2, i3, i4] -> [(-4 + 2i3 + i4)]; S1[i0, i1, i2, i3] -> [(-4 + 2i2 + i3)]; S3[i0, i1, i2, i3, i4] -> [(-4 + 2i3 + i4)] }, { S2[i0, i1, i2, i3, i4] -> [(i3)]; S1[i0, i1, i2, i3] -> [(i2)]; S3[i0, i1, i2, i3, i4] -> [(i3)] }]" + options: "[M, N] -> { atomic[i0] }" + child: + sequence: + - filter: "[M, N] -> { S3[i0, i1, i2, i3, i4] }" + child: + schedule: "[M, N] -> [{ S3[i0, i1, i2, i3, i4] -> [(i1)] }, { S3[i0, i1, i2, i3, i4] -> [(i4)] }]" + options: "[M, N] -> { atomic[i0] }" + - filter: "[M, N] -> { S1[i0, i1, i2, i3] }" + - filter: "[M, N] -> { S2[i0, i1, i2, i3, i4] }" + child: + schedule: "[M, N] -> [{ S2[i0, i1, i2, i3, i4] -> [(i2)] }, { S2[i0, i1, i2, i3, i4] -> [(i4)] }]" + options: "[M, N] -> { atomic[i0] }" + - filter: "[M, N] -> { S4[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.in deleted file mode 100644 index 028c792b640..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S2[i0, i1] -> [i0, i1, 1] : i1 >= 2 and i1 <= i0 and i0 <= M; S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M } -[M] -> { : M >= 1 } -[M] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.st new file mode 100644 index 00000000000..bff294dbda9 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/square+triangle-1-1-2-3.st @@ -0,0 +1,10 @@ +domain: "[M] -> { S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= M; S2[i0, i1] : i1 >= 2 and i1 <= i0 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 1 }" + child: + schedule: "[M] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M] -> { separate[i0] }" + child: + sequence: + - filter: "[M] -> { S1[i0, i1] }" + - filter: "[M] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/stride.in b/polly/lib/External/isl/test_inputs/codegen/cloog/stride.in deleted file mode 100644 index 410c6843527..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/stride.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[25] -> [25, 0]; S2[i0, i1] -> [i0, j] : 3i1 = i0 and 3j = i0 and i0 >= 3 and i0 <= 100 } -{ : } -{ [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/stride.st b/polly/lib/External/isl/test_inputs/codegen/cloog/stride.st new file mode 100644 index 00000000000..d83f97938d9 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/stride.st @@ -0,0 +1,6 @@ +domain: "{ S2[i0, i1] : 3i1 = i0 and i0 >= 3 and i0 <= 100; S1[25] }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[i0, i1] -> [(i0)]; S1[i0] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0] -> [(0)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/stride2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/stride2.in deleted file mode 100644 index 97e40866adf..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/stride2.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[27] -> [27, 0]; S2[i0, i1] -> [i0, j] : 3i1 = i0 and 3j = i0 and i0 >= 3 and i0 <= 100 } -{ : } -{ [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/stride2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/stride2.st new file mode 100644 index 00000000000..d2e34207b90 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/stride2.st @@ -0,0 +1,6 @@ +domain: "{ S2[i0, i1] : 3i1 = i0 and i0 >= 3 and i0 <= 100; S1[27] }" +child: + context: "{ [] }" + child: + schedule: "[{ S2[i0, i1] -> [(i0)]; S1[i0] -> [(i0)] }, { S2[i0, i1] -> [(i1)]; S1[i0] -> [(0)] }]" + options: "{ separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/stride3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/stride3.in deleted file mode 100644 index 9b87b899243..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/stride3.in +++ /dev/null @@ -1,3 +0,0 @@ -[m, n] -> { S1[i0] -> [50i0, 0] : i0 >= 1 and i0 <= n and i0 >= m } -[m, n] -> { : } -[m, n] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/stride3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/stride3.st new file mode 100644 index 00000000000..f970d2c3cf7 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/stride3.st @@ -0,0 +1,6 @@ +domain: "[m, n] -> { S1[i] : i >= 1 and i <= n and i >= m }" +child: + context: "[m, n] -> { [] }" + child: + schedule: "[m, n] -> [{ S1[i0] -> [(50i0)] }]" + options: "[m, n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/stride4.in b/polly/lib/External/isl/test_inputs/codegen/cloog/stride4.in deleted file mode 100644 index 436cad3c5a5..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/stride4.in +++ /dev/null @@ -1,3 +0,0 @@ -[t] -> { S1[i0, t] -> [i0, t, 0] : exists (e0 = [(t - i0)/16]: 16e0 = t - i0 and i0 >= 0 and i0 <= 99 and t >= 0 and t <= 15) } -[t] -> { : } -[t] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/stride4.st b/polly/lib/External/isl/test_inputs/codegen/cloog/stride4.st new file mode 100644 index 00000000000..9ffa62a90a7 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/stride4.st @@ -0,0 +1,6 @@ +domain: "[t] -> { S1[i0, t] : exists (e0 = floor((t - i0)/16): 16e0 = t - i0 and i0 >= 0 and i0 <= 99 and t >= 0 and t <= 15) }" +child: + context: "[t] -> { [] }" + child: + schedule: "[t] -> [{ S1[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)] }]" + options: "[t] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/swim.c b/polly/lib/External/isl/test_inputs/codegen/cloog/swim.c index 47b4ebe5ff8..14f65148965 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/swim.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/swim.c @@ -26,13 +26,13 @@ if (M == 1) { S25(); S26(); S27(); - for (int c1 = 1; c1 <= N; c1 += 1) { - for (int c3 = 1; c3 <= N; c3 += 1) { - S28(c1, c3); - S29(c1, c3); - S30(c1, c3); + for (int c0 = 1; c0 <= N; c0 += 1) { + for (int c1 = 1; c1 <= N; c1 += 1) { + S28(c0, c1); + S29(c0, c1); + S30(c0, c1); } - S31(c1); + S31(c0); } S32(); S33(); @@ -41,119 +41,119 @@ if (M == 1) { S35(); S36(); S37(); - for (int c1 = 2; c1 <= P; c1 += 1) { - S38(c1); - S39(c1); - for (int c3 = 1; c3 <= Q; c3 += 1) - for (int c5 = 1; c5 <= R; c5 += 1) { - S40(c1, c3, c5); - S41(c1, c3, c5); - S42(c1, c3, c5); - S43(c1, c3, c5); + for (int c0 = 2; c0 <= P; c0 += 1) { + S38(c0); + S39(c0); + for (int c1 = 1; c1 <= Q; c1 += 1) + for (int c2 = 1; c2 <= R; c2 += 1) { + S40(c0, c1, c2); + S41(c0, c1, c2); + S42(c0, c1, c2); + S43(c0, c1, c2); } - for (int c3 = 1; c3 <= Q; c3 += 1) { - S44(c1, c3); - S45(c1, c3); - S46(c1, c3); - S47(c1, c3); + for (int c1 = 1; c1 <= Q; c1 += 1) { + S44(c0, c1); + S45(c0, c1); + S46(c0, c1); + S47(c0, c1); } - for (int c3 = 1; c3 <= R; c3 += 1) { - S48(c1, c3); - S49(c1, c3); - S50(c1, c3); - S51(c1, c3); + for (int c1 = 1; c1 <= R; c1 += 1) { + S48(c0, c1); + S49(c0, c1); + S50(c0, c1); + S51(c0, c1); } - S52(c1); - S53(c1); - S54(c1); - S55(c1); - S56(c1); - S57(c1); - S58(c1); - for (int c3 = 1; c3 <= Q; c3 += 1) - for (int c5 = 1; c5 <= R; c5 += 1) { - S59(c1, c3, c5); - S60(c1, c3, c5); - S61(c1, c3, c5); + S52(c0); + S53(c0); + S54(c0); + S55(c0); + S56(c0); + S57(c0); + S58(c0); + for (int c1 = 1; c1 <= Q; c1 += 1) + for (int c2 = 1; c2 <= R; c2 += 1) { + S59(c0, c1, c2); + S60(c0, c1, c2); + S61(c0, c1, c2); } - for (int c3 = 1; c3 <= Q; c3 += 1) { - S62(c1, c3); - S63(c1, c3); - S64(c1, c3); + for (int c1 = 1; c1 <= Q; c1 += 1) { + S62(c0, c1); + S63(c0, c1); + S64(c0, c1); } - for (int c3 = 1; c3 <= R; c3 += 1) { - S65(c1, c3); - S66(c1, c3); - S67(c1, c3); + for (int c1 = 1; c1 <= R; c1 += 1) { + S65(c0, c1); + S66(c0, c1); + S67(c0, c1); } - S68(c1); - S69(c1); - S70(c1); - S71(c1); - S72(c1); - S73(c1); - S74(c1); - S75(c1); - S76(c1); - S77(c1); - S78(c1); - S79(c1); - S80(c1); - S81(c1); - S82(c1); - S83(c1); - S84(c1); - S85(c1); - S86(c1); - S87(c1); - S88(c1); - S89(c1); - S90(c1); - S91(c1); - S92(c1); - S93(c1); - S94(c1); - for (int c3 = 1; c3 <= N; c3 += 1) { - for (int c5 = 1; c5 <= N; c5 += 1) { - S95(c1, c3, c5); - S96(c1, c3, c5); - S97(c1, c3, c5); + S68(c0); + S69(c0); + S70(c0); + S71(c0); + S72(c0); + S73(c0); + S74(c0); + S75(c0); + S76(c0); + S77(c0); + S78(c0); + S79(c0); + S80(c0); + S81(c0); + S82(c0); + S83(c0); + S84(c0); + S85(c0); + S86(c0); + S87(c0); + S88(c0); + S89(c0); + S90(c0); + S91(c0); + S92(c0); + S93(c0); + S94(c0); + for (int c1 = 1; c1 <= N; c1 += 1) { + for (int c2 = 1; c2 <= N; c2 += 1) { + S95(c0, c1, c2); + S96(c0, c1, c2); + S97(c0, c1, c2); } - S98(c1, c3); + S98(c0, c1); } - S99(c1); - S100(c1); - S101(c1); - for (int c3 = 1; c3 <= Q; c3 += 1) - for (int c5 = 1; c5 <= R; c5 += 1) { - S102(c1, c3, c5); - S103(c1, c3, c5); - S104(c1, c3, c5); - S105(c1, c3, c5); - S106(c1, c3, c5); - S107(c1, c3, c5); + S99(c0); + S100(c0); + S101(c0); + for (int c1 = 1; c1 <= Q; c1 += 1) + for (int c2 = 1; c2 <= R; c2 += 1) { + S102(c0, c1, c2); + S103(c0, c1, c2); + S104(c0, c1, c2); + S105(c0, c1, c2); + S106(c0, c1, c2); + S107(c0, c1, c2); } - for (int c3 = 1; c3 <= Q; c3 += 1) { - S108(c1, c3); - S109(c1, c3); - S110(c1, c3); - S111(c1, c3); - S112(c1, c3); - S113(c1, c3); + for (int c1 = 1; c1 <= Q; c1 += 1) { + S108(c0, c1); + S109(c0, c1); + S110(c0, c1); + S111(c0, c1); + S112(c0, c1); + S113(c0, c1); } - for (int c3 = 1; c3 <= R; c3 += 1) { - S114(c1, c3); - S115(c1, c3); - S116(c1, c3); - S117(c1, c3); - S118(c1, c3); - S119(c1, c3); + for (int c1 = 1; c1 <= R; c1 += 1) { + S114(c0, c1); + S115(c0, c1); + S116(c0, c1); + S117(c0, c1); + S118(c0, c1); + S119(c0, c1); } - S120(c1); - S121(c1); - S122(c1); - S123(c1); - S124(c1); - S125(c1); + S120(c0); + S121(c0); + S122(c0); + S123(c0); + S124(c0); + S125(c0); } } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/swim.in b/polly/lib/External/isl/test_inputs/codegen/cloog/swim.in deleted file mode 100644 index 4661ff0cff2..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/swim.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N, O, P, Q, R] -> { S84[i0] -> [34, i0, 31, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S6[] -> [5, 0, 0, 0, 0, 0, 0] : M = 1; S25[] -> [24, 0, 0, 0, 0, 0, 0] : M = 1; S115[i0, i1] -> [34, i0, 48, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S64[i0, i1] -> [34, i0, 13, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S62[i0, i1] -> [34, i0, 13, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S40[i0, i1, i2] -> [34, i0, 2, i1, 0, i2, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S123[i0] -> [34, i0, 52, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S5[] -> [4, 0, 0, 0, 0, 0, 0] : M = 1; S15[] -> [14, 0, 0, 0, 0, 0, 0] : M = 1; S76[i0] -> [34, i0, 23, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S39[i0] -> [34, i0, 1, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S13[] -> [12, 0, 0, 0, 0, 0, 0] : M = 1; S28[i0, i1] -> [27, i0, 0, i1, 0, 0, 0] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S70[i0] -> [34, i0, 17, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S53[i0] -> [34, i0, 6, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S121[i0] -> [34, i0, 50, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S47[i0, i1] -> [34, i0, 3, i1, 3, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S59[i0, i1, i2] -> [34, i0, 12, i1, 0, i2, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S71[i0] -> [34, i0, 18, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S77[i0] -> [34, i0, 24, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S63[i0, i1] -> [34, i0, 13, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S51[i0, i1] -> [34, i0, 4, i1, 3, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S100[i0] -> [34, i0, 44, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S22[] -> [21, 0, 0, 0, 0, 0, 0] : M = 1; S95[i0, i1, i2] -> [34, i0, 42, i1, 0, i2, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S8[] -> [7, 0, 0, 0, 0, 0, 0] : M = 1; S120[i0] -> [34, i0, 49, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S50[i0, i1] -> [34, i0, 4, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S45[i0, i1] -> [34, i0, 3, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S72[i0] -> [34, i0, 19, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S52[i0] -> [34, i0, 5, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S7[] -> [6, 0, 0, 0, 0, 0, 0] : M = 1; S78[i0] -> [34, i0, 25, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S110[i0, i1] -> [34, i0, 47, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S124[i0] -> [34, i0, 53, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S60[i0, i1, i2] -> [34, i0, 12, i1, 0, i2, 1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S27[] -> [26, 0, 0, 0, 0, 0, 0] : M = 1; S114[i0, i1] -> [34, i0, 48, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S49[i0, i1] -> [34, i0, 4, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S94[i0] -> [34, i0, 41, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S57[i0] -> [34, i0, 10, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S66[i0, i1] -> [34, i0, 14, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S18[] -> [17, 0, 0, 0, 0, 0, 0] : M = 1; S92[i0] -> [34, i0, 39, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S3[] -> [2, 0, 0, 0, 0, 0, 0] : M = 1; S35[] -> [31, 0, 0, 0, 0, 0, 0] : M = 1 and O <= 1; S36[] -> [32, 0, 0, 0, 0, 0, 0] : M = 1; S10[] -> [9, 0, 0, 0, 0, 0, 0] : M = 1; S2[] -> [1, 0, 0, 0, 0, 0, 0] : M = 1; S48[i0, i1] -> [34, i0, 4, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S30[i0, i1] -> [27, i0, 0, i1, 2, 0, 0] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S75[i0] -> [34, i0, 22, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S83[i0] -> [34, i0, 30, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S87[i0] -> [34, i0, 34, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S88[i0] -> [34, i0, 35, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S33[] -> [29, 0, 0, 0, 0, 0, 0] : M = 1; S101[i0] -> [34, i0, 45, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S21[] -> [20, 0, 0, 0, 0, 0, 0] : M = 1; S32[] -> [28, 0, 0, 0, 0, 0, 0] : M = 1; S118[i0, i1] -> [34, i0, 48, i1, 4, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S79[i0] -> [34, i0, 26, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S38[i0] -> [34, i0, 0, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S108[i0, i1] -> [34, i0, 47, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S65[i0, i1] -> [34, i0, 14, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S91[i0] -> [34, i0, 38, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S17[] -> [16, 0, 0, 0, 0, 0, 0] : M = 1; S80[i0] -> [34, i0, 27, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S54[i0] -> [34, i0, 7, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S46[i0, i1] -> [34, i0, 3, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S68[i0] -> [34, i0, 15, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S116[i0, i1] -> [34, i0, 48, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S43[i0, i1, i2] -> [34, i0, 2, i1, 0, i2, 3] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S26[] -> [25, 0, 0, 0, 0, 0, 0] : M = 1; S31[i0] -> [27, i0, 1, 0, 0, 0, 0] : M = 1 and i0 >= 1 and i0 <= N; S69[i0] -> [34, i0, 16, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S24[] -> [23, 0, 0, 0, 0, 0, 0] : M = 1; S90[i0] -> [34, i0, 37, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S89[i0] -> [34, i0, 36, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S82[i0] -> [34, i0, 29, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S67[i0, i1] -> [34, i0, 14, i1, 2, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S58[i0] -> [34, i0, 11, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S109[i0, i1] -> [34, i0, 47, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S122[i0] -> [34, i0, 51, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S61[i0, i1, i2] -> [34, i0, 12, i1, 0, i2, 2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S1[] -> [0, 0, 0, 0, 0, 0, 0] : M = 1; S4[] -> [3, 0, 0, 0, 0, 0, 0] : M = 1; S86[i0] -> [34, i0, 33, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S14[] -> [13, 0, 0, 0, 0, 0, 0] : M = 1; S93[i0] -> [34, i0, 40, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S56[i0] -> [34, i0, 9, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S37[] -> [33, 0, 0, 0, 0, 0, 0] : M = 1; S125[i0] -> [34, i0, 54, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S96[i0, i1, i2] -> [34, i0, 42, i1, 0, i2, 1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S9[] -> [8, 0, 0, 0, 0, 0, 0] : M = 1; S41[i0, i1, i2] -> [34, i0, 2, i1, 0, i2, 1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S102[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S112[i0, i1] -> [34, i0, 47, i1, 4, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S16[] -> [15, 0, 0, 0, 0, 0, 0] : M = 1; S85[i0] -> [34, i0, 32, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S42[i0, i1, i2] -> [34, i0, 2, i1, 0, i2, 2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S12[] -> [11, 0, 0, 0, 0, 0, 0] : M = 1; S55[i0] -> [34, i0, 8, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S11[] -> [10, 0, 0, 0, 0, 0, 0] : M = 1; S19[] -> [18, 0, 0, 0, 0, 0, 0] : M = 1; S107[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 5] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S98[i0, i1] -> [34, i0, 42, i1, 1, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N; S104[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S29[i0, i1] -> [27, i0, 0, i1, 1, 0, 0] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S20[] -> [19, 0, 0, 0, 0, 0, 0] : M = 1; S103[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S105[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 3] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S97[i0, i1, i2] -> [34, i0, 42, i1, 0, i2, 2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S44[i0, i1] -> [34, i0, 3, i1, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S106[i0, i1, i2] -> [34, i0, 46, i1, 0, i2, 4] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S34[] -> [30, 0, 0, 0, 0, 0, 0] : M = 1; S111[i0, i1] -> [34, i0, 47, i1, 3, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S99[i0] -> [34, i0, 43, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S81[i0] -> [34, i0, 28, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S23[] -> [22, 0, 0, 0, 0, 0, 0] : M = 1; S117[i0, i1] -> [34, i0, 48, i1, 3, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S74[i0] -> [34, i0, 21, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P; S113[i0, i1] -> [34, i0, 47, i1, 5, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S119[i0, i1] -> [34, i0, 48, i1, 5, 0, 0] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S73[i0] -> [34, i0, 20, 0, 0, 0, 0] : M = 1 and i0 >= 2 and i0 <= P } -[M, N, O, P, Q, R] -> { : } -[M, N, O, P, Q, R] -> { [i, j, k, l, m, n, o] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/swim.st b/polly/lib/External/isl/test_inputs/codegen/cloog/swim.st new file mode 100644 index 00000000000..ff08bb12dcf --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/swim.st @@ -0,0 +1,223 @@ +domain: "[M, N, O, P, Q, R] -> { S40[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S106[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S99[i0] : M = 1 and i0 >= 2 and i0 <= P; S83[i0] : M = 1 and i0 >= 2 and i0 <= P; S86[i0] : M = 1 and i0 >= 2 and i0 <= P; S56[i0] : M = 1 and i0 >= 2 and i0 <= P; S124[i0] : M = 1 and i0 >= 2 and i0 <= P; S66[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S46[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S64[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S22[] : M = 1; S15[] : M = 1; S30[i0, i1] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S14[] : M = 1; S12[] : M = 1; S87[i0] : M = 1 and i0 >= 2 and i0 <= P; S110[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S73[i0] : M = 1 and i0 >= 2 and i0 <= P; S44[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S31[i0] : M = 1 and i0 >= 1 and i0 <= N; S118[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S8[] : M = 1; S125[i0] : M = 1 and i0 >= 2 and i0 <= P; S63[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S25[] : M = 1; S51[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S91[i0] : M = 1 and i0 >= 2 and i0 <= P; S84[i0] : M = 1 and i0 >= 2 and i0 <= P; S35[] : M = 1 and O <= 1; S97[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S75[i0] : M = 1 and i0 >= 2 and i0 <= P; S19[] : M = 1; S50[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S114[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S13[] : M = 1; S72[i0] : M = 1 and i0 >= 2 and i0 <= P; S78[i0] : M = 1 and i0 >= 2 and i0 <= P; S39[i0] : M = 1 and i0 >= 2 and i0 <= P; S102[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S107[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S68[i0] : M = 1 and i0 >= 2 and i0 <= P; S32[] : M = 1; S41[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S69[i0] : M = 1 and i0 >= 2 and i0 <= P; S3[] : M = 1; S100[i0] : M = 1 and i0 >= 2 and i0 <= P; S11[] : M = 1; S76[i0] : M = 1 and i0 >= 2 and i0 <= P; S88[i0] : M = 1 and i0 >= 2 and i0 <= P; S49[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S45[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S10[] : M = 1; S80[i0] : M = 1 and i0 >= 2 and i0 <= P; S61[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S67[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S70[i0] : M = 1 and i0 >= 2 and i0 <= P; S29[i0, i1] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S60[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S21[] : M = 1; S92[i0] : M = 1 and i0 >= 2 and i0 <= P; S47[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S24[] : M = 1; S16[] : M = 1; S105[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S18[] : M = 1; S48[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S5[] : M = 1; S113[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S7[] : M = 1; S38[i0] : M = 1 and i0 >= 2 and i0 <= P; S54[i0] : M = 1 and i0 >= 2 and i0 <= P; S109[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S23[] : M = 1; S82[i0] : M = 1 and i0 >= 2 and i0 <= P; S59[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S77[i0] : M = 1 and i0 >= 2 and i0 <= P; S101[i0] : M = 1 and i0 >= 2 and i0 <= P; S37[] : M = 1; S71[i0] : M = 1 and i0 >= 2 and i0 <= P; S121[i0] : M = 1 and i0 >= 2 and i0 <= P; S115[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S104[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S94[i0] : M = 1 and i0 >= 2 and i0 <= P; S6[] : M = 1; S43[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S1[] : M = 1; S98[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N; S55[i0] : M = 1 and i0 >= 2 and i0 <= P; S58[i0] : M = 1 and i0 >= 2 and i0 <= P; S42[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S89[i0] : M = 1 and i0 >= 2 and i0 <= P; S53[i0] : M = 1 and i0 >= 2 and i0 <= P; S111[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S52[i0] : M = 1 and i0 >= 2 and i0 <= P; S85[i0] : M = 1 and i0 >= 2 and i0 <= P; S26[] : M = 1; S79[i0] : M = 1 and i0 >= 2 and i0 <= P; S81[i0] : M = 1 and i0 >= 2 and i0 <= P; S57[i0] : M = 1 and i0 >= 2 and i0 <= P; S4[] : M = 1; S123[i0] : M = 1 and i0 >= 2 and i0 <= P; S36[] : M = 1; S65[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S34[] : M = 1; S119[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S9[] : M = 1; S28[i0, i1] : M = 1 and i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= N; S20[] : M = 1; S117[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S112[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S103[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q and i2 >= 1 and i2 <= R; S17[] : M = 1; S96[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S95[i0, i1, i2] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= N and i2 >= 1 and i2 <= N; S62[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S90[i0] : M = 1 and i0 >= 2 and i0 <= P; S120[i0] : M = 1 and i0 >= 2 and i0 <= P; S116[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= R; S108[i0, i1] : M = 1 and i0 >= 2 and i0 <= P and i1 >= 1 and i1 <= Q; S74[i0] : M = 1 and i0 >= 2 and i0 <= P; S93[i0] : M = 1 and i0 >= 2 and i0 <= P; S2[] : M = 1; S27[] : M = 1; S122[i0] : M = 1 and i0 >= 2 and i0 <= P; S33[] : M = 1 }" +child: + context: "[M, N, O, P, Q, R] -> { [] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S1[] }" + - filter: "[M, N, O, P, Q, R] -> { S2[] }" + - filter: "[M, N, O, P, Q, R] -> { S3[] }" + - filter: "[M, N, O, P, Q, R] -> { S4[] }" + - filter: "[M, N, O, P, Q, R] -> { S5[] }" + - filter: "[M, N, O, P, Q, R] -> { S6[] }" + - filter: "[M, N, O, P, Q, R] -> { S7[] }" + - filter: "[M, N, O, P, Q, R] -> { S8[] }" + - filter: "[M, N, O, P, Q, R] -> { S9[] }" + - filter: "[M, N, O, P, Q, R] -> { S10[] }" + - filter: "[M, N, O, P, Q, R] -> { S11[] }" + - filter: "[M, N, O, P, Q, R] -> { S12[] }" + - filter: "[M, N, O, P, Q, R] -> { S13[] }" + - filter: "[M, N, O, P, Q, R] -> { S14[] }" + - filter: "[M, N, O, P, Q, R] -> { S15[] }" + - filter: "[M, N, O, P, Q, R] -> { S16[] }" + - filter: "[M, N, O, P, Q, R] -> { S17[] }" + - filter: "[M, N, O, P, Q, R] -> { S18[] }" + - filter: "[M, N, O, P, Q, R] -> { S19[] }" + - filter: "[M, N, O, P, Q, R] -> { S20[] }" + - filter: "[M, N, O, P, Q, R] -> { S21[] }" + - filter: "[M, N, O, P, Q, R] -> { S22[] }" + - filter: "[M, N, O, P, Q, R] -> { S23[] }" + - filter: "[M, N, O, P, Q, R] -> { S24[] }" + - filter: "[M, N, O, P, Q, R] -> { S25[] }" + - filter: "[M, N, O, P, Q, R] -> { S26[] }" + - filter: "[M, N, O, P, Q, R] -> { S27[] }" + - filter: "[M, N, O, P, Q, R] -> { S30[i0, i1]; S28[i0, i1]; S31[i0]; S29[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S31[i0] -> [(i0)]; S29[i0, i1] -> [(i0)]; S30[i0, i1] -> [(i0)]; S28[i0, i1] -> [(i0)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S30[i0, i1]; S28[i0, i1]; S29[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S29[i0, i1] -> [(i1)]; S30[i0, i1] -> [(i1)]; S28[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S28[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S29[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S30[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S31[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S32[] }" + - filter: "[M, N, O, P, Q, R] -> { S33[] }" + - filter: "[M, N, O, P, Q, R] -> { S34[] }" + - filter: "[M, N, O, P, Q, R] -> { S35[] }" + - filter: "[M, N, O, P, Q, R] -> { S36[] }" + - filter: "[M, N, O, P, Q, R] -> { S37[] }" + - filter: "[M, N, O, P, Q, R] -> { S58[i0]; S116[i0, i1]; S120[i0]; S106[i0, i1, i2]; S102[i0, i1, i2]; S114[i0, i1]; S113[i0, i1]; S122[i0]; S83[i0]; S103[i0, i1, i2]; S71[i0]; S50[i0, i1]; S98[i0, i1]; S65[i0, i1]; S82[i0]; S109[i0, i1]; S51[i0, i1]; S60[i0, i1, i2]; S91[i0]; S78[i0]; S101[i0]; S123[i0]; S111[i0, i1]; S97[i0, i1, i2]; S67[i0, i1]; S117[i0, i1]; S88[i0]; S79[i0]; S46[i0, i1]; S56[i0]; S45[i0, i1]; S74[i0]; S49[i0, i1]; S75[i0]; S115[i0, i1]; S119[i0, i1]; S42[i0, i1, i2]; S57[i0]; S62[i0, i1]; S99[i0]; S107[i0, i1, i2]; S100[i0]; S104[i0, i1, i2]; S70[i0]; S89[i0]; S125[i0]; S44[i0, i1]; S93[i0]; S90[i0]; S84[i0]; S105[i0, i1, i2]; S95[i0, i1, i2]; S66[i0, i1]; S77[i0]; S38[i0]; S41[i0, i1, i2]; S92[i0]; S87[i0]; S47[i0, i1]; S108[i0, i1]; S54[i0]; S76[i0]; S112[i0, i1]; S80[i0]; S55[i0]; S39[i0]; S59[i0, i1, i2]; S121[i0]; S86[i0]; S110[i0, i1]; S48[i0, i1]; S68[i0]; S53[i0]; S72[i0]; S85[i0]; S52[i0]; S69[i0]; S61[i0, i1, i2]; S43[i0, i1, i2]; S124[i0]; S73[i0]; S81[i0]; S63[i0, i1]; S118[i0, i1]; S96[i0, i1, i2]; S40[i0, i1, i2]; S94[i0]; S64[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S99[i0] -> [(i0)]; S97[i0, i1, i2] -> [(i0)]; S53[i0] -> [(i0)]; S101[i0] -> [(i0)]; S60[i0, i1, i2] -> [(i0)]; S40[i0, i1, i2] -> [(i0)]; S103[i0, i1, i2] -> [(i0)]; S55[i0] -> [(i0)]; S89[i0] -> [(i0)]; S56[i0] -> [(i0)]; S87[i0] -> [(i0)]; S115[i0, i1] -> [(i0)]; S123[i0] -> [(i0)]; S88[i0] -> [(i0)]; S70[i0] -> [(i0)]; S59[i0, i1, i2] -> [(i0)]; S52[i0] -> [(i0)]; S54[i0] -> [(i0)]; S63[i0, i1] -> [(i0)]; S92[i0] -> [(i0)]; S93[i0] -> [(i0)]; S119[i0, i1] -> [(i0)]; S76[i0] -> [(i0)]; S57[i0] -> [(i0)]; S44[i0, i1] -> [(i0)]; S79[i0] -> [(i0)]; S61[i0, i1, i2] -> [(i0)]; S69[i0] -> [(i0)]; S117[i0, i1] -> [(i0)]; S121[i0] -> [(i0)]; S84[i0] -> [(i0)]; S83[i0] -> [(i0)]; S43[i0, i1, i2] -> [(i0)]; S98[i0, i1] -> [(i0)]; S78[i0] -> [(i0)]; S114[i0, i1] -> [(i0)]; S66[i0, i1] -> [(i0)]; S77[i0] -> [(i0)]; S109[i0, i1] -> [(i0)]; S42[i0, i1, i2] -> [(i0)]; S58[i0] -> [(i0)]; S71[i0] -> [(i0)]; S68[i0] -> [(i0)]; S116[i0, i1] -> [(i0)]; S81[i0] -> [(i0)]; S125[i0] -> [(i0)]; S80[i0] -> [(i0)]; S73[i0] -> [(i0)]; S110[i0, i1] -> [(i0)]; S72[i0] -> [(i0)]; S51[i0, i1] -> [(i0)]; S122[i0] -> [(i0)]; S38[i0] -> [(i0)]; S39[i0] -> [(i0)]; S90[i0] -> [(i0)]; S113[i0, i1] -> [(i0)]; S46[i0, i1] -> [(i0)]; S47[i0, i1] -> [(i0)]; S96[i0, i1, i2] -> [(i0)]; S45[i0, i1] -> [(i0)]; S49[i0, i1] -> [(i0)]; S118[i0, i1] -> [(i0)]; S50[i0, i1] -> [(i0)]; S102[i0, i1, i2] -> [(i0)]; S112[i0, i1] -> [(i0)]; S86[i0] -> [(i0)]; S124[i0] -> [(i0)]; S41[i0, i1, i2] -> [(i0)]; S100[i0] -> [(i0)]; S104[i0, i1, i2] -> [(i0)]; S75[i0] -> [(i0)]; S62[i0, i1] -> [(i0)]; S85[i0] -> [(i0)]; S105[i0, i1, i2] -> [(i0)]; S82[i0] -> [(i0)]; S111[i0, i1] -> [(i0)]; S48[i0, i1] -> [(i0)]; S65[i0, i1] -> [(i0)]; S120[i0] -> [(i0)]; S107[i0, i1, i2] -> [(i0)]; S106[i0, i1, i2] -> [(i0)]; S95[i0, i1, i2] -> [(i0)]; S108[i0, i1] -> [(i0)]; S91[i0] -> [(i0)]; S67[i0, i1] -> [(i0)]; S74[i0] -> [(i0)]; S64[i0, i1] -> [(i0)]; S94[i0] -> [(i0)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S38[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S39[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S40[i0, i1, i2]; S41[i0, i1, i2]; S43[i0, i1, i2]; S42[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S43[i0, i1, i2] -> [(i1)]; S41[i0, i1, i2] -> [(i1)]; S40[i0, i1, i2] -> [(i1)]; S42[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S43[i0, i1, i2] -> [(i2)]; S41[i0, i1, i2] -> [(i2)]; S40[i0, i1, i2] -> [(i2)]; S42[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S40[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S41[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S42[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S43[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S46[i0, i1]; S45[i0, i1]; S44[i0, i1]; S47[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S47[i0, i1] -> [(i1)]; S46[i0, i1] -> [(i1)]; S44[i0, i1] -> [(i1)]; S45[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S44[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S45[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S46[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S47[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S51[i0, i1]; S49[i0, i1]; S50[i0, i1]; S48[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S51[i0, i1] -> [(i1)]; S49[i0, i1] -> [(i1)]; S48[i0, i1] -> [(i1)]; S50[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S48[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S49[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S50[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S51[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S52[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S53[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S54[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S55[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S56[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S57[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S58[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S60[i0, i1, i2]; S59[i0, i1, i2]; S61[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S61[i0, i1, i2] -> [(i1)]; S59[i0, i1, i2] -> [(i1)]; S60[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S61[i0, i1, i2] -> [(i2)]; S59[i0, i1, i2] -> [(i2)]; S60[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S59[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S60[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S61[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S62[i0, i1]; S63[i0, i1]; S64[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S64[i0, i1] -> [(i1)]; S62[i0, i1] -> [(i1)]; S63[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S62[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S63[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S64[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S65[i0, i1]; S66[i0, i1]; S67[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S66[i0, i1] -> [(i1)]; S65[i0, i1] -> [(i1)]; S67[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S65[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S66[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S67[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S68[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S69[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S70[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S71[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S72[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S73[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S74[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S75[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S76[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S77[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S78[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S79[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S80[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S81[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S82[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S83[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S84[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S85[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S86[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S87[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S88[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S89[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S90[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S91[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S92[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S93[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S94[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S96[i0, i1, i2]; S98[i0, i1]; S97[i0, i1, i2]; S95[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S98[i0, i1] -> [(i1)]; S95[i0, i1, i2] -> [(i1)]; S96[i0, i1, i2] -> [(i1)]; S97[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S96[i0, i1, i2]; S97[i0, i1, i2]; S95[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S95[i0, i1, i2] -> [(i2)]; S96[i0, i1, i2] -> [(i2)]; S97[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S95[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S96[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S97[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S98[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S99[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S100[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S101[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S107[i0, i1, i2]; S105[i0, i1, i2]; S102[i0, i1, i2]; S104[i0, i1, i2]; S106[i0, i1, i2]; S103[i0, i1, i2] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S102[i0, i1, i2] -> [(i1)]; S103[i0, i1, i2] -> [(i1)]; S104[i0, i1, i2] -> [(i1)]; S107[i0, i1, i2] -> [(i1)]; S106[i0, i1, i2] -> [(i1)]; S105[i0, i1, i2] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S102[i0, i1, i2] -> [(i2)]; S103[i0, i1, i2] -> [(i2)]; S104[i0, i1, i2] -> [(i2)]; S107[i0, i1, i2] -> [(i2)]; S106[i0, i1, i2] -> [(i2)]; S105[i0, i1, i2] -> [(i2)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S102[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S103[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S104[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S105[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S106[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S107[i0, i1, i2] }" + - filter: "[M, N, O, P, Q, R] -> { S113[i0, i1]; S112[i0, i1]; S108[i0, i1]; S111[i0, i1]; S110[i0, i1]; S109[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S110[i0, i1] -> [(i1)]; S112[i0, i1] -> [(i1)]; S111[i0, i1] -> [(i1)]; S113[i0, i1] -> [(i1)]; S109[i0, i1] -> [(i1)]; S108[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S108[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S109[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S110[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S111[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S112[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S113[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S119[i0, i1]; S114[i0, i1]; S117[i0, i1]; S115[i0, i1]; S118[i0, i1]; S116[i0, i1] }" + child: + schedule: "[M, N, O, P, Q, R] -> [{ S115[i0, i1] -> [(i1)]; S116[i0, i1] -> [(i1)]; S118[i0, i1] -> [(i1)]; S117[i0, i1] -> [(i1)]; S119[i0, i1] -> [(i1)]; S114[i0, i1] -> [(i1)] }]" + options: "[M, N, O, P, Q, R] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N, O, P, Q, R] -> { S114[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S115[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S116[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S117[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S118[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S119[i0, i1] }" + - filter: "[M, N, O, P, Q, R] -> { S120[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S121[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S122[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S123[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S124[i0] }" + - filter: "[M, N, O, P, Q, R] -> { S125[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/test.in b/polly/lib/External/isl/test_inputs/codegen/cloog/test.in deleted file mode 100644 index 981d9339f52..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/test.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S1[i0, i1] -> [i0, i1, 0] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S2[i0, i0] -> [i0, i0, 1] : i0 >= 3 and i0 <= N } -[M, N] -> { : N >= M and M >= 4 } -[M, N] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/test.st b/polly/lib/External/isl/test_inputs/codegen/cloog/test.st new file mode 100644 index 00000000000..97a290ed501 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/test.st @@ -0,0 +1,10 @@ +domain: "[M, N] -> { S1[i0, i1] : i0 >= 1 and i0 <= N and i1 >= 1 and i1 <= M; S2[i0, i0] : i0 >= 3 and i0 <= N }" +child: + context: "[M, N] -> { [] : N >= M and M >= 4 }" + child: + schedule: "[M, N] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S1[i0, i1] }" + - filter: "[M, N] -> { S2[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/thomasset.in b/polly/lib/External/isl/test_inputs/codegen/cloog/thomasset.in deleted file mode 100644 index 398e5234603..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/thomasset.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1, 0, i3, i4] -> [i3 + i4, -1 + i0] : i0 <= n and i1 <= n and i1 >= 1 and i0 >= 1 and 3i4 <= i1 and 3i4 >= -2 + i1 and 3i3 <= n and 3i3 >= -2 + n; S1[i0, i1] -> [i1, 0] : i0 <= n and i0 >= 1 and 3i1 <= -1 + i0 and 3i1 >= -3 + i0 } -[n] -> { : } -[n] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/thomasset.st b/polly/lib/External/isl/test_inputs/codegen/cloog/thomasset.st new file mode 100644 index 00000000000..612b650545b --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/thomasset.st @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i, j] : i <= n and i >= 1 and 3j <= -1 + i and 3j >= -3 + i; S2[i, j, 0, p, q] : i <= n and j <= n and j >= 1 and i >= 1 and 3q <= j and 3q >= -2 + j and 3p <= n and 3p >= -2 + n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S2[i0, i1, i2, i3, i4] -> [(i2 + i3 + i4)]; S1[i0, i1] -> [(i1)] }, { S2[i0, i1, i2, i3, i4] -> [(-1 + i0)]; S1[i0, i1] -> [(0)] }]" + options: "[n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/tiling.in b/polly/lib/External/isl/test_inputs/codegen/cloog/tiling.in deleted file mode 100644 index 6f0530f2ba0..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/tiling.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S1[ii, i] -> [ii, i, 0] : i >= 0 and i <= n and i <= 9 + 10ii and i >= 10ii } -[n] -> { : n >= 0 } -[n] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/tiling.st b/polly/lib/External/isl/test_inputs/codegen/cloog/tiling.st new file mode 100644 index 00000000000..5e8f0af7662 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/tiling.st @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[ii, i] : i >= 0 and i <= n and i <= 9 + 10ii and i >= 10ii }" +child: + context: "[n] -> { [] : n >= 0 }" + child: + schedule: "[n] -> [{ S1[ii, i] -> [(ii)] }, { S1[ii, i] -> [(i)] }]" + options: "[n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/uday_scalars.c b/polly/lib/External/isl/test_inputs/codegen/cloog/uday_scalars.c index d8002a86d86..7d870a51926 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/uday_scalars.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/uday_scalars.c @@ -1,6 +1,6 @@ { - for (int c2 = 0; c2 <= n; c2 += 1) - S1(c2, 0, 0); - for (int c2 = 0; c2 <= n; c2 += 1) - S2(0, c2, 0); + for (int c0 = 0; c0 <= n; c0 += 1) + S1(c0, 0, 0); + for (int c0 = 0; c0 <= n; c0 += 1) + S2(0, c0, 0); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/uday_scalars.in b/polly/lib/External/isl/test_inputs/codegen/cloog/uday_scalars.in deleted file mode 100644 index ae29bb54f89..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/uday_scalars.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S1[i0, 0, 0] -> [0, 1, i0, 0] : i0 >= 0 and i0 <= n; S2[0, i1, 0] -> [1, 0, i1, 1] : i1 >= 0 and i1 <= n } -[n] -> { : } -[n] -> { [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/uday_scalars.st b/polly/lib/External/isl/test_inputs/codegen/cloog/uday_scalars.st new file mode 100644 index 00000000000..1501e8321a3 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/uday_scalars.st @@ -0,0 +1,13 @@ +domain: "[n] -> { S1[j, 0, 0] : j >= 0 and j <= n; S2[0, l, 0] : l >= 0 and l <= n }" +child: + context: "[n] -> { [] }" + child: + sequence: + - filter: "[n] -> { S1[i0, i1, i2] }" + child: + schedule: "[n] -> [{ S1[i0, i1, i2] -> [(i0)] }]" + options: "[n] -> { separate[i0] }" + - filter: "[n] -> { S2[i0, i1, i2] }" + child: + schedule: "[n] -> [{ S2[i0, i1, i2] -> [(i1)] }]" + options: "[n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/union.in b/polly/lib/External/isl/test_inputs/codegen/cloog/union.in deleted file mode 100644 index 23b6cab9a89..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/union.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S1[i0] -> [i0] : M <= 10 and i0 >= 0 and i0 <= 100; S1[i0] -> [-i0] : M >= 11 and i0 >= 0 and i0 <= 100 } -[M] -> { : M >= 1 or M <= -1 } -[M] -> { [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/union.st b/polly/lib/External/isl/test_inputs/codegen/cloog/union.st new file mode 100644 index 00000000000..c2622dc8690 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/union.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S1[i0] : i0 >= 0 and i0 <= 100 }" +child: + context: "[M] -> { [] : M >= 1 or M <= -1 }" + child: + schedule: "[M] -> [{ S1[i0] -> [(i0)] : M <= 10; S1[i0] -> [(-i0)] : M >= 11 }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/unroll.in b/polly/lib/External/isl/test_inputs/codegen/cloog/unroll.in deleted file mode 100644 index 1e449e0b420..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/unroll.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S1[i] -> [i, 0] : i >= 0 and i <= 10 } -[n] -> { : } -[n] -> { [i, j] -> unroll[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/unroll.st b/polly/lib/External/isl/test_inputs/codegen/cloog/unroll.st new file mode 100644 index 00000000000..8780a633fcd --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/unroll.st @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i] : i >= 0 and i <= 10 }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i] -> [(i)] }]" + options: "[n] -> { unroll[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/unroll2.c b/polly/lib/External/isl/test_inputs/codegen/cloog/unroll2.c index b96ddd73fe2..58f2705c852 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/unroll2.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/unroll2.c @@ -1,6 +1,5 @@ -{ - if (n >= 0 && n <= 9) +if (n >= -1 && n <= 9) { + if (n >= 0) S1(n); - if (n >= -1 && n <= 9) - S1(n + 1); + S1(n + 1); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/unroll2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/unroll2.in deleted file mode 100644 index eb71e075ab3..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/unroll2.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S1[i] -> [i, 0] : i >= n and i <= 1 + n and n <= 9 and i >= 0 } -[n] -> { : } -[n] -> { [i, j] -> unroll[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/unroll2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/unroll2.st new file mode 100644 index 00000000000..32cbb8cb382 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/unroll2.st @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i] : i >= n and i <= 1 + n and n <= 9 and i >= 0 }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i] -> [(i)] }]" + options: "[n] -> { unroll[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/usvd_e_t.in b/polly/lib/External/isl/test_inputs/codegen/cloog/usvd_e_t.in deleted file mode 100644 index feb8f0898bb..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/usvd_e_t.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S19[i0, i1, i2] -> [i0, i1, i2, 18] : i0 >= 8 and i1 >= 1 and i2 <= 0 and i2 >= -10 + i0 and i1 <= -6 + i0; S21[i0, i1, -7 + i0] -> [i0, i1, -7 + i0, 20] : i0 <= 10 and i1 >= 4 and i1 <= 8 and i0 >= 7; S17[i0, i1, -6 + i0] -> [i0, i1, -6 + i0, 16] : i0 >= 7 and i1 >= 4 and i0 <= 10 and i1 <= -2 + i0; S4[i0, i1, -1] -> [i0, i1, -1, 3] : i0 <= 8 and i1 >= 1 and i1 <= -4 + i0; S1[i0, 0, 0] -> [i0, 0, 0, 0] : i0 >= 0 and i0 <= 4; S10[i0, 4, 0] -> [i0, 4, 0, 9] : i0 >= 7 and i0 <= 10; S16[i0, i1, -6 + i0] -> [i0, i1, -6 + i0, 15] : i0 <= 10 and i1 >= 4 and i0 >= 7 and i1 <= -2 + i0; S24[i0, i1, i2] -> [i0, i1, i2, 23] : i0 >= 8 and i1 >= 4 and i1 <= 8 and i2 <= 3 and i2 >= -7 + i0; S23[i0, i1, i2] -> [i0, i1, i2, 22] : i0 <= 9 and i1 >= 4 and i1 <= 8 and i2 >= 0 and i2 <= -7 + i0; S7[i0, i1, 0] -> [i0, i1, 0, 6] : i0 >= 5 and i1 <= 0 and i1 >= -9 + i0; S25[i0, i1, 4] -> [i0, i1, 4, 24] : i0 >= 10 and i0 <= 14 and i1 >= 1 and i1 <= 5; S18[i0, i1, i2] -> [i0, i1, i2, 17] : i0 <= 10 and i1 >= 1 and i2 >= 4 and i2 <= -4 + i0 and i1 <= -5 + i0; S14[i0, i1, i2] -> [i0, i1, i2, 13] : i0 >= 8 and i1 <= 4 and i2 <= 0 and i2 >= -12 + i0 and i1 >= -6 + i0; S6[i0, i1, 0] -> [i0, i1, 0, 5] : i0 <= 8 and i1 >= -4 and i1 <= -9 + i0; S8[i0, i1, 0] -> [i0, i1, 0, 7] : i0 >= 3 and i0 <= 7 and i1 >= 7 and i1 <= 11; S15[i0, i1, i2] -> [i0, i1, i2, 14] : i0 <= 10 and i1 >= 1 and i1 <= 5 and i2 >= 4 and i2 <= -4 + i0; S11[i0, -3 + i0, i2] -> [i0, -3 + i0, i2, 10] : i0 <= 10 and i0 >= 7 and i2 <= 4 and i2 >= -7 + i0; S20[i0, i1, i2] -> [i0, i1, i2, 19] : i0 >= 8 and i1 <= 4 and i2 >= -4 and i2 <= 0 and i1 >= -6 + i0; S12[i0, -2 + i0, i2] -> [i0, -2 + i0, i2, 11] : i0 >= 7 and i0 <= 10 and i2 <= 4 and i2 >= -7 + i0; S9[i0, 4, 0] -> [i0, 4, 0, 8] : i0 >= 7 and i0 <= 10; S22[i0, i1, -7 + i0] -> [i0, i1, -7 + i0, 21] : i0 >= 7 and i1 >= 5 and i1 <= 9 and i0 <= 10; S13[i0, i1, i2] -> [i0, i1, i2, 12] : i0 <= 10 and i1 >= 4 and i2 <= 4 and i2 >= -7 + i0 and i1 <= -4 + i0; S26[i0, i1, 3] -> [i0, i1, 3, 25] : i0 >= 10 and i0 <= 14 and i1 >= 1 and i1 <= 5; S3[i0, 0, 0] -> [i0, 0, 0, 2] : i0 >= 4 and i0 <= 8; S5[i0, i1, 0] -> [i0, i1, 0, 4] : i0 >= 4 and i1 <= 4 and i1 >= -4 + i0; S2[i0, i1, 0] -> [i0, i1, 0, 1] : i0 >= 0 and i0 <= 4 and i1 >= 0 and i1 <= 4 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/usvd_e_t.st b/polly/lib/External/isl/test_inputs/codegen/cloog/usvd_e_t.st new file mode 100644 index 00000000000..64941659872 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/usvd_e_t.st @@ -0,0 +1,34 @@ +domain: "{ S22[i0, i1, -7 + i0] : i0 >= 7 and i1 >= 5 and i1 <= 9 and i0 <= 10; S21[i0, i1, -7 + i0] : i0 <= 10 and i1 >= 4 and i1 <= 8 and i0 >= 7; S4[i0, i1, -1] : i0 <= 8 and i1 >= 1 and i1 <= -4 + i0; S8[i0, i1, 0] : i0 >= 3 and i0 <= 7 and i1 >= 7 and i1 <= 11; S25[i0, i1, 4] : i0 >= 10 and i0 <= 14 and i1 >= 1 and i1 <= 5; S15[i0, i1, i2] : i0 <= 10 and i1 >= 1 and i1 <= 5 and i2 >= 4 and i2 <= -4 + i0; S6[i0, i1, 0] : i0 <= 8 and i1 >= -4 and i1 <= -9 + i0; S16[i0, i1, -6 + i0] : i0 <= 10 and i1 >= 4 and i0 >= 7 and i1 <= -2 + i0; S7[i0, i1, 0] : i0 >= 5 and i1 <= 0 and i1 >= -9 + i0; S1[i0, 0, 0] : i0 >= 0 and i0 <= 4; S2[i0, i1, 0] : i0 >= 0 and i0 <= 4 and i1 >= 0 and i1 <= 4; S26[i0, i1, 3] : i0 >= 10 and i0 <= 14 and i1 >= 1 and i1 <= 5; S10[i0, 4, 0] : i0 >= 7 and i0 <= 10; S12[i0, -2 + i0, i2] : i0 >= 7 and i0 <= 10 and i2 <= 4 and i2 >= -7 + i0; S23[i0, i1, i2] : i0 <= 9 and i1 >= 4 and i1 <= 8 and i2 >= 0 and i2 <= -7 + i0; S13[i0, i1, i2] : i0 <= 10 and i1 >= 4 and i2 <= 4 and i2 >= -7 + i0 and i1 <= -4 + i0; S20[i0, i1, i2] : i0 >= 8 and i1 <= 4 and i2 >= -4 and i2 <= 0 and i1 >= -6 + i0; S24[i0, i1, i2] : i0 >= 8 and i1 >= 4 and i1 <= 8 and i2 <= 3 and i2 >= -7 + i0; S19[i0, i1, i2] : i0 >= 8 and i1 >= 1 and i2 <= 0 and i2 >= -10 + i0 and i1 <= -6 + i0; S11[i0, -3 + i0, i2] : i0 <= 10 and i0 >= 7 and i2 <= 4 and i2 >= -7 + i0; S14[i0, i1, i2] : i0 >= 8 and i1 <= 4 and i2 <= 0 and i2 >= -12 + i0 and i1 >= -6 + i0; S3[i0, 0, 0] : i0 >= 4 and i0 <= 8; S9[i0, 4, 0] : i0 >= 7 and i0 <= 10; S18[i0, i1, i2] : i0 <= 10 and i1 >= 1 and i2 >= 4 and i2 <= -4 + i0 and i1 <= -5 + i0; S5[i0, i1, 0] : i0 >= 4 and i1 <= 4 and i1 >= -4 + i0; S17[i0, i1, -6 + i0] : i0 >= 7 and i1 >= 4 and i0 <= 10 and i1 <= -2 + i0 }" +child: + context: "{ [] }" + child: + schedule: "[{ S8[i0, i1, i2] -> [(i0)]; S21[i0, i1, i2] -> [(i0)]; S9[i0, i1, i2] -> [(i0)]; S10[i0, i1, i2] -> [(i0)]; S24[i0, i1, i2] -> [(i0)]; S15[i0, i1, i2] -> [(i0)]; S12[i0, i1, i2] -> [(i0)]; S7[i0, i1, i2] -> [(i0)]; S6[i0, i1, i2] -> [(i0)]; S23[i0, i1, i2] -> [(i0)]; S22[i0, i1, i2] -> [(i0)]; S16[i0, i1, i2] -> [(i0)]; S17[i0, i1, i2] -> [(i0)]; S25[i0, i1, i2] -> [(i0)]; S18[i0, i1, i2] -> [(i0)]; S26[i0, i1, i2] -> [(i0)]; S5[i0, i1, i2] -> [(i0)]; S2[i0, i1, i2] -> [(i0)]; S4[i0, i1, i2] -> [(i0)]; S13[i0, i1, i2] -> [(i0)]; S3[i0, i1, i2] -> [(i0)]; S14[i0, i1, i2] -> [(i0)]; S19[i0, i1, i2] -> [(i0)]; S20[i0, i1, i2] -> [(i0)]; S11[i0, i1, i2] -> [(i0)]; S1[i0, i1, i2] -> [(i0)] }, { S8[i0, i1, i2] -> [(i1)]; S21[i0, i1, i2] -> [(i1)]; S9[i0, i1, i2] -> [(i1)]; S10[i0, i1, i2] -> [(i1)]; S24[i0, i1, i2] -> [(i1)]; S15[i0, i1, i2] -> [(i1)]; S12[i0, i1, i2] -> [(i1)]; S7[i0, i1, i2] -> [(i1)]; S6[i0, i1, i2] -> [(i1)]; S23[i0, i1, i2] -> [(i1)]; S22[i0, i1, i2] -> [(i1)]; S16[i0, i1, i2] -> [(i1)]; S17[i0, i1, i2] -> [(i1)]; S25[i0, i1, i2] -> [(i1)]; S18[i0, i1, i2] -> [(i1)]; S26[i0, i1, i2] -> [(i1)]; S5[i0, i1, i2] -> [(i1)]; S2[i0, i1, i2] -> [(i1)]; S4[i0, i1, i2] -> [(i1)]; S13[i0, i1, i2] -> [(i1)]; S3[i0, i1, i2] -> [(i1)]; S14[i0, i1, i2] -> [(i1)]; S19[i0, i1, i2] -> [(i1)]; S20[i0, i1, i2] -> [(i1)]; S11[i0, i1, i2] -> [(i1)]; S1[i0, i1, i2] -> [(i1)] }, { S8[i0, i1, i2] -> [(i2)]; S21[i0, i1, i2] -> [(i2)]; S9[i0, i1, i2] -> [(i2)]; S10[i0, i1, i2] -> [(i2)]; S24[i0, i1, i2] -> [(i2)]; S15[i0, i1, i2] -> [(i2)]; S12[i0, i1, i2] -> [(i2)]; S7[i0, i1, i2] -> [(i2)]; S6[i0, i1, i2] -> [(i2)]; S23[i0, i1, i2] -> [(i2)]; S22[i0, i1, i2] -> [(i2)]; S16[i0, i1, i2] -> [(i2)]; S17[i0, i1, i2] -> [(i2)]; S25[i0, i1, i2] -> [(i2)]; S18[i0, i1, i2] -> [(i2)]; S26[i0, i1, i2] -> [(i2)]; S5[i0, i1, i2] -> [(i2)]; S2[i0, i1, i2] -> [(i2)]; S4[i0, i1, i2] -> [(i2)]; S13[i0, i1, i2] -> [(i2)]; S3[i0, i1, i2] -> [(i2)]; S14[i0, i1, i2] -> [(i2)]; S19[i0, i1, i2] -> [(i2)]; S20[i0, i1, i2] -> [(i2)]; S11[i0, i1, i2] -> [(i2)]; S1[i0, i1, i2] -> [(i2)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1, i2] }" + - filter: "{ S2[i0, i1, i2] }" + - filter: "{ S3[i0, i1, i2] }" + - filter: "{ S4[i0, i1, i2] }" + - filter: "{ S5[i0, i1, i2] }" + - filter: "{ S6[i0, i1, i2] }" + - filter: "{ S7[i0, i1, i2] }" + - filter: "{ S8[i0, i1, i2] }" + - filter: "{ S9[i0, i1, i2] }" + - filter: "{ S10[i0, i1, i2] }" + - filter: "{ S11[i0, i1, i2] }" + - filter: "{ S12[i0, i1, i2] }" + - filter: "{ S13[i0, i1, i2] }" + - filter: "{ S14[i0, i1, i2] }" + - filter: "{ S15[i0, i1, i2] }" + - filter: "{ S16[i0, i1, i2] }" + - filter: "{ S17[i0, i1, i2] }" + - filter: "{ S18[i0, i1, i2] }" + - filter: "{ S19[i0, i1, i2] }" + - filter: "{ S20[i0, i1, i2] }" + - filter: "{ S21[i0, i1, i2] }" + - filter: "{ S22[i0, i1, i2] }" + - filter: "{ S23[i0, i1, i2] }" + - filter: "{ S24[i0, i1, i2] }" + - filter: "{ S25[i0, i1, i2] }" + - filter: "{ S26[i0, i1, i2] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/vasilache.c b/polly/lib/External/isl/test_inputs/codegen/cloog/vasilache.c index c6d32ca637b..7dfadcf0c4e 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/vasilache.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/vasilache.c @@ -1,23 +1,23 @@ { S1(); S2(); - for (int c1 = 0; c1 < N; c1 += 1) - for (int c3 = 0; c3 < N; c3 += 1) { - S4(c1, c3); - S5(c1, c3); + for (int c0 = 0; c0 < N; c0 += 1) + for (int c1 = 0; c1 < N; c1 += 1) { + S4(c0, c1); + S5(c0, c1); } - for (int c1 = 0; c1 < N; c1 += 1) - for (int c3 = 0; c3 < N; c3 += 1) - for (int c5 = 0; c5 <= (N - 1) / 32; c5 += 1) { - S7(c1, c3, c5, 32 * c5); - for (int c7 = 32 * c5 + 1; c7 <= min(N - 1, 32 * c5 + 31); c7 += 1) { - S6(c1, c3, c5, c7 - 1); - S7(c1, c3, c5, c7); + for (int c0 = 0; c0 < N; c0 += 1) + for (int c1 = 0; c1 < N; c1 += 1) + for (int c2 = 0; c2 <= (N - 1) / 32; c2 += 1) { + S7(c0, c1, c2, 32 * c2); + for (int c3 = 32 * c2 + 1; c3 <= min(N - 1, 32 * c2 + 31); c3 += 1) { + S6(c0, c1, c2, c3 - 1); + S7(c0, c1, c2, c3); } - if (32 * c5 + 31 >= N) { - S6(c1, c3, c5, N - 1); + if (32 * c2 + 31 >= N) { + S6(c0, c1, c2, N - 1); } else - S6(c1, c3, c5, 32 * c5 + 31); + S6(c0, c1, c2, 32 * c2 + 31); } S8(); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/vasilache.in b/polly/lib/External/isl/test_inputs/codegen/cloog/vasilache.in deleted file mode 100644 index a9b9860fd2b..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/vasilache.in +++ /dev/null @@ -1,3 +0,0 @@ -[M, N] -> { S4[i0, i1] -> [3, i0, 0, i1, 0, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S1[] -> [0, 0, 0, 0, 0, 0, 0, 0, 0]; S6[i0, i1, i2, i3] -> [4, i0, 0, i1, 0, i2, 0, 1 + i3, 0] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N and i3 >= 0 and i3 <= -1 + N and i3 >= 32i2 and i3 <= 31 + 32i2; S7[i0, i1, i2, i3] -> [4, i0, 0, i1, 0, i2, 0, i3, 1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N and i3 >= 0 and i3 <= -1 + N and i3 >= 32i2 and i3 <= 31 + 32i2; S5[i0, i1] -> [3, i0, 0, i1, 1, 0, 0, 0, 0] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S2[] -> [1, 0, 0, 0, 0, 0, 0, 0, 0]; S8[] -> [5, 0, 0, 0, 0, 0, 0, 0, 0]; S3[] -> [2, 0, 0, 0, 0, 0, 0, 0, 0] : M >= 79 } -[M, N] -> { : M <= 3 and N >= 100 } -[M, N] -> { [i, j, k, l, m, n, o, p, q] -> separate[x] : x >= 7 } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/vasilache.st b/polly/lib/External/isl/test_inputs/codegen/cloog/vasilache.st new file mode 100644 index 00000000000..f0cd320bbe8 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/vasilache.st @@ -0,0 +1,37 @@ +domain: "[M, N] -> { S5[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S8[]; S2[]; S7[i0, i1, i2, i3] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N and i3 >= 0 and i3 <= -1 + N and i3 >= 32i2 and i3 <= 31 + 32i2; S4[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N; S1[]; S3[] : M >= 79; S6[i0, i1, i2, i3] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <= -1 + N and i3 >= 0 and i3 <= -1 + N and i3 >= 32i2 and i3 <= 31 + 32i2 }" +child: + context: "[M, N] -> { [] : M <= 3 and N >= 100 }" + child: + sequence: + - filter: "[M, N] -> { S1[] }" + - filter: "[M, N] -> { S2[] }" + - filter: "[M, N] -> { S3[] }" + - filter: "[M, N] -> { S5[i0, i1]; S4[i0, i1] }" + child: + schedule: "[M, N] -> [{ S5[i0, i1] -> [(i0)]; S4[i0, i1] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S5[i0, i1] -> [(i1)]; S4[i0, i1] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S4[i0, i1] }" + - filter: "[M, N] -> { S5[i0, i1] }" + - filter: "[M, N] -> { S7[i0, i1, i2, i3]; S6[i0, i1, i2, i3] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2, i3] -> [(i0)]; S6[i0, i1, i2, i3] -> [(i0)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2, i3] -> [(i1)]; S6[i0, i1, i2, i3] -> [(i1)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2, i3] -> [(i2)]; S6[i0, i1, i2, i3] -> [(i2)] }]" + options: "[M, N] -> { separate[i0] }" + child: + schedule: "[M, N] -> [{ S7[i0, i1, i2, i3] -> [(i3)]; S6[i0, i1, i2, i3] -> [(1 + i3)] }]" + options: "[M, N] -> { separate[i0] }" + child: + sequence: + - filter: "[M, N] -> { S6[i0, i1, i2, i3] }" + - filter: "[M, N] -> { S7[i0, i1, i2, i3] }" + - filter: "[M, N] -> { S8[] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/vivien.c b/polly/lib/External/isl/test_inputs/codegen/cloog/vivien.c index c4bd08b673a..ab0854a772e 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/vivien.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/vivien.c @@ -2,50 +2,52 @@ for (int c0 = -27 * n + 2; c0 <= 1; c0 += 1) S1(c0 - 1); for (int c0 = 2; c0 <= min(2 * n, n + 29); c0 += 1) { - if (c0 >= 3 && 2 * n >= c0 + 1) { - S4(c0 - c0 / 2 - 1, c0 / 2 + 1); - if (c0 >= 5 && 2 * n >= c0 + 3) { - S4(c0 - c0 / 2 - 2, c0 / 2 + 2); - for (int c2 = 1; c2 < c0 - c0 / 2 - 1; c2 += 1) - S5(c0 - c0 / 2 - 1, c0 / 2 + 1, c2); + if (c0 >= 3) { + if (2 * n >= c0 + 1) { + S4(c0 - c0 / 2 - 1, c0 / 2 + 1); + if (c0 + 2 >= 2 * n) { + for (int c2 = 1; c2 < -n + c0; c2 += 1) + S5(-n + c0, n, c2); + } else if (c0 >= 5) { + S4(c0 - c0 / 2 - 2, c0 / 2 + 2); + for (int c2 = 1; c2 < c0 - c0 / 2 - 1; c2 += 1) + S5(c0 - c0 / 2 - 1, c0 / 2 + 1, c2); + } } - } - for (int c1 = -c0 + c0 / 2 + 3; c1 <= min(-1, n - c0); c1 += 1) { - S4(-c1, c0 + c1); - S6(-c1 + 2, c0 + c1 - 2); - for (int c2 = 1; c2 <= -c1; c2 += 1) - S5(-c1 + 1, c0 + c1 - 1, c2); - } - if (c0 >= 3 && n + 1 >= c0 && c0 <= 4) { - S1(c0 - 1); - } else if (c0 >= 5 && n + 1 >= c0) { - S6(2, c0 - 2); - S1(c0 - 1); - } - if (n >= 2 && c0 == n + 1) { - S6(1, n); - } else if (2 * n >= c0 + 3 && c0 >= n + 2) { - S6(-n + c0 + 1, n - 1); - for (int c2 = 1; c2 < -n + c0; c2 += 1) - S5(-n + c0, n, c2); - } - if (2 * n >= c0 + 1 && c0 + 2 >= 2 * n) - for (int c2 = 1; c2 < -n + c0; c2 += 1) - S5(-n + c0, n, c2); - if (c0 >= n + 3 && 2 * n >= c0 + 1) { - S6(-n + c0, n); - } else if (c0 >= 3 && n >= c0) { - S6(1, c0 - 1); - } else if (c0 == 2) { + for (int c1 = -c0 + c0 / 2 + 3; c1 <= min(-1, n - c0); c1 += 1) { + S4(-c1, c0 + c1); + S6(-c1 + 2, c0 + c1 - 2); + for (int c2 = 1; c2 <= -c1; c2 += 1) + S5(-c1 + 1, c0 + c1 - 1, c2); + } + if (2 * n >= c0 + 3 && c0 >= n + 2) { + S6(-n + c0 + 1, n - 1); + for (int c2 = 1; c2 < -n + c0; c2 += 1) + S5(-n + c0, n, c2); + } + if (n >= 3 && c0 == n + 2) { + S6(2, n); + S1(n + 1); + } else { + if (c0 >= n + 3 && 2 * n >= c0 + 1) + S6(-n + c0, n); + if (c0 >= n + 3) { + S1(c0 - 1); + } else { + if (n + 1 >= c0 && c0 <= 4) { + S1(c0 - 1); + } else if (c0 >= 5 && n + 1 >= c0) { + S6(2, c0 - 2); + S1(c0 - 1); + } + if (n + 1 >= c0) + S6(1, c0 - 1); + } + } + if (n == 2 && c0 == 4) + S1(3); + } else S1(1); - } else if (n >= 3 && c0 == n + 2) { - S6(2, n); - S1(n + 1); - } - if (c0 >= n + 3) - S1(c0 - 1); - if (n == 2 && c0 == 4) - S1(3); if (c0 % 2 == 0) S3(c0 / 2); for (int c1 = max(1, -n + c0); c1 < (c0 + 1) / 2; c1 += 1) diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/vivien.in b/polly/lib/External/isl/test_inputs/codegen/cloog/vivien.in deleted file mode 100644 index b591ef35976..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/vivien.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S6[i0, i1] -> [2i0 + 2i1, 2 - i0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S2[i0, i1] -> [1 + 2i0 + 2i1, i1, 0] : 29i1 >= 1 - i0 and i0 <= n and i1 >= 1 and i1 <= -1 + i0; S1[i0] -> [2 + 2i0, 0, 0] : i0 >= 1 - 27n and i0 <= 28 + n; S4[i0, i1] -> [2i0 + 2i1, -i0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S3[i0] -> [1 + 4i0, 0, 0] : i0 >= 1 and i0 <= n; S5[i0, i1, i2] -> [2i0 + 2i1, 1 - i0, i2] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 and i2 <= -1 + i0 } -[n] -> { : } -[n] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/vivien.st b/polly/lib/External/isl/test_inputs/codegen/cloog/vivien.st new file mode 100644 index 00000000000..681b170cbc1 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/vivien.st @@ -0,0 +1,6 @@ +domain: "[n] -> { S2[i, j] : 29j >= 1 - i and i <= n and j >= 1 and j <= -1 + i; S1[i] : i >= 1 - 27n and i <= 28 + n; S4[i, j] : i >= 1 and i <= n and j >= 1 + i and j <= n; S5[i, j, k] : i >= 1 and i <= n and j >= 1 + i and j <= n and k >= 1 and k <= -1 + i; S6[i, j] : i >= 1 and i <= n and j >= 1 + i and j <= n; S3[i] : i >= 1 and i <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S1[i0] -> [(2 + 2i0)]; S4[i0, i1] -> [(2i0 + 2i1)]; S6[i0, i1] -> [(2i0 + 2i1)]; S3[i0] -> [(1 + 4i0)]; S5[i0, i1, i2] -> [(2i0 + 2i1)]; S2[i0, i1] -> [(1 + 2i0 + 2i1)] }, { S1[i0] -> [(0)]; S4[i0, i1] -> [(-i0)]; S6[i0, i1] -> [(2 - i0)]; S3[i0] -> [(0)]; S5[i0, i1, i2] -> [(1 - i0)]; S2[i0, i1] -> [(i1)] }, { S1[i0] -> [(0)]; S4[i0, i1] -> [(0)]; S6[i0, i1] -> [(0)]; S3[i0] -> [(0)]; S5[i0, i1, i2] -> [(i2)]; S2[i0, i1] -> [(0)] }]" + options: "[n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/vivien2.c b/polly/lib/External/isl/test_inputs/codegen/cloog/vivien2.c index 57fc55e6a6d..48be9ad97b3 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/vivien2.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/vivien2.c @@ -9,40 +9,38 @@ for (int c2 = 1; c2 < c0 - c0 / 2 - 1; c2 += 1) S5(c0 - c0 / 2 - 1, c0 / 2 + 1, c2); } - } - for (int c1 = -c0 + c0 / 2 + 3; c1 <= min(-1, n - c0); c1 += 1) { - S4(-c1, c0 + c1); - S6(-c1 + 2, c0 + c1 - 2); - for (int c2 = 1; c2 <= -c1; c2 += 1) - S5(-c1 + 1, c0 + c1 - 1, c2); - } - if (c0 >= 5 && n + 1 >= c0) { - S6(2, c0 - 2); - S1(c0 - 1); - if (c0 == n + 1) - S6(1, n); - } else if (c0 == 2) { - S1(1); - } else if (2 * n >= c0 + 3 && c0 >= n + 2) { - S6(-n + c0 + 1, n - 1); - for (int c2 = 1; c2 < -n + c0; c2 += 1) - S5(-n + c0, n, c2); - } else if (c0 <= 4) - S1(c0 - 1); - if (c0 >= 3 && n >= c0) { - S6(1, c0 - 1); - } else { - if (c0 + 2 >= 2 * n) + for (int c1 = -c0 + c0 / 2 + 3; c1 <= min(-1, n - c0); c1 += 1) { + S4(-c1, c0 + c1); + S6(-c1 + 2, c0 + c1 - 2); + for (int c2 = 1; c2 <= -c1; c2 += 1) + S5(-c1 + 1, c0 + c1 - 1, c2); + } + if (2 * n >= c0 + 3 && c0 >= n + 2) { + S6(-n + c0 + 1, n - 1); + for (int c2 = 1; c2 < -n + c0; c2 += 1) + S5(-n + c0, n, c2); + if (c0 == n + 2) { + S6(2, n); + S1(n + 1); + } + } 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); - } else if (c0 == n + 2) { - S6(2, n); - S1(n + 1); + } else { + if (c0 <= 4) { + S1(c0 - 1); + } else if (n + 1 >= c0) { + S6(2, c0 - 2); + S1(c0 - 1); + } + if (n + 1 >= c0) + S6(1, c0 - 1); } - } + } else + S1(1); if (c0 % 2 == 0) S3(c0 / 2); for (int c1 = max(1, -n + c0); c1 < (c0 + 1) / 2; c1 += 1) diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/vivien2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/vivien2.in deleted file mode 100644 index d8b1b1a007b..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/vivien2.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S6[i0, i1] -> [2i0 + 2i1, 2 - i0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S2[i0, i1] -> [1 + 2i0 + 2i1, i1, 0] : 29i1 >= 1 - i0 and i0 <= n and i1 >= 1 and i1 <= -1 + i0; S1[i0] -> [2 + 2i0, 0, 0] : i0 >= 1 - 27n and i0 <= 28 + n; S4[i0, i1] -> [2i0 + 2i1, -i0, 0] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n; S3[i0] -> [1 + 4i0, 0, 0] : i0 >= 1 and i0 <= n; S5[i0, i1, i2] -> [2i0 + 2i1, 1 - i0, i2] : i0 >= 1 and i0 <= n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 and i2 <= -1 + i0 } -[n] -> { : n >= 30 } -[n] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/vivien2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/vivien2.st new file mode 100644 index 00000000000..932fbc2ba2a --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/vivien2.st @@ -0,0 +1,6 @@ +domain: "[n] -> { S2[i, j] : 29j >= 1 - i and i <= n and j >= 1 and j <= -1 + i; S1[i] : i >= 1 - 27n and i <= 28 + n; S4[i, j] : i >= 1 and i <= n and j >= 1 + i and j <= n; S5[i, j, k] : i >= 1 and i <= n and j >= 1 + i and j <= n and k >= 1 and k <= -1 + i; S6[i, j] : i >= 1 and i <= n and j >= 1 + i and j <= n; S3[i] : i >= 1 and i <= n }" +child: + context: "[n] -> { [] : n >= 30 }" + child: + schedule: "[n] -> [{ S1[i0] -> [(2 + 2i0)]; S4[i0, i1] -> [(2i0 + 2i1)]; S6[i0, i1] -> [(2i0 + 2i1)]; S3[i0] -> [(1 + 4i0)]; S5[i0, i1, i2] -> [(2i0 + 2i1)]; S2[i0, i1] -> [(1 + 2i0 + 2i1)] }, { S1[i0] -> [(0)]; S4[i0, i1] -> [(-i0)]; S6[i0, i1] -> [(2 - i0)]; S3[i0] -> [(0)]; S5[i0, i1, i2] -> [(1 - i0)]; S2[i0, i1] -> [(i1)] }, { S1[i0] -> [(0)]; S4[i0, i1] -> [(0)]; S6[i0, i1] -> [(0)]; S3[i0] -> [(0)]; S5[i0, i1, i2] -> [(i2)]; S2[i0, i1] -> [(0)] }]" + options: "[n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/walters.in b/polly/lib/External/isl/test_inputs/codegen/cloog/walters.in deleted file mode 100644 index 6e2645147e6..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/walters.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S2[i, div36, div37, div38] -> [i, div36, k, div38, 1] : 3div37 = 2 + i and 3k = 2 + i and i >= 1 and i <= 10 and 3div36 >= -2 + i and 3div38 <= 1 + i and 3div38 >= -1 + i and 3div36 <= i; S1[i, div36, div37, div38] -> [i, j, div37, div38, 0] : 3j = i and 3div36 = i and i >= 3 and i <= 10 and 3div37 >= i and 3div38 <= 1 + i and 3div37 <= 2 + i and 3div38 >= -1 + i; S3[i, div36, div37, div38] -> [i, div36, div37, l, 2] : 3l = 1 + i and 3div38 = 1 + i and i <= 10 and i >= 2 and 3div36 >= -2 + i and 3div37 <= 2 + i and 3div36 <= i and 3div37 >= i; S4[i, div36, div37, div38] -> [i, div36, div37, div38, 3] : i >= 1 and i <= 10 and 3div36 <= i and 3div36 >= -2 + i and 3div37 <= 2 + i and 3div37 >= i and 3div38 <= 1 + i and 3div38 >= -1 + i } -{ : } -{ [i, j, k, l, m] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/walters.st b/polly/lib/External/isl/test_inputs/codegen/cloog/walters.st new file mode 100644 index 00000000000..f168c99615e --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/walters.st @@ -0,0 +1,12 @@ +domain: "{ S2[i, div36, div37, div38] : 3div37 = 2 + i and i >= 1 and i <= 10 and 3div36 >= -2 + i and 3div38 <= 1 + i and 3div38 >= -1 + i and 3div36 <= i; S4[i, div36, div37, div38] : i >= 1 and i <= 10 and 3div36 <= i and 3div36 >= -2 + i and 3div37 <= 2 + i and 3div37 >= i and 3div38 <= 1 + i and 3div38 >= -1 + i; S1[i, div36, div37, div38] : 3div36 = i and i >= 3 and i <= 10 and 3div37 >= i and 3div38 <= 1 + i and 3div37 <= 2 + i and 3div38 >= -1 + i; S3[i, div36, div37, div38] : 3div38 = 1 + i and i <= 10 and i >= 2 and 3div36 >= -2 + i and 3div37 <= 2 + i and 3div36 <= i and 3div37 >= i }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[i, div36, div37, div38] -> [(i)]; S4[i, div36, div37, div38] -> [(i)]; S3[i, div36, div37, div38] -> [(i)]; S2[i, div36, div37, div38] -> [(i)] }, { S1[i, div36, div37, div38] -> [(div36)]; S4[i, div36, div37, div38] -> [(div36)]; S3[i, div36, div37, div38] -> [(div36)]; S2[i, div36, div37, div38] -> [(div36)] }, { S1[i, div36, div37, div38] -> [(div37)]; S4[i, div36, div37, div38] -> [(div37)]; S3[i, div36, div37, div38] -> [(div37)]; S2[i, div36, div37, div38] -> [(div37)] }, { S1[i, div36, div37, div38] -> [(div38)]; S4[i, div36, div37, div38] -> [(div38)]; S3[i, div36, div37, div38] -> [(div38)]; S2[i, div36, div37, div38] -> [(div38)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i, div36, div37, div38] }" + - filter: "{ S2[i, div36, div37, div38] }" + - filter: "{ S3[i, div36, div37, div38] }" + - filter: "{ S4[i, div36, div37, div38] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/walters2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/walters2.in deleted file mode 100644 index ea01a10a336..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/walters2.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[j, i] -> [j, i, 0] : j >= 1 and j <= 24 and i >= 1 and i <= 50; S2[j, 51] -> [j, 51, 1] : j >= 1 and j <= 24; S2[25, i] -> [25, i, 1] : i >= 1 and i <= 51; S2[0, i] -> [0, i, 1] : i >= 0 and i <= 51; S2[j, 0] -> [j, 0, 1] : j >= 1 and j <= 25 } -{ : } -{ [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/walters2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/walters2.st new file mode 100644 index 00000000000..5caba80ab20 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/walters2.st @@ -0,0 +1,10 @@ +domain: "{ S2[j, 51] : j <= 24 and j >= 1; S2[25, i] : i <= 51 and i >= 1; S2[j, 0] : j <= 25 and j >= 1; S2[0, i] : i <= 51 and i >= 0; S1[j, i] : j >= 1 and j <= 24 and i >= 1 and i <= 50 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[j, i] -> [(j)]; S2[j, i] -> [(j)] }, { S1[j, i] -> [(i)]; S2[j, i] -> [(i)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[j, i] }" + - filter: "{ S2[j, i] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/walters3.in b/polly/lib/External/isl/test_inputs/codegen/cloog/walters3.in deleted file mode 100644 index 802bd4f0435..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/walters3.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S2[j, a, b] -> [j, j', b, 1] : 2a = j and 2j' = j and j >= 1 and j <= 10 and 2b <= j and 2b >= -1 + j; S1[j, a, b] -> [j, j', k, 0] : 2a = j and 2j' = j and 2k = j and 2b = j and j <= 8 and j >= 2 } -{ : } -{ [i, j, k, l] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/walters3.st b/polly/lib/External/isl/test_inputs/codegen/cloog/walters3.st new file mode 100644 index 00000000000..1a1427351df --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/walters3.st @@ -0,0 +1,10 @@ +domain: "{ S2[j, a, b] : 2a = j and j >= 1 and j <= 10 and 2b <= j and 2b >= -1 + j; S1[j, a, b] : 2a = j and 2b = j and j <= 8 and j >= 2 }" +child: + context: "{ [] }" + child: + schedule: "[{ S1[j, a, b] -> [(j)]; S2[j, a, b] -> [(j)] }, { S1[j, a, b] -> [(a)]; S2[j, a, b] -> [(a)] }, { S1[j, a, b] -> [(b)]; S2[j, a, b] -> [(b)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[j, a, b] }" + - filter: "{ S2[j, a, b] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/wavefront.in b/polly/lib/External/isl/test_inputs/codegen/cloog/wavefront.in deleted file mode 100644 index 61618c37a45..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/wavefront.in +++ /dev/null @@ -1,3 +0,0 @@ -[n, m] -> { S1[i0, i1] -> [i0 + i1, i0] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= m } -[n, m] -> { : } -[n, m] -> { [i, j] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/wavefront.st b/polly/lib/External/isl/test_inputs/codegen/cloog/wavefront.st new file mode 100644 index 00000000000..b31e0de4a34 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/wavefront.st @@ -0,0 +1,6 @@ +domain: "[n, m] -> { S1[i0, i1] : i0 >= 1 and i0 <= n and i1 >= 1 and i1 <= m }" +child: + context: "[n, m] -> { [] }" + child: + schedule: "[n, m] -> [{ S1[i0, i1] -> [(i0 + i1)] }, { S1[i0, i1] -> [(i0)] }]" + options: "[n, m] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/yosr.c b/polly/lib/External/isl/test_inputs/codegen/cloog/yosr.c index 93792b2fa34..b9a4aa111a1 100644 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/yosr.c +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/yosr.c @@ -1,7 +1,12 @@ -for (int c0 = 1; c0 <= n; c0 += 1) { - for (int c2 = c0 + 1; c2 <= n; c2 += 1) - S1(c0, c2); - for (int c1 = 1; c1 < c0; c1 += 1) +{ + for (int c0 = 1; c0 < n; c0 += 1) { + for (int c1 = 1; c1 < c0; c1 += 1) + for (int c2 = c1 + 1; c2 <= n; c2 += 1) + S2(c1, c2, c0); + for (int c2 = c0 + 1; c2 <= n; c2 += 1) + S1(c0, c2); + } + for (int c1 = 1; c1 < n; c1 += 1) for (int c2 = c1 + 1; c2 <= n; c2 += 1) - S2(c1, c2, c0); + S2(c1, c2, n); } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/yosr.in b/polly/lib/External/isl/test_inputs/codegen/cloog/yosr.in deleted file mode 100644 index dcc93e5a69e..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/yosr.in +++ /dev/null @@ -1,3 +0,0 @@ -[n] -> { S2[i0, i1, i2] -> [i2] : i0 >= 1 and i0 <= -1 + n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 + i0 and i2 <= n; S1[i0, i1] -> [i0] : i0 >= 1 and i0 <= -1 + n and i1 >= 1 + i0 and i1 <= n } -[n] -> { : } -[n] -> { [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/yosr.st b/polly/lib/External/isl/test_inputs/codegen/cloog/yosr.st new file mode 100644 index 00000000000..3ad429747be --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/yosr.st @@ -0,0 +1,6 @@ +domain: "[n] -> { S1[i0, i1] : i0 >= 1 and i0 <= -1 + n and i1 >= 1 + i0 and i1 <= n; S2[i0, i1, i2] : i0 >= 1 and i0 <= -1 + n and i1 >= 1 + i0 and i1 <= n and i2 >= 1 + i0 and i2 <= n }" +child: + context: "[n] -> { [] }" + child: + schedule: "[n] -> [{ S2[i0, i1, i2] -> [(i2)]; S1[i0, i1] -> [(i0)] }]" + options: "[n] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/yosr2.in b/polly/lib/External/isl/test_inputs/codegen/cloog/yosr2.in deleted file mode 100644 index a07e1492b1c..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/yosr2.in +++ /dev/null @@ -1,3 +0,0 @@ -[M] -> { S3[i0, i1, i2] -> [i0] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 and i2 <= -1 + i0; S4[i0, i1] -> [i1] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S1[i0, i1] -> [i0] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0; S2[i0] -> [0] : i0 >= 1 and i0 <= M } -[M] -> { : M >= 2 } -[M] -> { [i] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/yosr2.st b/polly/lib/External/isl/test_inputs/codegen/cloog/yosr2.st new file mode 100644 index 00000000000..eb1ab41653f --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/yosr2.st @@ -0,0 +1,6 @@ +domain: "[M] -> { S4[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M; S3[i0, i1, i2] : i0 >= 1 and i0 <= M and i1 >= 1 + i0 and i1 <= M and i2 >= 1 and i2 <= -1 + i0; S1[i0, i1] : i0 >= 1 and i0 <= M and i1 >= 1 and i1 <= -1 + i0; S2[i0] : i0 >= 1 and i0 <= M }" +child: + context: "[M] -> { [] : M >= 2 }" + child: + schedule: "[M] -> [{ S2[i0] -> [(0)]; S1[i0, i1] -> [(i0)]; S4[i0, i1] -> [(i1)]; S3[i0, i1, i2] -> [(i0)] }]" + options: "[M] -> { separate[i0] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/youcef.in b/polly/lib/External/isl/test_inputs/codegen/cloog/youcef.in deleted file mode 100644 index 5164abe2874..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/youcef.in +++ /dev/null @@ -1,3 +0,0 @@ -{ S1[i0, i0] -> [i0, i0, 0] : i0 >= 0 and i0 <= 5; S2[i0, i1] -> [i0, i1, 1] : i0 >= 0 and i0 <= 5 and i1 >= i0 and i1 <= 5; S3[i0, 5] -> [i0, 5, 2] : i0 >= 0 and i0 <= 5 } -{ : } -{ [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/youcef.st b/polly/lib/External/isl/test_inputs/codegen/cloog/youcef.st new file mode 100644 index 00000000000..fa7cbda5a3e --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/youcef.st @@ -0,0 +1,11 @@ +domain: "{ S2[i0, i1] : i0 >= 0 and i0 <= 5 and i1 >= i0 and i1 <= 5; S1[i0, i0] : i0 >= 0 and i0 <= 5; S3[i0, 5] : i0 >= 0 and i0 <= 5 }" +child: + context: "{ [] }" + child: + schedule: "[{ S3[i0, i1] -> [(i0)]; S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)] }, { S3[i0, i1] -> [(i1)]; S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)] }]" + options: "{ separate[i0] }" + child: + sequence: + - filter: "{ S1[i0, i1] }" + - filter: "{ S2[i0, i1] }" + - filter: "{ S3[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/youcefn.in b/polly/lib/External/isl/test_inputs/codegen/cloog/youcefn.in deleted file mode 100644 index b21e30d7fa7..00000000000 --- a/polly/lib/External/isl/test_inputs/codegen/cloog/youcefn.in +++ /dev/null @@ -1,3 +0,0 @@ -[n, m] -> { S3[i0, n] -> [i0, n, 2] : i0 >= 1 and i0 <= m; S2[i0, i1] -> [i0, i1, 1] : i0 >= 1 and i0 <= n and i1 >= i0 and i1 <= n; S1[i0, i0] -> [i0, i0, 0] : i0 >= 1 and i0 <= n } -[n, m] -> { : n >= 2 and m >= n } -[n, m] -> { [i, j, k] -> separate[o0] } diff --git a/polly/lib/External/isl/test_inputs/codegen/cloog/youcefn.st b/polly/lib/External/isl/test_inputs/codegen/cloog/youcefn.st new file mode 100644 index 00000000000..9405c655639 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/cloog/youcefn.st @@ -0,0 +1,11 @@ +domain: "[n, m] -> { S1[i0, i0] : i0 >= 1 and i0 <= n; S3[i0, n] : i0 >= 1 and i0 <= m; S2[i0, i1] : i0 >= 1 and i0 <= n and i1 >= i0 and i1 <= n }" +child: + context: "[n, m] -> { [] : n >= 2 and m >= n }" + child: + schedule: "[n, m] -> [{ S1[i0, i1] -> [(i0)]; S2[i0, i1] -> [(i0)]; S3[i0, i1] -> [(i0)] }, { S1[i0, i1] -> [(i1)]; S2[i0, i1] -> [(i1)]; S3[i0, i1] -> [(i1)] }]" + options: "[n, m] -> { separate[i0] }" + child: + sequence: + - filter: "[n, m] -> { S1[i0, i1] }" + - filter: "[n, m] -> { S2[i0, i1] }" + - filter: "[n, m] -> { S3[i0, i1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/component0.c b/polly/lib/External/isl/test_inputs/codegen/component0.c new file mode 100644 index 00000000000..9b1c6850984 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component0.c @@ -0,0 +1,5 @@ +{ + A(); + for (int c0 = 0; c0 <= 9; c0 += 1) + B(c0); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/component0.st b/polly/lib/External/isl/test_inputs/codegen/component0.st new file mode 100644 index 00000000000..3483af042b9 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component0.st @@ -0,0 +1,3 @@ +domain: "{ A[]; B[i] : 0 <= i < 10 }" +child: + schedule: "[{ A[] -> [0]; B[i] -> [i] }]" diff --git a/polly/lib/External/isl/test_inputs/codegen/component1.c b/polly/lib/External/isl/test_inputs/codegen/component1.c new file mode 100644 index 00000000000..9b1c6850984 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component1.c @@ -0,0 +1,5 @@ +{ + A(); + for (int c0 = 0; c0 <= 9; c0 += 1) + B(c0); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/component1.st b/polly/lib/External/isl/test_inputs/codegen/component1.st new file mode 100644 index 00000000000..87c5eeb18d8 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component1.st @@ -0,0 +1,7 @@ +domain: "{ A[]; B[i] : 0 <= i < 10 }" +child: + schedule: "[{ A[] -> [0]; B[i] -> [i] }]" + child: + sequence: + - filter: "{ A[] }" + - filter: "{ B[i] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/component2.c b/polly/lib/External/isl/test_inputs/codegen/component2.c new file mode 100644 index 00000000000..c963c7ae993 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component2.c @@ -0,0 +1,5 @@ +for (int c0 = 0; c0 <= 9; c0 += 1) { + B(c0); + if (c0 == 0) + A(); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/component2.st b/polly/lib/External/isl/test_inputs/codegen/component2.st new file mode 100644 index 00000000000..70acba4e0c7 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component2.st @@ -0,0 +1,7 @@ +domain: "{ A[]; B[i] : 0 <= i < 10 }" +child: + schedule: "[{ A[] -> [0]; B[i] -> [i] }]" + child: + sequence: + - filter: "{ B[i] }" + - filter: "{ A[] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/component3.c b/polly/lib/External/isl/test_inputs/codegen/component3.c new file mode 100644 index 00000000000..9b1c6850984 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component3.c @@ -0,0 +1,5 @@ +{ + A(); + for (int c0 = 0; c0 <= 9; c0 += 1) + B(c0); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/component3.st b/polly/lib/External/isl/test_inputs/codegen/component3.st new file mode 100644 index 00000000000..c0bb65b04aa --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component3.st @@ -0,0 +1,7 @@ +domain: "{ A[]; B[i] : 0 <= i < 10 }" +child: + schedule: "[{ A[] -> [0]; B[i] -> [i] }]" + child: + set: + - filter: "{ B[i] }" + - filter: "{ A[] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/component4.c b/polly/lib/External/isl/test_inputs/codegen/component4.c new file mode 100644 index 00000000000..1f188dd0128 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component4.c @@ -0,0 +1,7 @@ +{ + for (int c1 = 0; c1 <= 9; c1 += 1) + A(c1); + for (int c0 = 0; c0 <= 9; c0 += 1) + for (int c2 = 0; c2 <= 9; c2 += 1) + B(c0, c2); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/component4.st b/polly/lib/External/isl/test_inputs/codegen/component4.st new file mode 100644 index 00000000000..c9e400bf609 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component4.st @@ -0,0 +1,7 @@ +domain: "{ A[i] : 0 <= i < 10; B[i,j] : 0 <= i,j < 10 }" +child: + schedule: "[{ A[i] -> [0]; B[i,j] -> [i] }]" + child: + sequence: + - filter: "{ A[i] }" + - filter: "{ B[i,j] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/component5.c b/polly/lib/External/isl/test_inputs/codegen/component5.c new file mode 100644 index 00000000000..072f2eaba2c --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component5.c @@ -0,0 +1,6 @@ +for (int c0 = 0; c0 <= 9; c0 += 1) + for (int c1 = 0; c1 <= 9; c1 += 1) { + if (c0 == 0) + A(c1); + B(c0, c1); + } diff --git a/polly/lib/External/isl/test_inputs/codegen/component5.st b/polly/lib/External/isl/test_inputs/codegen/component5.st new file mode 100644 index 00000000000..1d228982dfa --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component5.st @@ -0,0 +1,9 @@ +domain: "{ A[i] : 0 <= i < 10; B[i,j] : 0 <= i,j < 10 }" +child: + schedule: "[{ A[i] -> [0]; B[i,j] -> [i] }]" + child: + schedule: "[{ A[i] -> [i]; B[i,j] -> [j] }]" + child: + sequence: + - filter: "{ A[i] }" + - filter: "{ B[i,j] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/component6.c b/polly/lib/External/isl/test_inputs/codegen/component6.c new file mode 100644 index 00000000000..9b1c6850984 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component6.c @@ -0,0 +1,5 @@ +{ + A(); + for (int c0 = 0; c0 <= 9; c0 += 1) + B(c0); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/component6.st b/polly/lib/External/isl/test_inputs/codegen/component6.st new file mode 100644 index 00000000000..d13e8bfcacf --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/component6.st @@ -0,0 +1,10 @@ +# Check that components are still detected in presence of nested context node +domain: "{ A[]; B[i] : 0 <= i < 10 }" +child: + schedule: "[{ A[] -> [0]; B[i] -> [i] }]" + child: + context: "[n] -> { [i] : 0 <= n <= i }" + child: + sequence: + - filter: "{ A[] }" + - filter: "{ B[i] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/filter.c b/polly/lib/External/isl/test_inputs/codegen/filter.c new file mode 100644 index 00000000000..c539f6fbfad --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/filter.c @@ -0,0 +1,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 + for (int c0 = 0; c0 < n; c0 += 1) + for (int c2 = 0; c2 < n; c2 += 1) + A(c0, c2); diff --git a/polly/lib/External/isl/test_inputs/codegen/filter.st b/polly/lib/External/isl/test_inputs/codegen/filter.st new file mode 100644 index 00000000000..719fb7ed9ab --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/filter.st @@ -0,0 +1,18 @@ +# Check proper handling of filters that turn out to be empty on their paths +domain: "[n,m] -> { A[i,j] : 0 <= i,j < n }" +child: + set: + - filter: "[n,m] -> { A[i,j] : m < n }" + child: + schedule: "[{ A[i,j] -> [i] }]" + child: + set: + - filter: "[n,m] -> { A[i,j] : m < n }" + - filter: "[n,m] -> { A[i,j] : m >= n }" + - filter: "[n,m] -> { A[i,j] : m >= n }" + child: + schedule: "[{ A[i,j] -> [i] }]" + child: + set: + - filter: "[n,m] -> { A[i,j] : m < n }" + - filter: "[n,m] -> { A[i,j] : m >= n }" diff --git a/polly/lib/External/isl/test_inputs/codegen/gemm.c b/polly/lib/External/isl/test_inputs/codegen/gemm.c new file mode 100644 index 00000000000..d309b23dd8d --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/gemm.c @@ -0,0 +1,6 @@ +for (int c0 = 0; c0 < ni; c0 += 1) + for (int c1 = 0; c1 < nj; c1 += 1) { + S_2(c0, c1); + for (int c2 = 0; c2 < nk; c2 += 1) + S_4(c0, c1, c2); + } diff --git a/polly/lib/External/isl/test_inputs/codegen/gemm.st b/polly/lib/External/isl/test_inputs/codegen/gemm.st new file mode 100644 index 00000000000..31df19dc3e5 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/gemm.st @@ -0,0 +1,12 @@ +domain: "[ni, nj, nk] -> { S_4[i, j, k] : k <= -1 + nk and k >= 0 and j <= -1 + nj and j >= 0 and i <= -1 + ni and i >= 0; S_2[i, j] : j <= -1 + nj and j >= 0 and i <= -1 + ni and i >= 0 }" +child: + set: + - filter: "[ni, nj, nk] -> { S_4[i, j, k]; S_2[i, j] }" + child: + schedule: "[ni, nj, nk] -> [{ S_4[i, j, k] -> [(i)]; S_2[i, j] -> [(i)] }, { S_4[i, j, k] -> [(j)]; S_2[i, j] -> [(j)] }, { S_4[i, j, k] -> [(k)]; S_2[i, j] -> [(0)] }]" + permutable: 1 + coincident: [ 1, 1, 0 ] + child: + sequence: + - filter: "[ni, nj, nk] -> { S_2[i, j] }" + - filter: "[ni, nj, nk] -> { S_4[i, j, k] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate1.c b/polly/lib/External/isl/test_inputs/codegen/isolate1.c new file mode 100644 index 00000000000..db6edf89f7f --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate1.c @@ -0,0 +1,8 @@ +{ + for (int c0 = 0; c0 <= 3; c0 += 1) + A(c0); + for (int c0 = 4; c0 <= 6; c0 += 1) + A(c0); + for (int c0 = 7; c0 <= 99; c0 += 1) + A(c0); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate1.st b/polly/lib/External/isl/test_inputs/codegen/isolate1.st new file mode 100644 index 00000000000..037dda1880b --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate1.st @@ -0,0 +1,5 @@ +# Check that the isolate option is adjusted by schedule space scaling +domain: "{ A[i] : 0 <= i < 100 }" +child: + schedule: "[{ A[i] -> [3i] }]" + options: "{ isolate[[] -> [x]] : 10 <= x <= 20 }" diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate2.c b/polly/lib/External/isl/test_inputs/codegen/isolate2.c new file mode 100644 index 00000000000..2c9e15d0dd5 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate2.c @@ -0,0 +1,11 @@ +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 + for (int c1 = 0; c1 <= 99; c1 += 1) + A(c0, c1); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate2.st b/polly/lib/External/isl/test_inputs/codegen/isolate2.st new file mode 100644 index 00000000000..a9478f338b8 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate2.st @@ -0,0 +1,7 @@ +# Check that the isolate option is adjusted by schedule space scaling +domain: "{ A[i,j] : 0 <= i,j < 100 }" +child: + schedule: "[{ A[i,j] -> [3i] }]" + child: + schedule: "[{ A[i,j] -> [3j] }]" + options: "{ isolate[[x] -> [y]] : 10 <= x <= 20 }" diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate3.c b/polly/lib/External/isl/test_inputs/codegen/isolate3.c new file mode 100644 index 00000000000..921ea4903d2 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate3.c @@ -0,0 +1,17 @@ +{ + for (int c0 = 0; c0 <= 9; c0 += 1) + A(c0); + A(10); + A(11); + A(12); + A(13); + A(14); + A(15); + A(16); + A(17); + A(18); + A(19); + A(20); + for (int c0 = 21; c0 <= 99; c0 += 1) + A(c0); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate3.st b/polly/lib/External/isl/test_inputs/codegen/isolate3.st new file mode 100644 index 00000000000..bce38a844d9 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate3.st @@ -0,0 +1,5 @@ +# Check use of options specific to isolated part +domain: "{ A[i] : 0 <= i < 100 }" +child: + schedule: "[{ A[i] -> [i] }]" + options: "{ isolate[[] -> [x]] : 10 <= x <= 20; [isolate[] -> unroll[x]] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate4.c b/polly/lib/External/isl/test_inputs/codegen/isolate4.c new file mode 100644 index 00000000000..71484e15d57 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate4.c @@ -0,0 +1,13 @@ +{ + A(0); + A(1); + A(2); + A(3); + A(4); + for (int c0 = 5; c0 <= 15; c0 += 1) + A(c0); + A(16); + A(17); + A(18); + A(19); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate4.st b/polly/lib/External/isl/test_inputs/codegen/isolate4.st new file mode 100644 index 00000000000..58b5168c6b6 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate4.st @@ -0,0 +1,5 @@ +# Check that generic options are not applied to isolated part +domain: "{ A[i] : 0 <= i < 20 }" +child: + schedule: "[{ A[i] -> [i] }]" + options: "{ isolate[[] -> [x]] : 5 <= x <= 15; unroll[x] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate5.c b/polly/lib/External/isl/test_inputs/codegen/isolate5.c new file mode 100644 index 00000000000..fe8c35f8f41 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate5.c @@ -0,0 +1,23 @@ +{ + for (int c0 = 0; c0 <= 9; c0 += 1) + for (int c1 = 0; c1 <= 1; c1 += 1) { + if (c0 % 2 == 0) { + A(c0 / 2, c1); + } 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 + 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 + B((c0 - 1) / 2, c1); + } +} diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate5.st b/polly/lib/External/isl/test_inputs/codegen/isolate5.st new file mode 100644 index 00000000000..86b0dd160ff --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate5.st @@ -0,0 +1,5 @@ +# Check that use of isolate option prevents shifted stride detection +domain: "{ A[i,j] : 0 <= i < 100 and 0 <= j < 2; B[i,j] : 0 <= i < 100 and 0 <= j < 2 }" +child: + schedule: "[{ A[i,j] -> [2i]; B[i,j] -> [2i+1] }, { A[i,j] -> [j]; B[i,j] -> [j]}]" + options: "{ isolate[[] -> [x, y]] : 10 <= x < 90 }" diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate6.c b/polly/lib/External/isl/test_inputs/codegen/isolate6.c new file mode 100644 index 00000000000..e92a2b89c18 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate6.c @@ -0,0 +1,26 @@ +{ + for (int c0 = 0; c0 <= 8; c0 += 1) { + for (int c1 = 0; c1 <= -c0 + 8; c1 += 1) + for (int c2 = 10 * c0; c2 <= 10 * c0 + 9; c2 += 1) { + A(c2, 10 * c1); + A(c2, 10 * c1 + 1); + A(c2, 10 * c1 + 2); + A(c2, 10 * c1 + 3); + A(c2, 10 * c1 + 4); + A(c2, 10 * c1 + 5); + A(c2, 10 * c1 + 6); + A(c2, 10 * c1 + 7); + A(c2, 10 * c1 + 8); + A(c2, 10 * c1 + 9); + } + for (int c1 = -c0 + 9; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); + } + for (int c0 = 9; c0 <= 10; c0 += 1) + for (int c1 = 0; c1 <= -c0 + 10; c1 += 1) + for (int c2 = 10 * c0; c2 <= min(10 * c0 + 9, -10 * c1 + 100); c2 += 1) + for (int c3 = 10 * c1; c3 <= min(10 * c1 + 9, -c2 + 100); c3 += 1) + A(c2, c3); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/isolate6.st b/polly/lib/External/isl/test_inputs/codegen/isolate6.st new file mode 100644 index 00000000000..1342223aec2 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/isolate6.st @@ -0,0 +1,8 @@ +# Example from the manual +domain: "{ A[i,j] : 0 <= i,j and i + j <= 100 }" +child: + schedule: "[{ A[i,j] -> [floor(i/10)] }, \ + { A[i,j] -> [floor(j/10)] }, \ + { A[i,j] -> [i] }, { A[i,j] -> [j] }]" + options: "{ isolate[[] -> [a,b,c,d]] : 0 <= 10a,10b and \ + 10a+9+10b+9 <= 100; [isolate[] -> unroll[3]] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/separate.st b/polly/lib/External/isl/test_inputs/codegen/separate.st new file mode 100644 index 00000000000..408c7d91320 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/separate.st @@ -0,0 +1,4 @@ +domain: "{ a[i] : 0 <= i < 10; b[i] : 0 <= i < 10 }" +child: + schedule: "[{ a[i] -> [i]; b[i] -> [i+1] }]" + options: "{ separate[x] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/unroll10.st b/polly/lib/External/isl/test_inputs/codegen/unroll10.st new file mode 100644 index 00000000000..77c5b19f27d --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/unroll10.st @@ -0,0 +1,7 @@ +# Check that all information is taken into account while trying to unroll +domain: "[m,n] -> { A[i] : 0 <= i < n,m }" +child: + context: "[m,n] -> { [] : m <= 10 or n <= 10 }" + child: + schedule: "[{ A[i] -> [i] }]" + options: "{ unroll[x] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/unroll8.c b/polly/lib/External/isl/test_inputs/codegen/unroll8.c new file mode 100644 index 00000000000..b3ca142d944 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/unroll8.c @@ -0,0 +1,6 @@ +for (int c0 = 0; c0 <= 99; c0 += 1) { + A(c0, 0); + A(c0, 1); + B(c0, 0); + B(c0, 1); +} diff --git a/polly/lib/External/isl/test_inputs/codegen/unroll8.st b/polly/lib/External/isl/test_inputs/codegen/unroll8.st new file mode 100644 index 00000000000..94fb49ea1e7 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/unroll8.st @@ -0,0 +1,5 @@ +# Check that options are adjusted by shifted stride detection +domain: "{ A[i,j] : 0 <= i < 100 and 0 <= j < 2; B[i,j] : 0 <= i < 100 and 0 <= j < 2 }" +child: + schedule: "[{ A[i,j] -> [2i]; B[i,j] -> [2i+1] }, { A[i,j] -> [j]; B[i,j] -> [j]}]" + options: "{ unroll[1] }" diff --git a/polly/lib/External/isl/test_inputs/codegen/unroll9.c b/polly/lib/External/isl/test_inputs/codegen/unroll9.c new file mode 100644 index 00000000000..b00ea41d44e --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/unroll9.c @@ -0,0 +1,7 @@ +for (int c0 = 0; c0 <= 99; c0 += 1) + for (int c1 = 0; c1 <= 99; c1 += 1) { + A(c1, 0, c0); + A(c1, 1, c0); + B(c1, 0, c0); + B(c1, 1, c0); + } diff --git a/polly/lib/External/isl/test_inputs/codegen/unroll9.st b/polly/lib/External/isl/test_inputs/codegen/unroll9.st new file mode 100644 index 00000000000..653da415eb7 --- /dev/null +++ b/polly/lib/External/isl/test_inputs/codegen/unroll9.st @@ -0,0 +1,7 @@ +# Check that options are interpreted locally +domain: "{ A[i,j,k] : 0 <= i,k < 100 and 0 <= j < 2; B[i,j,k] : 0 <= i,k < 100 and 0 <= j < 2 }" +child: + schedule: "[{ A[i,j,k] -> [k]; B[i,j,k] -> [k] }]" + child: + schedule: "[{ A[i,j,k] -> [2i]; B[i,j,k] -> [2i+1] }, { A[i,j,k] -> [j]; B[i,j,k] -> [j]}]" + options: "{ unroll[1] }" |