PIPS
basis.c File Reference
#include <stdlib.h>
#include <stdio.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 "matrice.h"
#include "tiling.h"
#include "ri-util.h"
#include "effects-util.h"
#include "wp65.h"
+ Include dependency graph for basis.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

entity create_local_index (entity module, Pvecteur pv, string st)
 basis.c More...
 
entity create_local_index2 (entity module, Pvecteur pv, string st)
 
void create_tile_basis (entity initial_module, entity compute_module, entity memory_module, Pbase initial_basis, Pbase *tile_basis_in_initial_basis, Pbase *tile_basis_in_tile_basis, Pbase *local_tile_basis, Pbase *tile_basis_in_tile_basis2, Pbase *local_tile_basis2)
 

Typedef Documentation

◆ arc_label

Code Generation for Distributed Memory Machines.

Generation of indices for the different bases used in code generation

PUMA, ESPRIT contract 2701

Corinne Ancourt 1991

Definition at line 51 of file basis.c.

◆ vertex_label

Definition at line 52 of file basis.c.

Function Documentation

◆ create_local_index()

entity create_local_index ( entity  module,
Pvecteur  pv,
string  st 
)

basis.c

Parameters
moduleodule
pvv
stt

Definition at line 61 of file basis.c.

62 {
63  entity new_ind;
65  vecteur_var(pv)),
66  st,NULL));
67  if ((new_ind =
69  MODULE_SEP_STRING,name,NULL),
71  {
72  new_ind=make_scalar_integer_entity(name,
75  }
76  free(name);
77  return(new_ind);
78 }
void free(void *)
#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
static char * module
Definition: pips.c:74
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
const char * module_local_name(entity e)
Returns the module local user name.
Definition: entity.c:582
void AddEntityToDeclarations(entity, entity)
END_EOLE.
Definition: variable.c:108
entity make_scalar_integer_entity(const char *, const char *)
Create an integer variable of name "name" in module of name "module_name".
Definition: variable.c:1068
#define entity_undefined
Definition: ri.h:2761
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410
char * strdup()
#define vecteur_var(v)

References AddEntityToDeclarations(), concatenate(), entity_domain, entity_local_name(), entity_undefined, free(), gen_find_tabulated(), make_scalar_integer_entity(), module, module_local_name(), MODULE_SEP_STRING, strdup(), and vecteur_var.

Referenced by create_tile_basis().

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

◆ create_local_index2()

entity create_local_index2 ( entity  module,
Pvecteur  pv,
string  st 
)
Parameters
moduleodule
pvv
stt

Definition at line 80 of file basis.c.

81 {
82  entity new_ind;
83  string name = strdup(concatenate(st,
85  NULL));
86  if ((new_ind=gen_find_tabulated(concatenate
88  MODULE_SEP_STRING,name,NULL),
90  new_ind=make_scalar_integer_entity(name,
92  module));
94  }
95  free(name);
96  return(new_ind);
97 }

References AddEntityToDeclarations(), concatenate(), entity_domain, entity_local_name(), entity_undefined, free(), gen_find_tabulated(), make_scalar_integer_entity(), module, module_local_name(), MODULE_SEP_STRING, strdup(), and vecteur_var.

Referenced by create_tile_basis().

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

◆ create_tile_basis()

void create_tile_basis ( entity  initial_module,
entity  compute_module,
entity  memory_module,
Pbase  initial_basis,
Pbase tile_basis_in_initial_basis,
Pbase tile_basis_in_tile_basis,
Pbase local_tile_basis,
Pbase tile_basis_in_tile_basis2,
Pbase local_tile_basis2 
)
Parameters
initial_modulenitial_module
compute_moduleompute_module
memory_moduleemory_module
initial_basisnitial_basis
tile_basis_in_initial_basisile_basis_in_initial_basis
tile_basis_in_tile_basisile_basis_in_tile_basis
local_tile_basisocal_tile_basis
tile_basis_in_tile_basis2ile_basis_in_tile_basis2
local_tile_basis2idem que les precedentes mais pour la sousroutine compute_module

Definition at line 100 of file basis.c.

111 {
112  string name;
113  entity new_ind;
114  Pvecteur pv;
115  Pbase tbib = BASE_NULLE;
116  Pbase tbtb = BASE_NULLE;
117  Pbase tbtbc = BASE_NULLE;
118  Pbase ltb = BASE_NULLE;
119  Pbase ltbc = BASE_NULLE;
120 
121  debug(8, "create_tile_basis", "begin initial_module_name=%s\n",
122  module_local_name(initial_module));
123  ifdebug(8) {
124  (void) fprintf(stderr, "initial_basis:\n");
125  vect_fprint(stderr, initial_basis, (string(*)(void*))entity_local_name);
126  }
127 
128  for (pv = initial_basis; !VECTEUR_NUL_P(pv); pv=pv->succ) {
129 
131  vecteur_var(pv)),
133  NULL));
134  if ((new_ind =
136  MODULE_SEP_STRING,name,NULL),
138  new_ind=make_scalar_integer_entity(name,
139  module_local_name(initial_module));
140 
141  free(name);
142  tbib = vect_add_variable (tbib,(char *)new_ind);
143 
144  new_ind = create_local_index(compute_module,
145  pv,
147  tbtbc = vect_add_variable (tbtbc,(char *) new_ind);
148 
149  new_ind= create_local_index(memory_module,
150  pv,
152  tbtb = vect_add_variable (tbtb,(char *) new_ind);
153 
154  new_ind = create_local_index2(compute_module, pv,
156  ltbc = vect_add_variable (ltbc,(char *) new_ind);
157 
158  new_ind = create_local_index2(memory_module, pv,
160  ltb = vect_add_variable (ltb,(char *) new_ind);
161  }
162 
163 
164  *tile_basis_in_initial_basis = base_reversal(tbib);
165  *tile_basis_in_tile_basis = base_reversal(tbtb);
166  *local_tile_basis = base_reversal(ltb);
167  *tile_basis_in_tile_basis2 = base_reversal(tbtbc);
168  *local_tile_basis2 = base_reversal(ltbc);
169 
170  ifdebug(8) {
171  (void) fprintf(stderr,"\nInitial basis:");
172  base_fprint(stderr, initial_basis, (string(*)(void*))entity_local_name);
173  (void) fprintf(stderr,"\nTile basis in initial basis:");
174  base_fprint(stderr, *tile_basis_in_initial_basis, (string(*)(void*))entity_local_name);
175  (void) fprintf(stderr,"\nTile basis in tile basis:");
176  base_fprint(stderr, *tile_basis_in_tile_basis, (string(*)(void*))entity_local_name);
177  (void) fprintf(stderr,"\nLocal basis:");
178  base_fprint(stderr, *local_tile_basis, (string(*)(void*))entity_local_name);
179  (void) fprintf(stderr,
180  "\nTile basis in tile basis for compute module:");
181  base_fprint(stderr, *tile_basis_in_tile_basis2, (string(*)(void*))entity_local_name);
182  (void) fprintf(stderr,"\nLocal basis for compute module:");
183  base_fprint(stderr, *local_tile_basis2, (string(*)(void*))entity_local_name);
184  }
185 
186  debug(8, "create_tile_basis", "end\n");
187 }
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
Pbase vect_add_variable(Pbase b, Variable v)
package vecteur - routines sur les bases
Definition: base.c:61
entity create_local_index(entity module, Pvecteur pv, string st)
basis.c
Definition: basis.c:61
entity create_local_index2(entity module, Pvecteur pv, string st)
Definition: basis.c:80
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
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
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
#define ifdebug(n)
Definition: sg.c:47
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
struct Svecteur * succ
Definition: vecteur-local.h:92
#define VECTEUR_NUL_P(v)
#define BASE_NULLE
MACROS SUR LES BASES.
#define SUFFIX_FOR_INDEX_TILE_IN_TILE_BASIS
Definition: wp65-local.h:47
#define PREFIX_FOR_LOCAL_TILE_BASIS
Definition: wp65-local.h:48
#define SUFFIX_FOR_INDEX_TILE_IN_INITIAL_BASIS
Definition: wp65-local.h:46

References base_fprint(), BASE_NULLE, base_reversal(), concatenate(), create_local_index(), create_local_index2(), debug(), entity_domain, entity_local_name(), entity_undefined, fprintf(), free(), gen_find_tabulated(), ifdebug, make_scalar_integer_entity(), module_local_name(), MODULE_SEP_STRING, PREFIX_FOR_LOCAL_TILE_BASIS, strdup(), Svecteur::succ, SUFFIX_FOR_INDEX_TILE_IN_INITIAL_BASIS, SUFFIX_FOR_INDEX_TILE_IN_TILE_BASIS, vect_add_variable(), vect_fprint(), VECTEUR_NUL_P, and vecteur_var.

Referenced by loop_nest_to_wp65_code().

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