block.h | block.h | |||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
**-------------------------------------------------------------------** | **-------------------------------------------------------------------** | |||
** First version: June 11th 2005 ** | ** First version: June 11th 2005 ** | |||
**-------------------------------------------------------------------** / | **-------------------------------------------------------------------** / | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* CLooG : the Chunky Loop Generator (experimental) * | * CLooG : the Chunky Loop Generator (experimental) * | |||
************************************************************************** **** | ************************************************************************** **** | |||
* * | * * | |||
* Copyright (C) 2001-2005 Cedric Bastoul * | * Copyright (C) 2001-2005 Cedric Bastoul * | |||
* * | * * | |||
* This is free software; you can redistribute it and/or modify it under th | * This library is free software; you can redistribute it and/or | |||
e * | * | |||
* terms of the GNU General Public License as published by the Free Softwar | * modify it under the terms of the GNU Lesser General Public | |||
e * | * | |||
* Foundation; either version 2 of the License, or (at your option) any lat | * License as published by the Free Software Foundation; either | |||
er * | * | |||
* version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* * | * * | |||
* This software is distributed in the hope that it will be useful, but | * This library is distributed in the hope that it will be useful, | |||
* | * | |||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILI | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
TY * | * | |||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* | * | |||
* for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* * | * * | |||
* You should have received a copy of the GNU General Public License along | * You should have received a copy of the GNU Lesser General Public | |||
* | * | |||
* with software; if not, write to the Free Software Foundation, Inc., | * License along with this library; if not, write to the Free Software | |||
* | * | |||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||
* | * | |||
* Boston, MA 02110-1301 USA | ||||
* | ||||
* * | * * | |||
* CLooG, the Chunky Loop Generator * | * CLooG, the Chunky Loop Generator * | |||
* Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | |||
* * | * * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
#ifndef CLOOG_BLOCK_H | #ifndef CLOOG_BLOCK_H | |||
#define CLOOG_BLOCK_H | #define CLOOG_BLOCK_H | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
extern "C" | extern "C" | |||
skipping to change at line 57 | skipping to change at line 58 | |||
* constant) instead of giving only one pair. CLooG provides them a last ch ance | * constant) instead of giving only one pair. CLooG provides them a last ch ance | |||
* to save time and memory by trying to find these blocks itself. The block | * to save time and memory by trying to find these blocks itself. The block | |||
* contains the statement list and the common informations of the statement s. | * contains the statement list and the common informations of the statement s. | |||
* This structure contains also the number of existing active references to it: | * This structure contains also the number of existing active references to it: | |||
* because CLooG uses many copies of blocks there is no need to actually co py | * because CLooG uses many copies of blocks there is no need to actually co py | |||
* these blocks but just to return a pointer to them and to increment the n umber | * these blocks but just to return a pointer to them and to increment the n umber | |||
* of active references. Each time a CloogBlock will be freed, we will decr ement | * of active references. Each time a CloogBlock will be freed, we will decr ement | |||
* the active reference counter and actually free it if its value is zero. | * the active reference counter and actually free it if its value is zero. | |||
*/ | */ | |||
struct cloogblock | struct cloogblock | |||
{ CloogStatement * statement ; /**< The list of statements in the block. * | { | |||
/ | CloogState *state; /**< State. */ | |||
CloogMatrix * scattering ; /**< The scattering function for the block. | CloogStatement * statement ; /**< The list of statements in the block. * | |||
*/ | / | |||
int nb_scaldims ; /**< Number of scalar dimensions. */ | int nb_scaldims ; /**< Number of scalar dimensions. */ | |||
Value * scaldims ; /**< Scalar dimension values. */ | cloog_int_t *scaldims; /**< Scalar dimension values. */ | |||
int depth ; /**< Original block depth (outer loop numbe r).*/ | int depth ; /**< Original block depth (outer loop numbe r).*/ | |||
int references ; /**< Number of references to this structure . */ | int references ; /**< Number of references to this structure . */ | |||
void * usr; /**< User field, for library user convenienc | ||||
e. | ||||
* This pointer is not freed when the | ||||
* CloogBlock structure is freed. | ||||
*/ | ||||
} ; | } ; | |||
typedef struct cloogblock CloogBlock ; | typedef struct cloogblock CloogBlock ; | |||
/** | /** | |||
* CloogBlockList structure: | * CloogBlockList structure: | |||
* this structure reprensents a node of a linked list of CloogBlock structu res. | * this structure reprensents a node of a linked list of CloogBlock structu res. | |||
*/ | */ | |||
struct cloogblocklist | struct cloogblocklist | |||
{ CloogBlock * block ; /**< An element of the list. */ | { CloogBlock * block ; /**< An element of the list. */ | |||
struct cloogblocklist * next ;/**< Pointer to the next element of the lis t.*/ | struct cloogblocklist * next ;/**< Pointer to the next element of the lis t.*/ | |||
skipping to change at line 92 | skipping to change at line 98 | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Memory deallocation function * | * Memory deallocation function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_block_free(CloogBlock *) ; | void cloog_block_free(CloogBlock *) ; | |||
void cloog_block_list_free(CloogBlockList *) ; | void cloog_block_list_free(CloogBlockList *) ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Processing functions * | * Processing functions * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
CloogBlock * cloog_block_malloc(void) ; | CloogBlock * cloog_block_malloc(CloogState *state); | |||
CloogBlock * cloog_block_alloc(CloogStatement*,CloogMatrix*,int,Value*, | CloogBlock * cloog_block_alloc(CloogStatement *statement, int nb_scaldi | |||
int); | ms, | |||
CloogBlockList * cloog_block_list_malloc(void) ; | cloog_int_t *scaldims, int depth); | |||
CloogBlockList * cloog_block_list_malloc(void); | ||||
CloogBlockList * cloog_block_list_alloc(CloogBlock *) ; | CloogBlockList * cloog_block_list_alloc(CloogBlock *) ; | |||
CloogBlock * cloog_block_copy(CloogBlock * block) ; | CloogBlock * cloog_block_copy(CloogBlock * block) ; | |||
void cloog_block_merge(CloogBlock *, CloogBlock *) ; | void cloog_block_merge(CloogBlock *, CloogBlock *) ; | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif /* define _H */ | #endif /* define _H */ | |||
End of changes. 7 change blocks. | ||||
31 lines changed or deleted | 39 lines changed or added | |||
cloog.h | cloog.h | |||
---|---|---|---|---|
skipping to change at line 14 | skipping to change at line 14 | |||
**-------------------------------------------------------------------** | **-------------------------------------------------------------------** | |||
** cloog.h ** | ** cloog.h ** | |||
**-------------------------------------------------------------------** | **-------------------------------------------------------------------** | |||
** First version: july 25th 2002 ** | ** First version: july 25th 2002 ** | |||
**-------------------------------------------------------------------** / | **-------------------------------------------------------------------** / | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* CLooG : the Chunky Loop Generator (experimental) * | * CLooG : the Chunky Loop Generator (experimental) * | |||
************************************************************************** **** | ************************************************************************** **** | |||
* * | * * | |||
* Copyright (C) 2001-2007 Cedric Bastoul * | * Copyright (C) 2001-2005 Cedric Bastoul * | |||
* * | * * | |||
* This is free software; you can redistribute it and/or modify it under th | * This library is free software; you can redistribute it and/or | |||
e * | * | |||
* terms of the GNU General Public License as published by the Free Softwar | * modify it under the terms of the GNU Lesser General Public | |||
e * | * | |||
* Foundation; either version 2 of the License, or (at your option) any lat | * License as published by the Free Software Foundation; either | |||
er * | * | |||
* version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* * | * * | |||
* This software is distributed in the hope that it will be useful, but | * This library is distributed in the hope that it will be useful, | |||
* | * | |||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILI | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
TY * | * | |||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* | * | |||
* for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* * | * * | |||
* You should have received a copy of the GNU General Public License along | * You should have received a copy of the GNU Lesser General Public | |||
* | * | |||
* with software; if not, write to the Free Software Foundation, Inc., | * License along with this library; if not, write to the Free Software | |||
* | * | |||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||
* | * | |||
* Boston, MA 02110-1301 USA | ||||
* | ||||
* * | * * | |||
* CLooG, the Chunky Loop Generator * | * CLooG, the Chunky Loop Generator * | |||
* Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | |||
* * | * * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* THIS FILE HAS BEEN AUTOMATICALLY GENERATED FROM clooh.h.in BY configure * | * THIS FILE HAS BEEN AUTOMATICALLY GENERATED FROM clooh.h.in BY configure * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
#define CLOOG_RELEASE "0.14.1" | #ifndef CLOOG_H | |||
#define CLOOG_VERSION "64" | #define CLOOG_H | |||
#include <polylib/polylib64.h> | #include <cloog/version.h> | |||
#include <cloog/options.h> | #include <cloog/int.h> | |||
#include <cloog/matrix.h> | #include <cloog/matrix.h> | |||
#include <cloog/state.h> | ||||
#include <cloog/options.h> | ||||
#include <cloog/names.h> | ||||
#include <cloog/constraints.h> | ||||
#include <cloog/stride.h> | ||||
#include <cloog/domain.h> | #include <cloog/domain.h> | |||
#include <cloog/statement.h> | #include <cloog/statement.h> | |||
#include <cloog/block.h> | #include <cloog/block.h> | |||
#include <cloog/names.h> | ||||
#include <cloog/loop.h> | #include <cloog/loop.h> | |||
#include <cloog/union_domain.h> | ||||
#include <cloog/input.h> | ||||
#include <cloog/program.h> | #include <cloog/program.h> | |||
#include <cloog/clast.h> | ||||
#include <cloog/pprint.h> | #include <cloog/pprint.h> | |||
/************************************************************************** | #endif /* !CLOOG_H */ | |||
**** | ||||
* CLOOG GMP MACROS | ||||
* | ||||
************************************************************************** | ||||
****/ | ||||
#ifdef GNUMP | ||||
#define value_init_c(val) { mpz_init((val)) ; \ | ||||
cloog_value_leak_up() ; \ | ||||
} | ||||
#define value_clear_c(val) { mpz_clear((val)) ; \ | ||||
cloog_value_leak_down() ; \ | ||||
} | ||||
#define value_sprint(Dst,fmt,val) { char * str ; \ | ||||
str = mpz_get_str(0,10,(val)) ; \ | ||||
sprintf((Dst),(fmt),str) ; \ | ||||
free(str) ; \ | ||||
} | ||||
#define value_eq_si(v1,i2) (mpz_cmp_si((v1),(i2)) == 0) | ||||
#define value_ne_si(v1,i2) (mpz_cmp_si((v1),(i2)) != 0) | ||||
#define value_gt_si(v1,i2) (mpz_cmp_si((v1),(i2)) > 0) | ||||
#define value_lt_si(v1,i2) (mpz_cmp_si((v1),(i2)) < 0) | ||||
#define value_multiply_si(ref,v1,i2) (mpz_mul_si((ref),(v1),(i2))) | ||||
/************************************************************************** | ||||
**** | ||||
* CLOOG BASIC TYPES MACROS | ||||
* | ||||
************************************************************************** | ||||
****/ | ||||
#else | ||||
#define value_init_c(val) ((val) = 0) | ||||
#define value_clear_c(val) ((val) = 0) | ||||
#define value_sprint(Dst,fmt,val) (sprintf((Dst),(fmt),(val))) | ||||
#define value_eq_si(v1,i2) ((v1) == (i2)) | ||||
#define value_ne_si(v1,i2) ((v1) != (i2)) | ||||
#define value_gt_si(v1,i2) ((v1) > (i2)) | ||||
#define value_lt_si(v1,i2) ((v1) < (i2)) | ||||
#define value_multiply_si(ref,v1,i2) ((ref) = value_mult((v1),(i2))) | ||||
#endif | ||||
#ifndef value_subtract | ||||
#define value_subtract value_substract | ||||
#endif | ||||
/************************************************************************** | ||||
**** | ||||
* POLYLIB MACROS | ||||
* | ||||
************************************************************************** | ||||
**** | ||||
* Because I was tired to look in polylib/include/polylib/arithmetique.h fo | ||||
r * | ||||
* the existing macros, here is a copy ! | ||||
* | ||||
************************************************************************** | ||||
****/ | ||||
#if 0 | ||||
/************************************************************************** | ||||
**** | ||||
* POLYLIB GMP MACROS | ||||
* | ||||
************************************************************************** | ||||
****/ | ||||
#if defined(GNUMP) | ||||
/* Basic macros */ | ||||
#define value_init(val) (mpz_init((val))) | ||||
#define value_assign(v1,v2) (mpz_set((v1),(v2))) | ||||
#define value_set_si(val,i) (mpz_set_si((val),(i))) | ||||
#define value_set_double(val,d) (mpz_set_d((val),(d))) | ||||
#define value_clear(val) (mpz_clear((val))) | ||||
#define value_read(val,str) (mpz_set_str((val),(str),10)) | ||||
#define value_print(Dst,fmt,val) {char *str; \ | ||||
str = mpz_get_str(0,10,(val)); \ | ||||
fprintf((Dst),(fmt),str); free(str) | ||||
; \ | ||||
} | ||||
#define value_swap(val1,val2) {mpz_t tmp; mpz_init_set(tmp,(val1)) | ||||
; \ | ||||
mpz_set((val1),(val2)); \ | ||||
mpz_set((val2),tmp); \ | ||||
mpz_clear(tmp); \ | ||||
} | ||||
/* Boolean operators on 'Value' */ | ||||
#define value_eq(v1,v2) (mpz_cmp((v1),(v2)) == 0) | ||||
#define value_ne(v1,v2) (mpz_cmp((v1),(v2)) != 0) | ||||
#define value_gt(v1,v2) (mpz_cmp((v1),(v2)) > 0) | ||||
#define value_ge(v1,v2) (mpz_cmp((v1),(v2)) >= 0) | ||||
#define value_lt(v1,v2) (mpz_cmp((v1),(v2)) < 0) | ||||
#define value_le(v1,v2) (mpz_cmp((v1),(v2)) <= 0) | ||||
/* Trian operators on 'Value' */ | ||||
#define value_sign(val) (mpz_sgn(val)) | ||||
#define value_compare(v1,v2) (mpz_cmp((v1),(v2))) | ||||
/* Binary operations on 'Value' */ | ||||
#define value_addto(ref,val1,val2) (mpz_add((ref),(val1),(val2))) | ||||
#define value_add_int(ref,val,vint) (mpz_add_ui((ref),(val),(long)(vint) | ||||
)) | ||||
#define value_increment(ref,val) (mpz_add_ui((ref),(val),1)) | ||||
#define value_multiply(ref,val1,val2) (mpz_mul((ref),(val1),(val2))) | ||||
#define value_substract(ref,val1,val2) (mpz_sub((ref),(val1),(val2))) | ||||
#define value_sub_int(ref,val,vint) (mpz_sub_ui((ref),(val),(long)(vint) | ||||
)) | ||||
#define value_decrement(ref,val) (mpz_sub_ui((ref),(val),1)) | ||||
#define value_division(ref,val1,val2) (mpz_tdiv_q((ref),(val1),(val2))) | ||||
#define value_modulus(ref,val1,val2) (mpz_tdiv_r((ref),(val1),(val2))) | ||||
#define value_pdivision(ref,val1,val2) (mpz_fdiv_q((ref),(val1),(val2))) | ||||
#define value_oppose(ref,val) (mpz_neg((ref),(val))) | ||||
#define value_absolute(ref,val) (mpz_abs((ref),(val))) | ||||
#define value_minimum(ref,val1,val2) (value_le((val1),(val2)) ? \ | ||||
mpz_set((ref),(val1)) : \ | ||||
mpz_set((ref),(val2))) | ||||
#define value_maximum(ref,val1,val2) (value_ge((val1),(val2)) ? \ | ||||
mpz_set((ref),(val1)) : \ | ||||
mpz_set((ref),(val2))) | ||||
#define value_orto(ref,val1,val2) (mpz_ior((ref),(val1),(val2))) | ||||
#define value_andto(ref,val1,val2) (mpz_and((ref),(val1),(val2))) | ||||
/* Conditional operations on 'Value' */ | ||||
#define value_pos_p(val) (mpz_sgn(val) > 0) | ||||
#define value_neg_p(val) (mpz_sgn(val) < 0) | ||||
#define value_posz_p(val) (mpz_sgn(val) >= 0) | ||||
#define value_negz_p(val) (mpz_sgn(val) <= 0) | ||||
#define value_zero_p(val) (mpz_sgn(val) == 0) | ||||
#define value_notzero_p(val) (mpz_sgn(val) != 0) | ||||
#define value_one_p(val) (mpz_cmp_si(val,1) == 0) | ||||
#define value_notone_p(val) (mpz_cmp_si(val,1) != 0) | ||||
#define value_mone_p(val) (mpz_cmp_si(val,-1) ==0) | ||||
#define value_notmone_p(val) (mpz_cmp_si(val,-1) !=0) | ||||
/************************************************************************** | ||||
**** | ||||
* POLYLIB BASIC TYPES MACROS | ||||
* | ||||
************************************************************************** | ||||
****/ | ||||
#else /* 'Value' set to longlong|long|float|char *|int */ | ||||
/* Basic Macros */ | ||||
#define value_init(val) ((val) = 0) | ||||
#define value_assign(v1,v2) ((v1) = (v2)) | ||||
#define value_set_si(val,i) ((val) = (Value)(i)) | ||||
#define value_set_double(val,d) ((val) = (Value)(d)) | ||||
#define value_clear(val) ((val) = 0) | ||||
#define value_read(val,str) (sscanf((str),VALUE_FMT,&(val))) | ||||
#define value_print(Dst,fmt,val) (fprintf((Dst),(fmt),(val))) | ||||
#define value_swap(v1,v2) {Value tmp; tmp = v2; \ | ||||
v2 = v1; v1 = tmp; \ | ||||
} | ||||
/* Cast to 'Value' */ | ||||
#define int_to_value(i) ((Value)(i)) | ||||
#define long_to_value(l) ((Value)(l)) | ||||
#define float_to_value(f) ((Value)(f)) | ||||
#define double_to_value(d) ((Value)(d)) | ||||
/* Boolean operators on 'Value' */ | ||||
#define value_eq(v1,v2) ((v1)==(v2)) | ||||
#define value_ne(v1,v2) ((v1)!=(v2)) | ||||
#define value_gt(v1,v2) ((v1)>(v2)) | ||||
#define value_ge(v1,v2) ((v1)>=(v2)) | ||||
#define value_lt(v1,v2) ((v1)<(v2)) | ||||
#define value_le(v1,v2) ((v1)<=(v2)) | ||||
/* Trian operators on 'Value' */ | ||||
#define value_sign(v) (value_eq(v,VALUE_ZERO) ? \ | ||||
0: \ | ||||
value_lt(v,VALUE_ZERO)?-1:1) | ||||
#define value_compare(v1,v2) (value_eq(v1,v2)? \ | ||||
0: \ | ||||
value_lt(v1,v2)?-1:1) | ||||
/* Binary operators on 'Value' */ | ||||
#define value_plus(v1,v2) ((v1)+(v2)) | ||||
#define value_div(v1,v2) ((v1)/(v2)) | ||||
#define value_mod(v1,v2) ((v1)%(v2)) | ||||
#define value_direct_multiply(v1,v2) ((v1)*(v2)) /* direct! */ | ||||
#define value_minus(v1,v2) ((v1)-(v2)) | ||||
#define value_pdiv(v1,v2) (divide((v1),(v2))) | ||||
#define value_pmod(v1,v2) (modulo((v1),(v2))) | ||||
#define value_min(v1,v2) (value_le((v1),(v2))? (v1): (v2)) | ||||
#define value_max(v1,v2) (value_ge((v1),(v2))? (v1): (v2)) | ||||
#define value_or(v1,v2) ((v1)|(v2)) | ||||
#define value_and(v1,v2) ((v1)&(v2)) | ||||
#define value_lshift(v1,v2) ((v1)<<(v2)) | ||||
#define value_rshift(v1,v2) ((v1)>>(v2)) | ||||
/* Binary operations on 'Value' */ | ||||
#define value_addto(ref,val1,val2) ((ref) = (val1)+(val2)) | ||||
#define value_add_int(ref,val,vint) ((ref) = (val)+(Value)(vint)) | ||||
#define value_increment(ref,val) ((ref) = (val)+VALUE_ONE) | ||||
#define value_direct_product(ref,val1,val2) ((ref) = (val1)*(val2)) /* dire | ||||
ct */ | ||||
#define value_multiply(ref,val1,val2) ((ref) = value_mult((val1),(val2))) | ||||
#define value_substract(ref,val1,val2) ((ref) = (val1)-(val2)) | ||||
#define value_sub_int(ref,val,vint) ((ref) = (val)-(Value)(vint)) | ||||
#define value_decrement(ref,val) ((ref) = (val)-VALUE_ONE) | ||||
#define value_division(ref,val1,val2) ((ref) = (val1)/(val2)) | ||||
#define value_modulus(ref,val1,val2) ((ref) = (val1)%(val2)) | ||||
#define value_pdivision(ref,val1,val2) ((ref) = value_pdiv((val1),(val2))) | ||||
#define value_oppose(ref,val) ((ref) = value_uminus((val))) | ||||
#define value_absolute(ref,val) ((ref) = value_abs((val))) | ||||
#define value_minimum(ref,val1,val2) ((ref) = value_min((val1),(val2))) | ||||
#define value_maximum(ref,val1,val2) ((ref) = value_max((val1),(val2))) | ||||
#define value_orto(ref,val1,val2) ((ref) = (val1)|(val2)) | ||||
#define value_andto(ref,val1,val2) ((ref) = (val1)&(val2)) | ||||
/* Unary operators on 'Value' */ | ||||
#define value_uminus(val) (-(val)) | ||||
#define value_not(val) (~(val)) | ||||
#define value_abs(val) (value_posz_p(val)? \ | ||||
(val) : \ | ||||
(value_ne((val), VALUE_NAN) ? \ | ||||
value_uminus(val) : \ | ||||
(THROW (overflow_error), VALUE_NA | ||||
N ))) | ||||
/* Conditional operations on 'Value' */ | ||||
#define value_pos_p(val) value_gt(val,VALUE_ZERO) | ||||
#define value_neg_p(val) value_lt(val,VALUE_ZERO) | ||||
#define value_posz_p(val) value_ge(val,VALUE_ZERO) | ||||
#define value_negz_p(val) value_le(val,VALUE_ZERO) | ||||
#define value_zero_p(val) value_eq(val,VALUE_ZERO) | ||||
#define value_notzero_p(val) value_ne(val,VALUE_ZERO) | ||||
#define value_one_p(val) value_eq(val,VALUE_ONE) | ||||
#define value_notone_p(val) value_ne(val,VALUE_ONE) | ||||
#define value_mone_p(val) value_eq(val,VALUE_MONE) | ||||
#define value_notmone_p(val) value_ne(val,VALUE_MONE) | ||||
#define value_min_p(val) value_eq(val,VALUE_MIN) | ||||
#define value_max_p(val) value_eq(val,VALUE_MAX) | ||||
#define value_notmin_p(val) value_ne(val,VALUE_MIN) | ||||
#define value_notmax_p(val) value_ne(val,VALUE_MAX) | ||||
#endif /* 'Value' set to |longlong|long|float|char *|int */ | ||||
#endif | ||||
End of changes. 11 change blocks. | ||||
28 lines changed or deleted | 37 lines changed or added | |||
domain.h | domain.h | |||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
**-------------------------------------------------------------------** | **-------------------------------------------------------------------** | |||
** First version: october 28th 2001 ** | ** First version: october 28th 2001 ** | |||
**-------------------------------------------------------------------** / | **-------------------------------------------------------------------** / | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* CLooG : the Chunky Loop Generator (experimental) * | * CLooG : the Chunky Loop Generator (experimental) * | |||
************************************************************************** **** | ************************************************************************** **** | |||
* * | * * | |||
* Copyright (C) 2001-2005 Cedric Bastoul * | * Copyright (C) 2001-2005 Cedric Bastoul * | |||
* * | * * | |||
* This is free software; you can redistribute it and/or modify it under th | * This library is free software; you can redistribute it and/or | |||
e * | * | |||
* terms of the GNU General Public License as published by the Free Softwar | * modify it under the terms of the GNU Lesser General Public | |||
e * | * | |||
* Foundation; either version 2 of the License, or (at your option) any lat | * License as published by the Free Software Foundation; either | |||
er * | * | |||
* version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* * | * * | |||
* This software is distributed in the hope that it will be useful, but | * This library is distributed in the hope that it will be useful, | |||
* | * | |||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILI | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
TY * | * | |||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* | * | |||
* for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* * | * * | |||
* You should have received a copy of the GNU General Public License along | * You should have received a copy of the GNU Lesser General Public | |||
* | * | |||
* with software; if not, write to the Free Software Foundation, Inc., | * License along with this library; if not, write to the Free Software | |||
* | * | |||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||
* | * | |||
* Boston, MA 02110-1301 USA | ||||
* | ||||
* * | * * | |||
* CLooG, the Chunky Loop Generator * | * CLooG, the Chunky Loop Generator * | |||
* Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | |||
* * | * * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
#ifndef CLOOG_DOMAIN_H | #ifndef CLOOG_DOMAIN_H | |||
#define CLOOG_DOMAIN_H | #define CLOOG_DOMAIN_H | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
extern "C" | extern "C" | |||
{ | { | |||
#endif | #endif | |||
/* The Polyhedron structure comes directly from PolyLib (defined in | struct cloogdomain; | |||
* polylib/types.h) here is how it looks like (at least in PolyLib 5.20.0 | ||||
* version). | ||||
* | ||||
* typedef struct polyhedron { | ||||
* unsigned Dimension, // Dimension number (NbColumns-2 in Matrix). | ||||
* NbConstraints, // Number of constraints (NbRows in Matrix). | ||||
* NbRays, // Number of rays in dual representation. | ||||
* NbEq, // Number of vertices (?). | ||||
* NbBid; // Number of extremal rays (?). | ||||
* Value **Constraint; // The pointers to rows in matrix representat | ||||
ion. | ||||
* Value **Ray; // The pointers to rays in dual representatio | ||||
n. | ||||
* Value *p_Init; // The whole data, consecutive in memory. | ||||
* int p_Init_size; // To clear values in GMP mode. | ||||
* struct polyhedron *next; // Pointer to next component of the union. | ||||
* } Polyhedron; | ||||
*/ | ||||
/** | ||||
* CloogDomain structure: | ||||
* this structure contains a polyhedron in the PolyLib shape and the number | ||||
of | ||||
* active references to this structure. Because CLooG uses many copies of | ||||
* domains there is no need to actually copy these domains but just to retu | ||||
rn | ||||
* a pointer to them and to increment the number of active references. Each | ||||
time | ||||
* a CloogDomain will be freed, we will decrement the active reference coun | ||||
ter | ||||
* and actually free it if its value is zero. | ||||
*/ | ||||
struct cloogdomain | ||||
{ Polyhedron * polyhedron ; /**< The polyhedral domain. */ | ||||
int references ; /**< Number of references to this structur | ||||
e. */ | ||||
} ; | ||||
typedef struct cloogdomain CloogDomain ; | typedef struct cloogdomain CloogDomain ; | |||
struct cloogscattering; | ||||
typedef struct cloogscattering CloogScattering; | ||||
/** | /** | |||
* CloogDomainList structure: | * CloogDomainList structure: | |||
* this structure reprensents a node of a linked list of CloogDomain struct ures. | * this structure reprensents a node of a linked list of CloogDomain struct ures. | |||
*/ | */ | |||
struct cloogdomainlist | struct cloogdomainlist { | |||
{ CloogDomain * domain ; /**< An element of the list. */ | CloogDomain *domain; /**< An element of the list. */ | |||
struct cloogdomainlist * next ;/**< Pointer to the next element of the li | struct cloogdomainlist *next;/**< Pointer to the next element of the list | |||
st.*/ | .*/ | |||
} ; | } ; | |||
typedef struct cloogdomainlist CloogDomainList ; | typedef struct cloogdomainlist CloogDomainList; | |||
/************************************************************************** | /** | |||
**** | * CloogScatteringList structure: | |||
* Memory leak hunt functions | * this structure reprensents a node of a linked list of CloogScattering st | |||
* | ructures. | |||
************************************************************************** | */ | |||
****/ | struct cloogscatteringlist { | |||
void cloog_value_leak_up(void) ; | CloogScattering *scatt; /**< An element of the list. */ | |||
void cloog_value_leak_down(void) ; | struct cloogscatteringlist *next;/**< Pointer to the next element of the | |||
list.*/ | ||||
} ; | ||||
typedef struct cloogscatteringlist CloogScatteringList; | ||||
/************************************************************************** **** | /************************************************************************** **** | |||
* PolyLib interface * | * PolyLib interface * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
CloogDomain * cloog_domain_matrix2domain(Matrix *) ; | void cloog_domain_print_constraints(FILE *, CloogDomain *, | |||
Matrix * cloog_domain_domain2matrix(CloogDomain *) ; | int print_number); | |||
void cloog_domain_print(FILE *, CloogDomain *) ; | void cloog_scattering_print_constraints(FILE *, CloogScattering *) | |||
void cloog_polyhedron_print(FILE *, Polyhedron *) ; | ; | |||
void cloog_domain_free(CloogDomain *) ; | void cloog_domain_free(CloogDomain *) ; | |||
void cloog_scattering_free(CloogScattering *); | ||||
CloogDomain * cloog_domain_copy(CloogDomain *) ; | CloogDomain * cloog_domain_copy(CloogDomain *) ; | |||
CloogDomain * cloog_domain_image(CloogDomain *, Matrix *) ; | ||||
CloogDomain * cloog_domain_preimage(CloogDomain *, Matrix *) ; | ||||
CloogDomain * cloog_domain_convex(CloogDomain * Pol) ; | CloogDomain * cloog_domain_convex(CloogDomain * Pol) ; | |||
CloogDomain * cloog_domain_simple_convex(CloogDomain * domain, int nb_par) ; | CloogDomain * cloog_domain_simple_convex(CloogDomain * domain); | |||
CloogDomain * cloog_domain_simplify(CloogDomain *, CloogDomain *) ; | CloogDomain * cloog_domain_simplify(CloogDomain *, CloogDomain *) ; | |||
CloogDomain * cloog_domain_union(CloogDomain *, CloogDomain *) ; | CloogDomain * cloog_domain_union(CloogDomain *, CloogDomain *) ; | |||
CloogDomain * cloog_domain_disjoint(CloogDomain *) ; | ||||
CloogDomain * cloog_domain_intersection(CloogDomain *, CloogDomain *) ; | CloogDomain * cloog_domain_intersection(CloogDomain *, CloogDomain *) ; | |||
CloogDomain * cloog_domain_difference(CloogDomain *, CloogDomain *) ; | CloogDomain * cloog_domain_difference(CloogDomain *, CloogDomain *) ; | |||
int cloog_domain_includes(CloogDomain *, CloogDomain *) ; | void cloog_domain_sort(CloogDomain**,unsigned,unsigned,int *); | |||
CloogDomain * cloog_domain_addconstraints(CloogDomain *, CloogDomain *) ; | int cloog_domain_follows(CloogDomain *dom1, CloogDomain *dom2, unsigned lev | |||
void cloog_domain_sort(Polyhedron**,unsigned,unsigned,unsigned,int | el); | |||
*); | CloogDomain * cloog_domain_empty(CloogDomain *model); | |||
CloogDomain * cloog_domain_empty(int) ; | int cloog_domain_is_bounded(CloogDomain *dim, unsigned level); | |||
CloogDomain *cloog_domain_bound_splitter(CloogDomain *dom, int level); | ||||
/************************************************************************** **** | /************************************************************************** **** | |||
* Structure display function * | * Structure display function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_domain_print_structure(FILE *, CloogDomain *, int) ; | void cloog_domain_print_structure(FILE *file, CloogDomain *domain, int leve | |||
void cloog_domain_list_print(FILE *, CloogDomainList *) ; | l, | |||
const char *name); | ||||
/************************************************************************** **** | /************************************************************************** **** | |||
* Memory deallocation function * | * Memory deallocation function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_domain_list_free(CloogDomainList *) ; | void cloog_domain_list_free(CloogDomainList *); | |||
void cloog_scattering_list_free(CloogScatteringList *); | ||||
/*+************************************************************************ **** | /*+************************************************************************ **** | |||
* Reading function * | * Reading function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
CloogDomain * cloog_domain_read(FILE *) ; | CloogDomain * cloog_domain_read_context(CloogState *state, FILE * foo); | |||
CloogDomain * cloog_domain_union_read(FILE *) ; | CloogDomain * cloog_domain_union_read(CloogState *state, FILE *foo, int nb_ | |||
CloogDomainList * cloog_domain_list_read(FILE *) ; | par); | |||
CloogScattering *cloog_domain_read_scattering(CloogDomain *domain, FILE *fo | ||||
o); | ||||
CloogDomain * cloog_domain_from_cloog_matrix(CloogState *state, | ||||
CloogMatrix *matrix, int nb_par); | ||||
CloogScattering * cloog_scattering_from_cloog_matrix(CloogState *state, | ||||
CloogMatrix *matrix, int nb_scat, int nb_par | ||||
); | ||||
/************************************************************************** **** | /************************************************************************** **** | |||
* Processing functions * | * Processing functions * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
CloogDomain * cloog_domain_malloc(void) ; | CloogConstraintSet *cloog_domain_constraints(CloogDomain *); | |||
CloogDomain * cloog_domain_alloc(Polyhedron *) ; | ||||
CloogDomain * cloog_domain_compact(CloogDomain *) ; | ||||
int cloog_domain_isempty(CloogDomain *) ; | int cloog_domain_isempty(CloogDomain *) ; | |||
int cloog_domain_universe(CloogDomain *) ; | CloogDomain * cloog_domain_universe(CloogState *state, unsigned dim); | |||
CloogDomain * cloog_domain_project(CloogDomain *, int, int) ; | CloogDomain * cloog_domain_project(CloogDomain *, int); | |||
CloogDomain * cloog_domain_bounds(CloogDomain *, int, int) ; | CloogDomain * cloog_domain_extend(CloogDomain *, int); | |||
CloogDomain * cloog_domain_extend(CloogDomain *, int, int) ; | ||||
int cloog_domain_never_integral(CloogDomain *) ; | int cloog_domain_never_integral(CloogDomain *) ; | |||
void cloog_domain_stride(CloogDomain *, int, int, Value *, Value * | void cloog_domain_stride(CloogDomain *, int, cloog_int_t *, cloog_ | |||
) ; | int_t *); | |||
int cloog_domain_integral_lowerbound(CloogDomain *, int, Value *) | int cloog_domain_can_stride(CloogDomain *domain, int level); | |||
; | int cloog_domain_is_otl(CloogDomain *domain, int level); | |||
void cloog_domain_lowerbound_update(CloogDomain *, int, Value) ; | CloogDomain * cloog_domain_stride_lower_bound(CloogDomain *domain, int leve | |||
l, | ||||
CloogStride *stride); | ||||
int cloog_domain_lazy_disjoint(CloogDomain *, CloogDomain *) ; | int cloog_domain_lazy_disjoint(CloogDomain *, CloogDomain *) ; | |||
int cloog_domain_lazy_equal(CloogDomain *, CloogDomain *) ; | int cloog_domain_lazy_equal(CloogDomain *, CloogDomain *) ; | |||
int cloog_domain_lazy_block(CloogDomain *, CloogDomain *, | int cloog_scattering_lazy_block(CloogScattering *, CloogScatterin | |||
CloogDomainList *, int) ; | g *, | |||
int cloog_domain_lazy_isscalar(CloogDomain *, int) ; | CloogScatteringList *, int); | |||
int cloog_domain_list_lazy_same(CloogDomainList *) ; | int cloog_scattering_lazy_isscalar(CloogScattering *, int, | |||
void cloog_domain_scalar(CloogDomain *, int, Value *) ; | cloog_int_t | |||
CloogDomain * cloog_domain_grow(CloogDomain *, int, int) ; | *); | |||
CloogDomain * cloog_domain_cut_first(CloogDomain *) ; | int cloog_domain_lazy_isconstant(CloogDomain *domain, int dimensi | |||
CloogDomain * cloog_domain_erase_dimension(CloogDomain *, int) ; | on, | |||
void cloog_domain_reverse(CloogDomain *) ; | cloog_int_t *value); | |||
void cloog_domain_line_update(Polyhedron *, CloogMatrix *, int, in | int cloog_scattering_list_lazy_same(CloogScatteringList *); | |||
t) ; | CloogDomain * cloog_domain_cut_first(CloogDomain *domain, CloogDomain **res | |||
t); | ||||
CloogDomain * cloog_domain_simplify_union(CloogDomain *domain); | ||||
CloogScattering * cloog_scattering_erase_dimension(CloogScattering *, int); | ||||
#define cloog_domain_polyhedron(x) (x)->polyhedron | ||||
#define cloog_domain_dimension(x) (x)->polyhedron->Dimension | ||||
#define cloog_domain_nbconstraints(x) (x)->polyhedron->NbConstraints | ||||
#define cloog_domain_isconvex(x) ((x)->polyhedron->next == NULL)? 1 : | ||||
0 | ||||
/* | ||||
Polyhedron * cloog_domain_polyhedron(CloogDomain *) ; | ||||
int cloog_domain_dimension(CloogDomain *) ; | int cloog_domain_dimension(CloogDomain *) ; | |||
int cloog_domain_nbconstraints(CloogDomain *) ; | int cloog_domain_parameter_dimension(CloogDomain *domain); | |||
int cloog_scattering_dimension(CloogScattering *, CloogDomain *); | ||||
int cloog_domain_isconvex(CloogDomain *) ; | int cloog_domain_isconvex(CloogDomain *) ; | |||
*/ | CloogDomain * cloog_domain_cube(CloogState *state, | |||
int dim, cloog_int_t min, cloog_int_t max); | ||||
CloogDomain * cloog_domain_from_context(CloogDomain *context); | ||||
CloogDomain * cloog_domain_scatter(CloogDomain *domain, CloogScattering *sc | ||||
att); | ||||
int cloog_scattering_fully_specified(CloogScattering *scattering, | ||||
CloogDomain *domain); | ||||
CloogStride *cloog_domain_list_stride(CloogDomainList *list, int level); | ||||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif /* define _H */ | #endif /* define _H */ | |||
End of changes. 24 change blocks. | ||||
124 lines changed or deleted | 107 lines changed or added | |||
loop.h | loop.h | |||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
**-------------------------------------------------------------------** | **-------------------------------------------------------------------** | |||
** First version: october 26th 2001 ** | ** First version: october 26th 2001 ** | |||
**-------------------------------------------------------------------** / | **-------------------------------------------------------------------** / | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* CLooG : the Chunky Loop Generator (experimental) * | * CLooG : the Chunky Loop Generator (experimental) * | |||
************************************************************************** **** | ************************************************************************** **** | |||
* * | * * | |||
* Copyright (C) 2001-2005 Cedric Bastoul * | * Copyright (C) 2001-2005 Cedric Bastoul * | |||
* * | * * | |||
* This is free software; you can redistribute it and/or modify it under th | * This library is free software; you can redistribute it and/or | |||
e * | * | |||
* terms of the GNU General Public License as published by the Free Softwar | * modify it under the terms of the GNU Lesser General Public | |||
e * | * | |||
* Foundation; either version 2 of the License, or (at your option) any lat | * License as published by the Free Software Foundation; either | |||
er * | * | |||
* version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* * | * * | |||
* This software is distributed in the hope that it will be useful, but | * This library is distributed in the hope that it will be useful, | |||
* | * | |||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILI | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
TY * | * | |||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* | * | |||
* for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* * | * * | |||
* You should have received a copy of the GNU General Public License along | * You should have received a copy of the GNU Lesser General Public | |||
* | * | |||
* with software; if not, write to the Free Software Foundation, Inc., | * License along with this library; if not, write to the Free Software | |||
* | * | |||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||
* | * | |||
* Boston, MA 02110-1301 USA | ||||
* | ||||
* * | * * | |||
* CLooG, the Chunky Loop Generator * | * CLooG, the Chunky Loop Generator * | |||
* Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | |||
* * | * * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
#ifndef CLOOG_LOOP_H | #ifndef CLOOG_LOOP_H | |||
#define CLOOG_LOOP_H | #define CLOOG_LOOP_H | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
extern "C" | extern "C" | |||
skipping to change at line 60 | skipping to change at line 61 | |||
* - if the loop comes as a result of a cloog_loop_generate call, the domai n | * - if the loop comes as a result of a cloog_loop_generate call, the domai n | |||
* describes the constraints (guards and loop bounds) for only one dimens ion | * describes the constraints (guards and loop bounds) for only one dimens ion | |||
* (the last one: outer dimensions being considered as parameters), the s tride | * (the last one: outer dimensions being considered as parameters), the s tride | |||
* may differ from one (this means that on the considered dimension, a st ep of | * may differ from one (this means that on the considered dimension, a st ep of | |||
* 'stride' must be considered between integral point, the first integral | * 'stride' must be considered between integral point, the first integral | |||
* point to be considered being the lower bound of the loop), inner may d iffer | * point to be considered being the lower bound of the loop), inner may d iffer | |||
* from NULL, meaning that there are further dimensions and nesting level s in | * from NULL, meaning that there are further dimensions and nesting level s in | |||
* the loop. | * the loop. | |||
*/ | */ | |||
struct cloogloop | struct cloogloop | |||
{ CloogDomain * domain ; /**< The iteration domain. */ | { | |||
Value stride ; /**< The stride for the corresponding iterato | CloogState *state; /**< State. */ | |||
r | CloogDomain * domain ; /**< The iteration domain. */ | |||
CloogDomain *unsimplified; /**< Unsimplified version of domain. */ | ||||
int otl; /**< Loop is executed at most once. */ | ||||
CloogStride *stride; /**< If not NULL, stride information on itera | ||||
tor | ||||
* (filled only after loop generation). | * (filled only after loop generation). | |||
*/ | */ | |||
CloogBlock * block ; /**< The included statement block, NULL if no ne.*/ | CloogBlock * block ; /**< The included statement block, NULL if no ne.*/ | |||
void * usr; /**< User field, for library user convenience. | ||||
* This pointer is not freed when the | ||||
* CloogLoop structure is freed. | ||||
*/ | ||||
struct cloogloop * inner ; /**< Loops at the next level. */ | struct cloogloop * inner ; /**< Loops at the next level. */ | |||
struct cloogloop * next ; /**< Next loop at the same level. */ | struct cloogloop * next ; /**< Next loop at the same level. */ | |||
} ; | } ; | |||
typedef struct cloogloop CloogLoop ; | typedef struct cloogloop CloogLoop ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Structure display function * | * Structure display function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_loop_print_structure(FILE *, CloogLoop *, int) ; | void cloog_loop_print_structure(FILE *, CloogLoop *, int) ; | |||
void cloog_loop_print(FILE *, CloogLoop *) ; | void cloog_loop_print(FILE *, CloogLoop *) ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Memory deallocation function * | * Memory deallocation function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_loop_free(CloogLoop *) ; | void cloog_loop_free(CloogLoop *) ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Reading functions * | * Reading functions * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
CloogLoop * cloog_loop_read(FILE *, int, int) ; | CloogLoop *cloog_loop_from_domain(CloogState *state, CloogDomain *domain, | |||
int number); | ||||
CloogLoop * cloog_loop_read(CloogState *state, | ||||
FILE * foo, int number, int nb_parameters); | ||||
/************************************************************************** **** | /************************************************************************** **** | |||
* Processing functions * | * Processing functions * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
CloogLoop * cloog_loop_malloc(void) ; | CloogLoop * cloog_loop_block(CloogLoop *loop, int *scaldims, int nb_scattdi | |||
CloogLoop * cloog_loop_generate(CloogLoop *, CloogDomain *, int, int, | ms); | |||
int *, int, int, CloogOptions *) ; | CloogLoop * cloog_loop_malloc(CloogState *state); | |||
CloogLoop * cloog_loop_simplify(CloogLoop *, CloogDomain *, int, int) ; | CloogLoop *cloog_loop_generate(CloogLoop *loop, CloogDomain *context, | |||
void cloog_loop_scatter(CloogLoop *, CloogDomain *) ; | int level, int scalar, int *scaldims, int nb_scattdims, | |||
CloogOptions *options); | ||||
CloogLoop *cloog_loop_simplify(CloogLoop *loop, CloogDomain *context, int l | ||||
evel, | ||||
int nb_scattdims, CloogOptions *options); | ||||
void cloog_loop_scatter(CloogLoop *, CloogScattering *); | ||||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif /* define _H */ | #endif /* define _H */ | |||
End of changes. 7 change blocks. | ||||
31 lines changed or deleted | 49 lines changed or added | |||
matrix.h | matrix.h | |||
---|---|---|---|---|
/**-------------------------------------------------------------------** | ||||
** CLooG ** | ||||
**-------------------------------------------------------------------** | ||||
** matrix.h ** | ||||
**-------------------------------------------------------------------** | ||||
** First version: april 17th 2005 ** | ||||
**-------------------------------------------------------------------** | ||||
/ | ||||
/************************************************************************** | ||||
**** | ||||
* CLooG : the Chunky Loop Generator (experimental) | ||||
* | ||||
************************************************************************** | ||||
**** | ||||
* | ||||
* | ||||
* Copyright (C) 2005 Cedric Bastoul | ||||
* | ||||
* | ||||
* | ||||
* This is free software; you can redistribute it and/or modify it under th | ||||
e * | ||||
* terms of the GNU General Public License as published by the Free Softwar | ||||
e * | ||||
* Foundation; either version 2 of the License, or (at your option) any lat | ||||
er * | ||||
* version. | ||||
* | ||||
* | ||||
* | ||||
* This software is distributed in the hope that it will be useful, but | ||||
* | ||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILI | ||||
TY * | ||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||||
* | ||||
* for more details. | ||||
* | ||||
* | ||||
* | ||||
* You should have received a copy of the GNU General Public License along | ||||
* | ||||
* with software; if not, write to the Free Software Foundation, Inc., | ||||
* | ||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||||
* | ||||
* | ||||
* | ||||
* CLooG, the Chunky Loop Generator | ||||
* | ||||
* Written by Cedric Bastoul, Cedric.Bastoul@inria.fr | ||||
* | ||||
* | ||||
* | ||||
************************************************************************** | ||||
****/ | ||||
#ifndef CLOOG_MATRIX_H | #ifndef CLOOG_MATRIX_H | |||
#define CLOOG_MATRIX_H | #define CLOOG_MATRIX_H | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
extern "C" | extern "C" | |||
{ | { | |||
#endif | #endif | |||
/* The Matrix structure comes directly from PolyLib (defined in polylib/typ | /* The CloogMatrix structure is equivalent to the PolyLib Matrix data struc | |||
es.h) | ture | |||
* here is how it looks like (at least in PolyLib 5.20.0 version). | * (see Wil93). This structure is devoted to represent a set of constraints | |||
. | ||||
* | * | |||
* typedef struct matrix { | * The whole matrix is stored in memory row after row at the p_Init address | |||
* unsigned NbRows; // The number of rows (= NbConstraints in Polyhedro | . p | |||
n). | * is an array of pointers where p[i] points to the first element of the i^ | |||
* unsigned NbColumns; // The number of columns (= Dimension+2 in Polyhedr | {th | |||
on). | * row. NbRows and NbColumns are respectively the number of rows and column | |||
* Value **p; // An array of pointers to the beginning of each ro | s of | |||
w. | * the matrix. Each row corresponds to a constraint. The first element of e | |||
* Value *p_Init; // The matrix is stored here, contiguously in memor | ach | |||
y. | * row is an equality/inequality tag. The constraint is an equality p(x) = | |||
* int p_Init_size; // Needed to free the memory allocated by mpz_init. | 0 if | |||
* Matrix; | * the first element is 0, but it is an inequality p(x) \geq 0 if the first | |||
*/ | * element is 1. The next elements are the unknown coefficients, followed b | |||
y | ||||
#define CloogMatrix Matrix | * the parameter coefficients, then the constant term. For instance, the | |||
* following three constraints: | ||||
/************************************************************************** | * | |||
**** | * -i + m = 0 | |||
* PolyLib interface | * -j + n >= 0 | |||
* | * i + j - k >= 0 | |||
************************************************************************** | * | |||
****/ | * would be represented by the following rows: | |||
void cloog_matrix_print(FILE *, CloogMatrix *) ; | * | |||
void cloog_matrix_free(CloogMatrix *) ; | * # eq/in i j k m n cst | |||
CloogMatrix * cloog_matrix_alloc(unsigned, unsigned) ; | * 0 0 -1 0 1 0 0 | |||
CloogMatrix * cloog_matrix_matrix(Matrix *); | * 1 -1 0 0 0 1 0 | |||
* 1 1 1 -1 0 0 0 | ||||
* | ||||
* To be able to provide different precision version (CLooG supports 32 bit | ||||
s, | ||||
* 64 bits and arbitrary precision through the GMP library), the cloog_int_ | ||||
t | ||||
* type depends on the configuration options (it may be long int for 32 bit | ||||
s | ||||
* version, long long int for 64 bits version, and mpz_t for multiple preci | ||||
sion | ||||
* version). */ | ||||
/************************************************************************** | struct cloogmatrix | |||
**** | { unsigned NbRows; /* Number of rows. */ | |||
* Structure display function | unsigned NbColumns; /* Number of columns. */ | |||
* | cloog_int_t ** p; /* Array of pointers to the matrix rows. */ | |||
************************************************************************** | cloog_int_t * p_Init; /* Matrix rows contiguously in memory. */ | |||
****/ | }; | |||
void cloog_matrix_print_structure(FILE *, CloogMatrix *, int) ; | ||||
/************************************************************************** | typedef struct cloogmatrix CloogMatrix; | |||
**** | ||||
* Reading function | ||||
* | ||||
************************************************************************** | ||||
****/ | ||||
CloogMatrix * cloog_matrix_read(FILE *) ; | ||||
/************************************************************************** | CloogMatrix *cloog_matrix_alloc (unsigned, unsigned); | |||
**** | void cloog_matrix_free (CloogMatrix *); | |||
* Processing functions | void cloog_matrix_print_structure(FILE *file, CloogMatrix *M, | |||
* | const char *prefix, const char *suffix); | |||
************************************************************************** | CloogMatrix *cloog_matrix_read(FILE *input); | |||
****/ | CloogMatrix *cloog_matrix_read_of_size(FILE *input, | |||
void cloog_matrix_normalize(CloogMatrix *, int) ; | unsigned n_row, unsigned n_col); | |||
void cloog_matrix_equality_update(CloogMatrix *, int, int) ; | void cloog_matrix_print(FILE*, CloogMatrix*); | |||
CloogMatrix * cloog_matrix_copy(CloogMatrix *) ; | ||||
Value * cloog_matrix_vector_copy(Value *, int) ; | ||||
Value * cloog_matrix_vector_simplify(Value*, CloogMatrix*, int, int, | ||||
int); | ||||
CloogMatrix * cloog_matrix_simplify(CloogMatrix *, CloogMatrix *, int, int) | ||||
; | ||||
void cloog_matrix_vector_free(Value *, int) ; | ||||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif /* define _H */ | #endif /* define _H */ | |||
End of changes. 6 change blocks. | ||||
116 lines changed or deleted | 55 lines changed or added | |||
names.h | names.h | |||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
**-------------------------------------------------------------------** | **-------------------------------------------------------------------** | |||
** First version: august 1st 2002 ** | ** First version: august 1st 2002 ** | |||
**-------------------------------------------------------------------** / | **-------------------------------------------------------------------** / | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* CLooG : the Chunky Loop Generator (experimental) * | * CLooG : the Chunky Loop Generator (experimental) * | |||
************************************************************************** **** | ************************************************************************** **** | |||
* * | * * | |||
* Copyright (C) 2001-2005 Cedric Bastoul * | * Copyright (C) 2001-2005 Cedric Bastoul * | |||
* * | * * | |||
* This is free software; you can redistribute it and/or modify it under th | * This library is free software; you can redistribute it and/or | |||
e * | * | |||
* terms of the GNU General Public License as published by the Free Softwar | * modify it under the terms of the GNU Lesser General Public | |||
e * | * | |||
* Foundation; either version 2 of the License, or (at your option) any lat | * License as published by the Free Software Foundation; either | |||
er * | * | |||
* version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* * | * * | |||
* This software is distributed in the hope that it will be useful, but | * This library is distributed in the hope that it will be useful, | |||
* | * | |||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILI | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
TY * | * | |||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* | * | |||
* for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* * | * * | |||
* You should have received a copy of the GNU General Public License along | * You should have received a copy of the GNU Lesser General Public | |||
* | * | |||
* with software; if not, write to the Free Software Foundation, Inc., | * License along with this library; if not, write to the Free Software | |||
* | * | |||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||
* | * | |||
* Boston, MA 02110-1301 USA | ||||
* | ||||
* * | * * | |||
* CLooG, the Chunky Loop Generator * | * CLooG, the Chunky Loop Generator * | |||
* Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | |||
* * | * * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
#ifndef CLOOG_NAMES_H | #ifndef CLOOG_NAMES_H | |||
#define CLOOG_NAMES_H | #define CLOOG_NAMES_H | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
extern "C" | extern "C" | |||
skipping to change at line 60 | skipping to change at line 61 | |||
*/ | */ | |||
struct cloognames | struct cloognames | |||
{ int nb_scalars ; /**< Scalar dimension number. */ | { int nb_scalars ; /**< Scalar dimension number. */ | |||
int nb_scattering ; /**< Scattering iterator number. */ | int nb_scattering ; /**< Scattering iterator number. */ | |||
int nb_iterators ; /**< Iterator number. */ | int nb_iterators ; /**< Iterator number. */ | |||
int nb_parameters ; /**< Parameter number. */ | int nb_parameters ; /**< Parameter number. */ | |||
char ** scalars ; /**< The scalar names (an array of strings). */ | char ** scalars ; /**< The scalar names (an array of strings). */ | |||
char ** scattering ; /**< The scattering names (an array of strings). */ | char ** scattering ; /**< The scattering names (an array of strings). */ | |||
char ** iterators ; /**< The iterator names (an array of strings). */ | char ** iterators ; /**< The iterator names (an array of strings). */ | |||
char ** parameters ; /**< The parameter names (an array of strings). */ | char ** parameters ; /**< The parameter names (an array of strings). */ | |||
int references; /**< Number of references to this structure. */ | ||||
} ; | } ; | |||
typedef struct cloognames CloogNames ; | typedef struct cloognames CloogNames ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Structure display function * | * Structure display function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_names_print_structure(FILE *, CloogNames *, int) ; | void cloog_names_print_structure(FILE *, CloogNames *, int) ; | |||
void cloog_names_print(FILE *, CloogNames *) ; | void cloog_names_print(FILE *, CloogNames *) ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Memory deallocation function * | * Memory deallocation function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_names_free(CloogNames *) ; | void cloog_names_free(CloogNames *) ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Reading functions * | * Reading functions * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
char ** cloog_names_read_strings(FILE *, int, char *, char) ; | char ** cloog_names_read_strings(FILE *file, int nb_items); | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Processing functions * | * Processing functions * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
CloogNames * cloog_names_malloc(void) ; | CloogNames * cloog_names_malloc(void); | |||
CloogNames * cloog_names_alloc(int,int,int,int,char **,char **,char **,char | CloogNames * cloog_names_copy(CloogNames *names); | |||
**); | CloogNames * cloog_names_alloc(void); | |||
char ** cloog_names_generate_items(int, char *, char) ; | char ** cloog_names_generate_items(int, char *, char) ; | |||
CloogNames * cloog_names_generate(int, int, int, int, char, char, char, cha r) ; | CloogNames * cloog_names_generate(int, int, int, int, char, char, char, cha r) ; | |||
void cloog_names_scalarize(CloogNames *, int, int *) ; | void cloog_names_scalarize(CloogNames *, int, int *) ; | |||
const char * cloog_names_name_at_level(CloogNames *names, int level); | ||||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif /* define _H */ | #endif /* define _H */ | |||
End of changes. 7 change blocks. | ||||
26 lines changed or deleted | 30 lines changed or added | |||
options.h | options.h | |||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
**-------------------------------------------------------------------** | **-------------------------------------------------------------------** | |||
** First version: april 19th 2003 ** | ** First version: april 19th 2003 ** | |||
**-------------------------------------------------------------------** / | **-------------------------------------------------------------------** / | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* CLooG : the Chunky Loop Generator (experimental) * | * CLooG : the Chunky Loop Generator (experimental) * | |||
************************************************************************** **** | ************************************************************************** **** | |||
* * | * * | |||
* Copyright (C) 2001-2005 Cedric Bastoul * | * Copyright (C) 2001-2005 Cedric Bastoul * | |||
* * | * * | |||
* This is free software; you can redistribute it and/or modify it under th | * This library is free software; you can redistribute it and/or | |||
e * | * | |||
* terms of the GNU General Public License as published by the Free Softwar | * modify it under the terms of the GNU Lesser General Public | |||
e * | * | |||
* Foundation; either version 2 of the License, or (at your option) any lat | * License as published by the Free Software Foundation; either | |||
er * | * | |||
* version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* * | * * | |||
* This software is distributed in the hope that it will be useful, but | * This library is distributed in the hope that it will be useful, | |||
* | * | |||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILI | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
TY * | * | |||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* | * | |||
* for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* * | * * | |||
* You should have received a copy of the GNU General Public License along | * You should have received a copy of the GNU Lesser General Public | |||
* | * | |||
* with software; if not, write to the Free Software Foundation, Inc., | * License along with this library; if not, write to the Free Software | |||
* | * | |||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||
* | * | |||
* Boston, MA 02110-1301 USA | ||||
* | ||||
* * | * * | |||
* CLooG, the Chunky Loop Generator * | * CLooG, the Chunky Loop Generator * | |||
* Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | |||
* * | * * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
#include <stdio.h> | ||||
#ifndef CLOOG_OPTIONS_H | #ifndef CLOOG_OPTIONS_H | |||
#define CLOOG_OPTIONS_H | #define CLOOG_OPTIONS_H | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
extern "C" | extern "C" | |||
{ | { | |||
#endif | #endif | |||
/* Uncomment the following line if you want some information about | /* Uncomment the following line if you want some information about | |||
* maximum total allocated memory for code generation. | * maximum total allocated memory for code generation. | |||
#define CLOOG_MEMORY | ||||
*/ | */ | |||
/* #define CLOOG_MEMORY */ | ||||
#define CLOOG_SCALARS | #define CLOOG_SCALARS | |||
struct cloogoptions; | ||||
typedef struct cloogoptions CloogOptions; | ||||
struct cloogoptions | struct cloogoptions | |||
{ /* OPTIONS FOR LOOP GENERATION */ | { | |||
CloogState *state; /* State. */ | ||||
/* OPTIONS FOR LOOP GENERATION */ | ||||
int l ; /* Last level to optimize. */ | int l ; /* Last level to optimize. */ | |||
int f ; /* First level to optimize. */ | int f ; /* First level to optimize. */ | |||
int stop ; /* Level to stop code generation. */ | int stop ; /* Level to stop code generation. */ | |||
int shortcode ; /* 1 to avoid some warning when user wants a short code. */ | ||||
int strides ; /* 1 if user wants to handle non-unit strides (then loop | int strides ; /* 1 if user wants to handle non-unit strides (then loop | |||
* increment can be something else than one), 0 otherwise . | * increment can be something else than one), 0 otherwise . | |||
*/ | */ | |||
int sh ; /* 1 for computing simple hulls, 0 otherwise. */ | int sh; /* 1 for computing simple hulls */ | |||
/* OPTIONS FOR PRETTY PRINTING */ | /* OPTIONS FOR PRETTY PRINTING */ | |||
int esp ; /* 1 if user wants to spread all equalities, i.e. when th ere | int esp ; /* 1 if user wants to spread all equalities, i.e. when th ere | |||
* is something like "i = 3*j + 1 ; A[i] = 0 ;" the gener ator | * is something like "i = 3*j + 1 ; A[i] = 0 ;" the gener ator | |||
* will write "A[3*j + 1] = 0 ;", 0 otherwise. | * will write "A[3*j + 1] = 0 ;", 0 otherwise. | |||
*/ | */ | |||
int csp ; /* 1 if user wants to spread the constant equalities, | ||||
* i.e. the simple equalities like "i = M ;", "i = j ;".. | ||||
. | ||||
* It is for performance saving with a spreading, 0 other | ||||
wise. | ||||
*/ | ||||
int fsp ; /* The iteration level where equalities spreading can beg in | int fsp ; /* The iteration level where equalities spreading can beg in | |||
* (it might happen that the user wants not to spread val ues | * (it might happen that the user wants not to spread val ues | |||
* of scattering iterators). | * of scattering iterators). | |||
*/ | */ | |||
int otl ; /* 1 for eliminate loops running just one time and write them | int otl ; /* 1 for eliminate loops running just one time and write them | |||
* as an affectation of the iterator, 0 otherwise. | * as an affectation of the iterator, 0 otherwise. | |||
*/ | */ | |||
int block ; /* 1 to make one new block {...} per new dimension, | int block ; /* 1 to make one new block {...} per new dimension, | |||
* 0 otherwise. | * 0 otherwise. | |||
*/ | */ | |||
int cpp ; /* 1 to generate a pseudo-code easily compilable by using | int compilable; /* 1 to generate a compilable code by using | |||
* preprocessing, 0 otherwise. | * preprocessing, 0 otherwise. | |||
*/ | */ | |||
int compilable; /* 1 to generate a compilable code by using | int callable; /* 1 to generate callable code by using | |||
* preprocessing, 0 otherwise. | * preprocessing, 0 otherwise. | |||
*/ | */ | |||
int language; /* 1 to generate FORTRAN, 0 for C otherwise. */ | ||||
int save_domains;/* Save unsimplified copy of domain. */ | ||||
/* MISC OPTIONS */ | /* MISC OPTIONS */ | |||
char * name ; /* Name of the input file. */ | char * name ; /* Name of the input file. */ | |||
float time ; /* Time spent for code generation in seconds. */ | float time ; /* Time spent for code generation in seconds. */ | |||
#ifdef CLOOG_MEMORY | #ifdef CLOOG_MEMORY | |||
int memory ; /* Memory spent for code generation in kilobytes. */ | int memory ; /* Memory spent for code generation in kilobytes. */ | |||
#endif | #endif | |||
int quiet; /* Don't print any informational messages. */ | ||||
/* UNDOCUMENTED OPTIONS FOR THE AUTHOR ONLY */ | /* UNDOCUMENTED OPTIONS FOR THE AUTHOR ONLY */ | |||
int leaks ; /* 1 if I want to print the allocation statistics, | int leaks ; /* 1 if I want to print the allocation statistics, | |||
* 0 otherwise. | * 0 otherwise. | |||
*/ | */ | |||
int nobacktrack;/* 1 if I don't want to achieve backtracking in | int backtrack; /* 1 to perform backtracking in | |||
* Quillere's algorithm, 0 otherwise. | * Quillere's algorithm, 0 otherwise. | |||
*/ | */ | |||
int override ; /* 1 if I want to bypass CLooG decisions on option correc tness | int override ; /* 1 if I want to bypass CLooG decisions on option correc tness | |||
* (generated code may be incorrect), 0 otherwise. | * (generated code may be incorrect), 0 otherwise. | |||
*/ | */ | |||
int structure ; /* 1 if I want to print the CloogProgram structure before the | int structure ; /* 1 if I want to print the CloogProgram structure before the | |||
* pretty printed code, 0 otherwise. | * pretty printed code, 0 otherwise. | |||
*/ | */ | |||
int noblocks ; /* 1 if I don't want to make statement blocks, 0 otherwis e. */ | int noblocks ; /* 1 if I don't want to make statement blocks, 0 otherwis e. */ | |||
int noscalars ; /* 1 if I don't want to use scalar dimensions, 0 otherwis e. */ | int noscalars ; /* 1 if I don't want to use scalar dimensions, 0 otherwis e. */ | |||
int nosimplify; /* 1 if I don't want to simplify polyhedra, 0 otherwise. */ | int nosimplify; /* 1 if I don't want to simplify polyhedra, 0 otherwise. */ | |||
} ; | } ; | |||
typedef struct cloogoptions CloogOptions ; | ||||
/************************************************************************** | ||||
**** | ||||
* Error reporting functions | ||||
* | ||||
************************************************************************** | ||||
****/ | ||||
enum cloog_msg_type { CLOOG_ERROR, CLOOG_WARNING, CLOOG_INFO }; | ||||
void cloog_msg(CloogOptions *options, enum cloog_msg_type type, | ||||
const char *msg, ...); | ||||
void cloog_die(const char *msg, ...); | ||||
/************************************************************************** **** | /************************************************************************** **** | |||
* Structure display function * | * Structure display function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_options_print(FILE *, CloogOptions *) ; | void cloog_options_print(FILE *, CloogOptions *) ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Memory deallocation function * | * Memory deallocation function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_options_free(CloogOptions *) ; | void cloog_options_free(CloogOptions *) ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Reading function * | * Reading function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_options_read(int, char **, FILE **, FILE **, CloogOptions **) ; | void cloog_options_read(CloogState *state, int argc, char **argv, | |||
FILE **input, FILE **output, CloogOptions **options) | ||||
; | ||||
/************************************************************************** **** | /************************************************************************** **** | |||
* Processing functions * | * Processing functions * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
CloogOptions * cloog_options_malloc(void) ; | CloogOptions *cloog_options_malloc(CloogState *state); | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif /* define _H */ | #endif /* define _H */ | |||
End of changes. 19 change blocks. | ||||
38 lines changed or deleted | 58 lines changed or added | |||
pprint.h | pprint.h | |||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
**-------------------------------------------------------------------** | **-------------------------------------------------------------------** | |||
** First version: october 26th 2001 ** | ** First version: october 26th 2001 ** | |||
**-------------------------------------------------------------------** / | **-------------------------------------------------------------------** / | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* CLooG : the Chunky Loop Generator (experimental) * | * CLooG : the Chunky Loop Generator (experimental) * | |||
************************************************************************** **** | ************************************************************************** **** | |||
* * | * * | |||
* Copyright (C) 2001-2005 Cedric Bastoul * | * Copyright (C) 2001-2005 Cedric Bastoul * | |||
* * | * * | |||
* This is free software; you can redistribute it and/or modify it under th | * This library is free software; you can redistribute it and/or | |||
e * | * | |||
* terms of the GNU General Public License as published by the Free Softwar | * modify it under the terms of the GNU Lesser General Public | |||
e * | * | |||
* Foundation; either version 2 of the License, or (at your option) any lat | * License as published by the Free Software Foundation; either | |||
er * | * | |||
* version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* * | * * | |||
* This software is distributed in the hope that it will be useful, but | * This library is distributed in the hope that it will be useful, | |||
* | * | |||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILI | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
TY * | * | |||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* | * | |||
* for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* * | * * | |||
* You should have received a copy of the GNU General Public License along | * You should have received a copy of the GNU Lesser General Public | |||
* | * | |||
* with software; if not, write to the Free Software Foundation, Inc., | * License along with this library; if not, write to the Free Software | |||
* | * | |||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||
* | * | |||
* Boston, MA 02110-1301 USA | ||||
* | ||||
* * | * * | |||
* CLooG, the Chunky Loop Generator * | * CLooG, the Chunky Loop Generator * | |||
* Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | |||
* * | * * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
#ifndef CLOOG_PPRINT_H | #ifndef CLOOG_PPRINT_H | |||
#define CLOOG_PPRINT_H | #define CLOOG_PPRINT_H | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
extern "C" | extern "C" | |||
{ | { | |||
#endif | #endif | |||
# define MAX_STRING_VAL 32 | # define MAX_STRING_VAL 32 | |||
# define INDENT_STEP 2 | # define INDENT_STEP 2 | |||
# define ONE_TIME_LOOP -1 | ||||
# define EQTYPE_NONE 0 | ||||
# define EQTYPE_CONSTANT 1 | # define EQTYPE_CONSTANT 1 | |||
# define EQTYPE_PUREITEM 2 | # define EQTYPE_PUREITEM 2 | |||
# define EQTYPE_EXAFFINE 3 | # define EQTYPE_EXAFFINE 3 | |||
# define LANGUAGE_C 0 | # define LANGUAGE_C 0 | |||
# define LANGUAGE_FORTRAN 1 | # define LANGUAGE_FORTRAN 1 | |||
/** | ||||
* CloogInfos structure: | ||||
* this structure contains all the informations necessary for pretty printi | ||||
ng, | ||||
* they come from the original CloogProgram structure (language, names), fr | ||||
om | ||||
* genereral options (options) or are built only for pretty printing (strid | ||||
e). | ||||
* This structure is mainly there to reduce the number of function paramete | ||||
rs, | ||||
* since most pprint.c functions need most of its field. | ||||
*/ | ||||
struct clooginfos | ||||
{ Value * stride ; /**< The stride for each iterator. */ | ||||
int language ; /**< 1 to generate FORTRAN, 0 for C otherwise. | ||||
*/ | ||||
int nb_scattdims ; /**< Scattering dimension number. */ | ||||
int * scaldims ; /**< Boolean array saying whether a given | ||||
* scattering dimension is scalar or not. | ||||
*/ | ||||
CloogNames * names ; /**< Names of iterators and parameters. */ | ||||
CloogOptions * options ; /**< Options on CLooG's behaviour. */ | ||||
} ; | ||||
typedef struct clooginfos CloogInfos ; | ||||
/************************************************************************** | ||||
**** | ||||
* useful prototypes | ||||
* | ||||
************************************************************************** | ||||
****/ | ||||
char * pprint_line(CloogMatrix *, CloogMatrix *, int, int, CloogInfos *) ; | ||||
char * pprint_minmax(CloogMatrix *, CloogMatrix *, int, int, int, CloogInfo | ||||
s *); | ||||
/************************************************************************** **** | /************************************************************************** **** | |||
* Structure display function * | * Structure display function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void pprint(FILE *, CloogLoop *, CloogMatrix *, int, int, int, CloogInfos * | void clast_pprint(FILE *foo, struct clast_stmt *root, int indent, | |||
) ; | CloogOptions *options); | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif /* define _H */ | #endif /* define _H */ | |||
End of changes. 7 change blocks. | ||||
60 lines changed or deleted | 27 lines changed or added | |||
program.h | program.h | |||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
**-------------------------------------------------------------------** | **-------------------------------------------------------------------** | |||
** First version: october 25th 2001 ** | ** First version: october 25th 2001 ** | |||
**-------------------------------------------------------------------** / | **-------------------------------------------------------------------** / | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* CLooG : the Chunky Loop Generator (experimental) * | * CLooG : the Chunky Loop Generator (experimental) * | |||
************************************************************************** **** | ************************************************************************** **** | |||
* * | * * | |||
* Copyright (C) 2001-2005 Cedric Bastoul * | * Copyright (C) 2001-2005 Cedric Bastoul * | |||
* * | * * | |||
* This is free software; you can redistribute it and/or modify it under th | * This library is free software; you can redistribute it and/or | |||
e * | * | |||
* terms of the GNU General Public License as published by the Free Softwar | * modify it under the terms of the GNU Lesser General Public | |||
e * | * | |||
* Foundation; either version 2 of the License, or (at your option) any lat | * License as published by the Free Software Foundation; either | |||
er * | * | |||
* version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* * | * * | |||
* This software is distributed in the hope that it will be useful, but | * This library is distributed in the hope that it will be useful, | |||
* | * | |||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILI | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
TY * | * | |||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* | * | |||
* for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* * | * * | |||
* You should have received a copy of the GNU General Public License along | * You should have received a copy of the GNU Lesser General Public | |||
* | * | |||
* with software; if not, write to the Free Software Foundation, Inc., | * License along with this library; if not, write to the Free Software | |||
* | * | |||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||
* | * | |||
* Boston, MA 02110-1301 USA | ||||
* | ||||
* * | * * | |||
* CLooG, the Chunky Loop Generator * | * CLooG, the Chunky Loop Generator * | |||
* Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | |||
* * | * * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
#ifndef CLOOG_PROGRAM_H | #ifndef CLOOG_PROGRAM_H | |||
#define CLOOG_PROGRAM_H | #define CLOOG_PROGRAM_H | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
extern "C" | extern "C" | |||
skipping to change at line 63 | skipping to change at line 64 | |||
int nb_scattdims ; /**< Scattering dimension number. */ | int nb_scattdims ; /**< Scattering dimension number. */ | |||
CloogDomain * context ; /**< The context of the program. */ | CloogDomain * context ; /**< The context of the program. */ | |||
CloogLoop * loop ; /**< The loops of the program. */ | CloogLoop * loop ; /**< The loops of the program. */ | |||
CloogNames * names ; /**< Iterators and parameters names. */ | CloogNames * names ; /**< Iterators and parameters names. */ | |||
CloogBlockList * blocklist ; /**< The statement block list. */ | CloogBlockList * blocklist ; /**< The statement block list. */ | |||
/* Internal service fields, filled up by cloog_program_scatter function. */ | /* Internal service fields, filled up by cloog_program_scatter function. */ | |||
int * scaldims ; /**< Boolean array saying whether a given | int * scaldims ; /**< Boolean array saying whether a given | |||
* scattering dimension is scalar or not. | * scattering dimension is scalar or not. | |||
*/ | */ | |||
/* Library user reserved field. */ | ||||
void * usr; /**< User field, for library user convenience | ||||
. | ||||
* This pointer is not freed when the | ||||
* CloogProgram structure is freed. | ||||
*/ | ||||
} ; | } ; | |||
typedef struct cloogprogram CloogProgram ; | typedef struct cloogprogram CloogProgram ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Structure display function * | * Structure display function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_program_print_structure(FILE *, CloogProgram *, int) ; | void cloog_program_print_structure(FILE *, CloogProgram *, int) ; | |||
void cloog_program_print(FILE *, CloogProgram *) ; | void cloog_program_print(FILE *, CloogProgram *) ; | |||
void cloog_program_pprint(FILE *, CloogProgram *, CloogOptions *) ; | void cloog_program_pprint(FILE *, CloogProgram *, CloogOptions *) ; | |||
void cloog_program_dump_cloog(FILE *, CloogProgram *) ; | void cloog_program_dump_cloog(FILE *, CloogProgram *, CloogScatteringList * ); | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Memory deallocation function * | * Memory deallocation function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_program_free(CloogProgram *) ; | void cloog_program_free(CloogProgram *) ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Reading function * | * Reading function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
CloogProgram * cloog_program_read(FILE *, CloogOptions *) ; | CloogProgram * cloog_program_read(FILE *, CloogOptions *) ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Processing functions * | * Processing functions * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
CloogProgram * cloog_program_malloc(void) ; | CloogProgram * cloog_program_malloc(void); | |||
CloogProgram * cloog_program_alloc(CloogDomain *context, CloogUnionDomain * | ||||
ud, | ||||
CloogOptions *options); | ||||
CloogProgram * cloog_program_generate(CloogProgram *, CloogOptions *) ; | CloogProgram * cloog_program_generate(CloogProgram *, CloogOptions *) ; | |||
void cloog_program_block(CloogProgram *, CloogDomainList *) ; | void cloog_program_block(CloogProgram *program, | |||
void cloog_program_extract_scalars(CloogProgram *program, CloogDomainList * | CloogScatteringList *scattering, CloogOptions *options); | |||
) ; | void cloog_program_extract_scalars(CloogProgram *program, | |||
void cloog_program_scatter(CloogProgram *, CloogDomainList *) ; | CloogScatteringList *scattering, CloogOptions *options); | |||
void cloog_program_scatter(CloogProgram *program, | ||||
CloogScatteringList *scattering, CloogOptions *optio | ||||
ns); | ||||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif /* define _H */ | #endif /* define _H */ | |||
End of changes. 7 change blocks. | ||||
28 lines changed or deleted | 42 lines changed or added | |||
statement.h | statement.h | |||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
**-------------------------------------------------------------------** | **-------------------------------------------------------------------** | |||
** First version: november 4th 2001 ** | ** First version: november 4th 2001 ** | |||
**-------------------------------------------------------------------** / | **-------------------------------------------------------------------** / | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* CLooG : the Chunky Loop Generator (experimental) * | * CLooG : the Chunky Loop Generator (experimental) * | |||
************************************************************************** **** | ************************************************************************** **** | |||
* * | * * | |||
* Copyright (C) 2001-2005 Cedric Bastoul * | * Copyright (C) 2001-2005 Cedric Bastoul * | |||
* * | * * | |||
* This is free software; you can redistribute it and/or modify it under th | * This library is free software; you can redistribute it and/or | |||
e * | * | |||
* terms of the GNU General Public License as published by the Free Softwar | * modify it under the terms of the GNU Lesser General Public | |||
e * | * | |||
* Foundation; either version 2 of the License, or (at your option) any lat | * License as published by the Free Software Foundation; either | |||
er * | * | |||
* version. | * version 2.1 of the License, or (at your option) any later version. | |||
* | * | |||
* * | * * | |||
* This software is distributed in the hope that it will be useful, but | * This library is distributed in the hope that it will be useful, | |||
* | * | |||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILI | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
TY * | * | |||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* | * | |||
* for more details. | * Lesser General Public License for more details. | |||
* | * | |||
* * | * * | |||
* You should have received a copy of the GNU General Public License along | * You should have received a copy of the GNU Lesser General Public | |||
* | * | |||
* with software; if not, write to the Free Software Foundation, Inc., | * License along with this library; if not, write to the Free Software | |||
* | * | |||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | |||
* | * | |||
* Boston, MA 02110-1301 USA | ||||
* | ||||
* * | * * | |||
* CLooG, the Chunky Loop Generator * | * CLooG, the Chunky Loop Generator * | |||
* Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * | |||
* * | * * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
#ifndef CLOOG_STATEMENT_H | #ifndef CLOOG_STATEMENT_H | |||
#define CLOOG_STATEMENT_H | #define CLOOG_STATEMENT_H | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
extern "C" | extern "C" | |||
{ | { | |||
#endif | #endif | |||
struct cloogstatement | struct cloogstatement | |||
{ int number ; /* The statement unique number. */ | { | |||
CloogState *state; /* State. */ | ||||
char *name; /* Name of the statement. */ | ||||
int number; /* The statement unique number. */ | ||||
void * usr ; /* A pointer for library users convenience . */ | void * usr ; /* A pointer for library users convenience . */ | |||
struct cloogstatement * next ; /* Pointer to the next statement with the | struct cloogstatement * next ; /* Pointer to the next statement with the | |||
* same original domain and the same | * same original domain and the same | |||
* scattering function. | * scattering function. | |||
*/ | */ | |||
} ; | } ; | |||
typedef struct cloogstatement CloogStatement ; | typedef struct cloogstatement CloogStatement ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Structure display function * | * Structure display function * | |||
skipping to change at line 66 | skipping to change at line 70 | |||
void cloog_statement_print(FILE *, CloogStatement *) ; | void cloog_statement_print(FILE *, CloogStatement *) ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Memory deallocation function * | * Memory deallocation function * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
void cloog_statement_free(CloogStatement *) ; | void cloog_statement_free(CloogStatement *) ; | |||
/************************************************************************** **** | /************************************************************************** **** | |||
* Processing functions * | * Processing functions * | |||
************************************************************************** ****/ | ************************************************************************** ****/ | |||
CloogStatement * cloog_statement_malloc() ; | CloogStatement * cloog_statement_malloc(CloogState *state); | |||
CloogStatement * cloog_statement_alloc(int) ; | CloogStatement * cloog_statement_alloc(CloogState *state, int); | |||
CloogStatement * cloog_statement_copy(CloogStatement *) ; | CloogStatement * cloog_statement_copy(CloogStatement *) ; | |||
void cloog_statement_add(CloogStatement**, CloogStatement**, CloogStatement *) ; | void cloog_statement_add(CloogStatement**, CloogStatement**, CloogStatement *) ; | |||
#if defined(__cplusplus) | #if defined(__cplusplus) | |||
} | } | |||
#endif | #endif | |||
#endif /* define _H */ | #endif /* define _H */ | |||
End of changes. 5 change blocks. | ||||
25 lines changed or deleted | 30 lines changed or added | |||