PIPS
|
#include "matrice.h"
Go to the source code of this file.
Macros | |
#define | COLUMN_MAJOR true |
Warning! Do not modify this file that is automatically generated! More... | |
#define | SUFFIX_FOR_TEMP_VAR1_IN_INNER_LOOP "_1" |
#define | SUFFIX_FOR_TEMP_VAR2_IN_INNER_LOOP "_2" |
#define COLUMN_MAJOR true |
Warning! Do not modify this file that is automatically generated!
Modify src/Libs/movements/movements-local.h instead, to add your own modifications. header file built by cproto movements-local.h Package movements
Definition at line 36 of file movements.h.
#define SUFFIX_FOR_TEMP_VAR1_IN_INNER_LOOP "_1" |
Definition at line 38 of file movements.h.
#define SUFFIX_FOR_TEMP_VAR2_IN_INNER_LOOP "_2" |
Definition at line 39 of file movements.h.
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.
The set of systems lsystem describes the set of constraints of each loop index. New loop bounds are deduced from these sytems.
Initialisation des systemes
make new bound expression and new range loop
looplabel = make_new_label(initial_module_name);
new code by FI to add continue statements starts here
end of new code by FI
module | odule |
bank_code | ank_code |
receive_code | eceive_code |
ent | nt |
loop_body_indices | oop_body_indices |
var_id | ar_id |
lsystem | system |
index_base | ndex_base |
sc_info | c_info |
Definition at line 328 of file bound_generation.c.
References bound_distribution(), CONS, CONTRAINTE_UNDEFINED_P, debug(), debug_off, debug_on, entity_empty_label(), entity_local_name(), entity_undefined, fprintf(), free(), gen_nconc(), ifdebug, Ssysteme::inegalites, instruction_block, instruction_block_p, int_to_expression(), is_execution_parallel, is_execution_sequential, loop_to_statement, lower_bound_generation(), make_block_statement(), make_continue_statement(), make_datum_movement(), make_execution(), make_loop(), make_loop_label(), make_movements_loop_body_wp65(), make_range(), make_test(), malloc(), module, NIL, pips_debug, printf(), rank_of_variable(), sc_fprint(), sc_init_with_sc(), space, STATEMENT, statement_instruction, statement_undefined, Svecteur::succ, test_bound_generation(), test_to_statement, upper_bound_generation(), UU, Svecteur::var, variable_of_rank(), vect_size(), and wp65_debug_print_text().
Referenced by movement_computation().
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().
Psysteme build_sc_machine | ( | int | pn, |
int | bn, | ||
int | ls, | ||
Psysteme | sc_array_function, | ||
entity | proc_id, | ||
Pbase | bank_indices, | ||
entity | entity_var | ||
) |
Corinne Ancourt - septembre 1991 this function builds the following system of constraints depending on the machine. It describes the implementation of array elements in the memory in function of bank, ligne size, ligne bank,...
bn is the number of banks, ls the ligne size, ms the first array dimension bank is a variable giving the bank id., ligne a variable corresponding to a ligne in the bank, ofs a variable corresponding to an offset in a ligne of the bank.
if COLUMN_MAJOR is true the system is the following one
(VAR1-1) + (VAR2-1) *ms == bn*ls* ligne +ls*bank+ofs, 1 <= bank <= bn , 1 <= proc <= pn , 0 <= ofs <= ls-1
else it is
(VAR1-1) * ms + (VAR2-1) == bn*ls*ligne +ls*bank+ofs, 1 <= bank <= bn , 1 <= proc <= pn , 0 <= ofs <= ls-1
Si l'on veut utiliser le nombre d'octets il faut remplacer l'equation par deux inequations du type
if COLUMN_MAJOR is true the system is the following one
(VAR1-1) + (VAR2-1) ms <= bn*ls (ligne-1) +ls*(bank-1)+ofs, bn*ls* (ligne-1) +ls*(bank-1)+ofs <= (VAR1) + (VAR2-1) *ms
else it is
(VAR1-1) * ms + (VAR2-1) <= bn*ls*(ligne-1) +ls*(bank-1)+ofs, bn*ls*(ligne-1) +ls*(bank-1)+ofs <= (VAR1-1) * ms + (VAR2)
nb_bytes = SizeOfElements(bas);
bank_indices is assumed to belong the three variables bank_id, L and O (see documentation for more details)
if COLUMN_MAJOR is true then build the constraint
(VAR1-1) + (VAR2-1) *ms == bn*ls*L +ls*bank_id+O, else build the constraint (VAR1-1) * ms + (VAR2-1) == bn*ls*L +ls*bank_id+O, VAR1 and VAR2 correspond to the image array function indices
to deal with MONO dimensional array
to deal with MONO dimensional array
build the constraints 0 <= bank_id <= bn-1
build the constraints 0 <= proc_id <= pn-1
build the constraints 0 <= O <= ls -1
build the constraints 0 <= L
pn | n |
bn | n |
ls | s |
sc_array_function | c_array_function |
proc_id | roc_id |
bank_indices | ank_indices |
entity_var | ntity_var |
Definition at line 70 of file build_sc_machine.c.
References Ssysteme::base, CAR, COLUMN_MAJOR, contrainte_make(), debug(), Ssysteme::dimension, DIMENSION, dimension_lower, dimension_upper, entity_local_name(), entity_type, fprint_string_Value(), fprintf(), ifdebug, Ssysteme::inegalites, int_to_value, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, sc_fprint(), sc_init_with_sc(), Scontrainte::succ, Svecteur::succ, TCST, type_variable, type_variable_p, value_minus, VALUE_MONE, value_mult, VALUE_ONE, value_plus, VALUE_ZERO, variable_dimensions, vect_add(), vect_add_elem(), vect_add_variable(), vect_coeff(), vect_dup(), vect_multiply(), vect_new(), Scontrainte::vecteur, and vecteur_var.
Referenced by sc_image_computation().
expression complex_bound_computation | ( | Psysteme | , |
Pbase | , | ||
Pcontrainte | , | ||
Pcontrainte | , | ||
int | |||
) |
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.
System sc contains all the contraints having to be used to generate bound expressions for all loop indices.
A new system is defined for each system variable. Each new system defines the set of constraints needed for the generation of loop bound expressions for one variable.
The constraint constraining directly a variable of rank "rank_hr" is added to the system corresponding to the variable "var_hr" except if this variable must not be kept (var_hr is not a loop index). In this last case, the constraint must be combined with another constraint in order to eliminate the variable "var_hr" and to deduce a constraint constrainnig another variable of rank "rank". In that case, the two constraints are added to the system corresponding to the variable "var = variable_of_rank(rank)"
This condition is true if the variable must be kept like loop index. All the constraints constraining directly the variable of rank "rank_hr" are kept in the system bound_systems[rank_hr]
this condition is true if the combination of the two constraints pc1 and pc2 is not redundant for the
system. Then the two constraints are added to the system of the variable of higher rank
sc | c |
bound_systems | ound_systems |
index_base | ndex_base |
sc_info | c_info |
Definition at line 164 of file constraint_distribution.c.
References bound_redund_with_sc_p(), CONTRAINTE_UNDEFINED_P, debug(), debug_off, debug_on, entity_local_name(), fprintf(), ifdebug, Ssysteme::inegalites, insert_ineq_end_sc(), rank, rank_of_variable(), sc_fprint(), sc_init_with_sc(), search_higher_rank(), search_var_of_higher_rank(), Scontrainte::succ, value_notzero_p, value_sign, variable_of_rank(), vect_coeff(), vect_size(), and Scontrainte::vecteur.
Referenced by movement_computation(), and parallel_tiling().
sc | c |
bound_systems | ound_systems |
index_base | ndex_base |
Definition at line 241 of file constraint_distribution.c.
References CONTRAINTE_UNDEFINED_P, debug(), debug_off, debug_on, Ssysteme::egalites, rank, search_higher_rank(), Scontrainte::succ, and Scontrainte::vecteur.
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().
module | odule |
oper | per |
str | tr |
Definition at line 117 of file make_loop_body.c.
References concatenate(), entity_domain, entity_undefined, gen_find_tabulated(), is_type_functional, is_type_void, is_value_unknown, make_entity, make_functional(), make_storage_rom(), make_type(), make_value(), module, module_local_name(), MODULE_SEP_STRING, NIL, strdup(), TOP_LEVEL_MODULE_NAME, and UU.
Referenced by make_datum_movement(), make_movement_scalar_wp65(), and make_movements_loop_body_wp65().
Psysteme loop_bounds_to_tile_bounds | ( | Psysteme | loop_bounds, |
Pbase | loop_indices, | ||
tiling | t, | ||
Pvecteur | tile_delay, | ||
Pvecteur | tile_indices, | ||
Pvecteur | tile_local_indices | ||
) |
this function returns the system of constraints
-------—> --------—> ------—> ---—> --------------—> loop_indices = P (tile_indices - tile_delay) + origin + tile_local_indices
P is the matrice describing the tiling. Its determinant is 1.
mise a jour de la base du systeme de contraintes
build the constraints min (=0) <= lti <= max (=ls-1)
build the constraints 0 <= ti
loop_bounds | oop_bounds |
loop_indices | oop_indices |
tile_delay | ile_delay |
tile_indices | ile_indices |
tile_local_indices | ile_local_indices |
Definition at line 97 of file build_sc_tile.c.
References ACCESS, Ssysteme::base, contrainte_make(), debug(), debug_off, debug_on, Ssysteme::dimension, entity_local_name(), fprintf(), ifdebug, max, min, sc_add_egalite(), sc_dup(), sc_force_variable_to_zero(), sc_fprint(), Svecteur::succ, TCST, tiling_origin, tiling_tile, VALUE_CONST, value_maximum, value_minimum, value_minus, VALUE_MONE, value_mult, value_ne, value_notzero_p, VALUE_ONE, value_uminus, VALUE_ZERO, Svecteur::var, vect_add_elem(), vect_add_variable(), vect_coeff(), vect_new(), VECTEUR_NUL_P, and vecteur_var.
Referenced by loop_nest_to_wp65_code().
expression lower_bound_generation | ( | Psysteme | sc_neg, |
Pbase | index_base, | ||
int | number_of_lower_bounds, | ||
int | loop_rank | ||
) |
bound_generation.c
bound_generation.c
this condition is true if the constraint constrains directly the variable
In that case the bound expression results from the combination of two constraints. The variable of rank "higher_rank" will be eliminated from these two constraints in order to give only one bound for the "loop_rank" index.
sc_neg | c_neg |
index_base | ndex_base |
number_of_lower_bounds | umber_of_lower_bounds |
loop_rank | oop_rank |
Definition at line 56 of file bound_generation.c.
References CAR, complex_bound_computation(), CONS, CONTRAINTE_UNDEFINED_P, debug(), debug_off, debug_on, EXPRESSION, expression_undefined, Ssysteme::inegalites, int_to_expression(), local_name_to_top_level_entity(), make_div_expression(), make_op_expression(), make_vecteur_expression(), max, NIL, search_higher_rank(), Scontrainte::succ, TCST, value_abs, value_notmone_p, VALUE_ONE, value_one_p, value_plus, VALUE_TO_INT, value_uminus, VALUE_ZERO, variable_of_rank(), vect_add_elem(), vect_chg_coeff(), vect_cl2(), vect_coeff(), vect_dup(), Scontrainte::vecteur, and VECTEUR_NUL.
Referenced by bound_generation(), and make_movements_loop_body_wp65().
statement make_datum_movement | ( | entity | module, |
bool | receive_code, | ||
entity | ent, | ||
Pbase | local_indices, | ||
Pbase | var_id | ||
) |
statement make_datum_movement(module,receive_code,ent, local_indices,var_id)
This function generates the loop body of the movement code. In the case of bank code generation the loop body must be :
BANK_/WP65_ send/receive_nb_bytes(ES_A,O,1,L,Prod_id) ES_A is the emulated shared variable given as entity ent. Prod_id is the Processeur id. given as a Pvecteur in var_id. O and L are the local indices for the bank passed like Pbase in local_indices.
In the case of engine code generation the loop body must be :
BANK_/WP65_send/receive_nb_bytes(L_A,LI,1,LJ,Bank_id)
L_A is the local variable given as entity in ent. Bank_id is the bank id, given as Pvecteur in var_id. LJ, and LI are the local indices passed like Pbase in local_indices corresponds to the Pvecteur belonging Prod_id if bank_code and Bank_id otherwise
build the list of expressions : Prod_id,ES_A(L,O),1 for bank case and Bank_id,L_A(LJ,LI),1 for engine case
generate the send or the receive call
module | odule |
receive_code | eceive_code |
ent | This function generates the loop body of the movement code. In the case of bank code generation the loop body must be : |
BANK_/WP65_ send/receive_nb_bytes(ES_A,O,1,L,Prod_id) ES_A is the emulated shared variable given as entity ent. Prod_id is the Processeur id. given as a Pvecteur in var_id. O and L are the local indices for the bank passed like Pbase in local_indices.
In the case of engine code generation the loop body must be :
BANK_/WP65_send/receive_nb_bytes(L_A,LI,1,LJ,Bank_id)
L_A is the local variable given as entity in ent. Bank_id is the bank id, given as Pvecteur in var_id. LJ, and LI are the local indices passed like Pbase in local_indices is true if the code is generated for receive
local_indices | This function generates the loop body of the movement code. In the case of bank code generation the loop body must be : |
BANK_/WP65_ send/receive_nb_bytes(ES_A,O,1,L,Prod_id) ES_A is the emulated shared variable given as entity ent. Prod_id is the Processeur id. given as a Pvecteur in var_id. O and L are the local indices for the bank passed like Pbase in local_indices.
In the case of engine code generation the loop body must be :
BANK_/WP65_send/receive_nb_bytes(L_A,LI,1,LJ,Bank_id)
L_A is the local variable given as entity in ent. Bank_id is the bank id, given as Pvecteur in var_id. LJ, and LI are the local indices passed like Pbase in local_indices corresponds to the shared entiy if bank_code and to the local entity otherwise
var_id | This function generates the loop body of the movement code. In the case of bank code generation the loop body must be : |
BANK_/WP65_ send/receive_nb_bytes(ES_A,O,1,L,Prod_id) ES_A is the emulated shared variable given as entity ent. Prod_id is the Processeur id. given as a Pvecteur in var_id. O and L are the local indices for the bank passed like Pbase in local_indices.
In the case of engine code generation the loop body must be :
BANK_/WP65_send/receive_nb_bytes(L_A,LI,1,LJ,Bank_id)
L_A is the local variable given as entity in ent. Bank_id is the bank id, given as Pvecteur in var_id. LJ, and LI are the local indices passed like Pbase in local_indices correspond to O,L if bank_code and to LJ,LI otherwise
Definition at line 401 of file make_loop_body.c.
References CONS, debug(), debug_off, debug_on, entity_type, EXPRESSION, find_operator(), free(), int2a(), int_to_expression(), is_syntax_reference, make_expression(), make_reference(), make_statement_operator(), make_syntax(), make_vecteur_expression(), module, NIL, normalized_undefined, offset_dim1, offset_dim2, SizeOfElements(), Svecteur::succ, TCST, type_variable, type_variable_p, VALUE_ONE, variable_basic, vect_add(), vect_add_elem(), vect_dup(), vect_new(), VECTEUR_NUL, VECTEUR_NUL_P, and vecteur_var.
Referenced by bound_generation().
expression make_div_expression | ( | expression | ex1, |
cons * | ex2 | ||
) |
ex1 | x1 |
ex2 | x2 |
Definition at line 42 of file operation.c.
References CONS, EXPRESSION, is_syntax_call, local_name_to_top_level_entity(), make_call(), make_expression(), make_syntax(), and normalized_undefined.
Referenced by array_indices_communication(), complex_bound_generation(), lower_bound_generation(), test_bound_generation(), and upper_bound_generation().
Pvecteur make_loop_indice_equation | ( | Pbase | loop_indices, |
tiling | tile, | ||
Pvecteur | tile_delay, | ||
Pvecteur | tile_indices, | ||
Pvecteur | tile_local_indices, | ||
int | rank | ||
) |
Corinne Ancourt - septembre 1991
loop_indices | oop_indices |
tile | ile |
tile_delay | ile_delay |
tile_indices | ile_indices |
tile_local_indices | ile_local_indices |
rank | ank |
Definition at line 51 of file build_sc_tile.c.
References ACCESS, fprintf(), ifdebug, rank, Svecteur::succ, TCST, tiling_origin, tiling_tile, VALUE_CONST, value_mult, value_ne, value_notzero_p, VALUE_ONE, value_uminus, VALUE_ZERO, Svecteur::var, vect_add_elem(), vect_coeff(), vect_dump(), vect_make(), vect_size(), and vecteur_var.
Referenced by array_indices_communication(), and reference_conversion_computation().
statement make_movement_scalar_wp65 | ( | entity | module, |
bool | receive_code, | ||
reference | r, | ||
entity | var_id | ||
) |
statement make_movement_scalar_wp65(receive_code,r)
This function generates the loop body of the movement code. In the case of bank code generation the loop body must be :
call BANK_/WP65_send/receive_nb_bytes(S)
In the case of engine code generation the loop body must be :
call BANK_/WP65_send/receive_nb_bytes(S)
where nb_bytes is the number of bytes needed for the variable location
nb_bytes is the number of bytes needed for the variable location
build the expression : S
args = CONS(EXPRESSION,int_expr(nb_bytes),NIL);
generate the send or the receive call
module | odule |
receive_code | eceive_code |
r | This function generates the loop body of the movement code. In the case of bank code generation the loop body must be : call BANK_/WP65_send/receive_nb_bytes(S)In the case of engine code generation the loop body must be : call BANK_/WP65_send/receive_nb_bytes(S)where nb_bytes is the number of bytes needed for the variable location is true if the code is generated for receive |
var_id | This function generates the loop body of the movement code. In the case of bank code generation the loop body must be : call BANK_/WP65_send/receive_nb_bytes(S)In the case of engine code generation the loop body must be : call BANK_/WP65_send/receive_nb_bytes(S)where nb_bytes is the number of bytes needed for the variable location corresponds to scalaire entity |
Definition at line 485 of file make_loop_body.c.
References CONS, debug_off, debug_on, entity_local_name(), entity_type, entity_undefined, EXPRESSION, find_operator(), free(), ifdebug, int2a(), int_to_expression(), is_syntax_reference, make_expression(), make_statement_operator(), make_syntax(), make_vecteur_expression(), module, NIL, normalized_undefined, pips_debug, reference_variable, SizeOfElements(), type_variable, type_variable_p, VALUE_ONE, variable_basic, vect_new(), and wp65_debug_print_text().
Referenced by constant_symbolic_communication(), make_load_blocks(), and make_store_blocks().
statement make_movements_loop_body_wp65 | ( | entity | module, |
bool | receive_code, | ||
entity | ent, | ||
Pbase | local_indices, | ||
Pbase | var_id, | ||
Psysteme | sc_neg, | ||
Psysteme | sc_pos, | ||
Pbase | index_base, | ||
int | rank, | ||
int | number_of_lower_bounds, | ||
int | number_of_upper_bounds | ||
) |
statement make_movements_loop_body_wp65(module,receive_code, ent,local_indices,var_id, sc_neg,sc_pos,index_base,rank, number_of_lower_bounds, number_of_upper_bounds)
This function generates the loop body of the movement code. In the case of bank code generation the loop body must be :
O1 = ..... O2 = ..... IF (O1.LE.O2) THEN BANK_/WP65_send/receive_nb_bytes(Prod_id,ES_A(L,O1),O2-O1+1)
ES_A is the emulated shared variable given as entity ent. Prod_id is the Processeur id. given as a Pvecteur in var_id. O and L are the local indices for the bank passed like Pbase in local_indices.
In the case of engine code generation the loop body must be :
LI1 = .... LI2 = .... IF (LI1.LE.LI2) THEN BANK_/WP65_send/receive_nb_bytes(Bank_id,L_A(LJ,LI1),LI2-LI1+1) L_A is the local variable given as entity in ent. Bank_id is the bank id, given as Pvecteur in var_id. LJ, and LI are the local indices passed like Pbase in local_indices
create the new indices new_ind1 et new_ind2 corresponding to LI1 et LI2 when the code is generated for engines and O1 et O2 when code is generated for banks vecteur_var(ofs) is respectivly LI or O
build the expression new_ind2 - new_ind1+1
build the list of expressions : Prod_id,ES_A(L,O1),O2-O1+1 for bank case and Bank_id,L_A(LJ,LI1),LI2-LI1+1 for engine case
generate the send or the receive call
build the test around stat
if (pmin == INT_MIN || pmax == INT_MAX || pmax > pmin) {
}
build the whole code:
O1 = ..... O2 = ..... IF (O1.LE.O2) THEN BANK_/WP65_send/receive(Prod_id,ES_A(L,O1),O2-O1+1) for bank case or: LI1 = .... LI2 = .... IF (LI1.LE.LI2) THEN BANK_/WP65_send/receive(Bank_id,L_A(LJ,LI1),LI2-LI1+1) for engine case
module | odule |
receive_code | eceive_code |
ent | This function generates the loop body of the movement code. In the case of bank code generation the loop body must be : O1 = ..... O2 = ..... IF (O1.LE.O2) THEN BANK_/WP65_send/receive_nb_bytes(Prod_id,ES_A(L,O1),O2-O1+1)ES_A is the emulated shared variable given as entity ent. Prod_id is the Processeur id. given as a Pvecteur in var_id. O and L are the local indices for the bank passed like Pbase in local_indices. |
In the case of engine code generation the loop body must be :
LI1 = .... LI2 = .... IF (LI1.LE.LI2) THEN BANK_/WP65_send/receive_nb_bytes(Bank_id,L_A(LJ,LI1),LI2-LI1+1) L_A is the local variable given as entity in ent. Bank_id is the bank id, given as Pvecteur in var_id. LJ, and LI are the local indices passed like Pbase in local_indices is true if the code is generated for receive
local_indices | This function generates the loop body of the movement code. In the case of bank code generation the loop body must be : O1 = ..... O2 = ..... IF (O1.LE.O2) THEN BANK_/WP65_send/receive_nb_bytes(Prod_id,ES_A(L,O1),O2-O1+1)ES_A is the emulated shared variable given as entity ent. Prod_id is the Processeur id. given as a Pvecteur in var_id. O and L are the local indices for the bank passed like Pbase in local_indices. |
In the case of engine code generation the loop body must be :
LI1 = .... LI2 = .... IF (LI1.LE.LI2) THEN BANK_/WP65_send/receive_nb_bytes(Bank_id,L_A(LJ,LI1),LI2-LI1+1) L_A is the local variable given as entity in ent. Bank_id is the bank id, given as Pvecteur in var_id. LJ, and LI are the local indices passed like Pbase in local_indices corresponds to the shared entiy if bank_code and to the local entity otherwise
var_id | This function generates the loop body of the movement code. In the case of bank code generation the loop body must be : O1 = ..... O2 = ..... IF (O1.LE.O2) THEN BANK_/WP65_send/receive_nb_bytes(Prod_id,ES_A(L,O1),O2-O1+1)ES_A is the emulated shared variable given as entity ent. Prod_id is the Processeur id. given as a Pvecteur in var_id. O and L are the local indices for the bank passed like Pbase in local_indices. |
In the case of engine code generation the loop body must be :
LI1 = .... LI2 = .... IF (LI1.LE.LI2) THEN BANK_/WP65_send/receive_nb_bytes(Bank_id,L_A(LJ,LI1),LI2-LI1+1) L_A is the local variable given as entity in ent. Bank_id is the bank id, given as Pvecteur in var_id. LJ, and LI are the local indices passed like Pbase in local_indices correspond to O,L if bank_code and to LI,LJ otherwise
sc_neg | This function generates the loop body of the movement code. In the case of bank code generation the loop body must be : O1 = ..... O2 = ..... IF (O1.LE.O2) THEN BANK_/WP65_send/receive_nb_bytes(Prod_id,ES_A(L,O1),O2-O1+1)ES_A is the emulated shared variable given as entity ent. Prod_id is the Processeur id. given as a Pvecteur in var_id. O and L are the local indices for the bank passed like Pbase in local_indices. |
In the case of engine code generation the loop body must be :
LI1 = .... LI2 = .... IF (LI1.LE.LI2) THEN BANK_/WP65_send/receive_nb_bytes(Bank_id,L_A(LJ,LI1),LI2-LI1+1) L_A is the local variable given as entity in ent. Bank_id is the bank id, given as Pvecteur in var_id. LJ, and LI are the local indices passed like Pbase in local_indices corresponds to the Pvecteur belonging Prod_id if bank_code and Bank_id otherwise
sc_pos | c_pos |
index_base | ndex_base |
rank | ank |
number_of_lower_bounds | umber_of_lower_bounds |
number_of_upper_bounds | umber_of_upper_bounds |
Definition at line 182 of file make_loop_body.c.
References ASSIGN_OPERATOR_NAME, concatenate(), CONS, debug(), debug_off, debug_on, entity_domain, entity_empty_label(), entity_local_name(), entity_type, entity_undefined, EXPRESSION, find_entity(), find_operator(), FindOrCreateEntity(), fprint_string_Value(), fprintf(), free(), gen_find_tabulated(), ifdebug, int2a(), int_to_expression(), is_syntax_reference, local_name_to_top_level_entity(), lower_bound_generation(), make_block_statement(), make_continue_statement(), make_entity_fullname(), make_expression(), make_op_expression(), make_reference(), make_statement_operator(), make_syntax(), make_test(), make_vecteur_expression(), MakeBinaryCall(), MINUS_OPERATOR_NAME, module, MODULE_SEP_STRING, NIL, normalized_undefined, offset_dim1, offset_dim2, PLUS_OPERATOR_NAME, print_text(), rank, sc_append(), sc_dup(), sc_minmax_of_variable(), SizeOfElements(), STATEMENT, Svecteur::succ, SUFFIX_FOR_TEMP_VAR1_IN_INNER_LOOP, SUFFIX_FOR_TEMP_VAR2_IN_INNER_LOOP, TCST, test_to_statement, Text_Statement(), TOP_LEVEL_MODULE_NAME, type_variable, type_variable_p, upper_bound_generation(), VALUE_ONE, variable_basic, vect_add(), vect_add_elem(), vect_dup(), vect_new(), VECTEUR_NUL_P, vecteur_val, and vecteur_var.
Referenced by bound_generation().
expression make_op_expression | ( | entity | op, |
cons * | ex2 | ||
) |
op | p |
ex2 | x2 |
Definition at line 55 of file operation.c.
References is_syntax_call, make_call(), make_expression(), make_syntax(), and normalized_undefined.
Referenced by complex_bound_generation(), lower_bound_generation(), make_movements_loop_body_wp65(), test_bound_generation(), and upper_bound_generation().
oper | per |
args | rgs |
Definition at line 138 of file make_loop_body.c.
References empty_extensions(), entity_empty_label(), is_instruction_call, make_call(), make_instruction(), make_statement(), make_synchronization_none(), NIL, STATEMENT_NUMBER_UNDEFINED, STATEMENT_ORDERING_UNDEFINED, and string_undefined.
Referenced by make_datum_movement(), make_movement_scalar_wp65(), and make_movements_loop_body_wp65().
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().
Corinne Ancourt - juin 1990 This function adds a new variable to the system of constraints ps.
module | odule |
ps | s |
Definition at line 48 of file sc_add_variable.c.
References Ssysteme::base, concatenate(), Ssysteme::dimension, entity_domain, entity_undefined, free(), full_name, gen_find_tabulated(), make_scalar_integer_entity(), module, module_local_name(), MODULE_SEP_STRING, strdup(), and vect_add_variable().
Referenced by build_sc_with_several_uniform_ref(), and 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);
module | odule |
entity_var | ntity_var |
sc_domain | c_domain |
sc_array_function | c_array_function |
index_base | ndex_base |
const_base | onst_base |
proc_id | roc_id |
bank_indices | ank_indices |
tile_indices | ile_indices |
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().
expression test_bound_generation | ( | Psysteme | sc_test, |
Pbase | index_base | ||
) |
This function generates the expressions of the guard if it exists.
All the expressions of the guards are computed from the combination of two constraints where the variable of higher_rank is eliminated.
generation of the left hand side of the guard
generation of the right hand side of the guard
generation of the inequality
sc_test | c_test |
index_base | ndex_base |
Definition at line 234 of file bound_generation.c.
References AND_OPERATOR_NAME, CONS, contrainte_dup(), CONTRAINTE_UNDEFINED_P, debug(), debug_off, debug_on, EXPRESSION, expression_undefined, Ssysteme::inegalites, int_to_expression(), LESS_OR_EQUAL_OPERATOR_NAME, local_name_to_top_level_entity(), make_div_expression(), make_op_expression(), make_vecteur_expression(), NIL, rank, search_higher_rank(), Scontrainte::succ, TCST, value_abs, value_notmone_p, value_notone_p, VALUE_ONE, value_plus, value_pos_p, VALUE_TO_INT, value_uminus, VALUE_ZERO, variable_of_rank(), vect_add_elem(), vect_chg_coeff(), vect_chg_sgn(), vect_coeff(), and Scontrainte::vecteur.
Referenced by bound_generation().
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().
expression upper_bound_generation | ( | Psysteme | sc_pos, |
Pbase | index_base, | ||
int | number_of_upper_bounds, | ||
int | loop_rank | ||
) |
This fonction generates the upper bounds of the "loop_rank"-th loop.
this condition is true if the constraint constrains directly the variable
In that case the bound expression results from the combination of two constraints. The variable of rank "higher_rank" will be eliminated from these two constraints in order to give only one bound for the "loop_rank" index.
sc_pos | c_pos |
index_base | ndex_base |
number_of_upper_bounds | umber_of_upper_bounds |
loop_rank | oop_rank |
Definition at line 145 of file bound_generation.c.
References CAR, complex_bound_computation(), CONS, CONTRAINTE_UNDEFINED_P, debug(), debug_off, debug_on, EXPRESSION, expression_undefined, Ssysteme::inegalites, int_to_expression(), local_name_to_top_level_entity(), make_div_expression(), make_op_expression(), make_vecteur_expression(), min, NIL, search_higher_rank(), Scontrainte::succ, value_abs, value_notone_p, value_one_p, VALUE_TO_INT, VALUE_ZERO, variable_of_rank(), vect_chg_coeff(), vect_chg_sgn(), vect_cl2(), vect_coeff(), vect_dup(), Scontrainte::vecteur, and VECTEUR_NUL.
Referenced by bound_generation(), and make_movements_loop_body_wp65().
Definition at line 74 of file make_loop_body.c.
References CAR, CDR, code_declarations, ENDP, ENTITY, entity_initial, entity_local_name(), NIL, and value_code.
Definition at line 61 of file make_loop_body.c.
References debug_off, debug_on, free_text(), print_text(), and text_module().
Referenced by module_to_wp65_modules().
Definition at line 53 of file make_loop_body.c.
References debug(), debug_off, debug_on, entity_name, and print_statement().
Referenced by bound_generation(), eval_variable_in_statement(), loop_nest_to_wp65_code(), make_all_movement_blocks(), make_movement_scalar_wp65(), make_scanning_over_one_tile(), make_scanning_over_tiles(), movement_computation(), reference_conversion_statement(), and translate_unary_into_binary_ref().