2 /**-------------------------------------------------------------------**
4 **-------------------------------------------------------------------**
6 **-------------------------------------------------------------------**
7 ** First version: June 11th 2005 **
8 **-------------------------------------------------------------------**/
11 /******************************************************************************
12 * CLooG : the Chunky Loop Generator (experimental) *
13 ******************************************************************************
15 * Copyright (C) 2001-2005 Cedric Bastoul *
17 * This is free software; you can redistribute it and/or modify it under the *
18 * terms of the GNU General Public License as published by the Free Software *
19 * Foundation; either version 2 of the License, or (at your option) any later *
22 * This software is distributed in the hope that it will be useful, but *
23 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
24 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
27 * You should have received a copy of the GNU General Public License along *
28 * with software; if not, write to the Free Software Foundation, Inc., *
29 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
31 * CLooG, the Chunky Loop Generator *
32 * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
34 ******************************************************************************/
39 #if defined(__cplusplus)
46 * CloogBlock structure:
47 * this structure contains the informations of a statement block. It may happen
48 * that users are lazy enough to ask CLooG to generate the code for statements
49 * with exactly the same domain/scattering pair (possibly differing by only one
50 * constant) instead of giving only one pair. CLooG provides them a last chance
51 * to save time and memory by trying to find these blocks itself. The block
52 * contains the statement list and the common informations of the statements.
53 * This structure contains also the number of existing active references to it:
54 * because CLooG uses many copies of blocks there is no need to actually copy
55 * these blocks but just to return a pointer to them and to increment the number
56 * of active references. Each time a CloogBlock will be freed, we will decrement
57 * the active reference counter and actually free it if its value is zero.
60 { CloogStatement
* statement
; /**< The list of statements in the block. */
61 CloogMatrix
* scattering
; /**< The scattering function for the block. */
62 int nb_scaldims
; /**< Number of scalar dimensions. */
63 Value
* scaldims
; /**< Scalar dimension values. */
64 int depth
; /**< Original block depth (outer loop number).*/
65 int references
; /**< Number of references to this structure. */
66 void * usr
; /**< User field, for library user convenience.
67 * This pointer is not freed when the
68 * CloogBlock structure is freed.
71 typedef struct cloogblock CloogBlock
;
75 * CloogBlockList structure:
76 * this structure reprensents a node of a linked list of CloogBlock structures.
79 { CloogBlock
* block
; /**< An element of the list. */
80 struct cloogblocklist
* next
;/**< Pointer to the next element of the list.*/
82 typedef struct cloogblocklist CloogBlockList
;
85 /******************************************************************************
86 * Structure display function *
87 ******************************************************************************/
88 void cloog_block_print_structure(FILE *, CloogBlock
*, int) ;
89 void cloog_block_print(FILE *, CloogBlock
*) ;
90 void cloog_block_list_print(FILE *, CloogBlockList
*) ;
93 /******************************************************************************
94 * Memory deallocation function *
95 ******************************************************************************/
96 void cloog_block_free(CloogBlock
*) ;
97 void cloog_block_list_free(CloogBlockList
*) ;
100 /******************************************************************************
101 * Processing functions *
102 ******************************************************************************/
103 CloogBlock
* cloog_block_malloc(void);
104 CloogBlock
* cloog_block_alloc(CloogStatement
*,CloogMatrix
*,int,Value
*,int);
105 CloogBlockList
* cloog_block_list_malloc(void);
106 CloogBlockList
* cloog_block_list_alloc(CloogBlock
*) ;
107 CloogBlock
* cloog_block_copy(CloogBlock
* block
) ;
108 void cloog_block_merge(CloogBlock
*, CloogBlock
*) ;
110 #if defined(__cplusplus)
113 #endif /* define _H */