PIPS
|
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
#include "boolean.h"
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
#include "sommet.h"
#include "ray_dte.h"
#include "sg.h"
#include "polyedre.h"
#include "union.h"
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "database.h"
#include "constants.h"
#include "ri-util.h"
#include "effects-util.h"
#include "pipsdbm.h"
#include "workspace-util.h"
#include "resources.h"
#include "misc.h"
#include "text.h"
#include "text-util.h"
#include "transformer.h"
#include "preprocessor.h"
#include "properties.h"
#include "prettyprint.h"
#include "effects-generic.h"
#include "effects-convex.h"
Go to the source code of this file.
Data Structures | |
struct | Common_Dimension_Stat |
translation More... | |
struct | Linearization_Stat |
struct | Remaining_Dimension_Stat |
struct | Beta_Elimination_Stat |
struct | Phi_Elimination_Stat |
struct | Predicate_Translation |
Macros | |
#define | BACKWARD true |
Package regions : Be'atrice Creusillet 11/95. More... | |
#define | FORWARD false |
#define | min(a, b) (((a)<(b))?(a):(b)) |
#define | max(a, b) (((a)>(b))?(a):(b)) |
#define | IS_EG true |
#define | NOT_EG false |
#define | PHI_FIRST true |
#define | NOT_PHI_FIRST false |
Functions | |
static void | reg_v_debug (Pvecteur v) |
static void | reg_sc_debug (Psysteme sc) |
void | region_translation_statistics_init (bool stat_p) |
initialization and closing More... | |
void | region_translation_statistics_close (const char *mod_name, const char *prefix) |
static bool | dims_array_init (entity array, dimension *dims, int dim_array) |
static Psysteme | entity_assumed_declaration_sc (dimension *dims, int ndim) |
void | region_translation_init (entity ent_1, reference rf_1, entity ent_2, reference rf_2, Value offset_1_m_2) |
static void | region_translation_close () |
static bool | some_phi_variable (Pcontrainte c) |
void | append_declaration_sc_if_exact_without_constraints (region r) |
if we have a region like: <A(PHI)-EXACT-{}> it means that all declared elements are touched, although this is implicit. More... | |
static void | region_translation_of_predicate (region reg, entity to_func) |
static Psysteme | array_translation_sc (bool *p_exact_translation_p) |
region | region_translation (region reg_1, entity func_1, reference rf_1, entity ent_2, entity func_2, reference rf_2, Value offset_1_m_2, bool backward_p) |
region region_translation(region reg1, entity mod1, reference ref1, entity ent2, entity mod2, reference ref2, Pvecteur offset_1_m_2, bool offset_undef_p) input : a region reg1, from module mod1; a target entity ent2 in module mod2 (it is possible to have mod1 = mod2 for equivalences); references ref1 and ref2 and offset_1_m_2 are provided to represent the offset between the index of the initial and target entity; if both entities are in a common or are equivalenced, then we can only provide offset_1_m_2; when translating from a formal to a real parameter or from a real to a formal one, we only know the real reference, the other one being undefined. More... | |
#define BACKWARD true |
Package regions : Be'atrice Creusillet 11/95.
This File contains general purpose functions that compute the translation of regions from one array to another (e.g. interprocedural translation).
Definition at line 76 of file translation.c.
#define FORWARD false |
Definition at line 77 of file translation.c.
#define IS_EG true |
Definition at line 339 of file translation.c.
#define max | ( | a, | |
b | |||
) | (((a)>(b))?(a):(b)) |
Definition at line 80 of file translation.c.
#define min | ( | a, | |
b | |||
) | (((a)<(b))?(a):(b)) |
Definition at line 79 of file translation.c.
#define NOT_EG false |
Definition at line 340 of file translation.c.
#define NOT_PHI_FIRST false |
Definition at line 343 of file translation.c.
#define PHI_FIRST true |
Definition at line 342 of file translation.c.
void append_declaration_sc_if_exact_without_constraints | ( | region | r | ) |
if we have a region like: <A(PHI)-EXACT-{}> it means that all declared elements are touched, although this is implicit.
this occurs with io effects of "PRINT *, A". in such a case, the declaration constraints MUST be appended before the translation, otherwise the result might be false.
potential bug : if the declaration system cannot be generated, the region should be turned to MAY for the translation?
we have an exact array region
Definition at line 492 of file translation.c.
References entity_declaration_sc(), entity_name, entity_scalar_p(), pips_debug, reference_variable, region_any_reference, region_entity, region_may_p, region_sc_append(), region_system, and some_phi_variable().
Referenced by region_translation().
FI: special case for the old Fortran habit of using declarations such as D(1) or E(N,1) to declare a pointer to an array of undefined (last) dimension.
Such declarations cannot be used for array bound checking.
The warning message does not seem to fit the test.
Definition at line 289 of file translation.c.
References array, CreateIntrinsic(), DIMENSION, dimension_lower, dimension_upper, entity_name, entity_type, FOREACH, make_dimension(), MakeNullaryCall(), NIL, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, pips_user_warning, type_variable, UNBOUNDED_DIMENSION_NAME, val_of, value_one_p, variable_dimensions, vect_constant_p(), and VECTEUR_NUL_P.
Referenced by region_translation_init().
Definition at line 345 of file translation.c.
References dimension_lower, dimension_upper, NOT_EG, NOT_PHI_FIRST, PHI_FIRST, sc_add_phi_equation(), and sc_new().
Referenced by region_translation().
|
static |
Definition at line 91 of file translation.c.
References pips_region_user_name(), and sc_fprint().
Referenced by region_translation().
|
static |
Definition at line 85 of file translation.c.
References pips_region_user_name(), and vect_fprint().
region region_translation | ( | region | reg_1, |
entity | func_1, | ||
reference | rf_1, | ||
entity | ent_2, | ||
entity | func_2, | ||
reference | rf_2, | ||
Value | offset_1_m_2, | ||
bool | backward_p | ||
) |
region region_translation(region reg1, entity mod1, reference ref1, entity ent2, entity mod2, reference ref2, Pvecteur offset_1_m_2, bool offset_undef_p) input : a region reg1, from module mod1; a target entity ent2 in module mod2 (it is possible to have mod1 = mod2 for equivalences); references ref1 and ref2 and offset_1_m_2 are provided to represent the offset between the index of the initial and target entity; if both entities are in a common or are equivalenced, then we can only provide offset_1_m_2; when translating from a formal to a real parameter or from a real to a formal one, we only know the real reference, the other one being undefined.
output : a list of regions corresponding to the translation of reg1. modifies : nothing, reg1 is duplicated. comment :
NW: before calling "region_translation" do
call "set_interprocedural_translation_context_sc" (see comment for "set_interprocedural_translation_context_sc" for what must be done before that is called)
and "set_backward_arguments_to_eliminate" (for translation formals->reals) or "set_forward_arguments_to_eliminate"
like this:
call call_site; entity callee; list real_args; ... (set up call to "set_interprocedural_translation_context_sc" as indicated in its comments) ... real_args = call_arguments(call_site); set_interprocedural_translation_context_sc(callee, real_args); set_backward_arguments_to_eliminate(callee);
(that's it, but after the call to "region_translation", don't forget to do:)
reset_translation_context_sc(); reset_arguments_to_eliminate(); (resets after call to "set_interprocedural_translation_context_sc" as indicated in its comments)
Definition at line 561 of file translation.c.
References append_declaration_sc_if_exact_without_constraints(), array_1, array_2, array_to_array_stat, array_translation_sc(), BACKWARD, Ssysteme::base, BASE_NULLE, beta_elimination_stat, cell_preference, cell_preference_p, cell_reference, copy_action(), debug_off, debug_on, debug_region_consistency, dim_2, dims_2, entity_assumed_declaration_sc(), entity_declaration_sc(), entity_minimal_name(), entity_name, entity_scalar_p(), entity_storage, entity_undefined, entity_whole_region(), Beta_Elimination_Stat::exact, Phi_Elimination_Stat::exact, Predicate_Translation::exact, Beta_Elimination_Stat::exact_input, Phi_Elimination_Stat::exact_input, Predicate_Translation::exact_input, free_reference(), get_bool_property(), get_translation_context_sc(), ifdebug, is_approximation_may, make_reference(), make_reference_region(), make_regions_psi_reference(), Beta_Elimination_Stat::nb_calls, Phi_Elimination_Stat::nb_calls, Predicate_Translation::nb_calls, newgen_Psysteme, NIL, phi_elimination_stat, pips_assert, pips_debug, pips_user_warning, predicate_translation_stat, preference_reference, print_region, psi_to_phi_region(), reference_p, reference_undefined_p, reg_sc_debug(), region, region_action, region_any_reference, region_approximation_tag, region_cell, region_dup(), region_entity, region_exact_p, region_remove_beta_variables(), region_remove_phi_variables(), region_sc_append(), region_sc_append_and_normalize(), region_system, region_system_, region_translation_close(), region_translation_init(), region_translation_of_predicate(), region_undefined, sc_creer_base(), sc_safe_append(), scalar_to_array_stat, scalar_to_scalar_stat, size_elt_1, size_elt_2, statistics_p, storage_formal_p, value_ne, and value_zero_p.
|
static |
do not free the real declaration
do not free the real declaration
Definition at line 457 of file translation.c.
References dim_1, dim_1_assumed, dim_2, dim_2_assumed, dimension_lower, dims_1, dims_2, expression_undefined, and free_dimension().
Referenced by region_translation().
void region_translation_init | ( | entity | ent_1, |
reference | rf_1, | ||
entity | ent_2, | ||
reference | rf_2, | ||
Value | offset_1_m_2 | ||
) |
relative sizes of elements
ent_1 | nt_1 |
rf_1 | f_1 |
ent_2 | nt_2 |
rf_2 | f_2 |
offset_1_m_2 | ffset_1_m_2 |
Definition at line 362 of file translation.c.
References array_1, array_2, dim_1, dim_1_assumed, dim_2, dim_2_assumed, dims_1, dims_2, dims_array_init(), entity_type, fprint_string_Value(), fprintf(), ifdebug, int_to_value, mat_dim_stat, NumberOfDimension(), offset, pips_debug, ref_1, ref_2, reference_p, reference_undefined_p, size_elt_1, size_elt_2, SizeOfElements(), statistics_p, type_variable, VALUE_CONST, value_division, value_eq, value_mod, VALUE_ONE, value_zero_p, variable_basic, vect_size_ratio_stat, and zero_offset_stat.
Referenced by region_translation().
void region_translation_statistics_close | ( | const char * | mod_name, |
const char * | prefix | ||
) |
inputs
other ratios
translation
mod_name | od_name |
prefix | refix |
Definition at line 212 of file translation.c.
References Common_Dimension_Stat::all_similar, array_to_array_stat, beta_elimination_stat, common_dimension_stat, concatenate(), db_get_current_workspace_directory(), Linearization_Stat::exact, Remaining_Dimension_Stat::exact, Beta_Elimination_Stat::exact, Phi_Elimination_Stat::exact, Predicate_Translation::exact, Beta_Elimination_Stat::exact_input, Phi_Elimination_Stat::exact_input, Predicate_Translation::exact_input, fprintf(), free(), linearization_stat, mat_dim_stat, Remaining_Dimension_Stat::nb, Common_Dimension_Stat::nb_calls, Linearization_Stat::nb_calls, Beta_Elimination_Stat::nb_calls, Phi_Elimination_Stat::nb_calls, Predicate_Translation::nb_calls, Common_Dimension_Stat::non_linear_decl, Linearization_Stat::non_linear_decl, Remaining_Dimension_Stat::non_linear_decl_or_offset, Linearization_Stat::non_linear_system, Common_Dimension_Stat::not_same_decl, phi_elimination_stat, predicate_translation_stat, prefix, remaining_dimension_stat, safe_fclose(), safe_fopen(), scalar_to_array_stat, scalar_to_scalar_stat, statistics_p, strdup(), vect_size_ratio_stat, and zero_offset_stat.
Referenced by reset_convex_rw_regions().
void region_translation_statistics_init | ( | bool | stat_p | ) |
initialization and closing
translation.c
stat_p | tat_p |
Definition at line 162 of file translation.c.
References Common_Dimension_Stat::all_similar, array_to_array_stat, beta_elimination_stat, common_dimension_stat, Linearization_Stat::exact, Remaining_Dimension_Stat::exact, Beta_Elimination_Stat::exact, Phi_Elimination_Stat::exact, Predicate_Translation::exact, Beta_Elimination_Stat::exact_input, Phi_Elimination_Stat::exact_input, Predicate_Translation::exact_input, linearization_stat, mat_dim_stat, Remaining_Dimension_Stat::nb, Common_Dimension_Stat::nb_calls, Linearization_Stat::nb_calls, Beta_Elimination_Stat::nb_calls, Phi_Elimination_Stat::nb_calls, Predicate_Translation::nb_calls, Common_Dimension_Stat::non_linear_decl, Linearization_Stat::non_linear_decl, Remaining_Dimension_Stat::non_linear_decl_or_offset, Linearization_Stat::non_linear_system, Common_Dimension_Stat::not_same_decl, phi_elimination_stat, predicate_translation_stat, remaining_dimension_stat, scalar_to_array_stat, scalar_to_scalar_stat, statistics_p, vect_size_ratio_stat, and zero_offset_stat.
Referenced by init_convex_rw_regions().
|
static |
Definition at line 475 of file translation.c.
References Scontrainte::succ, vect_contains_phi_p(), and Scontrainte::vecteur.
Referenced by append_declaration_sc_if_exact_without_constraints().
|
static |
Local variables and functions to avoid multiple computations
Definition at line 280 of file translation.c.
Referenced by region_translation(), and region_translation_init().
|
static |
Definition at line 280 of file translation.c.
Referenced by region_translation(), and region_translation_init().
|
static |
Definition at line 111 of file translation.c.
Referenced by region_translation(), region_translation_statistics_close(), and region_translation_statistics_init().
|
static |
|
static |
Referenced by region_translation_statistics_close(), and region_translation_statistics_init().
|
static |
Definition at line 284 of file translation.c.
Referenced by region_translation_close(), and region_translation_init().
|
static |
Definition at line 287 of file translation.c.
Referenced by region_translation_close(), and region_translation_init().
|
static |
Definition at line 284 of file translation.c.
Referenced by region_translation(), region_translation_close(), and region_translation_init().
|
static |
Definition at line 287 of file translation.c.
Referenced by region_translation_close(), and region_translation_init().
|
static |
Definition at line 286 of file translation.c.
Referenced by region_translation_close(), and region_translation_init().
|
static |
Definition at line 286 of file translation.c.
Referenced by region_translation(), region_translation_close(), and region_translation_init().
|
static |
Referenced by region_translation_statistics_close(), and region_translation_statistics_init().
|
static |
inputs
Definition at line 104 of file translation.c.
Referenced by region_translation_init(), region_translation_statistics_close(), and region_translation_statistics_init().
|
static |
Definition at line 283 of file translation.c.
Referenced by common_members_of_module(), common_region_translation(), ComputeAreaOffset(), convert_bound_expression(), declarations_to_dimensions(), declare_common_variables_in_module(), do_array_expansion(), do_grouping_replace_reference_by_expression(), do_terapix_warmup_patching(), FindParameterEntity(), gen_external_member(), gen_member(), gen_or(), generate_load_statement(), generate_mmcd_stat_from_ref(), generate_mmcd_stats_from_ref(), generate_save_statement(), generate_struct_members(), generic_make_entity_copy_with_new_name(), get_final_offset(), gfc2pips_computeAdressesOfArea(), gfc2pips_computeEquiv(), gfc2pips_symbol2data_instruction(), isolate_patch_reference(), make_scalar_entity(), MakeParameterList(), normalize_microcode(), offset_of_struct(), outliner_patch_parameters(), region_to_minimal_dimensions(), region_translation_init(), safe_fseek(), sort_parameters(), supported_ref_p(), test_flt(), test_rwt(), text_equivalence_class(), tile_hyperplane_constraints(), tile_membership_constraints(), UpdateEntity(), valuer(), and verify_formal_and_common_variables().
|
static |
|
static |
|
static |
Definition at line 281 of file translation.c.
Referenced by region_translation_init().
|
static |
Definition at line 281 of file translation.c.
Referenced by region_translation_init().
|
static |
Definition at line 282 of file translation.c.
Referenced by region_translation(), and region_translation_init().
|
static |
Referenced by region_translation_statistics_close(), and region_translation_statistics_init().
|
static |
Definition at line 110 of file translation.c.
Referenced by region_translation(), region_translation_statistics_close(), and region_translation_statistics_init().
|
static |
number cases in which the offset is nul
Definition at line 109 of file translation.c.
Referenced by region_translation(), region_translation_statistics_close(), and region_translation_statistics_init().
|
static |
Definition at line 285 of file translation.c.
Referenced by region_translation(), region_translation_init(), and text_equivalence_class().
|
static |
Definition at line 285 of file translation.c.
Referenced by region_translation(), and region_translation_init().
|
static |
STATISTICS
Definition at line 101 of file translation.c.
Referenced by region_translation(), region_translation_init(), region_translation_statistics_close(), and region_translation_statistics_init().
|
static |
correspondances between source and target array number of dimensions
Definition at line 106 of file translation.c.
Referenced by region_translation_init(), region_translation_statistics_close(), and region_translation_statistics_init().
|
static |
size ratio after normalization
Definition at line 107 of file translation.c.
Referenced by region_translation_init(), region_translation_statistics_close(), and region_translation_statistics_init().