/* * Copyright 2011 INRIA Saclay * Copyright 2014 Ecole Normale Superieure * Copyright 2015 Sven Verdoolaege * * 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 * and Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France */ #include <isl/space.h> #include <isl_vec_private.h> #include <isl_mat_private.h> #include <isl_reordering.h> #include <isl_seq.h> #include <isl_local_private.h> /* Return the isl_ctx to which "local" belongs. */ isl_ctx *isl_local_get_ctx(__isl_keep isl_local *local) { … } /* Create an isl_local object from a matrix describing * integer divisions. * * An isl_local object is current defined as exactly such a matrix, * so simply return the input. */ __isl_give isl_local *isl_local_alloc_from_mat(__isl_take isl_mat *mat) { … } /* Return a new reference to "local". */ __isl_give isl_local *isl_local_copy(__isl_keep isl_local *local) { … } /* Free "local" and return NULL. */ __isl_null isl_local *isl_local_free(__isl_take isl_local *local) { … } /* Return the number of local variables (isl_dim_div), * the number of other variables (isl_dim_set) or * the total number of variables (isl_dim_all) in "local". * * Other types do not have any meaning for an isl_local object. */ isl_size isl_local_dim(__isl_keep isl_local *local, enum isl_dim_type type) { … } #undef TYPE #define TYPE … static #include "check_type_range_templ.c" /* Check that "pos" is a valid position for a variable in "local". */ static isl_stat isl_local_check_pos(__isl_keep isl_local *local, int pos) { … } /* Given local variables "local", * is the variable at position "pos" marked as not having * an explicit representation? * Note that even if this variable is not marked in this way and therefore * does have an explicit representation, this representation may still * depend (indirectly) on other local variables that do not * have an explicit representation. */ isl_bool isl_local_div_is_marked_unknown(__isl_keep isl_local *local, int pos) { … } /* Given local variables "local", * does the variable at position "pos" have a complete explicit representation? * Having a complete explicit representation requires not only * an explicit representation, but also that all local variables * that appear in this explicit representation in turn have * a complete explicit representation. */ isl_bool isl_local_div_is_known(__isl_keep isl_local *local, int pos) { … } /* Does "local" have an explicit representation for all local variables? */ isl_bool isl_local_divs_known(__isl_keep isl_local *local) { … } /* Compare two sets of local variables, defined over * the same space. * * Return -1 if "local1" is "smaller" than "local2", 1 if "local1" is "greater" * than "local2" and 0 if they are equal. * * The order is fairly arbitrary. We do "prefer" divs that only involve * earlier dimensions in the sense that we consider matrices where * the first differing div involves earlier dimensions to be smaller. */ int isl_local_cmp(__isl_keep isl_local *local1, __isl_keep isl_local *local2) { … } /* Return the position of the variables of the given type * within the sequence of variables of "local". * * Only the position of the local variables can be obtained. * It is equal to the total number of variables minus * the number of local variables. */ isl_size isl_local_var_offset(__isl_keep isl_local *local, enum isl_dim_type type) { … } /* Reorder the columns of the given local variables according to the * given reordering. * The order of the local variables themselves is assumed not to change. */ __isl_give isl_local *isl_local_reorder(__isl_take isl_local *local, __isl_take isl_reordering *r) { … } /* Move the "n" variables starting at "src_pos" of "local" to "dst_pos". * * Moving local variables is not allowed. */ __isl_give isl_local *isl_local_move_vars(__isl_take isl_local *local, unsigned dst_pos, unsigned src_pos, unsigned n) { … } /* Extend a vector "v" representing an integer point * in the domain space of "local" * to one that also includes values for the local variables. * All local variables are required to have an explicit representation. * If there are no local variables, then the point is not required * to be integral. */ __isl_give isl_vec *isl_local_extend_point_vec(__isl_keep isl_local *local, __isl_take isl_vec *v) { … }