PIPS
|
#include "defines-local.h"
#include "prettyprint.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "effects-convex.h"
Go to the source code of this file.
Macros | |
#define | ALPHA_PREFIX "ALPHA" |
#define | LALPHA_PREFIX "LALPHA" |
#define | THETA_PREFIX "THETA" |
#define | PSI_PREFIX "PSI" |
#define | GAMMA_PREFIX "GAMMA" |
#define | DELTA_PREFIX "DELTA" |
#define | IOTA_PREFIX "IOTA" |
#define | SIGMA_PREFIX "SIGMA" |
#define | TMP_PREFIX "TMP" |
#define | is_entity_array 0 |
tags with a newgen look and feel More... | |
#define | is_entity_template 1 |
#define | is_entity_processors 2 |
#define | PRIME_LETTER_FOR_VARIABLES "p" |
#define | GET_DUMMY_VARIABLE_ENTITY(MODULE, NAME, lname) |
define to build the _dummy and _prime of a variable. More... | |
#define | STORE(name) put_dummy_and_prime(get_ith_##name##_dummy, get_ith_##name##_prime) |
#define | Psysteme_undefined SC_UNDEFINED |
already computed constraints More... | |
#define | Psysteme_undefined_p(sc) SC_UNDEFINED_P(sc) |
Functions | |
bool | entity_hpfc_dummy_p (entity e) |
Variables. More... | |
static void | put_dummy_and_prime (entity(*gen1)(), gen2) |
shift dummy variables to prime variables. More... | |
void | hpfc_init_dummy_to_prime () |
void | hpfc_close_dummy_to_prime () |
Psysteme | shift_system_to_prime_variables (Psysteme s) |
void | make_hpfc_current_mappings () |
??? used with a temporary hack to differentiate array and templates More... | |
void | free_hpfc_current_mappings () |
Psysteme | compute_entity_to_declaration_constraints (entity ent, string suffix, string prefix) |
Psysteme compute_entity_to_constraints(ent, suffix, prefix) entity ent: variable the constraints of which are computed strings suffix and prefix: to be used in the dummy variables created. More... | |
static Psysteme | hpfc_compute_entity_to_declaration_constraints (entity e, tag what) |
Psysteme | entity_to_declaration_constraints (entity e, tag what) |
gives back the constraints due to the declarations. More... | |
static Psysteme | hpfc_compute_align_constraints (entity e) |
Psysteme hpfc_compute_align_constraints(e) entity e is an array. More... | |
Psysteme | hpfc_compute_unicity_constraints (entity e) |
Psysteme hpfc_compute_unicity_constraints(e) entity e should be an array;. More... | |
static Psysteme | hpfc_compute_distribute_constraints (entity e) |
Psysteme hpfc_compute_distribute_constraints(e) entity e should be a template;. More... | |
Psysteme | entity_to_hpf_align_constraints (entity e) |
Psysteme | entity_to_hpf_distribute_constraints (entity e) |
effect | entity_to_region (statement stat, entity ent, tag act) |
effect entity_to_region(stat, ent, act) statement stat; entity ent; tag act; More... | |
Psysteme | hpfc_compute_entity_to_new_declaration (entity array) |
Psysteme | entity_to_new_declaration (entity array) |
Psysteme | generate_system_for_equal_variables (int n, entity(*gen1)(int), entity(*gen2)(int)) |
Psysteme | hpfc_unstutter_dummies (entity array) |
Psysteme | generate_system_for_distributed_variable (entity v) |
Psysteme generate_system_for_variable(v) entity v;. More... | |
#define ALPHA_PREFIX "ALPHA" |
Definition at line 42 of file build-system.c.
#define DELTA_PREFIX "DELTA" |
Definition at line 47 of file build-system.c.
#define GAMMA_PREFIX "GAMMA" |
Definition at line 46 of file build-system.c.
define to build the _dummy and _prime of a variable.
Definition at line 118 of file build-system.c.
#define IOTA_PREFIX "IOTA" |
Definition at line 48 of file build-system.c.
#define is_entity_array 0 |
tags with a newgen look and feel
Definition at line 53 of file build-system.c.
#define is_entity_processors 2 |
Definition at line 55 of file build-system.c.
#define is_entity_template 1 |
Definition at line 54 of file build-system.c.
#define LALPHA_PREFIX "LALPHA" |
Definition at line 43 of file build-system.c.
#define PRIME_LETTER_FOR_VARIABLES "p" |
Definition at line 114 of file build-system.c.
#define PSI_PREFIX "PSI" |
Definition at line 45 of file build-system.c.
#define Psysteme_undefined SC_UNDEFINED |
already computed constraints
Definition at line 183 of file build-system.c.
#define Psysteme_undefined_p | ( | sc | ) | SC_UNDEFINED_P(sc) |
Definition at line 184 of file build-system.c.
#define SIGMA_PREFIX "SIGMA" |
Definition at line 49 of file build-system.c.
#define STORE | ( | name | ) | put_dummy_and_prime(get_ith_##name##_dummy, get_ith_##name##_prime) |
Definition at line 152 of file build-system.c.
#define THETA_PREFIX "THETA" |
Definition at line 44 of file build-system.c.
#define TMP_PREFIX "TMP" |
Definition at line 50 of file build-system.c.
Psysteme compute_entity_to_constraints(ent, suffix, prefix) entity ent: variable the constraints of which are computed strings suffix and prefix: to be used in the dummy variables created.
DECLARATION CONSTRAINTS GENERATION
computes the constraints due to the declarations. ! usefull
system may be empty for scalars ???
now the dummy is to be used to generate two inequalities: -dummy + lower <= 0 and dummy - upper <= 0
ent | nt |
suffix | uffix |
prefix | refix |
Definition at line 220 of file build-system.c.
References contrainte_make(), DIMENSION, dimension_lower, dimension_upper, entity_name, entity_type, entity_variable_p, get_ith_dummy(), hpfc_integer_constant_expression_p(), int_to_value, MAP, pips_assert, pips_debug, prefix, sc_add_inegalite(), sc_creer_base(), sc_new(), TCST, type_variable, VALUE_MONE, VALUE_ONE, variable_dimensions, vect_make(), and VECTEUR_NUL.
Referenced by hpfc_compute_entity_to_declaration_constraints().
Variables.
Inequations to be defined
Equations to be defined
Remarks
ALPHA{1-7}: array dimensions, THETA{1-7}: template dimensions, PSI{1-7}: processor dimensions, SIGMA{1-7}: auxiliary variable, GAMMA{1-7}: cycles, DELTA{1-7}: local offsets, LALPHA{1-7}: local array dimensions, if specified...
plus "PRIME" versions
HPF CONSTRAINTS GENERATION
Definition at line 106 of file build-system.c.
References entity_module_name(), HPFC_PACKAGE, and same_string_p.
Referenced by put_variables_in_ordered_lists().
gives back the constraints due to the declarations.
Uses a demand driven approach: computed systems are stored in the declaration_constraints mapping for later search.
what | hat |
Definition at line 285 of file build-system.c.
References concatenate(), DEBUG_SYST, entity_name, entity_variable_p, hpfc_compute_entity_to_declaration_constraints(), pips_assert, and Psysteme_undefined_p.
Referenced by generate_shared_io_system(), generate_system_for_distributed_variable(), GENERATION(), and processor_loop().
Definition at line 480 of file build-system.c.
References array_distributed_p(), hpfc_compute_align_constraints(), pips_assert, and Psysteme_undefined_p.
Referenced by generate_system_for_distributed_variable().
Definition at line 495 of file build-system.c.
References entity_template_p(), hpfc_compute_distribute_constraints(), pips_assert, and Psysteme_undefined_p.
Referenced by generate_system_for_distributed_variable().
array | rray |
Definition at line 732 of file build-system.c.
References array, array_distributed_p(), hpfc_compute_entity_to_new_declaration(), pips_assert, and Psysteme_undefined_p.
Referenced by generate_system_for_distributed_variable().
effect entity_to_region(stat, ent, act) statement stat; entity ent; tag act;
gives the region of ent with action act in statement stat.
stat | tat |
ent | nt |
act | ct |
Definition at line 515 of file build-system.c.
References action_tag, EFFECT, effect_action, effect_any_reference, effect_undefined, load_statement_local_regions(), MAP, and reference_variable.
Referenced by generate_distributed_io_system(), and generate_shared_io_system().
void free_hpfc_current_mappings | ( | void | ) |
Definition at line 200 of file build-system.c.
Referenced by reset_resources_for_module().
Psysteme generate_system_for_variable(v) entity v;.
what: generates a system for DISTRIBUTED variable v. how: uses the declarations of v, t, p and align and distribute, and new declarations. input: entity (variable) v output: the built system, which is a new allocated system. side effects:
Definition at line 789 of file build-system.c.
References align_template, array_distributed_p(), base_rm, distribute_processors, entity_to_declaration_constraints(), entity_to_hpf_align_constraints(), entity_to_hpf_distribute_constraints(), entity_to_new_declaration(), load_hpf_alignment(), load_hpf_distribution(), pips_assert, sc_append(), sc_creer_base(), and sc_rn().
Referenced by generate_distributed_io_system(), and generate_remapping_system().
Definition at line 751 of file build-system.c.
References contrainte_make(), sc_add_egalite(), sc_creer_base(), sc_rn(), TCST, VALUE_MONE, VALUE_ONE, VALUE_ZERO, vect_make(), and VECTEUR_NUL.
Referenced by generate_remapping_system(), and hpfc_unstutter_dummies().
void hpfc_close_dummy_to_prime | ( | void | ) |
Definition at line 168 of file build-system.c.
Referenced by compile_module().
Psysteme hpfc_compute_align_constraints(e) entity e is an array.
compute the align equations:
theta_i - a phi_j - b == 0
Definition at line 310 of file build-system.c.
References align_alignment, align_template, alignment_arraydim, alignment_constant, alignment_rate, alignment_undefined, array_distributed_p(), contrainte_make(), FindAlignmentOfTemplateDim(), get_ith_array_dummy(), get_ith_template_dummy(), HpfcExpressionToInt(), int_to_value, load_hpf_alignment(), NumberOfDimension(), pips_assert, sc_add_egalite(), sc_creer_base(), sc_new(), TCST, VALUE_ONE, VALUE_ZERO, vect_make(), and VECTEUR_NUL.
Referenced by entity_to_hpf_align_constraints().
Psysteme hpfc_compute_distribute_constraints(e) entity e should be a template;.
the constraints due to the distribution are defined:
theta_i - theta_i0 == Nj Pj gamma_j + Nj (psi_j - psi_j0) + delta_j delta_j >= 0 delta_j < Nj ??? if block distribution: gamma_j == 0 ??? not distributed template dimensions are skipped... ??? if cyclic(1) distribution: delta_j == 0
-delta_j <= 0
delta_j - (N_j - 1) <= 0
theta_i - Nj psi_j - Nj Pj gamma_j - delta_j + Nj psi_j0 - theta_i0 == 0
if block distributed gamma_j == 0
if cyclic(1) distributed delta_j == 0
Definition at line 407 of file build-system.c.
References contrainte_make(), dimension_lower, distribute_distribution, distribute_processors, distribution_parameter, distribution_style, entity_ith_dimension(), entity_template_p(), FindDistributionOfProcessorDim(), get_ith_block_dummy(), get_ith_cycle_dummy(), get_ith_processor_dummy(), get_ith_template_dummy(), HpfcExpressionToInt(), int_to_value, load_hpf_distribution(), NumberOfDimension(), pips_assert, sc_add_egalite(), sc_add_inegalite(), sc_creer_base(), sc_new(), SizeOfIthDimension(), style_block_p, style_cyclic_p, TCST, VALUE_MONE, VALUE_ONE, vect_make(), vect_new(), VECTEUR_NUL, and VECTEUR_UNDEFINED.
Referenced by entity_to_hpf_distribute_constraints().
Definition at line 268 of file build-system.c.
References ALPHA_PREFIX, compute_entity_to_declaration_constraints(), HPFC_PACKAGE, is_entity_array, is_entity_processors, is_entity_template, PSI_PREFIX, and THETA_PREFIX.
Referenced by entity_to_declaration_constraints().
LALPHAi == ALPHAi
LALPHAi = ALPHAi - ALPHAi_min + 1
(|a|==1) LALPHA_i == DELTA_j + 1 generalized to: (|a|!=1) |a| * (LALPHA_i - 1) + IOTA_j == DELTA_j 0 <= IOTA_j < |a|
IOTA is not needed
LALPHA_i == N* (GAMMA_j - GAMMA_0) + DELTA_j + 1
LALPHA_i = iceil(N,|a|) * (GAMMA_j - GAMMA_0) + SIGMA_j +1 DELTA_j = |a|*SIGMA_j + IOTA_j 0 <= IOTA_j < |a|
array | rray |
Definition at line 533 of file build-system.c.
References abs, array, array_distributed_p(), array_to_template, contrainte_make(), entity_undefined, get_alignment(), get_distribution(), get_entity_dimensions(), get_ith_array_dummy(), get_ith_auxiliary_dummy(), get_ith_block_dummy(), get_ith_cycle_dummy(), get_ith_dim_new_declaration(), get_ith_local_dummy(), get_ith_shift_dummy(), iceil, int_to_value, is_hpf_newdecl_alpha, is_hpf_newdecl_beta, is_hpf_newdecl_delta, is_hpf_newdecl_gamma, is_hpf_newdecl_none, max, min, new_declaration_tag(), NumberOfDimension(), pips_assert, pips_internal_error, sc_add_egalite(), sc_add_inegalite(), sc_creer_base(), sc_rn(), TCST, template_to_processors, VALUE_MONE, VALUE_ONE, VALUE_ZERO, vect_make(), vect_new(), and VECTEUR_NUL.
Referenced by entity_to_new_declaration().
Psysteme hpfc_compute_unicity_constraints(e) entity e should be an array;.
equations for non aligned template dimensions are computed: ???
theta_i - lower_template_i == 0
Definition at line 360 of file build-system.c.
References align_alignment, align_template, alignment_undefined, array_distributed_p(), contrainte_make(), dimension_lower, entity_ith_dimension(), FindAlignmentOfTemplateDim(), get_ith_template_dummy(), HpfcExpressionToInt(), int_to_value, load_hpf_alignment(), NumberOfDimension(), pips_assert, sc_add_egalite(), sc_creer_base(), sc_new(), TCST, VALUE_ONE, vect_make(), and VECTEUR_NUL.
Referenced by generate_distributed_io_system().
void hpfc_init_dummy_to_prime | ( | void | ) |
Definition at line 155 of file build-system.c.
Referenced by compile_module().
array | rray |
Definition at line 767 of file build-system.c.
References array, generate_system_for_equal_variables(), get_ith_array_dummy(), get_ith_region_dummy(), and variable_entity_dimension().
Referenced by generate_distributed_io_system(), and generate_shared_io_system().
void make_hpfc_current_mappings | ( | void | ) |
??? used with a temporary hack to differentiate array and templates
Definition at line 192 of file build-system.c.
Referenced by set_resources_for_module().
|
static |
shift dummy variables to prime variables.
systeme s is modified.
Definition at line 144 of file build-system.c.
Definition at line 173 of file build-system.c.
References sc_rename_variables().
Referenced by generate_remapping_system(), and processor_loop().