PIPS
|
#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"
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... | |
#define maxscinfosize 100 |
#define sys_debug | ( | level, | |
msg, | |||
sc | |||
) |
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.
cproto-generated files
bank_code | ank_code |
proc_id | roc_id |
bank_indices | ank_indices |
tile_indices | ile_indices |
Definition at line 76 of file movement_computation.c.
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().
Build the system of inequations of sc1 no-redundant with system sc2.
sc1 | c1 |
sc2 | c2 |
index_base | ndex_base |
dim | im |
Definition at line 262 of file movement_computation.c.
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().
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:-)
module | odule |
used_def | sed_def |
bank_code | ank_code |
receive_code | is true if it is the generation of code for bank false if it is for engine |
private_entity | is true if the generated code must be a RECEIVE, false if it must be a SEND |
sc_image | local entity |
const_base | domain of image |
bank_indices | ank_indices |
tile_indices | contains the index describing the bank: bank_id, L (ligne of bank) and O (offset in the ligne) |
ppid | contains the local indices LI, LJ,.. of tile |
loop_body_indices | oop_body_indices |
n | contains the loop indices situated in the tile |
dim_h | im_h |
Definition at line 321 of file movement_computation.c.
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().
void print_fullname_base | ( | Pbase | sb | ) |
sb | b |
Definition at line 114 of file movement_computation.c.
References entity_local_name(), entity_module_name(), fprintf(), Svecteur::succ, and Svecteur::var.
Referenced by update_basis().
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);
module | odule |
entity_var | module |
sc_domain | entity |
sc_array_function | domain of iteration |
index_base | system of constraints of the array function |
const_base | index basis |
proc_id | roc_id |
bank_indices | ank_indices |
tile_indices | contains the index describing the bank: bank_id, L (ligne of bank) and O (offset in the ligne) |
new_tile_indices | ew_tile_indices |
pn | n |
bn | n |
ls | s |
n | bank number and line size (depends on the machine) |
dim_h | im_h |
Definition at line 572 of file movement_computation.c.
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().
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...
tile_indices | ile_indices |
new_tile_indices | ew_tile_indices |
Definition at line 236 of file movement_computation.c.
References ACCESS, BASE_NULLE, Q, Svecteur::succ, vect_coeff(), vect_new(), and VECTEUR_UNDEFINED.
Referenced by sc_image_computation().
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
scbase | cbase |
index_base | ndex_base |
const_base | onst_base |
image_base | mage_base |
bank_indices | ank_indices |
tile_indices | ile_indices |
lindex | index |
lvar_coeff_nunit | var_coeff_nunit |
lvar_coeff_unit | var_coeff_unit |
loop_body_offsets | oop_body_offsets |
loop_body_indices | oop_body_indices |
bank_code | ank_code |
ppid | pid |
Definition at line 136 of file movement_computation.c.
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().
Pbase variables_in_declaration_list | ( | entity __attribute__((unused)) | module, |
code | ce | ||
) |
Definition at line 299 of file movement_computation.c.
References BASE_NULLE, BASE_UNDEFINED_P, CAR, code_declarations, ENTITY, MAPL, VALUE_ONE, vect_add_elem(), and vect_new().
Referenced by movement_computation().