PIPS
variable.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <limits.h>
#include <string.h>
#include "genC.h"
#include "misc.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "dg.h"
#include "graph.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "effects-util.h"
#include "text-util.h"
#include "effects-generic.h"
#include "effects-convex.h"
#include "arithmetique.h"
#include "matrice.h"
#include "tiling.h"
#include "wp65.h"
+ Include dependency graph for variable.c:

Go to the source code of this file.

Typedefs

typedef dg_arc_label arc_label
 Code Generation for Distributed Memory Machines. More...
 
typedef dg_vertex_label vertex_label
 

Functions

void loop_nest_to_local_variables (entity initial_module, entity compute_module, entity memory_module, hash_table llv_to_lcr, hash_table r_to_llv, hash_table v_to_lllv, hash_table r_to_ud, hash_table v_to_esv, hash_table v_to_nlv, list lpv, statement body, Pbase indices, graph dg, int bn, int ls, int pd, tiling tile)
 for the phi variable More...
 
entity make_emulated_shared_variable (entity v, entity memory_module, int bn, int ls)
 
entity find_or_create_emulated_shared_variable (entity v, entity memory_module, hash_table v_to_esv, int bn, int ls)
 
list make_new_local_variables (entity v, entity compute_module, int number, int pd, hash_table v_to_lllv)
 
bool reference_conflicting_test_and_update (reference r, graph dg, hash_table v_to_lllv, hash_table llv_to_lcr, hash_table r_to_llv, hash_table r_to_ud)
 reference_conflicting_test_and_update(): More...
 
bool reference_conflicting_p (reference r1, reference r2, graph dg)
 
Psysteme make_tile_constraints (matrice P, Pbase b)
 Psysteme make_tile_constraints(P, b): More...
 
void set_dimensions_of_local_variables (hash_table v_to_lllv, Pbase basis, tiling tile, hash_table llv_to_lcr)
 
void set_dimensions_of_local_variable_family (list llv, Psysteme tc, list lr, tiling tile, int dimn)
 void set_dimensions_of_local_variable_family(llv, tc, lr): More...
 

Typedef Documentation

◆ arc_label

Code Generation for Distributed Memory Machines.

Define and allocate local variables as well as emulated shared variables

File: variable.c

PUMA, ESPRIT contract 2701

Francois Irigoin, Corinne Ancourt, Lei Zhou 1991

Definition at line 54 of file variable.c.

◆ vertex_label

Definition at line 55 of file variable.c.

Function Documentation

◆ find_or_create_emulated_shared_variable()

entity find_or_create_emulated_shared_variable ( entity  v,
entity  memory_module,
hash_table  v_to_esv,
int  bn,
int  ls 
)

nothing to do

Parameters
memory_moduleemory_module
v_to_esv_to_esv
bnn
lss

Definition at line 284 of file variable.c.

290 {
291  entity esv = entity_undefined;
292 
293  if ( (esv = gen_find_tabulated(concatenate(entity_local_name(memory_module),
297  NULL),
299  /* nothing to do */
300  ;
301  else {
302  esv = make_emulated_shared_variable(v, memory_module, bn, ls);
303  hash_put(v_to_esv, (char *) v, (char *) esv);
304  }
305  return (esv);
306 }
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
Definition: hash.c:364
#define MODULE_SEP_STRING
Definition: naming-local.h:30
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
void * gen_find_tabulated(const char *, int)
Definition: tabulated.c:218
entity make_emulated_shared_variable(entity v, entity memory_module, int bn, int ls)
Definition: variable.c:195
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
#define entity_undefined
Definition: ri.h:2761
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410
#define EMULATED_SHARED_MEMORY_PREFIX
Header File for WP65.
Definition: wp65-local.h:34

References concatenate(), EMULATED_SHARED_MEMORY_PREFIX, entity_domain, entity_local_name(), entity_undefined, gen_find_tabulated(), hash_put(), make_emulated_shared_variable(), and MODULE_SEP_STRING.

Referenced by loop_nest_to_local_variables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loop_nest_to_local_variables()

void loop_nest_to_local_variables ( entity  initial_module,
entity  compute_module,
entity  memory_module,
hash_table  llv_to_lcr,
hash_table  r_to_llv,
hash_table  v_to_lllv,
hash_table  r_to_ud,
hash_table  v_to_esv,
hash_table  v_to_nlv,
list  lpv,
statement  body,
Pbase  indices,
graph  dg,
int  bn,
int  ls,
int  pd,
tiling  tile 
)

for the phi variable

variable.c

loop_nest_to_local_variables():

Key function allocating local copies according to interferences between references. It also gather information about references (which is also indirectly available in the effect information), allocate emulated shared variables, and create different mappings between local variables and references.

pips_assert("loop_nest_to_local_variables", instruction_block_p(instr));

first reference in statement s

there are only two expressions to loop over: the lhs and the rhs

FI: local variable dimensions should be set later by the caller so as to use the clustering performed here to compute space complexity, to use space complexity to define the tiling and to use the tiling to define the dimensions

Parameters
initial_modulenitial_module
compute_moduleloop_nest_to_local_variables():

Key function allocating local copies according to interferences between references. It also gather information about references (which is also indirectly available in the effect information), allocate emulated shared variables, and create different mappings between local variables and references. initial module: achtung, this arg. is not used!?!

Parameters
memory_moduleloop_nest_to_local_variables():

Key function allocating local copies according to interferences between references. It also gather information about references (which is also indirectly available in the effect information), allocate emulated shared variables, and create different mappings between local variables and references. compute module

Parameters
llv_to_lcrloop_nest_to_local_variables():

Key function allocating local copies according to interferences between references. It also gather information about references (which is also indirectly available in the effect information), allocate emulated shared variables, and create different mappings between local variables and references. memory module

Parameters
r_to_llvloop_nest_to_local_variables():

Key function allocating local copies according to interferences between references. It also gather information about references (which is also indirectly available in the effect information), allocate emulated shared variables, and create different mappings between local variables and references. local variable to list of conflicting references

Parameters
v_to_lllvloop_nest_to_local_variables():

Key function allocating local copies according to interferences between references. It also gather information about references (which is also indirectly available in the effect information), allocate emulated shared variables, and create different mappings between local variables and references. reference to list of local variables

Parameters
r_to_udloop_nest_to_local_variables():

Key function allocating local copies according to interferences between references. It also gather information about references (which is also indirectly available in the effect information), allocate emulated shared variables, and create different mappings between local variables and references. variable to list of lists of local variables

Parameters
v_to_esvloop_nest_to_local_variables():

Key function allocating local copies according to interferences between references. It also gather information about references (which is also indirectly available in the effect information), allocate emulated shared variables, and create different mappings between local variables and references. reference to use def

Parameters
v_to_nlvloop_nest_to_local_variables():

Key function allocating local copies according to interferences between references. It also gather information about references (which is also indirectly available in the effect information), allocate emulated shared variables, and create different mappings between local variables and references. variable to emulated shared variable

Parameters
lpvloop_nest_to_local_variables():

Key function allocating local copies according to interferences between references. It also gather information about references (which is also indirectly available in the effect information), allocate emulated shared variables, and create different mappings between local variables and references. variable to number of associated local variables (local to this procedure)

Parameters
bodyloop_nest_to_local_variables():

Key function allocating local copies according to interferences between references. It also gather information about references (which is also indirectly available in the effect information), allocate emulated shared variables, and create different mappings between local variables and references. private variables

Parameters
indicesndices
dgg
bnn
lss
pdd
tileile

Definition at line 80 of file variable.c.

103 {
104  pips_assert("true", initial_module==initial_module);
105  list block;
106  instruction instr = statement_instruction(body);
107 
108  debug(6,"loop_nest_to_local_variables","begin\n");
109 
110  ifdebug(5) {
111  (void) fprintf(stderr,"Private variables:");
112  print_entities(lpv);
113  }
114 
115 /* pips_assert("loop_nest_to_local_variables",
116  instruction_block_p(instr));*/
117 
118  if (instruction_call_p(instr))
119  block = CONS(STATEMENT,body,NIL);
120  else block = instruction_block(instr);
121 
122  for( ;!ENDP(block); POP(block)) {
124 
125  if(assignment_statement_p(s)) {
127  /* first reference in statement s */
128  bool first_reference = true;
129  /* there are only two expressions to loop over: the lhs and the
130  rhs */
131  for(; !ENDP(lexpr); POP(lexpr)) {
132  expression e = EXPRESSION(CAR(lexpr));
134  list consr;
135 
136  ifdebug(7) {
137  (void) fprintf(stderr, "reference list:");
139  (void) fprintf(stderr, "first_reference=%s\n",
140  bool_to_string(first_reference));
141  }
142 
143  for(consr = lr; !ENDP(consr) ; POP(consr)) {
144  reference r = REFERENCE(CAR(consr));
145  entity rv = reference_variable(r);
146 
147  if(entity_is_argument_p(rv, lpv) || reference_indices(r) ==NIL) {
148  debug(7,"loop_nest_to_local_variables",
149  "Variable %s is private\n",
150  entity_local_name(rv));
151 
152  first_reference = false;
153  }
154  else {
155  hash_put(r_to_ud, r,
156  (void*)(intptr_t)(first_reference?
158  first_reference = false;
160  v_to_lllv,
161  llv_to_lcr,
162  r_to_llv,
163  r_to_ud)) {
164  entity v = reference_variable(r);
165  intptr_t n;
166  list llv;
167  (void) find_or_create_emulated_shared_variable(v, memory_module,
168  v_to_esv,
169  bn, ls);
170  if((n = (intptr_t) hash_get(v_to_nlv, (char *) v))
172  n = 0;
173  llv = make_new_local_variables(v, compute_module, n, pd,
174  v_to_lllv);
175  hash_put(llv_to_lcr, llv,
176  CONS(REFERENCE, r, NIL));
177  hash_put(r_to_llv, r, llv);
178  hash_put(v_to_nlv, v, (void*)(n+1));
179  }
180  }
181  }
182  gen_free_list(lr);
183  }
184  }
185  }
186  /* FI: local variable dimensions should be set later by the caller
187  so as to use the clustering performed here to compute space
188  complexity, to use space complexity to define the tiling and
189  to use the tiling to define the dimensions */
190  set_dimensions_of_local_variables(v_to_lllv, indices, tile, llv_to_lcr);
191 
192  debug(6,"loop_nest_to_local_variables","end\n");
193 }
bool entity_is_argument_p(entity e, cons *args)
Definition: arguments.c:150
static graph dg
dg is the dependency graph ; FIXME : should not be static global ?
Definition: chains.c:124
@ is_action_write
Definition: effects.h:293
@ is_action_read
Definition: effects.h:292
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define POP(l)
Modify a list pointer to point on the next element of the list.
Definition: newgen_list.h:59
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
bool assignment_statement_p(statement)
Test if a statement is an assignment.
Definition: statement.c:135
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:449
static list indices
Definition: icm.c:204
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189
string bool_to_string(bool)
Definition: string.c:243
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
Definition: newgen_hash.h:56
void set_dimensions_of_local_variables(hash_table v_to_lllv, Pbase basis, tiling tile, hash_table llv_to_lcr)
Definition: variable.c:652
list make_new_local_variables(entity v, entity compute_module, int number, int pd, hash_table v_to_lllv)
Definition: variable.c:310
bool reference_conflicting_test_and_update(reference r, graph dg, hash_table v_to_lllv, hash_table llv_to_lcr, hash_table r_to_llv, hash_table r_to_ud)
reference_conflicting_test_and_update():
Definition: variable.c:401
entity find_or_create_emulated_shared_variable(entity v, entity memory_module, hash_table v_to_esv, int bn, int ls)
Definition: variable.c:284
void print_reference_list(list lr)
Definition: expression.c:147
#define instruction_block(i)
void print_entities(list l)
Definition: entity.c:167
list expression_to_reference_list(expression e, list lr)
conversion of an expression into a list of references; references are appended to list lr as they are...
Definition: expression.c:1263
#define REFERENCE(x)
REFERENCE.
Definition: ri.h:2296
#define reference_variable(x)
Definition: ri.h:2326
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define reference_indices(x)
Definition: ri.h:2328
#define instruction_call_p(x)
Definition: ri.h:1527
#define statement_instruction(x)
Definition: ri.h:2458
#define instruction_call(x)
Definition: ri.h:1529
#define call_arguments(x)
Definition: ri.h:711
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
#define ifdebug(n)
Definition: sg.c:47
#define intptr_t
Definition: stdint.in.h:294
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
struct block block

References assignment_statement_p(), bool_to_string(), call_arguments, CAR, CONS, debug(), dg, ENDP, entity_is_argument_p(), entity_local_name(), EXPRESSION, expression_to_reference_list(), find_or_create_emulated_shared_variable(), fprintf(), gen_free_list(), hash_get(), hash_put(), HASH_UNDEFINED_VALUE, ifdebug, indices, instruction_block, instruction_call, instruction_call_p, intptr_t, is_action_read, is_action_write, make_new_local_variables(), NIL, pips_assert, POP, print_entities(), print_reference_list(), REFERENCE, reference_conflicting_test_and_update(), reference_indices, reference_variable, set_dimensions_of_local_variables(), STATEMENT, and statement_instruction.

Referenced by loop_nest_to_wp65_code().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_emulated_shared_variable()

entity make_emulated_shared_variable ( entity  v,
entity  memory_module,
int  bn,
int  ls 
)

filled in the following

filled in the following

generate the proper type; basic is preserved but the array is made two dimensional

In two sprintf , -1 is added once seperately by LZ make_expression_1 takes the place of the make_expression_1 12/11/91

FI->CA, LZ: what should we do with scalar variables? Put a copy on each memory bank? Take into account memory bank conflicts shown in thresholding (PUMA WP 6.1 and 6.7)

Parameters
memory_moduleemory_module
bnn
lss

Definition at line 195 of file variable.c.

200 {
201  string esv_name = strdup(concatenate(entity_local_name(memory_module),
205  NULL));
206  entity esv = gen_find_tabulated(esv_name, entity_domain);
207  type tv = entity_type(v);
210  entity a;
211  int number_of_elements = 1;
212 
215  debug(8,"make_emulated_shared_variable", "begin\n");
216 
217  pips_assert("make_emulated_shared_variable", esv == entity_undefined );
218  pips_assert("make_emulated_shared_variable", type_variable_p(tv));
219 
220 
221 
222  esv = make_entity(esv_name,
223  type_undefined, /* filled in the following */
225  value_undefined ); /* filled in the following */
226 
227  /* generate the proper type; basic is preserved but the array is made
228  two dimensional */
229 
230  for( ; !ENDP(ldv); POP(ldv)) {
231  dimension d = DIMENSION(CAR(ldv));
232  int size = dimension_size(d);
233  number_of_elements *= size;
234  }
235 
236  ifdebug(8) {
237  (void) fprintf(stderr,"number of elements for %s: %d\n",
239  }
240 
241  /* In two sprintf , -1 is added once seperately by LZ
242  * make_expression_1 takes the place of the make_expression_1
243  * 12/11/91
244  */
245  if(number_of_elements > 1) {
247  int_to_expression(ls-1),
248  NIL);
250  int_to_expression((number_of_elements+ls*bn-1)/(ls*bn)),
251  NIL);
252 
254  CONS(DIMENSION, esvd1,
255  CONS(DIMENSION, esvd2, NIL)));
256  }
257  else {
258  /* FI->CA, LZ: what should we do with scalar variables? Put a copy
259  on each memory bank? Take into account memory bank conflicts
260  shown in thresholding (PUMA WP 6.1 and 6.7) */
262  }
263 
265 
266  a = FindEntity(module_local_name(memory_module),
269  (make_ram(memory_module,
270  a,
272  esv),
273  NIL)));
274 
275  AddEntityToDeclarations(esv,memory_module);
276 
277  debug(8,"make_emulated_shared_variable", "esv_name=%s\n", entity_name(esv));
278  ifdebug(8) print_sentence(stderr,Sentence_Variable(esv));
280 
281  return(esv);
282 }
value make_value_unknown(void)
Definition: ri.c:2847
basic copy_basic(basic p)
BASIC.
Definition: ri.c:104
storage make_storage(enum storage_utype tag, void *val)
Definition: ri.c:2273
ram make_ram(entity a1, entity a2, intptr_t a3, list a4)
Definition: ri.c:1999
dimension make_dimension(expression a1, expression a2, list a3)
Definition: ri.c:565
bool number_of_elements(list, intptr_t *)
flint_utils.c
Definition: flint_utils.c:50
char end
Definition: gtk_status.c:82
#define DYNAMIC_AREA_LOCAL_NAME
Definition: naming-local.h:69
void AddEntityToDeclarations(entity e, entity module)
END_EOLE.
Definition: variable.c:108
int add_variable_to_area(entity a, entity v)
Definition: variable.c:1376
sentence Sentence_Variable(entity e)
Definition: declarations.c:583
#define make_entity(n, t, s, i)
entity FindEntity(const char *package, const char *name)
Retrieve an entity from its package/module name and its local name.
Definition: entity.c:1503
const char * module_local_name(entity e)
Returns the module local user name.
Definition: entity.c:582
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
int dimension_size(dimension)
this function computes the size of a dimension.
Definition: size.c:491
type MakeTypeVariable(basic, cons *)
BEGIN_EOLE.
Definition: type.c:116
#define value_undefined
Definition: ri.h:3016
#define type_variable(x)
Definition: ri.h:2949
#define entity_storage(x)
Definition: ri.h:2794
@ is_storage_ram
Definition: ri.h:2492
#define entity_name(x)
Definition: ri.h:2790
#define dimension_undefined
Definition: ri.h:955
#define variable_dimensions(x)
Definition: ri.h:3122
#define type_undefined
Definition: ri.h:2883
#define entity_type(x)
Definition: ri.h:2792
#define type_variable_p(x)
Definition: ri.h:2947
#define variable_basic(x)
Definition: ri.h:3120
#define storage_undefined
Definition: ri.h:2476
#define entity_initial(x)
Definition: ri.h:2796
char * strdup()
return(s1)
void print_sentence(FILE *fd, sentence s)
FI: just to make sure that text.h is built; pips-makemake -l does not tale into account a library who...
Definition: print.c:53

References add_variable_to_area(), AddEntityToDeclarations(), CAR, concatenate(), CONS, copy_basic(), debug(), DIMENSION, dimension_size(), dimension_undefined, DYNAMIC_AREA_LOCAL_NAME, EMULATED_SHARED_MEMORY_PREFIX, ENDP, entity_domain, entity_initial, entity_local_name(), entity_name, entity_storage, entity_type, entity_undefined, FindEntity(), fprintf(), gen_find_tabulated(), ifdebug, int_to_expression(), is_storage_ram, make_dimension(), make_entity, make_ram(), make_storage(), make_value_unknown(), MakeTypeVariable(), module_local_name(), MODULE_SEP_STRING, NIL, number_of_elements(), pips_assert, POP, print_sentence(), Sentence_Variable(), storage_undefined, strdup(), type_undefined, type_variable, type_variable_p, value_undefined, variable_basic, and variable_dimensions.

Referenced by find_or_create_emulated_shared_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_new_local_variables()

list make_new_local_variables ( entity  v,
entity  compute_module,
int  number,
int  pd,
hash_table  v_to_lllv 
)

Local variables cannot be immediately dimensionned because this will depend on all associated references.

To avoid a possible "fusion" between references connected in the dg, local variable declarations should be delayed to that point.

concatenate cannot be used (directly) because of n and s conversions

a new btv is necessary for each variable because CONS cannot be shared under NewGen rules

FI->LZ: the type should be v's type, except for the dimensions, the storage should be RAM and allocated in the dynamic area of module_name, and the value is undefined; the actual dimensions will be updated later

update v_to_lllv by side effect

Parameters
compute_moduleompute_module
numberumber
pdlocal copy number
v_to_lllvpipeline depth

Definition at line 310 of file variable.c.

316 {
317  /* Local variables cannot be immediately dimensionned because this
318  will depend on *all* associated references.
319 
320  To avoid a possible "fusion" between references connected in the dg,
321  local variable declarations should be delayed to that point. */
322 
323  /* concatenate cannot be used (directly) because of n and s conversions */
324  char *local_variable_name;
325  int s;
326  list llv = NIL;
327  list lllv = NIL;
328  const char* computational_name = entity_local_name(compute_module);
329 
330  type tv = entity_type(v);
331  entity a;
332 
333  debug(7,"make_new_local_variables","begin v=%s, number=%d, pd=%d\n",
334  entity_name(v), number, pd);
335 
336  for(s=0; s<pd; s++) {
337  entity lv;
338  /* a new btv is necessary for each variable because CONS cannot
339  be shared under NewGen rules */
341 
342  (void) asprintf(&local_variable_name,"%s%s%s%s%s%d%s%d",
343  computational_name,
348  number,
350  s);
351 
352  /* FI->LZ: the type should be v's type, except for the dimensions,
353  the storage should be RAM and allocated in the dynamic
354  area of module_name, and the value is undefined;
355  the actual dimensions will be updated later */
356  lv = make_entity(local_variable_name,
357  MakeTypeVariable(btv, NIL),
360 
361  a = FindEntity(module_local_name(compute_module),
363  pips_assert("make_new_local_variables",!entity_undefined_p(a));
364 
366  (make_ram(compute_module, a,
367  add_variable_to_area(a, lv),
368  NIL)));
369 
370 
371  AddEntityToDeclarations( lv,compute_module);
372  llv = gen_nconc(llv, CONS(ENTITY, lv, NIL));
373  }
374 
375  if((lllv = (list) hash_get(v_to_lllv, (char *) v))
376  == (list) HASH_UNDEFINED_VALUE) {
377  lllv = CONS(LIST, llv, NIL);
378  hash_put(v_to_lllv, (char *) v, (char *) lllv);
379  }
380  else {
381  /* update v_to_lllv by side effect */
382  lllv = gen_nconc(lllv, CONS(LIST, llv, NIL));
383  }
384 
385 
386  debug(7,"make_new_local_variables","end\n");
387 
388  return llv;
389 }
#define LIST(x)
Definition: genC.h:93
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define asprintf
Definition: misc-local.h:225
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define entity_undefined_p(x)
Definition: ri.h:2762
#define LOCAL_MEMORY_SEPARATOR
Definition: wp65-local.h:36
#define LOCAL_MEMORY_PREFIX
Definition: wp65-local.h:35

References add_variable_to_area(), AddEntityToDeclarations(), asprintf, CONS, copy_basic(), debug(), DYNAMIC_AREA_LOCAL_NAME, ENTITY, entity_local_name(), entity_name, entity_storage, entity_type, entity_undefined_p, FindEntity(), gen_nconc(), hash_get(), hash_put(), HASH_UNDEFINED_VALUE, is_storage_ram, LIST, LOCAL_MEMORY_PREFIX, LOCAL_MEMORY_SEPARATOR, make_entity, make_ram(), make_storage(), MakeTypeVariable(), module_local_name(), MODULE_SEP_STRING, NIL, pips_assert, storage_undefined, type_variable, value_undefined, and variable_basic.

Referenced by loop_nest_to_local_variables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_tile_constraints()

Psysteme make_tile_constraints ( matrice  P,
Pbase  b 
)

Psysteme make_tile_constraints(P, b):

convert a partitioning matrice into a system of linear constraints for a tile whose origin is 0, i.e. generate constraints over local indices:

-> -1 -> -—> 0 <= k P b <= (k-1)

where k is the denominator of P inverse.

FI: such functions should be put together in a file, linear.c

pips_assert("make_tile_constraints", k > 1);

Definition at line 591 of file variable.c.

594 {
595  Psysteme tc = sc_new();
596 
597  int d = base_dimension(b);
598  Value k = DENOMINATOR(P);
599  int i,j;
600 
601  matrice IP = matrice_new(d,d);
602  Pcontrainte c1;
603 
604  debug(8,"make_tile_constraints", "begin\n");
605 
606  pips_assert("make_tile_constraints", value_one_p(k));
607 
608  ifdebug(8) {
609  (void) fprintf(stderr,"Partitioning matrix P:\n");
610  matrice_fprint(stderr, P, d, d);
611  }
612 
613  matrice_general_inversion(P, IP, d);
614  matrice_normalize(IP, d, d);
615  k = DENOMINATOR(IP);
616 
617  /* pips_assert("make_tile_constraints", k > 1); */
618 
619  ifdebug(8) {
620  (void) fprintf(stderr,"Inverse of partitioning matrix, IP:\n");
621  matrice_fprint(stderr, IP, d, d);
622  }
623 
624  for ( i=1; i<=d; i++) {
626 
627  for ( j=1; j<=d; j++) {
629  variable_of_rank(b,i),
630  value_uminus(ACCESS(IP, d, j, i)));
631 
632  }
633  sc_add_inegalite(tc, c);
634  c1 = contrainte_dup(c);
635  contrainte_chg_sgn(c1);
637  sc_add_inegalite(tc, c1);
638  }
639 
640  sc_creer_base(tc);
641  matrice_free(IP);
642 
643  ifdebug(8) {
644  sc_fprint(stderr, tc, (string(*)(Variable))entity_local_name);
645  }
646 
647  debug(8,"make_tile_constraints", "end\n");
648 
649  return (tc);
650 }
#define value_minus(v1, v2)
#define value_uminus(val)
unary operators on values
#define value_one_p(val)
int Value
#define VALUE_ONE
#define contrainte_vecteur(c)
passage au champ vecteur d'une contrainte "a la Newgen"
Pcontrainte contrainte_dup(Pcontrainte c_in)
Pcontrainte contrainte_dup(Pcontrainte c_in): allocation d'une contrainte c_out prenant la valeur de ...
Definition: alloc.c:132
Pcontrainte contrainte_new(void)
package contrainte - allocations et desallocations
Definition: alloc.c:47
void contrainte_chg_sgn(Pcontrainte)
void contrainte_chg_sgn(Pcontrainte eq): changement de signe d'une contrainte, i.e.
Definition: unaires.c:56
#define DENOMINATOR(matrix)
int DENOMINATEUR(matrix): acces au denominateur global d'une matrice matrix La combinaison *(&()) est...
Definition: matrice-local.h:93
#define matrice_free(m)
Definition: matrice-local.h:78
#define ACCESS(matrix, column, i, j)
Macros d'acces aux elements d'une matrice.
Definition: matrice-local.h:86
#define matrice_new(n, m)
Allocation et desallocation d'une matrice.
Definition: matrice-local.h:77
Value * matrice
package matrice
Definition: matrice-local.h:71
void matrice_general_inversion(matrice a, matrice inv_a, int n)
void matrice_general_inversion(matrice a; matrice inv_a; int n) calcul de l'inversion du matrice gene...
Definition: inversion.c:222
void matrice_normalize(matrice a, int n, int m)
void matrice_normalize(matrice a, int n, int m)
Definition: matrice.c:125
void matrice_fprint(FILE *, matrice, int, int)
matrice_io.c
Definition: matrice_io.c:62
static int tc
Internal variables
Definition: reindexing.c:107
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
Definition: sc_alloc.c:129
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
Definition: sc_alloc.c:55
void sc_add_inegalite(Psysteme p, Pcontrainte i)
void sc_add_inegalite(Psysteme p, Pcontrainte i): macro ajoutant une inegalite i a un systeme p; la b...
Definition: sc_alloc.c:406
Variable variable_of_rank()
void sc_fprint(FILE *fp, Psysteme ps, get_variable_name_t nom_var)
void sc_fprint(FILE * f, Psysteme ps, char * (*nom_var)()): cette fonction imprime dans le fichier po...
Definition: sc_io.c:220
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60
#define base_dimension(b)
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...
Definition: unaires.c:72

References ACCESS, base_dimension, contrainte_chg_sgn(), contrainte_dup(), contrainte_new(), contrainte_vecteur, debug(), DENOMINATOR, entity_local_name(), fprintf(), ifdebug, matrice_fprint(), matrice_free, matrice_general_inversion(), matrice_new, matrice_normalize(), pips_assert, sc_add_inegalite(), sc_creer_base(), sc_fprint(), sc_new(), tc, TCST, value_minus, VALUE_ONE, value_one_p, value_uminus, variable_of_rank(), and vect_add_elem().

Referenced by set_dimensions_of_local_variables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reference_conflicting_p()

bool reference_conflicting_p ( reference  r1,
reference  r2,
graph  dg 
)
Parameters
r11
r22
dgg

Definition at line 513 of file variable.c.

516 {
517  /*
518  graph = vertices:vertex* ;
519  successor = arc_label x vertex ;
520  vertex = vertex_label x successors:successor* ;
521  */
522  list ver1 = graph_vertices(dg);
523 
524  debug(8,"reference_conflicting_p","begin\n");
525  ifdebug(8) {
526  (void) fprintf(stderr,"Reference 1 %p: ", r1);
527  print_reference(r1);
528  (void) fprintf(stderr,"\nReference 2 %p: ", r2);
529  print_reference(r2);
530  (void) fputc('\n',stderr);
531  }
532 
533  MAPL(pm1,{
534  vertex v1 = VERTEX(CAR(pm1));
535  list ver2 = vertex_successors(v1);
536  MAPL(pm2,{
537  successor su = SUCCESSOR(CAR(pm2));
538 
540  list conf_list = dg_arc_label_conflicts(dal);
541 
542  MAPL(pm3,{
543  conflict conf2 = CONFLICT(CAR(pm3));
544 
545  effect e_source = conflict_source(conf2);
546  effect e_sink = conflict_sink(conf2);
547 
548  reference r11 = effect_any_reference(e_source);
549  reference r21 = effect_any_reference(e_sink);
550 
551  ifdebug(8) {
552  (void) fprintf(stderr,"Test with reference 1 %p: ", r1);
553  print_reference(r1);
554  (void) fprintf(stderr," and reference 2 %p: ", r2);
555  print_reference(r2);
556  (void) fputc('\n',stderr);
557  (void) fprintf(stderr,"Test with reference 11 %p: ", r11);
558  print_reference(r11);
559  (void) fprintf(stderr," and reference 21 %p: ", r21);
560  print_reference(r21);
561  (void) fputc('\n',stderr);
562  (void) fputc('\n',stderr);
563  }
564 
565  if( (reference_equal_p(r11,r1) && reference_equal_p(r21,r2))
566  || (reference_equal_p(r11,r2) && reference_equal_p(r21,r1)) ) {
567  debug(8,"reference_conflicting_p","return TRUE\n");
568  return true;
569  }
570  },conf_list);
571  },ver2);
572  },ver1);
573 
574  debug(8,"reference_conflicting_p","return FALSE\n");
575  return false;
576 }
struct _newgen_struct_dg_arc_label_ * dg_arc_label
Definition: dg.h:60
#define conflict_sink(x)
Definition: dg.h:167
#define CONFLICT(x)
CONFLICT.
Definition: dg.h:134
#define dg_arc_label_conflicts(x)
Definition: dg.h:201
#define conflict_source(x)
Definition: dg.h:165
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define successor_arc_label(x)
Definition: graph.h:116
#define vertex_successors(x)
Definition: graph.h:154
#define SUCCESSOR(x)
SUCCESSOR.
Definition: graph.h:86
#define graph_vertices(x)
Definition: graph.h:82
#define VERTEX(x)
VERTEX.
Definition: graph.h:122
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
void print_reference(reference r)
Definition: expression.c:142
bool reference_equal_p(reference r1, reference r2)
Definition: expression.c:1500

References CAR, CONFLICT, conflict_sink, conflict_source, debug(), dg, dg_arc_label_conflicts, effect_any_reference, fprintf(), graph_vertices, ifdebug, MAPL, print_reference(), reference_equal_p(), SUCCESSOR, successor_arc_label, VERTEX, and vertex_successors.

Referenced by reference_conflicting_test_and_update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reference_conflicting_test_and_update()

bool reference_conflicting_test_and_update ( reference  r,
graph  dg,
hash_table  v_to_lllv,
hash_table  llv_to_lcr,
hash_table  r_to_llv,
hash_table  r_to_ud 
)

reference_conflicting_test_and_update():

Build, incrementally, connected component in the dependence graph. Input dependences should be used to save local memory space. Mappings are updated.

Too many local variables might be created if two connected components had to be fused. This is not likely to happen with real code. In that case, the function would stop with pips_error().

referenced variable

short cut for identical references; not necessarily a good idea for the body translation process; design to save time in transfer code generation

should go one step forwards and take care of use-def, easier by introducing a "use and def" value or by adding the new reference directly

we need to remember there is a use and a def

this is very clumsy as we may keep a large number of identical def after one use and vice-versa; we need a use-and-def value or we have to keep all references and filter them for data movements

update llv_to_lcr by side-effect

should not happen too often: the regions associated with two references do not intersect together but each of them intersect a third one on which we bump afterwards; the two initial llv's should be merged...

update llv_to_lcr by side-effect

save current_llv for a future (?) merge

no need to study conflicts with other references in the same connected component

Parameters
dgg
v_to_lllv_to_lllv
llv_to_lcrlv_to_lcr
r_to_llv_to_llv
r_to_ud_to_ud

Definition at line 401 of file variable.c.

410 {
411  list current_llv = list_undefined;
412  entity rv; /* referenced variable */
413  list lllv;
414  list cllv;
415  bool conflicting = false;
416 
417  debug(8,"reference_conflicting_test_and_update", "begin\n");
418 
419  rv = reference_variable(r);
420 
421  ifdebug(8) {
422  (void) fprintf(stderr, "reference %p to %s:",
423  r, entity_local_name(rv));
424  print_reference(r);
425  (void) putc('\n', stderr);
426  }
427 
428  if((lllv = (list) hash_get(v_to_lllv, (char *) rv))
429  == (list) HASH_UNDEFINED_VALUE) {
430  debug(8, "reference_conflicting_test_and_update",
431  "no local variables for reference %p to %s\n",
432  r, entity_local_name(rv));
433 
434  debug(8,"reference_conflicting_test_and_update", "return FALSE\n");
435  return false;
436  }
437 
438  for(cllv = lllv; !ENDP(cllv); POP(cllv)) {
439  list llv = LIST(CAR(cllv));
440  list lcr = (list) hash_get(llv_to_lcr, (char *) llv);
441  list ccr;
442 
443  for(ccr = lcr; !ENDP(ccr); POP(ccr)) {
444  reference r2 = REFERENCE(CAR(ccr));
445  entity rv2 = reference_variable(r2);
446 
447  ifdebug(8) {
448  (void) fprintf(stderr, "conflict_p with reference %p to %s:",
449  r2, entity_local_name(rv2));
450  print_reference(r2);
451  (void) putc('\n', stderr);
452  }
453 
454  if(reference_equal_p(r, r2)) {
455  if(hash_get(r_to_ud,(char*) r)==hash_get(r_to_ud,(char*) r2)){
456  /* short cut for identical references; not necessarily a good
457  idea for the body translation process; design to save
458  time in transfer code generation */
459  /* should go one step forwards and take care of use-def,
460  easier by introducing a "use and def" value or by adding
461  the new reference directly */
462 
463  debug(8,"reference_conflicting_test_and_update",
464  "reference equality and same use, return TRUE\n");
465  }
466  else {
467  /* we need to remember there is a use and a def */
468  /* this is very clumsy as we may keep a large number
469  of identical def after one use and vice-versa;
470  we need a use-and-def value or we have to keep
471  all references and filter them for data movements */
472  /* update llv_to_lcr by side-effect */
473  lcr = gen_nconc(lcr, CONS(REFERENCE, r, NIL));
474  debug(8,"reference_conflicting_test_and_update",
475  "reference equality and same use, return TRUE\n");
476  }
477  hash_put(r_to_llv, (char *) r, (char *) llv);
478  return true;
479  }
480  else if(reference_conflicting_p(r, r2, dg)) {
481  if(conflicting) {
482  /* should not happen too often: the regions associated
483  with two references do not intersect together but
484  each of them intersect a third one on which we bump
485  afterwards; the two initial llv's should be merged...
486  */
487  pips_assert("reference_conflicting_test_and_update",
488  current_llv != llv);
489  pips_internal_error("local variable merge not implemented");
490  }
491  else {
492  conflicting = true;
493  /* update llv_to_lcr by side-effect */
494  lcr = gen_nconc(lcr, CONS(REFERENCE, r, NIL));
495  hash_put(r_to_llv, (char *) r, (char *) llv);
496  /* save current_llv for a future (?) merge */
497  current_llv = llv;
498  /* no need to study conflicts with other references
499  in the *same* connected component */
500  debug(8,"reference_conflicting_test_and_update",
501  "Conflict! Look for conflicts with other components\n");
502  break;
503  }
504  }
505  }
506  }
507 
508  debug(8,"reference_conflicting_test_and_update", "return %d\n",
509  conflicting);
510  return conflicting;
511 }
#define list_undefined
Undefined list definition :-)
Definition: newgen_list.h:69
#define pips_internal_error
Definition: misc-local.h:149
struct cons * list
Definition: newgen_types.h:106
bool reference_conflicting_p(reference r1, reference r2, graph dg)
Definition: variable.c:513

References CAR, CONS, debug(), dg, ENDP, entity_local_name(), fprintf(), gen_nconc(), hash_get(), hash_put(), HASH_UNDEFINED_VALUE, ifdebug, LIST, list_undefined, NIL, pips_assert, pips_internal_error, POP, print_reference(), REFERENCE, reference_conflicting_p(), reference_equal_p(), and reference_variable.

Referenced by loop_nest_to_local_variables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_dimensions_of_local_variable_family()

void set_dimensions_of_local_variable_family ( list  llv,
Psysteme  tc,
list  lr,
tiling  tile,
int  dimn 
)

void set_dimensions_of_local_variable_family(llv, tc, lr):

The algorithm used is not general; references are assumed equal up to a translation;

A general algorithm, as would be necessary for instance if a dependence was detected in the transposition algorithm between M(I,J) and M(J,I), would preserve some translation information for each reference in lr so as to generate proper new references to the local variable.

let's use the first reference to find out the number of dimensions

referenced variable

referenced variable type

referenced variable dimension list

dimension number

dimensions for the local variables

computation of the initial bounds of Entity rv

pips_assert("set_dimensions_of_local_variable_family",

pour tenir compte des offsets numeriques dans les fonctions d'acces

parameter ==> min = max = 1

ips_internal_error("unbounded domain for phi, %s", "check tile bounds and subscript expressions");

update types

sharing is not legal under NewGen rules; to avoid it lvd is duplicated at the CONS level, except the first time

Parameters
llvlv
tcThe algorithm used is not general; references are assumed equal up to a translation;

A general algorithm, as would be necessary for instance if a dependence was detected in the transposition algorithm between M(I,J) and M(J,I), would preserve some translation information for each reference in lr so as to generate proper new references to the local variable. list of local variables with same dimensions used at different pipeline stages

Parameters
lrr
tileThe algorithm used is not general; references are assumed equal up to a translation;

A general algorithm, as would be necessary for instance if a dependence was detected in the transposition algorithm between M(I,J) and M(J,I), would preserve some translation information for each reference in lr so as to generate proper new references to the local variable. non-empty list of associated references

Parameters
dimnimn

Definition at line 689 of file variable.c.

696 {
697  /* let's use the first reference to find out the number of dimensions */
698  reference r;
699  entity rv; /* referenced variable */
700  type rvt; /* referenced variable type */
701  list rvld; /* referenced variable dimension list */
702  int d = -1; /* dimension number */
703  list lvd = NIL; /* dimensions for the local variables */
704  bool first_ref;
705  matrice P = (matrice) tiling_tile(tile);
706  debug(8,"set_dimensions_of_local_variable_family","begin\n");
707 
708  r = REFERENCE(CAR(lr));
709  rv = reference_variable(r);
710  rvt = entity_type(rv);
711  rvld = variable_dimensions(type_variable(rvt));
712 
713  debug(8,"set_dimensions_of_local_variable_family","entity=%s\n",
714  entity_name(rv));
715 
716  for( d = 1; !ENDP(rvld); POP(rvld), d++) {
717  Value imax = VALUE_MIN;
718  Value gmin = VALUE_MAX;
719  Value gmax = VALUE_MIN;
720  list cr = list_undefined;
722 
723 
724  /* computation of the initial bounds of Entity rv */
725  dimension dim1 = DIMENSION(CAR(rvld));
726  expression lower= dimension_lower(dim1);
727  normalized norm1 = NORMALIZE_EXPRESSION(lower);
728  expression upper= dimension_upper(dim1);
729  normalized norm2 = NORMALIZE_EXPRESSION(upper);
730  if (normalized_linear_p(norm1) && normalized_linear_p(norm2)) {
731  gmin = vect_coeff(TCST,(Pvecteur) normalized_linear(norm1));
732  value_decrement(gmin);
733  gmax = vect_coeff(TCST,(Pvecteur) normalized_linear(norm2));
734  value_decrement(gmax);
735  imax = gmax;
736  }
737  first_ref = true;
738  for(cr = lr; !ENDP(cr); POP(cr)) {
739  entity phi = make_phi_entity(d);
740  expression e;
741  normalized n;
742  Pvecteur vec;
743  Pcontrainte eg;
744  Psysteme s;
745  Value min, max, coef;
746  r = REFERENCE(CAR(cr));
748  n = NORMALIZE_EXPRESSION(e);
749 
750  /* pips_assert("set_dimensions_of_local_variable_family", */
751  if (normalized_linear_p(n)) {
752  vec = vect_dup((Pvecteur) normalized_linear(n));
753  vect_add_elem(&vec, (Variable) phi, VALUE_MONE);
754  eg = contrainte_make(vec);
755 
756  /* pour tenir compte des offsets numeriques dans les
757  fonctions d'acces */
758  coef =vect_coeff(TCST,vec);
759  if (value_pos_p(coef)) value_addto(gmax,coef);
760  else value_addto(gmin,coef);
761 
762  s = sc_dup(tc);
763  sc_add_egalite(s, eg);
764  vect_add_variable(sc_base(s), (Variable) phi);
765 
766  s = sc_normalize(s);
767  ifdebug(8) {
768  (void) fprintf(stderr,
769  "System on phi for dimension %d:\n", d);
770  sc_fprint(stderr, s, (string(*)(Variable))entity_local_name);
771  }
772 
773 
774  if(!sc_minmax_of_variable(s, (Variable) phi,
775  &min, &max))
776  pips_internal_error("empty domain for phi");
777 
778  if(value_min_p(min) || value_max_p(max)) {
779  Value divis= ACCESS(P,dimn,d,d);
780  /* parameter ==> min = max = 1 */
781  /*pips_internal_error("unbounded domain for phi, %s",
782  "check tile bounds and subscript expressions"); */
783  min= VALUE_ZERO;
784  max= value_lt(divis,VALUE_CONST(999)) &&
785  value_gt(divis,VALUE_ONE)? value_div(imax,divis): imax;
786  }
787 
788  debug(8,"set_dimensions_of_local_variable_family",
789  "bounds for dimension %d: [%d:%d]\n", d, min, max);
790 
791  gmin = first_ref? value_max(gmin, min): value_min(gmin, min);
792  gmax = first_ref? value_min(gmax, max): value_max(gmax, max);
793 
794  if (value_gt(gmin,gmax)) gmax = gmin;
795  first_ref=false;
796  }
797  }
800  NIL);
801 
802  debug(8,"set_dimensions_of_local_variable_family",
803  "bounds for dimension %d: [%d:%d]\n", d, gmin, gmax);
804 
805  lvd = gen_nconc(lvd, CONS(DIMENSION, dimd, NIL));
806  }
807 
808  /* update types */
809  MAPL(clv,
810  {
811  entity lv = ENTITY(CAR(clv));
812  type tlv = entity_type(lv);
813  variable tv = type_variable(tlv);
814 
815  /* sharing is not legal under NewGen rules; to avoid
816  it lvd is duplicated at the CONS level, except the first time */
817  if(clv!=llv)
818  lvd = gen_copy_seq(lvd);
819  variable_dimensions(tv) = lvd;
820  },
821  llv);
822 
823  ifdebug(8) {
824  MAPL(clv,
825  {
826  entity lv = ENTITY(CAR(clv));
827  print_sentence(stderr,Sentence_Variable(lv));
828  },
829  llv);
830  }
831 
832  pips_debug(8,"end\n");
833 }
#define value_pos_p(val)
#define VALUE_ZERO
#define value_gt(v1, v2)
#define value_min(v1, v2)
#define value_decrement(ref)
#define VALUE_TO_INT(val)
#define VALUE_CONST(val)
#define VALUE_MIN
#define VALUE_MONE
#define value_min_p(val)
#define value_max(v1, v2)
#define value_addto(ref, val)
#define VALUE_MAX
#define value_max_p(val)
#define value_lt(v1, v2)
#define value_div(v1, v2)
Pbase vect_add_variable(Pbase b, Variable v)
package vecteur - routines sur les bases
Definition: base.c:61
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Definition: alloc.c:73
#define min(a, b)
#define max(a, b)
entity make_phi_entity(int)
list gen_copy_seq(list l)
Copy a list structure.
Definition: list.c:501
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define NORMALIZE_EXPRESSION(e)
expression find_ith_expression(list le, int r)
find_ith_expression() is obsolet; use find_ith_argument() instead
Definition: expression.c:1161
#define normalized_linear_p(x)
Definition: ri.h:1779
#define dimension_lower(x)
Definition: ri.h:980
#define dimension_upper(x)
Definition: ri.h:982
#define normalized_linear(x)
Definition: ri.h:1781
void sc_add_egalite(Psysteme p, Pcontrainte e)
void sc_add_egalite(Psysteme p, Pcontrainte e): macro ajoutant une egalite e a un systeme p; la base ...
Definition: sc_alloc.c:389
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176
bool sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, Value *pmax)
void sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, *pmax): examine un systeme pour tr...
Definition: sc_eval.c:143
Psysteme sc_normalize(Psysteme ps)
Psysteme sc_normalize(Psysteme ps): normalisation d'un systeme d'equation et d'inequations lineaires ...
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
#define tiling_tile(x)
Definition: tiling.h:68
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Definition: alloc.c:51
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
Definition: unaires.c:228

References ACCESS, CAR, CONS, contrainte_make(), debug(), DIMENSION, dimension_lower, dimension_undefined, dimension_upper, ENDP, ENTITY, entity_local_name(), entity_name, entity_type, find_ith_expression(), fprintf(), gen_copy_seq(), gen_nconc(), ifdebug, int_to_expression(), list_undefined, make_dimension(), make_phi_entity(), MAPL, max, min, NIL, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, pips_debug, pips_internal_error, POP, print_sentence(), REFERENCE, reference_indices, reference_variable, sc_add_egalite(), sc_dup(), sc_fprint(), sc_minmax_of_variable(), sc_normalize(), Sentence_Variable(), tc, TCST, tiling_tile, type_variable, value_addto, VALUE_CONST, value_decrement, value_div, value_gt, value_lt, VALUE_MAX, value_max, value_max_p, VALUE_MIN, value_min, value_min_p, VALUE_MONE, VALUE_ONE, value_pos_p, VALUE_TO_INT, VALUE_ZERO, variable_dimensions, vect_add_elem(), vect_add_variable(), vect_coeff(), and vect_dup().

Referenced by set_dimensions_of_local_variables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_dimensions_of_local_variables()

void set_dimensions_of_local_variables ( hash_table  v_to_lllv,
Pbase  basis,
tiling  tile,
hash_table  llv_to_lcr 
)
Parameters
v_to_lllv_to_lllv
basisasis
tileile
llv_to_lcrlv_to_lcr

Definition at line 652 of file variable.c.

657 {
658  Psysteme tc = SC_UNDEFINED;
659  matrice P = (matrice) tiling_tile(tile);
660 
661  debug(8,"set_dimensions_of_local_variables","begin\n");
662 
663  tc = make_tile_constraints(P, basis);
664 
665  HASH_MAP(v, clllv, {
666  list cllv;
667  for(cllv = (list) clllv; !ENDP(cllv); POP(cllv)) {
668  list llv = LIST(CAR(cllv));
669  list lr = (list) hash_get(llv_to_lcr, (char *) llv);
671  }
672  }, v_to_lllv);
673 
674  sc_rm(tc);
675 
676  debug(8,"set_dimensions_of_local_variables","end\n");
677 }
int vect_size(Pvecteur v)
package vecteur - reductions
Definition: reductions.c:47
#define HASH_MAP(k, v, code, ht)
Definition: newgen_hash.h:60
Psysteme make_tile_constraints(matrice P, Pbase b)
Psysteme make_tile_constraints(P, b):
Definition: variable.c:591
void set_dimensions_of_local_variable_family(list llv, Psysteme tc, list lr, tiling tile, int dimn)
void set_dimensions_of_local_variable_family(llv, tc, lr):
Definition: variable.c:689
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Definition: sc_alloc.c:277

References CAR, debug(), ENDP, hash_get(), HASH_MAP, LIST, make_tile_constraints(), POP, sc_rm(), set_dimensions_of_local_variable_family(), tc, tiling_tile, and vect_size().

Referenced by loop_nest_to_local_variables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: