PIPS
movement_computation.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include "genC.h"
#include "misc.h"
#include "linear.h"
#include "ri.h"
#include "ri-util.h"
#include "constants.h"
#include "text-util.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
#include "matrice.h"
#include "sommet.h"
#include "matrix.h"
#include "sparse_sc.h"
#include "tiling.h"
#include "movements.h"
+ Include dependency graph for movement_computation.c:

Go to the source code of this file.

Macros

#define sys_debug(level, msg, sc)
 build the base of the image domain. More...
 
#define maxscinfosize   100
 

Functions

Pbase build_image_base (bool bank_code, Pbase proc_id, Pbase bank_indices, Pbase tile_indices)
 cproto-generated files More...
 
void print_fullname_base (Pbase sb)
 
void update_basis (Pbase scbase, Pbase *index_base, Pbase *const_base, Pbase *image_base, Pbase bank_indices, Pbase tile_indices, Pbase *lindex, Pbase *lvar_coeff_nunit, Pbase *lvar_coeff_unit, Pbase *loop_body_offsets, Pbase *loop_body_indices, bool bank_code, Pbase ppid)
 Update all the basis needed for data movement generation. More...
 
void sort_tile_indices (Pbase tile_indices, Pbase *new_tile_indices, matrice Q, int m)
 Sort the tile indices base, such that the indices correspond to the tile indices of the array elements accessed by the local entity. More...
 
Psysteme elim_redund_sc_with_sc (Psysteme sc1, Psysteme sc2, Pbase index_base, int dim)
 Build the system of inequations of sc1 no-redundant with system sc2. More...
 
Pbase variables_in_declaration_list (entity __attribute__((unused)) module, code ce)
 
statement movement_computation (entity module, bool used_def, bool bank_code, bool receive_code, entity private_entity, Psysteme sc_image, Pbase const_base, Pbase bank_indices, Pbase tile_indices, Pbase ppid, Pbase loop_body_indices, int n, int dim_h)
 Calcul des nouvelles bornes des boucles et de la nouvelle fonction d'acces a une reference d'un tableau permettant d'exprimer l'ensemble des elements references dans une base. More...
 
Psysteme sc_image_computation (entity module, entity entity_var, Psysteme sc_domain, Psysteme sc_array_function, Pbase index_base, Pbase *const_base, entity proc_id, Pbase bank_indices, Pbase tile_indices, Pbase *new_tile_indices, int pn, int bn, int ls, int *n, int *dim_h)
 This function computes the system of constraints characterizing the image by the array function of the iteration domain. More...
 

Macro Definition Documentation

◆ maxscinfosize

#define maxscinfosize   100

◆ sys_debug

#define sys_debug (   level,
  msg,
  sc 
)
Value:
pips_debug(level, msg); \
sc_fprint(stderr, sc, (get_variable_name_t) entity_local_name); \
}
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 level
#define ifdebug(n)
Definition: sg.c:47
char *(* get_variable_name_t)(Variable)
Definition: vecteur-local.h:62

build the base of the image domain.

It corresponds to the loop indices of the generated code. Then it is

Si COLUMN_MAJOR TRUE Bank_id, LJ,L,LI in case of engine code and Proc_id, LJ,L,O in case of bank code Si COLUMN_MAJOR FALSE Bank_id, LI,L,LJ in case of engine code and Proc_id, LI,L,O in case of bank code

In these examples L_I, resp. L_J, corresponds to the first, resp. second, array subscript.

Definition at line 70 of file movement_computation.c.

Function Documentation

◆ build_image_base()

Pbase build_image_base ( bool  bank_code,
Pbase  proc_id,
Pbase  bank_indices,
Pbase  tile_indices 
)

cproto-generated files

movement_computation.c

Parameters
bank_codeank_code
proc_idroc_id
bank_indicesank_indices
tile_indicesile_indices

Definition at line 76 of file movement_computation.c.

81 {
82  Pvecteur pb,ti;
83  Pbase invt = base_reversal(tile_indices);
84  Pbase dupt = base_dup(tile_indices);
85 
86  debug_on("MOVEMENT_DEBUG_LEVEL");
87  debug(8,"build_image_base","begin\n");
88 
89  ti = (COLUMN_MAJOR) ? dupt:invt ;
90 
91  if (bank_code)
92  pb = vect_new(vecteur_var(bank_indices->succ->succ),VALUE_ONE);
93  else
94  pb = vect_new(ti->var,VALUE_ONE);
95  vect_add_elem(&pb,vecteur_var(bank_indices->succ),VALUE_ONE);
96 
97  if (!VECTEUR_NUL_P(ti->succ))
99 
100  if (bank_code)
101  vect_add_elem(&pb,vecteur_var(proc_id),VALUE_ONE);
102  else
103  vect_add_elem(&pb,vecteur_var(bank_indices),VALUE_ONE);
104 
105  vect_rm(dupt);
106  vect_rm(invt);
107  debug(8,"build_image_base","end\n");
108  debug_off();
109  return ((Pbase) pb);
110 }
#define VALUE_ONE
Pbase base_reversal(Pbase b_in)
Pbase base_reversal(Pbase b_in): produces a basis b_out, having the same basis vectors as b_in,...
Definition: base.c:221
#define debug_on(env)
Definition: misc-local.h:157
#define debug_off()
Definition: misc-local.h:160
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189
#define COLUMN_MAJOR
Package movements
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Variable var
Definition: vecteur-local.h:90
struct Svecteur * succ
Definition: vecteur-local.h:92
#define vecteur_var(v)
#define VECTEUR_NUL_P(v)
Pbase base_dup(Pbase b)
Pbase base_dup(Pbase b) Note: this function changes the value of the pointer.
Definition: alloc.c:268
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
Definition: alloc.c:110
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Definition: alloc.c:78
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 base_dup(), base_reversal(), COLUMN_MAJOR, debug(), debug_off, debug_on, Svecteur::succ, VALUE_ONE, Svecteur::var, vect_add_elem(), vect_new(), vect_rm(), VECTEUR_NUL_P, and vecteur_var.

Referenced by update_basis().

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

◆ elim_redund_sc_with_sc()

Psysteme elim_redund_sc_with_sc ( Psysteme  sc1,
Psysteme  sc2,
Pbase  index_base,
int  dim 
)

Build the system of inequations of sc1 no-redundant with system sc2.

Parameters
sc1c1
sc2c2
index_basendex_base
dimim

Definition at line 262 of file movement_computation.c.

266 {
267  Pcontrainte pc,pc2;
268  Psysteme ps1 = sc_init_with_sc(sc1);
269  Psysteme ps2 = sc_dup(sc2);
270 
271  for (pc =sc1->inegalites; pc != NULL;pc = pc->succ) {
272 
273  pc2 = contrainte_dup(pc);
274  if (search_higher_rank(pc2->vecteur,index_base) > dim ||
275  !ineq_redund_with_sc_p(ps2,pc2)) {
276  pc2 = contrainte_dup(pc);
277  sc_add_ineg(ps1,pc2);
278  pc2 = contrainte_dup(pc);
279  sc_add_ineg(ps2,pc2);
280  }
281  }
282  ps2 = sc_dup(sc2);
283 
284  for (pc = ps1->inegalites; pc != NULL;pc = pc->succ) {
285  pc2 = contrainte_dup(pc);
286  if (search_higher_rank(pc2->vecteur,index_base) > dim ||
287  !ineq_redund_with_sc_p(ps2,pc2)) {
288  pc2 = contrainte_dup(pc);
289  sc_add_ineg(ps2,pc2);
290  }
291  else eq_set_vect_nul(pc);
292  }
293 
294  sc_rm_empty_constraints(ps1, false);
295  return (ps1);
296 }
int search_higher_rank(Pvecteur vect, Pbase base)
int search_higher_rank(): this fonction returns the rank of the variable of higher rank in the vecteu...
Definition: base.c:541
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
void eq_set_vect_nul(Pcontrainte)
void_eq_set_vect_nul(Pcontrainte c): transformation d'une contrainte en une contrainte triviale 0 == ...
Definition: unaires.c:84
Psysteme sc_init_with_sc(Psysteme sc)
This function returns a new empty system which has been initialized with the same dimension and base ...
Definition: sc_alloc.c:303
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176
bool ineq_redund_with_sc_p(Psysteme sc, Pcontrainte ineq)
This function returns true if the inequation ineq is redundant for the system ps and false otherwise.
void sc_rm_empty_constraints(Psysteme ps, bool process_equalities)
package sc: elimination de redondance simple
Definition: sc_elim_eq.c:56
Pvecteur vecteur
struct Scontrainte * succ
Pcontrainte inegalites
Definition: sc-local.h:71

References contrainte_dup(), eq_set_vect_nul(), Ssysteme::inegalites, ineq_redund_with_sc_p(), sc_dup(), sc_init_with_sc(), sc_rm_empty_constraints(), search_higher_rank(), Scontrainte::succ, and Scontrainte::vecteur.

Referenced by movement_computation(), and parallel_tiling().

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

◆ movement_computation()

statement movement_computation ( entity  module,
bool  used_def,
bool  bank_code,
bool  receive_code,
entity  private_entity,
Psysteme  sc_image,
Pbase  const_base,
Pbase  bank_indices,
Pbase  tile_indices,
Pbase  ppid,
Pbase  loop_body_indices,
int  n,
int  dim_h 
)

Calcul des nouvelles bornes des boucles et de la nouvelle fonction d'acces a une reference d'un tableau permettant d'exprimer l'ensemble des elements references dans une base.

Cette base est pour le moment la base de Hermite associee a la fonction d'acces au tableau

constains the list of variables for which integer projection might be necessary

constains the variables remaining in the system after all the projections i.e. constants, index loops. It is usefull to project (FM) on these variables at the end for collecting more informations on variables and to eliminate redundant constraints

corresponds to the loop indices of the generated code. Then it is Bank_id, LJ,L,LI in case of engine code and Bank_id, LJ,L,O in case of bank code

contains the local indices O and L if it is the generation of bank code and LI, LJ if it is for engine code

int sc_info[sc_image->dimension+1][3]; // this is NOT ANSI C

added

Translate each entity in its appropriated entity full name for generating module code

allocation d'un tableau de systemes et d'une table contenant des infos sur ces systemes

update the different basis

Projection on each variable having unity coefficients in the system

Projection on the others variables having to be eliminated from the system. In case of Copy-in local memory code generation, the FM projection algorithm is used. For Copy-back code generation interger projection algorithm is used.

vect_chg_coeff(&lvar_coeff_nunit,vecteur_var(pv1),0);

Computation of sample constraints contraining only index variables

why 11?

ore restrictive system

Elimination of redundant constraints for integer systems

Constraints distribution. Lsc[i] will contain all constraints contraining the i-th index variable

Computation of constraints contraining symbolic constants

Elimination of constraints redundant in list_of_systems[i] with the "symbolic constant system"

if you get through this pp, it core dumps much later on:-)

Parameters
moduleodule
used_defsed_def
bank_codeank_code
receive_codeis true if it is the generation of code for bank false if it is for engine
private_entityis true if the generated code must be a RECEIVE, false if it must be a SEND
sc_imagelocal entity
const_basedomain of image
bank_indicesank_indices
tile_indicescontains the index describing the bank: bank_id, L (ligne of bank) and O (offset in the ligne)
ppidcontains the local indices LI, LJ,.. of tile
loop_body_indicesoop_body_indices
ncontains the loop indices situated in the tile
dim_him_h

Definition at line 321 of file movement_computation.c.

340 {
341  Psysteme sc_proj,*list_of_systems,sc_proj2,sc_image2,sc_on_constants;
343  Pvecteur lvar_coeff_nunit = VECTEUR_NUL;
344  /* constains the list of variables for which integer projection
345  might be necessary */
346  Pvecteur lvar_coeff_unit= VECTEUR_NUL;
347 
348  Pbase lindex = BASE_NULLE;
349  /* constains the variables remaining in the system after all the
350  projections i.e. constants, index loops. It is usefull to project (FM)
351  on these variables at the end for collecting more informations on
352  variables and to eliminate redundant constraints */
353 
354  Pbase image_base=BASE_NULLE;
355  /* corresponds to the loop indices of the generated code. Then it is
356  Bank_id, LJ,L,LI in case of engine code
357  and Bank_id, LJ,L,O in case of bank code */
358 
359 
360  Pbase loop_body_offsets;
361  /* contains the local indices O and L if it is the generation of bank
362  code and LI, LJ if it is for engine code */
363 
364  Pbase index_base=BASE_NULLE;
365  Pbase const_base2;
366  Pbase var_id;
367  int dim_h2= dim_h;
368  unsigned space;
369 #define maxscinfosize 100
370  /* int sc_info[sc_image->dimension+1][3]; // this is NOT ANSI C */
371  int sc_info[maxscinfosize][4];
372  int i;
373  Pvecteur pv1= NULL;
374  Pbase btmp = BASE_NULLE;
375  debug_on("MOVEMENT_DEBUG_LEVEL");
376  debug(3,"movement_computation","begin\n");
377 
378  assert(sc_image->dimension<maxscinfosize); /* added */
379 
380  /* Translate each entity in its appropriated entity full name
381  for generating module code */
382 
384  sc_image = sc_variables_rename(sc_image, bank_indices, btmp,
386  sc_image = sc_variables_rename(sc_image, const_base, btmp,
388  sc_image = sc_variables_rename(sc_image,tile_indices, btmp,
390  bank_indices= vect_rename(bank_indices, btmp,
392  tile_indices= vect_rename(tile_indices, btmp,
394  const_base= vect_rename(const_base, btmp,
396  ppid = vect_rename(ppid, btmp,
398 
399  const_base2 =base_dup(const_base);
400  sc_image2 = sc_dup(sc_image);
401  sc_proj = sc_dup(sc_image2);
402  n = sc_image2->dimension;
403 
404  /* allocation d'un tableau de systemes et d'une table
405  contenant des infos sur ces systemes*/
406 
407  space = (n+1) * sizeof(Ssysteme);
408  list_of_systems = (Psysteme *) malloc((unsigned) space);
409  /* update the different basis */
410 
411  update_basis(sc_image2->base,&index_base,&const_base2,&image_base,
412  bank_indices,tile_indices,&lindex,&lvar_coeff_nunit,
413  &lvar_coeff_unit,&loop_body_offsets,&loop_body_indices,
414  bank_code,ppid);
415 
416 
417  dim_h2 = vect_size(image_base);
418 
419  sys_debug(2, "Domain before Projection :\n",sc_proj);
420 
421  /* Projection on each variable having unity coefficients in the system */
422 
423  for (pv1 = lvar_coeff_unit;!VECTEUR_UNDEFINED_P(pv1);pv1=pv1->succ) {
424  if (var_with_unity_coeff_p(sc_proj,vecteur_var(pv1))) {
425  sc_proj = sc_projection(sc_proj,vecteur_var(pv1));
426  sc_proj= sc_normalize(sc_proj);
427  vect_chg_coeff(&lvar_coeff_nunit,vecteur_var(pv1),0);
428  }
429  }
430 
431  sys_debug(2, " After FM projection :\n", sc_proj);
432 
433  sc_proj->inegalites = contrainte_sort(sc_proj->inegalites,
434  sc_proj->base, index_base,
435  true,false);
436  ifdebug(2) {
437  pips_debug(2," After FM projection and sort:\n");
438  sc_fprint(stderr, sc_proj, (get_variable_name_t) entity_local_name);
439  }
440 
441  /* Projection on the others variables having to be eliminated from
442  the system. In case of Copy-in local memory code generation, the
443  FM projection algorithm is used. For Copy-back code generation
444  interger projection algorithm is used.*/
445 
446  if (!used_def)
447  sc_proj = sc_integer_projection_along_variables(
448  sc_image2,sc_proj, index_base, lvar_coeff_nunit, sc_info,dim_h2,n);
449  else {
450  for (pv1 = lvar_coeff_nunit;!VECTEUR_UNDEFINED_P(pv1);pv1=pv1->succ) {
451  sc_proj = sc_projection(sc_proj,vecteur_var(pv1));
452  sc_proj= sc_normalize(sc_proj);
453  }
454  /* vect_chg_coeff(&lvar_coeff_nunit,vecteur_var(pv1),0);*/
455 
456  }
457 
458  ifdebug(2) {
459  sys_debug(2," Before contrainte sort :\n",sc_proj);
460  pips_debug(2," Base index :\n");
461  vect_fprint(stderr, index_base, (get_variable_name_t) entity_local_name);
462  }
463  sc_proj->inegalites = contrainte_sort(sc_proj->inegalites,
464  sc_proj->base, index_base,
465  true,false);
466 
467  sys_debug(5," After contrainte sort:\n",sc_proj);
468 
469  build_sc_nredund_1pass(&sc_proj);
470 
471  sys_debug(5,"After Integer Projection :\n",sc_proj);
472 
473  /* Computation of sample constraints contraining only index variables
474  */
475  sc_proj2 = sc_dup(sc_proj);
476 
477  sys_debug(4, "sc_proj2 [dup] = \n", sc_proj2);
478 
479  if (vect_size(sc_image2->base) <= 11) /* why 11? */
480  {
481  for (pv1 = const_base2; pv1 != NULL; pv1 = pv1->succ)
482  vect_erase_var(&lindex, vecteur_var(pv1));
483 
484  sc_proj = sc_projection_on_list_of_variables
485  (sc_image2, image_base, lindex);
486  sys_debug(9, "sc_proj = \n", sc_proj);
487 
488  sc_proj2 = sc_intersection(sc_proj2,sc_proj2,sc_proj);
489  sys_debug(4, "sc_proj2 [inter] = \n", sc_proj2);
490 
491  sc_proj2 = sc_normalize(sc_proj2);
492  sys_debug(4, "sc_proj2 [norm] = \n", sc_proj2);
493 
494  sys_debug(9, "sc_image2 [minmax] = \n", sc_image2);
495  sc_minmax_of_variables(sc_image2,sc_proj2,const_base2);
496  sys_debug(4, "sc_proj2 [minmax] = \n", sc_proj2);
497  }
498  else /*more restrictive system */
499  sc_minmax_of_variables(sc_image2,sc_proj2,image_base);
500 
501  sys_debug(2, "Iterat. Domain Before redundancy elimin.:\n",sc_proj2);
502 
503  /* Elimination of redundant constraints for integer systems*/
504 
505  sc_proj2->inegalites =
506  contrainte_sort(sc_proj2->inegalites,
507  sc_proj2->base, index_base,
508  false,false);
509 
510  sys_debug(2,"Iterat. Domain After 1rst sort:\n",sc_proj2);
511 
512  sc_integer_projection_information(sc_proj2,index_base, sc_info,dim_h2,n);
513  sc_proj2=build_integer_sc_nredund(sc_proj2,index_base,sc_info,1,dim_h2,n);
514  sys_debug(2," After redundancy elimination :\n",sc_proj2);
515 
516  for (i=1;i<=n;i++)
517  list_of_systems[i] = sc_init_with_sc(sc_proj2);
518 
519  /* Constraints distribution. Lsc[i] will contain all constraints
520  contraining the i-th index variable */
521 
522  constraint_distribution(sc_proj2,list_of_systems,index_base,sc_info);
523 
524  /* Computation of constraints contraining symbolic constants */
525  sc_on_constants= sc_init_with_sc(sc_proj2);
526  for (pv1 = tile_indices; pv1!=NULL; pv1=pv1->succ)
527  vect_erase_var(&const_base2, vecteur_var(pv1));
528  for (pv1 = bank_indices; pv1!=NULL; pv1=pv1->succ)
529  vect_erase_var(&const_base2, vecteur_var(pv1));
530  for (pv1 = ppid; pv1!=NULL; pv1=pv1->succ)
531  vect_erase_var(&const_base2, vecteur_var(pv1));
532 
533  /* Elimination of constraints redundant in list_of_systems[i] with the
534  "symbolic constant system" */
535 
536  sc_minmax_of_variables(sc_image2,sc_on_constants,const_base2);
537  for (i = 1; sc_on_constants != NULL && i <=vect_size(image_base);i++) {
538  list_of_systems[i] = elim_redund_sc_with_sc(list_of_systems[i],
539  sc_on_constants,
540  index_base,
541  dim_h2);
542  ifdebug(8) {
543  pips_debug(8,"Constraints on the %d-th var.:\n",i);
544  sc_fprint(stderr, list_of_systems[i], (get_variable_name_t) entity_local_name);
545  }
546  }
547 
548  var_id = (bank_code) ? vect_dup(ppid) :
549  vect_new(vecteur_var(bank_indices), VALUE_ONE);
550  stat = bound_generation(module,bank_code,receive_code,
551  private_entity,
552  loop_body_offsets,var_id,
553  list_of_systems,index_base,n,sc_info);
554 
555  ifdebug(4) {
556  /* if you get through this pp, it core dumps much later on:-) */
557  pips_debug(3, "returning:\n");
559  }
560  debug(3,"movement_computation","end\n");
561  debug_off();
562 
563  return (stat);
564 }
Pvecteur vect_rename(Pvecteur v, Pbase b, char *(*variable_name)(Variable))
Pvecteur vect_rename(Pvecteur v, Pbase b, char * (*variable_name)()): modify vector v so that its coo...
Definition: base.c:247
void constraint_distribution(Psysteme sc, Psysteme *bound_systems, Pbase index_base, int sc_info[][4])
Distribution of the constraints of the system sc into several systems.
void * malloc(YYSIZE_T)
float_t space[SIZE][SIZE]
Definition: jacobi.c:7
void vect_fprint(FILE *f, Pvecteur v, get_variable_name_t variable_name)
void vect_fprint(FILE * f, Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v su...
Definition: io.c:124
int vect_size(Pvecteur v)
package vecteur - reductions
Definition: reductions.c:47
void wp65_debug_print_text(entity m, statement s)
include "values.h"
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
void update_basis(Pbase scbase, Pbase *index_base, Pbase *const_base, Pbase *image_base, Pbase bank_indices, Pbase tile_indices, Pbase *lindex, Pbase *lvar_coeff_nunit, Pbase *lvar_coeff_unit, Pbase *loop_body_offsets, Pbase *loop_body_indices, bool bank_code, Pbase ppid)
Update all the basis needed for data movement generation.
#define sys_debug(level, msg, sc)
build the base of the image domain.
Pbase variables_in_declaration_list(entity __attribute__((unused)) module, code ce)
Psysteme elim_redund_sc_with_sc(Psysteme sc1, Psysteme sc2, Pbase index_base, int dim)
Build the system of inequations of sc1 no-redundant with system sc2.
#define maxscinfosize
statement bound_generation(entity module, bool bank_code, bool receive_code, entity ent, Pbase loop_body_indices, Pbase var_id, Psysteme *lsystem, Pbase index_base, int n, int sc_info[][4])
Generation of the new loop nest characterizing the new domain.
#define assert(ex)
Definition: newgen_assert.h:41
static char * module
Definition: pips.c:74
code entity_code(entity e)
Definition: entity.c:1098
#define entity_undefined
Definition: ri.h:2761
#define statement_undefined
Definition: ri.h:2419
Psysteme sc_variables_rename(Psysteme s, Pvecteur pv_old, Pvecteur pv_new, get_variable_name_t variable_name)
Psysteme sc_variables_rename(Psysteme s, Pvecteur pv_old, Pvecteur pv_new): reecriture du systeme s r...
Definition: sc.c:224
void build_sc_nredund_1pass(Psysteme volatile *ps)
Computation of a new system sc from the system ps, where each constraint of the system ps is added to...
Psysteme build_integer_sc_nredund(volatile Psysteme ps, Pbase index_base, int tab_info[][4], int loop_level, int dim_h __attribute__((unused)), int n __attribute__((unused)))
Computation of a new system sc from the system ps, where each constraint of the system ps is added to...
void sc_minmax_of_variables(Psysteme ps1, Psysteme ps2, Pbase b)
This function uses sc_minmax_of_variable to compute the min and max of each variable belonging to bas...
Definition: sc_eval.c:212
void sc_integer_projection_information(Psysteme sc, Pbase index_base, int sc_info[][4], int dim_h, int n)
This function gives information about the variables and the constraints of the system.
bool var_with_unity_coeff_p(Psysteme sc, Variable var)
This function returns true: if all positive OR all negative coefficients of the variable var in the s...
Psysteme sc_intersection(Psysteme s1, Psysteme s2, Psysteme s3)
Psysteme sc_intersection(Psysteme s1, Psysteme s2, Psysteme s3): calcul d'un systeme de contraintes s...
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
Psysteme sc_normalize(Psysteme ps)
Psysteme sc_normalize(Psysteme ps): normalisation d'un systeme d'equation et d'inequations lineaires ...
Pcontrainte contrainte_sort(Pcontrainte c, Pbase base, Pbase sort_base, bool inner_first, bool complex_first)
Pbase base
Definition: sc-local.h:75
int dimension
Definition: sc-local.h:74
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define BASE_NULLE
MACROS SUR LES BASES.
#define VECTEUR_UNDEFINED_P(v)
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
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....
Definition: unaires.c:106
void vect_chg_coeff(Pvecteur *ppv, Variable var, Value val)
void vect_chg_coeff(Pvecteur *ppv, Variable var, Value val): mise de la coordonnee var du vecteur *pp...
Definition: unaires.c:143

References assert, Ssysteme::base, base_dup(), BASE_NULLE, bound_generation(), build_integer_sc_nredund(), build_sc_nredund_1pass(), constraint_distribution(), contrainte_sort(), debug(), debug_off, debug_on, Ssysteme::dimension, elim_redund_sc_with_sc(), entity_code(), entity_local_name(), entity_undefined, ifdebug, Ssysteme::inegalites, malloc(), maxscinfosize, module, pips_debug, sc_dup(), sc_fprint(), sc_init_with_sc(), sc_integer_projection_information(), sc_intersection(), sc_minmax_of_variables(), sc_normalize(), sc_variables_rename(), space, statement_undefined, Svecteur::succ, sys_debug, update_basis(), VALUE_ONE, var_with_unity_coeff_p(), variables_in_declaration_list(), vect_chg_coeff(), vect_dup(), vect_erase_var(), vect_fprint(), vect_new(), vect_rename(), vect_size(), VECTEUR_NUL, VECTEUR_UNDEFINED_P, vecteur_var, and wp65_debug_print_text().

Referenced by make_load_blocks(), and make_store_blocks().

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

◆ print_fullname_base()

void print_fullname_base ( Pbase  sb)
Parameters
sbb

Definition at line 114 of file movement_computation.c.

115 {
116  Pvecteur pv;
117  for (pv = sb; pv !=NULL;
118  (void) fprintf(stderr,"%s_%s,",
119  entity_module_name((entity)(pv->var)),
120  entity_local_name((entity)(pv->var))),
121  pv=pv->succ);
122  (void) fprintf(stderr,"\n");
123 }
const char * entity_module_name(entity e)
See comments about module_name().
Definition: entity.c:1092
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
Definition: statement.c:4047

References entity_local_name(), entity_module_name(), fprintf(), Svecteur::succ, and Svecteur::var.

Referenced by update_basis().

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

◆ sc_image_computation()

Psysteme sc_image_computation ( entity  module,
entity  entity_var,
Psysteme  sc_domain,
Psysteme  sc_array_function,
Pbase  index_base,
Pbase const_base,
entity  proc_id,
Pbase  bank_indices,
Pbase  tile_indices,
Pbase new_tile_indices,
int  pn,
int  bn,
int  ls,
int n,
int dim_h 
)

This function computes the system of constraints characterizing the image by the array function of the iteration domain.

Computation of the system depending on the machine

conversion des egalites en deux inegalites

pdate the base of constants in the system

initialisation du nombre de constantes symboliques du systeme

allocation et initialisation des matrices utiles

conversion du premier systeme relatif au domaine d'iteration et du deuxieme systeme relatif a la fonction d'acces aux elements du tableau

mise sous forme normale de matrice_hermite

calcul de la dimension reelle de la fonction d'acces

Computation of the new iteration domain

conversion de la matrice en systeme

Computation of the new matrix for array function

conversion from matrix to system

sc_transform_ineg_in_eg(sc_image);

Parameters
moduleodule
entity_varmodule
sc_domainentity
sc_array_functiondomain of iteration
index_basesystem of constraints of the array function
const_baseindex basis
proc_idroc_id
bank_indicesank_indices
tile_indicescontains the index describing the bank: bank_id, L (ligne of bank) and O (offset in the ligne)
new_tile_indicesew_tile_indices
pnn
bnn
lss
nbank number and line size (depends on the machine)
dim_him_h

Definition at line 572 of file movement_computation.c.

588 {
589 
590  Psysteme sc_image = SC_UNDEFINED;
591  Psysteme sc_machine = SC_UNDEFINED;
592  Psysteme sc_domain2 = sc_dup(sc_domain);
594  Pbase new_index_base = BASE_NULLE;
595  Pvecteur pv = VECTEUR_NUL;
596  Pvecteur pvnew = VECTEUR_NUL;
597  Pvecteur pv1= VECTEUR_NUL;
598  Pvecteur pvi=VECTEUR_NUL;
599 
600  Pbase pbv, list_new_var=BASE_NULLE;
601  matrice A,B,F0,P,HERM,HERF,R;
602  matrice F = 0;
603  matrice Q = NULL;
604  int n1,mb,i;
605  Value det_p, det_q;
606  int n2 = 0;
607  int ma =0;
608  Variable new_var;
609 
610  debug_on("MOVEMENT_DEBUG_LEVEL");
611  debug(3,"sc_image_computation","begin\n");
612 
613  ifdebug(3) {
614  pips_debug(3,"ITERATION DOMAIN:\n");
615  sc_fprint(stderr, sc_domain2, (get_variable_name_t) entity_local_name);
616  pips_debug(3,"ARRAY FUNCTION :\n");
617  sc_fprint(stderr, sc_array_function, (get_variable_name_t) entity_local_name);
618  }
619  if (!sc_faisabilite(sc_domain2))
620  (void) fprintf(stderr,"systeme non faisable en reels \n");
621  else {
622 
623  /* Computation of the system depending on the machine */
624  sc_machine = build_sc_machine(pn,bn,ls,sc_array_function,proc_id,
625  bank_indices,entity_var);
626  sc_domain2 = sc_append(sc_domain2,sc_machine);
627 
628  /* conversion des egalites en deux inegalites */
629  sc_transform_eg_in_ineg(sc_domain2);
630 
631  /*update the base of constants in the system */
632 
633  pv1 =vect_dup(sc_domain2->base);
634  for (pv = index_base;
635  !VECTEUR_NUL_P(pv);
636  vect_chg_coeff(&pv1,vecteur_var(pv),0),pv=pv->succ);
637  *const_base = pv1;
638  ifdebug(8) {
639  pips_debug(8,"\n constant basis - sc_image_computation:");
640  base_fprint(stderr, *const_base,
642  }
643 
644  /* initialisation du nombre de constantes symboliques du systeme */
645 
646  for (pv1 = index_base, ma=0;
647  !VECTEUR_NUL_P(pv1);
648  ma ++, pv1 = pv1->succ);
649  for (pv1 = *const_base, mb=1;
650  !VECTEUR_NUL_P(pv1);
651  mb ++, pv1 = pv1->succ);
652 
653  sc_image = sc_new();
654  n1 = sc_domain2->nb_ineq;
655  n2 = sc_array_function->nb_ineq;
656 
657  /* allocation et initialisation des matrices utiles */
658  A = matrice_new(n1,ma);
659  B = matrice_new(n1,mb);
660  F = matrice_new(n2,ma);
661  F0 = matrice_new(n2,mb);
662  R = matrice_new(n1,ma);
663  P = matrice_new(n2,n2);
664  Q = matrice_new(ma,ma);
665  HERM = matrice_new(n2,ma);
666  HERF= matrice_new(n2,ma);
667 
668  matrice_nulle(R,n1,ma);
669  matrice_nulle(HERF,n2,ma);
670  matrice_identite(P,n2,0);
671 
672  *n= ma;
673 
674  /* conversion du premier systeme relatif au domaine d'iteration
675  et du deuxieme systeme relatif a la fonction d'acces
676  aux elements du tableau */
677  loop_sc_to_matrices(sc_domain2,index_base,*const_base,A,B,n1,ma,mb);
678 
679  loop_sc_to_matrices(sc_array_function,index_base,
680  *const_base,F,F0,n2,ma,mb);
681 
682  /* mise sous forme normale de matrice_hermite */
683  matrice_hermite(F,n2,ma,P,HERM,Q,&det_p,&det_q);
684  ifdebug(8) {
685  sc_fprint(stderr, sc_array_function, (get_variable_name_t) entity_local_name);
686  (void) fprintf(stderr," matrice F\n");
687  matrice_fprint(stderr,F,n2,ma);
688  }
689 
690  ifdebug(8) {
691  (void) fprintf(stderr," matrice P\n");
692  matrice_fprint(stderr,P,n2,n2);
693  (void) fprintf(stderr," matrice Q\n");
694  matrice_fprint(stderr,Q,ma,ma);
695  }
696 
697  /* calcul de la dimension reelle de la fonction d'acces */
698  *dim_h = dim_H(HERM,n2,ma);
699 
700  /** Computation of the new iteration domain **/
701  matrice_multiply(A,Q,R,n1,ma,ma);
702  ifdebug(8) {
703  (void) fprintf(stderr," matrix of new iteration domain \n");
704  matrice_fprint(stderr,R,n1,ma);
705  }
706  /* conversion de la matrice en systeme */
707  for (i = 1; i<= ma;i++) {
708  new_var = sc_add_new_variable_name(module,sc_image);
709  if (i==1) {
710  new_index_base= vect_new(new_var,VALUE_ONE);
711  pvi = new_index_base;
712  }
713  else { pvi->succ = vect_new(new_var,VALUE_ONE);
714  pvi=pvi->succ;
715  }
716  }
717  matrices_to_loop_sc(sc_image,new_index_base,
718  *const_base,R,B,n1,ma,mb);
719  list_new_var = new_index_base;
720  for (i = 1,pc=sc_array_function->inegalites,pbv = list_new_var;
721  i<= ma && !CONTRAINTE_UNDEFINED_P(pc) && !VECTEUR_NUL_P(pbv);
722  i++,pc =pc->succ,pbv=pbv->succ) {
723  if (vect_size(pc->vecteur) == 1 && pc->vecteur->var == TCST) {
724  pvnew = vect_make(NULL,
725  pbv->var,VALUE_ONE,
726  TCST,value_uminus(pc->vecteur->val));
727  sc_add_inegalite(sc_image,contrainte_make(pvnew));
728  pvnew = vect_make(NULL,
729  pbv->var,VALUE_MONE,
730  TCST,pc->vecteur->val);
731  sc_add_inegalite(sc_image,contrainte_make(pvnew));
732  }
733  }
734  ifdebug(3) {
735  pips_debug(3,"NEW ITERATION DOMAIN:\n");
736  sc_fprint(stderr, sc_image, (get_variable_name_t) entity_local_name);
737  }
738 
739  /** Computation of the new matrix for array function **/
740  matrice_multiply(P,HERM,HERF,n2,n2,ma);
741  ifdebug(3) {
742  pips_debug(3," New Matrix for Array Function \n");
743  matrice_fprint(stderr,HERF,n2,ma);
744  matrice_fprint(stderr,F0,n2,mb);
745  }
746  /* conversion from matrix to system */
747  matrices_to_loop_sc(sc_array_function,
748  new_index_base,*const_base,
749  HERF,
750  F0,
751  n2,
752  ma,mb);
753  ifdebug(3) {
754  pips_debug(3,"New Array Function :\n");
755  sc_fprint(stderr, sc_array_function, (get_variable_name_t) entity_local_name);
756  }
757  }
758 
759  /* sc_transform_ineg_in_eg(sc_image);*/
760  *new_tile_indices = BASE_NULLE;
761  sort_tile_indices(tile_indices,new_tile_indices,F,n2);
762 
763 
764  ifdebug(3) {
765  pips_debug(3,"New Iteration Domain :\n");
766  sc_fprint(stderr, sc_image, (get_variable_name_t) entity_local_name);
767  }
768  debug(3,"sc_image_computation","end\n");
769  debug_off();
770 
771  return(sc_image);
772 }
#define value_uminus(val)
unary operators on values
#define VALUE_MONE
int Value
Psysteme build_sc_machine(int pn, int bn, int ls, Psysteme sc_array_function, entity proc_id, Pbase bank_indices, entity entity_var)
PACKAGE MOVEMENTS.
#define A(i, j)
comp_matrice.c
Definition: comp_matrice.c:63
#define CONTRAINTE_UNDEFINED_P(c)
#define CONTRAINTE_UNDEFINED
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Definition: alloc.c:73
#define F
Definition: freia-utils.c:51
#define B(A)
Definition: iabrev.h:61
void base_fprint(FILE *f, Pbase b, get_variable_name_t variable_name)
void base_fprint(FILE * f, Pbase b, char * (*variable_name)()): impression d'une base sur le fichier ...
Definition: io.c:342
#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
int dim_H(matrice H, int n, int m)
Calcul de la dimension de la matrice de Hermite H.
Definition: hermite.c:197
void matrice_hermite(Value *MAT, int n, int m, Value *P, Value *H, Value *Q, Value *det_p, Value *det_q)
package matrice
Definition: hermite.c:78
void matrice_multiply(matrice a, matrice b, matrice c, int p, int q, int r)
void matrice_multiply(matrice a, matrice b, matrice c, int p, int q, int r): multiply rational matrix...
Definition: matrice.c:82
void matrice_nulle(matrice Z, int n, int m)
void matrice_nulle(matrice Z, int n, int m): Initialisation de la matrice Z a la valeur matrice nulle
Definition: matrice.c:311
void matrice_identite(matrice, int, int)
void matrice_identite(matrice ID, int n, int level) Construction d'une sous-matrice identite dans ID(...
Definition: sous-matrice.c:322
void matrice_fprint(FILE *, matrice, int, int)
matrice_io.c
Definition: matrice_io.c:62
void sort_tile_indices(Pbase tile_indices, Pbase *new_tile_indices, matrice Q, int m)
Sort the tile indices base, such that the indices correspond to the tile indices of the array element...
Variable sc_add_new_variable_name(entity, Psysteme)
sc_add_variable.c
#define Q
Definition: pip__type.h:39
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
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...
void sc_transform_eg_in_ineg(Psysteme sc)
Package sc.
void loop_sc_to_matrices(Psysteme, Pbase, Pbase, matrice, matrice, int, int, int)
Creation de la matrice A correspondant au systeme lineaire et de la matrice correspondant a la partie...
void matrices_to_loop_sc(Psysteme, Pbase, Pbase, matrice, matrice, int, int, int)
Definition: pip__tab.h:25
int nb_ineq
Definition: sc-local.h:73
#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
Pvecteur vect_make(Pvecteur v, Variable var, Value val,...)
Pvecteur vect_make(v, [var, val,]* 0, val) Pvecteur v; // may be NULL, use assigne anyway Variable va...
Definition: alloc.c:165

References A, B, Ssysteme::base, base_fprint(), BASE_NULLE, build_sc_machine(), contrainte_make(), CONTRAINTE_UNDEFINED, CONTRAINTE_UNDEFINED_P, debug(), debug_off, debug_on, dim_H(), entity_local_name(), F, fprintf(), ifdebug, Ssysteme::inegalites, loop_sc_to_matrices(), matrice_fprint(), matrice_hermite(), matrice_identite(), matrice_multiply(), matrice_new, matrice_nulle(), matrices_to_loop_sc(), module, Ssysteme::nb_ineq, pips_debug, Q, sc_add_inegalite(), sc_add_new_variable_name(), sc_append(), sc_dup(), sc_fprint(), sc_new(), sc_transform_eg_in_ineg(), sort_tile_indices(), Scontrainte::succ, Svecteur::succ, TCST, VALUE_MONE, VALUE_ONE, value_uminus, Svecteur::var, vect_chg_coeff(), vect_dup(), vect_make(), vect_new(), vect_size(), VECTEUR_NUL, VECTEUR_NUL_P, and vecteur_var.

Referenced by make_load_blocks(), and make_store_blocks().

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

◆ sort_tile_indices()

void sort_tile_indices ( Pbase  tile_indices,
Pbase new_tile_indices,
matrice  Q,
int  m 
)

Sort the tile indices base, such that the indices correspond to the tile indices of the array elements accessed by the local entity.

Example: If A[I,K] is referenced. the tile indices base sould be L_I,L_K...

Parameters
tile_indicesile_indices
new_tile_indicesew_tile_indices

Definition at line 236 of file movement_computation.c.

241 {
242  register int i,j;
243  Pvecteur pv,pv2;
245 
246  for (i=1;i<=m;i++) {
247  for (j=1,pv=tile_indices; pv!=NULL;j++,pv=pv->succ) {
248  if (ACCESS(Q,m,i,j) && vect_coeff(pv->var,pv3)==0 ) {
249  pv2 = vect_new(pv->var,ACCESS(Q,m,i,j));
250  if (*new_tile_indices ==BASE_NULLE)
251  *new_tile_indices =pv2 ;
252  else pv3->succ= pv2;
253  pv3 = pv2;
254  }
255  }
256  }
257 }
#define ACCESS(matrix, column, i, j)
Macros d'acces aux elements d'une matrice.
Definition: matrice-local.h:86
#define VECTEUR_UNDEFINED
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, BASE_NULLE, Q, Svecteur::succ, vect_coeff(), vect_new(), and VECTEUR_UNDEFINED.

Referenced by sc_image_computation().

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

◆ update_basis()

void update_basis ( Pbase  scbase,
Pbase index_base,
Pbase const_base,
Pbase image_base,
Pbase  bank_indices,
Pbase  tile_indices,
Pbase lindex,
Pbase lvar_coeff_nunit,
Pbase lvar_coeff_unit,
Pbase loop_body_offsets,
Pbase loop_body_indices,
bool  bank_code,
Pbase  ppid 
)

Update all the basis needed for data movement generation.

-loop_body_offsets: indices such as O or LI or LJ used to describe the range of contiguous values accessed on line (of tile or bank).

-loop_body_indices: list of the loop indices that are not parameters of the tiling transformation and are situated in the loop body of the tile

Parameters
scbasecbase
index_basendex_base
const_baseonst_base
image_basemage_base
bank_indicesank_indices
tile_indicesile_indices
lindexindex
lvar_coeff_nunitvar_coeff_nunit
lvar_coeff_unitvar_coeff_unit
loop_body_offsetsoop_body_offsets
loop_body_indicesoop_body_indices
bank_codeank_code
ppidpid

Definition at line 136 of file movement_computation.c.

150 {
151 
152  Pvecteur pv,pv1;
153 
154  debug(8,"update_basis","begin\n");
155  ifdebug(8) {
156  (void) fprintf(stderr,"BASIS PRINTING: \n");
157  (void) fprintf(stderr," sc_base :");
158  print_fullname_base(scbase);
159  (void) fprintf(stderr," const_base :");
160  print_fullname_base(*const_base);
161  (void) fprintf(stderr," bank_indices ");
162  print_fullname_base(bank_indices);
163  (void) fprintf(stderr," index_base");
164  print_fullname_base(*index_base);
165  (void) fprintf(stderr," tile_indices");
166  print_fullname_base(tile_indices);
167  (void) fprintf(stderr," loop_body_indices");
168  print_fullname_base(*loop_body_indices); }
169 
170  for (pv = bank_indices; !VECTEUR_NUL_P(pv); pv = pv->succ)
171  vect_chg_coeff(const_base,pv->var, VALUE_ZERO);
172 
173  vect_chg_coeff(const_base,ppid->var, VALUE_ZERO);
174 
175  if (bank_code)
176  vect_chg_coeff(const_base,vecteur_var(bank_indices), VALUE_ONE);
177  else
178  vect_chg_coeff(const_base,vecteur_var(ppid), VALUE_ONE);
179 
180  for (pv = tile_indices; !VECTEUR_NUL_P(pv); pv = pv->succ)
181  vect_chg_coeff(const_base,pv->var, VALUE_ZERO);
182 
183  for (pv = *loop_body_indices; !VECTEUR_NUL_P(pv); pv = pv->succ)
184  vect_erase_var(const_base,pv->var);
185 
186  *index_base = vect_dup(scbase);
187  *lindex = vect_dup(scbase);
188  *lvar_coeff_nunit = base_dup(scbase);
189 
190  for (pv = *const_base; !BASE_NULLE_P(pv);
191  vect_erase_var(lvar_coeff_nunit, vecteur_var(pv)),
192  vect_erase_var(index_base, vecteur_var(pv)),
193  vect_erase_var(lindex, vecteur_var(pv)),
194  pv= pv->succ);
195 
196  *image_base = build_image_base(bank_code,ppid,bank_indices,tile_indices);
197 
198  for (pv1 = *image_base;
199  !BASE_NULLE_P(pv1);
200  vect_erase_var(lvar_coeff_nunit,vecteur_var(pv1)),
201  vect_erase_var(index_base,vecteur_var(pv1)),
202  vect_erase_var(lindex,vecteur_var(pv1)),
203  pv1=pv1->succ);
204 
205  *lvar_coeff_unit = base_dup(*lvar_coeff_nunit);
206  *index_base = vect_add(vect_dup(*index_base),vect_dup(*image_base));
207  *lindex = vect_add(*image_base,vect_dup(*lindex));
208  *lindex = vect_add(vect_dup(*lindex),vect_dup(*const_base));
209 
210  if (bank_code)
211  *loop_body_offsets = vect_dup(bank_indices->succ);
212  else
213  *loop_body_offsets = base_dup(tile_indices);
214  ifdebug(8) {
215  (void) fprintf(stderr,"New BASIS:");
216  print_fullname_base(*image_base);
217  (void) fprintf(stderr," base lindex:");
218  print_fullname_base(*lindex);
219  (void) fprintf(stderr," base index:");
220  print_fullname_base(*index_base);
221  (void) fprintf(stderr," lvar_coeff_nunit:");
222  print_fullname_base(*lvar_coeff_nunit);
223  (void) fprintf(stderr," lvar_coeff_unit:");
224  print_fullname_base(*lvar_coeff_unit);
225  }
226  debug(8,"update_basis","end\n");
227 }
#define VALUE_ZERO
void print_fullname_base(Pbase sb)
Pbase build_image_base(bool bank_code, Pbase proc_id, Pbase bank_indices, Pbase tile_indices)
cproto-generated files
#define BASE_NULLE_P(b)
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Definition: binaires.c:53

References base_dup(), BASE_NULLE_P, build_image_base(), debug(), fprintf(), ifdebug, print_fullname_base(), Svecteur::succ, VALUE_ONE, VALUE_ZERO, Svecteur::var, vect_add(), vect_chg_coeff(), vect_dup(), vect_erase_var(), VECTEUR_NUL_P, and vecteur_var.

Referenced by movement_computation().

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

◆ variables_in_declaration_list()

Pbase variables_in_declaration_list ( entity __attribute__((unused))  module,
code  ce 
)

Definition at line 299 of file movement_computation.c.

300  {
301  Pbase b= BASE_NULLE;
302  MAPL(p,{
303  entity e = ENTITY(CAR(p));
304  if (BASE_UNDEFINED_P(b))
305  b = vect_new((Variable) e, VALUE_ONE);
306  else vect_add_elem(&b,(Variable) e, VALUE_ONE);
307  }, code_declarations(ce));
308 
309  return(b);
310 }
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#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
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define code_declarations(x)
Definition: ri.h:784
#define BASE_UNDEFINED_P(b)

References BASE_NULLE, BASE_UNDEFINED_P, CAR, code_declarations, ENTITY, MAPL, VALUE_ONE, vect_add_elem(), and vect_new().

Referenced by movement_computation().

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