From e7948080608f2dbafcf3f4ddaf1c40475c76520f Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 23 Jul 2013 12:51:24 +0200 Subject: [PATCH] gpu.c: use pet_stmt_build_ast_exprs and pet_stmt_print_body to print statements Signed-off-by: Sven Verdoolaege --- Makefile.am | 2 - gpu.c | 362 ++++++++++++++++++++++++++++++++-------------------------- gpu.h | 24 +--- gpu_print.c | 96 +--------------- pet_printer.c | 99 ---------------- pet_printer.h | 13 --- 6 files changed, 202 insertions(+), 394 deletions(-) delete mode 100644 pet_printer.c delete mode 100644 pet_printer.h diff --git a/Makefile.am b/Makefile.am index 5b716f0..83a1e8d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,8 +40,6 @@ ppcg_SOURCES = \ rewrite.h \ schedule.c \ schedule.h \ - pet_printer.c \ - pet_printer.h \ ppcg_options.c \ ppcg_options.h \ ppcg.c \ diff --git a/gpu.c b/gpu.c index a292d38..3b76216 100644 --- a/gpu.c +++ b/gpu.c @@ -1279,51 +1279,6 @@ static __isl_give isl_map *tile_access_schedule(struct gpu_gen *gen, return sched; } -/* Given an index expression "pa" into a tile of an array, adjust the expression - * to a shift of the tile to the origin - * (based on the lower bounds in "bound". - * If the index is strided, then we first add - * bound->shift and divide by bound->stride. - * In the end, we compute the gist with respect to "domain". - * - * All of the input expression "pa", the set "domain" and - * the output are expressed in terms of the AST schedule domain. - * The expressions in "bound" are expressed - * in terms of the first shared_len dimensions of the schedule computed by PPCG. - * The mapping "sched2shared" maps the former domain to the latter domain. - */ -static __isl_give isl_pw_aff *shift_index(__isl_take isl_pw_aff *pa, - struct gpu_array_info *array, - struct gpu_array_bound *bound, __isl_take isl_set *domain, - __isl_take isl_map *sched2shared) -{ - isl_map *map; - isl_pw_aff *tmp; - isl_pw_multi_aff *pma; - - if (bound->shift) { - map = isl_map_from_aff(isl_aff_copy(bound->shift)); - map = isl_map_apply_range(isl_map_copy(sched2shared), map); - pma = isl_pw_multi_aff_from_map(map); - tmp = isl_pw_multi_aff_get_pw_aff(pma, 0); - isl_pw_multi_aff_free(pma); - pa = isl_pw_aff_add(pa, tmp); - pa = isl_pw_aff_scale_down_val(pa, isl_val_copy(bound->stride)); - } - - - map = isl_map_from_aff(isl_aff_copy(bound->lb)); - map = isl_map_apply_range(sched2shared, map); - pma = isl_pw_multi_aff_from_map(map); - tmp = isl_pw_multi_aff_get_pw_aff(pma, 0); - isl_pw_multi_aff_free(pma); - pa = isl_pw_aff_sub(pa, tmp); - pa = isl_pw_aff_coalesce(pa); - pa = isl_pw_aff_gist(pa, domain); - - return pa; -} - /* Return the union of all read (read = 1) and/or write (write = 1) * access relations in the group. */ @@ -3236,11 +3191,7 @@ void ppcg_kernel_stmt_free(void *user) isl_ast_expr_free(stmt->u.c.local_index); break; case ppcg_kernel_domain: - for (i = 0; i < stmt->u.d.n_access; ++i) { - isl_ast_expr_list_free(stmt->u.d.access[i].index); - free(stmt->u.d.access[i].local_name); - } - free(stmt->u.d.access); + isl_id_to_ast_expr_free(stmt->u.d.ref2expr); break; case ppcg_kernel_sync: break; @@ -3321,120 +3272,212 @@ static __isl_give isl_union_map *extend_schedule( return schedule; } -/* This function is called for each access to an array in each instance - * in the kernel of some statement in the original code. - * Replace that access by an access to global, shared or private memory - * and store the results in *kernel_access. +/* Return the gpu_stmt_access in the list "accesses" that corresponds + * to "ref_id". + */ +static struct gpu_stmt_access *find_access(struct gpu_stmt_access *accesses, + __isl_keep isl_id *ref_id) +{ + struct gpu_stmt_access *access; + + for (access = accesses; access; access = access->next) + if (access->ref_id == ref_id) + return access; + + return NULL; +} + +/* Return the index of the array called "name" in the list of arrays. + */ +static int find_array_index(struct gpu_gen *gen, const char *name) +{ + int i; + + for (i = 0; i < gen->prog->n_array; ++i) + if (!strcmp(name, gen->prog->array[i].name)) + return i; + + return -1; +} + +/* Internal data structure for the index and AST expression transformation + * callbacks for pet_stmt_build_ast_exprs. + * + * "accesses" is the list of gpu_stmt_access in the statement. + * "iterator_map" expresses the statement iterators in terms of + * the AST loop iterators. + * "sched2shared" expresses the first shared_len dimensions of + * the computed schedule in terms of the AST loop iterators. + * + * The following fields are set in transform_index and used in transform_expr. + * "array" is the array that is being accessed. + * "global" is set if the global array is accessed (rather than + * shared/private memory). + * "bound" refers to the bounds on the array specialized to the current kernel. + */ +struct ppcg_transform_data { + struct gpu_gen *gen; + struct gpu_stmt_access *accesses; + isl_pw_multi_aff *iterator_map; + isl_pw_multi_aff *sched2shared; + + struct gpu_array_info *array; + int global; + isl_pw_aff_list *bound; +}; + +/* Index transformation callback for pet_stmt_build_ast_exprs. + * + * "index" expresses the array indices in terms of statement iterators + * + * We first reformulate "index" in terms of the AST loop iterators. + * Then we check if we are accessing the global array or + * a shared/private copy. In the former case, we simply return + * the updated index. If "index" is an affine expression rather + * than an array access, then we also return the updated index here. + * + * Otherwise, we apply the tiling to the index. + * This tiling is of the form + * + * [D -> A] -> T + * + * The index is of the form * - * Since the array in shared or private memory is just - * a shifted copy of part of the original array, we simply need - * to subtract the lower bound, which was computed in can_tile. - * If any of the indices is strided, then we first add - * shared_tile->bound[i].shift and divide by shared_tile->bound[i].stride. + * L -> A * - * If the given array is accessed directly from global memory, - * we don't need to perform any shifting and simply simplify - * the expression in the context of the domain instead. + * We update the tiling to refer to the AST loop iteratos * - * If the array space (range of access) has no name, then we are - * accessing an iterator in the original program. + * [L -> A] -> T * - * The input stmt_access->access relation maps the iteration domain - * of the current statement to an array element. - * The first step is to reformulate - * this access relation in terms of the loop iterators of the generated - * code through precomposition with gen->stmt_it. + * and modify index to keep track of those iterators * - * The expressions in "tile" are formulated in terms of the first - * gen->shared_len dimensions of the computed schedule using the mapping - * sched2shared which maps the loop iterators to these dimensions. + * L -> [L -> A] + * + * Combining these two yields a tiled index expression in terms + * of the AST loop iterators + * + * L -> T */ -static void compute_index_expression(struct gpu_gen *gen, - struct ppcg_kernel_access *kernel_access, - struct gpu_stmt_access *stmt_access, __isl_keep isl_map *stmt_it, - __isl_keep isl_map *sched2shared, __isl_keep isl_ast_build *build) +static __isl_give isl_multi_pw_aff *transform_index( + __isl_take isl_multi_pw_aff *index, __isl_keep isl_id *ref_id, + void *user) { - isl_map *access; - isl_pw_multi_aff *pma; + struct ppcg_transform_data *data = user; + struct gpu_stmt_access *access; + struct gpu_array_ref_group *group; + struct gpu_array_tile *tile; + isl_pw_multi_aff *iterator_map; int i; - unsigned n_index; - struct gpu_array_tile *tile = NULL; + const char *name; + isl_space *space; + isl_multi_pw_aff *tiling; + isl_pw_multi_aff *pma; + isl_multi_pw_aff *mpa; - if (isl_map_has_tuple_name(stmt_access->access, isl_dim_out)) { - int i; - const char *name; - struct gpu_array_ref_group *group; - isl_printer *p; + data->array = NULL; - name = isl_map_get_tuple_name(stmt_access->access, isl_dim_out); + iterator_map = isl_pw_multi_aff_copy(data->iterator_map); + index = isl_multi_pw_aff_pullback_pw_multi_aff(index, iterator_map); - for (i = 0; i < gen->prog->n_array; ++i) { - if (strcmp(name, gen->prog->array[i].name)) - continue; - kernel_access->array = &gen->prog->array[i]; - kernel_access->local_array = &gen->kernel->array[i]; - } - assert(kernel_access->array); - group = kernel_access->array->groups[stmt_access->group]; - p = isl_printer_to_str(gen->ctx); - p = print_array_name(p, group); - kernel_access->local_name = isl_printer_get_str(p); - isl_printer_free(p); - tile = group->private_tile; - kernel_access->type = ppcg_access_private; - if (!tile) { - tile = group->shared_tile; - kernel_access->type = ppcg_access_shared; - } - } - if (!tile) - kernel_access->type = ppcg_access_global; + access = find_access(data->accesses, ref_id); + if (!access) + return index; + if (!isl_map_has_tuple_name(access->access, isl_dim_out)) + return index; - n_index = isl_map_dim(stmt_access->access, isl_dim_out); - kernel_access->index = isl_ast_expr_list_alloc(gen->ctx, n_index); + name = isl_map_get_tuple_name(access->access, isl_dim_out); + i = find_array_index(data->gen, name); + if (i < 0) + isl_die(isl_multi_pw_aff_get_ctx(index), isl_error_internal, + "cannot find array reference group", + return isl_multi_pw_aff_free(index)); - if (n_index == 0) - return; + data->array = &data->gen->prog->array[i]; + data->bound = data->gen->kernel->array[i].bound; + group = data->array->groups[access->group]; + tile = group->private_tile; + if (!tile) + tile = group->shared_tile; + data->global = !tile; + if (!tile) + return index; - access = isl_map_copy(stmt_access->access); - access = isl_map_apply_range(isl_map_copy(stmt_it), access); - pma = isl_pw_multi_aff_from_map(access); - pma = isl_pw_multi_aff_coalesce(pma); + space = isl_space_range(isl_multi_pw_aff_get_space(index)); + space = isl_space_map_from_set(space); + pma = isl_pw_multi_aff_identity(space); + pma = isl_pw_multi_aff_product( + isl_pw_multi_aff_copy(data->sched2shared), pma); + tiling = isl_multi_pw_aff_from_multi_aff( + isl_multi_aff_copy(tile->tiling)); + tiling = isl_multi_pw_aff_pullback_pw_multi_aff(tiling, pma); + + space = isl_space_domain(isl_multi_pw_aff_get_space(index)); + space = isl_space_map_from_set(space); + mpa = isl_multi_pw_aff_identity(space); + index = isl_multi_pw_aff_range_product(mpa, index); + index = isl_multi_pw_aff_pullback_multi_pw_aff(tiling, index); - for (i = 0; i < n_index; ++i) { - isl_set *domain; - isl_pw_aff *index; - isl_ast_expr *expr; + return index; +} - index = isl_pw_multi_aff_get_pw_aff(pma, i); +/* AST expression transformation callback for pet_stmt_build_ast_exprs. + * + * If the AST expression refers to an access to a global array, + * then we linearize the access exploiting the bounds in data->bounds. + */ +static __isl_give isl_ast_expr *transform_expr(__isl_take isl_ast_expr *expr, + __isl_keep isl_id *id, void *user) +{ + int i, n; + isl_ctx *ctx; + isl_set *context; + isl_ast_expr *res; + isl_ast_expr_list *list; + isl_ast_build *build; + struct ppcg_transform_data *data = user; + + if (!data->array) + return expr; + if (gpu_array_is_scalar(data->array)) + return expr; + if (!data->global) + return expr; + + ctx = isl_ast_expr_get_ctx(expr); + context = isl_set_universe(isl_space_params_alloc(ctx, 0)); + build = isl_ast_build_from_context(context); + + n = isl_ast_expr_get_op_n_arg(expr); + res = isl_ast_expr_get_op_arg(expr, 1); + for (i = 2; i < n; ++i) { + isl_pw_aff *bound_i; + isl_ast_expr *expr_i; + + bound_i = isl_pw_aff_list_get_pw_aff(data->bound, i - 1); + expr_i = isl_ast_build_expr_from_pw_aff(build, bound_i); + res = isl_ast_expr_mul(res, expr_i); + expr_i = isl_ast_expr_get_op_arg(expr, i); + res = isl_ast_expr_add(res, expr_i); + } - if (!kernel_access->array) { - } else if (!tile) { - domain = isl_map_domain(isl_map_copy(stmt_it)); - index = isl_pw_aff_coalesce(index); - index = isl_pw_aff_gist(index, domain); - } else { - domain = isl_map_domain(isl_map_copy(stmt_it)); - index = shift_index(index, kernel_access->array, - &tile->bound[i], domain, - isl_map_copy(sched2shared)); - } + isl_ast_build_free(build); - expr = isl_ast_build_expr_from_pw_aff(build, index); + list = isl_ast_expr_list_from_ast_expr(res); + res = isl_ast_expr_get_op_arg(expr, 0); + res = isl_ast_expr_access(res, list); - kernel_access->index = isl_ast_expr_list_add( - kernel_access->index, expr); - } + isl_ast_expr_free(expr); - isl_pw_multi_aff_free(pma); + return res; } /* This function is called for each instance of a user statement * in the kernel. * * We attach a struct ppcg_kernel_stmt to the "node", containing - * local information about the accesses. - * This information is computed from stmt_it, which expresses the domain + * a computed AST expression for each access. + * These AST expressions are computed from iterator_map, + * which expresses the domain * elements in terms of the generated loops, and sched2shared, * which expresses the first shared_len dimensions of the schedule * computed by PPCG in terms of the generated loops. @@ -3442,10 +3485,12 @@ static void compute_index_expression(struct gpu_gen *gen, static __isl_give isl_ast_node *at_each_domain(__isl_take isl_ast_node *node, __isl_keep isl_ast_build *build, void *user) { + struct ppcg_transform_data data; struct gpu_gen *gen = (struct gpu_gen *) user; struct ppcg_kernel_stmt *stmt; isl_id *id; - isl_map *stmt_it, *sched2shared; + isl_pw_multi_aff *sched2shared; + isl_map *map; isl_pw_multi_aff *iterator_map; isl_ast_expr *expr, *arg; isl_union_map *schedule; @@ -3461,36 +3506,27 @@ static __isl_give isl_ast_node *at_each_domain(__isl_take isl_ast_node *node, id = isl_ast_expr_get_id(arg); schedule = isl_ast_build_get_schedule(build); - stmt_it = isl_map_reverse(isl_map_from_union_map(schedule)); - iterator_map = isl_pw_multi_aff_from_map(isl_map_copy(stmt_it)); - iterator_map = compute_sched_to_shared(gen, iterator_map); - sched2shared = isl_map_from_pw_multi_aff(iterator_map); + map = isl_map_reverse(isl_map_from_union_map(schedule)); + iterator_map = isl_pw_multi_aff_from_map(map); + sched2shared = compute_sched_to_shared(gen, + isl_pw_multi_aff_copy(iterator_map)); stmt->type = ppcg_kernel_domain; stmt->u.d.stmt = find_stmt(gen->prog, id); if (!stmt->u.d.stmt) goto error; - n = 0; - for (access = stmt->u.d.stmt->accesses; access; access = access->next) - ++n; - - stmt->u.d.access = isl_calloc_array(gen->ctx, - struct ppcg_kernel_access, n); - if (!stmt->u.d.access) - goto error; - - stmt->u.d.n_access = n; - - access = stmt->u.d.stmt->accesses; - for (i = 0; i < n; ++i, access = access->next) { - compute_index_expression(gen, &stmt->u.d.access[i], access, - stmt_it, sched2shared, build); - } + data.gen = gen; + data.accesses = stmt->u.d.stmt->accesses; + data.iterator_map = iterator_map; + data.sched2shared = sched2shared; + stmt->u.d.ref2expr = pet_stmt_build_ast_exprs(stmt->u.d.stmt->stmt, + build, &transform_index, &data, + &transform_expr, &data); isl_id_free(id); - isl_map_free(stmt_it); - isl_map_free(sched2shared); + isl_pw_multi_aff_free(iterator_map); + isl_pw_multi_aff_free(sched2shared); isl_ast_expr_free(arg); isl_ast_expr_free(expr); @@ -3499,9 +3535,9 @@ static __isl_give isl_ast_node *at_each_domain(__isl_take isl_ast_node *node, return isl_ast_node_set_annotation(node, id); error: isl_id_free(id); - isl_map_free(stmt_it); + isl_pw_multi_aff_free(iterator_map); ppcg_kernel_stmt_free(stmt); - isl_map_free(sched2shared); + isl_pw_multi_aff_free(sched2shared); return isl_ast_node_free(node); } diff --git a/gpu.h b/gpu.h index f93c7da..5bd773a 100644 --- a/gpu.h +++ b/gpu.h @@ -2,6 +2,7 @@ #define _GPU_H #include +#include #include "ppcg.h" #include "ppcg_options.h" @@ -80,25 +81,6 @@ enum ppcg_kernel_stmt_type { ppcg_kernel_sync }; -/* Instance specific information about an access inside a kernel statement. - * - * type indicates whether it is a global, shared or private access - * array is the original array information and may be NULL in case - * of an affine expression - * local_array is a pointer to the appropriate element in the "array" - * array of the ppcg_kernel to which this access belongs. It is - * NULL whenever array is NULL. - * local_name is the name of the array or its local copy - * index is the sequence of local index expressions - */ -struct ppcg_kernel_access { - enum ppcg_kernel_access_type type; - struct gpu_array_info *array; - struct gpu_local_array_info *local_array; - char *local_name; - isl_ast_expr_list *index; -}; - /* Representation of special statements, in particular copy statements * and __syncthreads statements, inside a kernel. * @@ -139,9 +121,7 @@ struct ppcg_kernel_stmt { } c; struct { struct gpu_stmt *stmt; - - int n_access; - struct ppcg_kernel_access *access; + isl_id_to_ast_expr *ref2expr; } d; } u; }; diff --git a/gpu_print.c b/gpu_print.c index b14e6c6..4854db0 100644 --- a/gpu_print.c +++ b/gpu_print.c @@ -10,7 +10,6 @@ #include #include "gpu_print.h" -#include "pet_printer.h" #include "schedule.h" static int print_macro(enum isl_ast_op_type type, void *user) @@ -159,101 +158,8 @@ __isl_give isl_printer *ppcg_kernel_print_copy(__isl_take isl_printer *p, return p; } -/* Print an access based on the information in "access". - * If this an access to global memory, then the index expression - * is linearized. - * - * If access->array is NULL, then we are - * accessing an iterator in the original program. - */ -static __isl_give isl_printer *print_access(__isl_take isl_printer *p, - struct ppcg_kernel_access *access) -{ - int i; - unsigned n_index; - struct gpu_array_info *array; - isl_pw_aff_list *bound; - - array = access->array; - bound = array ? access->local_array->bound : NULL; - if (!array) - p = isl_printer_print_str(p, "("); - else { - if (access->type == ppcg_access_global && - gpu_array_is_scalar(array) && !array->read_only) - p = isl_printer_print_str(p, "*"); - p = isl_printer_print_str(p, access->local_name); - if (gpu_array_is_scalar(array)) - return p; - p = isl_printer_print_str(p, "["); - } - - n_index = isl_ast_expr_list_n_ast_expr(access->index); - if (access->type == ppcg_access_global) - for (i = 0; i + 1 < n_index; ++i) - p = isl_printer_print_str(p, "("); - - for (i = 0; i < n_index; ++i) { - isl_ast_expr *index; - - index = isl_ast_expr_list_get_ast_expr(access->index, i); - if (array && i) { - if (access->type == ppcg_access_global) { - isl_pw_aff *bound_i; - bound_i = isl_pw_aff_list_get_pw_aff(bound, i); - p = isl_printer_print_str(p, ") * ("); - p = isl_printer_print_pw_aff(p, bound_i); - p = isl_printer_print_str(p, ") + "); - isl_pw_aff_free(bound_i); - } else - p = isl_printer_print_str(p, "]["); - } - p = isl_printer_print_ast_expr(p, index); - isl_ast_expr_free(index); - } - if (!array) - p = isl_printer_print_str(p, ")"); - else - p = isl_printer_print_str(p, "]"); - - return p; -} - -struct gpu_access_print_info { - int i; - struct ppcg_kernel_stmt *stmt; -}; - -/* To print the gpu accesses we walk the list of gpu accesses simultaneously - * with the pet printer. This means that whenever the pet printer prints a - * pet access expression we have the corresponding gpu access available and can - * print the modified access. - */ -static __isl_give isl_printer *print_gpu_access(__isl_take isl_printer *p, - struct pet_expr *expr, void *usr) -{ - struct gpu_access_print_info *info = - (struct gpu_access_print_info *) usr; - - p = print_access(p, &info->stmt->u.d.access[info->i]); - info->i++; - - return p; -} - __isl_give isl_printer *ppcg_kernel_print_domain(__isl_take isl_printer *p, struct ppcg_kernel_stmt *stmt) { - struct gpu_access_print_info info; - - info.i = 0; - info.stmt = stmt; - - p = isl_printer_start_line(p); - p = print_pet_expr(p, stmt->u.d.stmt->stmt->body, - &print_gpu_access, &info); - p = isl_printer_print_str(p, ";"); - p = isl_printer_end_line(p); - - return p; + return pet_stmt_print_body(stmt->u.d.stmt->stmt, p, stmt->u.d.ref2expr); } diff --git a/pet_printer.c b/pet_printer.c deleted file mode 100644 index 6ae6392..0000000 --- a/pet_printer.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2010-2011 INRIA Saclay - * - * Use of this software is governed by the MIT license - * - * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France, - * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod, - * 91893 Orsay, France - */ - -#include "pet_printer.h" -#include "pet.h" - -static __isl_take isl_printer *print_pet_expr_help(__isl_take isl_printer *p, - struct pet_expr *expr, int outer, - __isl_take isl_printer *(*print_access_fn)(__isl_take isl_printer *p, - struct pet_expr *expr, void *usr), void *usr) -{ - int i; - - switch (expr->type) { - case pet_expr_double: - p = isl_printer_print_str(p, expr->d.s); - break; - case pet_expr_access: - p = print_access_fn(p, expr, usr); - break; - case pet_expr_unary: - if (!outer) - p = isl_printer_print_str(p, "("); - p = isl_printer_print_str(p, " "); - p = isl_printer_print_str(p, pet_op_str(expr->op)); - p = isl_printer_print_str(p, " "); - p = print_pet_expr_help(p, expr->args[pet_un_arg], 0, - print_access_fn, usr); - if (!outer) - p = isl_printer_print_str(p, ")"); - break; - case pet_expr_binary: - if (!outer) - p = isl_printer_print_str(p, "("); - p = print_pet_expr_help(p, expr->args[pet_bin_lhs], 0, - print_access_fn, usr); - p = isl_printer_print_str(p, " "); - p = isl_printer_print_str(p, pet_op_str(expr->op)); - p = isl_printer_print_str(p, " "); - p = print_pet_expr_help(p, expr->args[pet_bin_rhs], 0, - print_access_fn, usr); - if (!outer) - p = isl_printer_print_str(p, ")"); - break; - case pet_expr_ternary: - if (!outer) - p = isl_printer_print_str(p, "("); - p = print_pet_expr_help(p, expr->args[pet_ter_cond], 0, - print_access_fn, usr); - p = isl_printer_print_str(p, " ? "); - p = print_pet_expr_help(p, expr->args[pet_ter_true], 0, - print_access_fn, usr); - p = isl_printer_print_str(p, " : "); - p = print_pet_expr_help(p, expr->args[pet_ter_false], 0, - print_access_fn, usr); - if (!outer) - p = isl_printer_print_str(p, ")"); - break; - case pet_expr_call: - p = isl_printer_print_str(p, expr->name); - p = isl_printer_print_str(p, "("); - for (i = 0; i < expr->n_arg; ++i) { - if (i) - p = isl_printer_print_str(p, ", "); - p = print_pet_expr_help(p, expr->args[i], 1, - print_access_fn, usr); - } - p = isl_printer_print_str(p, ")"); - break; - case pet_expr_cast: - if (!outer) - p = isl_printer_print_str(p, "("); - p = isl_printer_print_str(p, "("); - p = isl_printer_print_str(p, expr->type_name); - p = isl_printer_print_str(p, ") "); - p = print_pet_expr_help(p, expr->args[0], 0, - print_access_fn, usr); - if (!outer) - p = isl_printer_print_str(p, ")"); - break; - } - - return p; -} - -__isl_give isl_printer *print_pet_expr(__isl_take isl_printer *p, - struct pet_expr *expr, - __isl_give isl_printer *(*print_access)(__isl_take isl_printer *p, - struct pet_expr *expr, void *usr), void *usr) -{ - return print_pet_expr_help(p, expr, 1, print_access, usr); -} diff --git a/pet_printer.h b/pet_printer.h deleted file mode 100644 index 5adc11f..0000000 --- a/pet_printer.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _PET_PRINTER_H -#define _PET_PRINTER_H - -#include - -struct pet_expr; - -__isl_give isl_printer *print_pet_expr(__isl_take isl_printer *p, - struct pet_expr *expr, - __isl_give isl_printer *(*print_access)(__isl_take isl_printer *p, - struct pet_expr *expr, void *usr), void *usr); - -#endif -- 2.11.4.GIT