25 #include "pips_config.h"
148 #include "resources.h"
158 #define ALIAS_SECTION "ALIAS_SECTION"
253 pips_debug(4,
"\nThe formal parameter %s is translated to the caller's frame\n",
301 ps = sc_system_projection_along_variables(ps, pv_var);
303 if (ps != SC_UNDEFINED)
307 for (egal = ps->
egalites; egal != NULL; egal = egal1)
326 for (v = newv; (v !=NULL) && (check); v = v->
succ)
335 pips_debug(4,
"\nThe variable %s is translated by using binding information\n",
360 pips_debug(4,
"\nNumerical constant or symbolic value is translated\n");
411 end_off = initial_off;
415 fprintf(stderr,
"\nwith initial ram offset %d and end offset %d",initial_off,end_off);
430 fprintf(stderr,
"\nSubval expression before translation:");
432 fprintf(stderr,
"\nSubval expression after translation:");
529 pips_debug(3,
"\nAliases from an actual argument that is a formal parameter and has same section with other actual argument (the last one can be a common variable or another formal variable).\n");
561 pips_debug(3,
"\nAliases from an actual argument that is a common variable and has same section with other actual argument that is a formal variable.\n");
588 pips_debug(2,
"\nActual argument %s is a formal parameter",
615 fprintf(stderr,
"\nEntry for %s found in the alias_association",
625 fprintf(stderr,
"\nInitial offset expression before translation: \n");
627 fprintf(stderr,
"\nInitial offset expression after translation: \n");
644 fprintf(stderr,
"\n Subval expression before translation: \n");
646 fprintf(stderr,
"\n Subval expression after translation: \n");
720 list l_actual,
bool equiv)
771 fprintf(stderr,
"\nSubval expression before translation: \n");
773 fprintf(stderr,
"\nSubval expression after translation: \n");
808 fprintf(stderr,
"\nCurrent call site:");
840 fprintf(stderr,
"\nList of equivalent arguments: ");
842 fprintf(stderr,
"\nList of same arguments: ");
875 make_current_statement_stack();
880 free_current_statement_stack();
910 debug_on(
"ALIAS_PROPAGATION_DEBUG_LEVEL");
931 if (l_formals !=
NIL)
936 if (l_callers !=
NIL)
940 fprintf(stderr,
"The list of formal parameters:");
942 fprintf(stderr,
"\nThe list of callers: ");
void user_log(const char *format,...)
call_site make_call_site(entity a1, intptr_t a2)
bool call_site_consistent_p(call_site p)
bool alias_association_consistent_p(alias_association p)
alias_association make_alias_association(entity a1, entity a2, expression a3, intptr_t a4, intptr_t a5, list a6)
alias_associations make_alias_associations(list a)
expression copy_expression(expression p)
EXPRESSION.
reference make_reference(entity a1, list a2)
static reference ref
Current stmt (an integer)
bool included_call_chain_p(list l1, list l2)
void print_alias_association(alias_association aa)
#define alias_associations_list(x)
#define CALL_SITE(x)
CALL_SITE.
#define alias_association_section(x)
#define alias_association_variable(x)
#define ALIAS_ASSOCIATION(x)
ALIAS_ASSOCIATION.
#define alias_association_call_chain(x)
#define alias_association_undefined
#define alias_association_offset(x)
static void display_alias_propagation_statistics()
Special alias section counter.
static int number_of_unknown_offsets
static void same_or_equivalence_argument_add_aliases(list l, call c, call_site cs, list l_actual, bool equiv)
Add alias_association for each formal variable whose offset is in the list l.
static bool same_section_formal_variable_in_list_p(entity actual_var, entity sec, list actual_path, list l, list l_aliases)
static bool add_aliases_for_current_call_site(call c)
static void add_aliases_for_current_caller()
static entity current_caller
static bool same_section_common_variable_in_list_p(entity sec, list l)
static bool common_is_visible_p(entity sec, entity mod)
This function tests if a common com (TOP_LEVEL:~FOO) is visible in the module mod or in at least one ...
static int number_of_known_offsets
#define ALIAS_SECTION
Aliasing occurs when two or more variables refer to the same storage location at the same program poi...
static int number_of_processed_modules
static int number_of_alias_associations
static void ram_variable_add_aliases(call c, call_site cs, entity actual_var, entity formal_var, expression subval)
expression translate_to_module_frame(entity mod1, entity mod2, expression e1, call c)
This function translates an expression e1 from the frame of module 1 to the frame of module 2 1....
bool alias_propagation(char *module_name)
static list alias_propagation_callers(list l_callers)
static entity current_mod
Define a static stack and related functions to remember the current statement.
static list l_current_aliases
static const char * caller_name
static list list_of_same_or_equivalence_arguments(entity e, list l)
static void formal_variable_add_aliases(call c, call_site cs, entity actual_var, entity formal_var, expression subval, list l_actuals)
static int unique_section_number
#define value_mone_p(val)
void const char const char const int
bool base_contains_variable_p(Pbase b, Variable v)
bool base_contains_variable_p(Pbase b, Variable v): returns true if variable v is one of b's elements...
transformer transformer_identity()
Allocate an identity transformer.
bool module_is_called_by_main_program_p(entity mod)
struct _newgen_struct_statement_ * statement
Pcontrainte contraintes_free(Pcontrainte pc)
Pcontrainte contraintes_free(Pcontrainte pc): desallocation de toutes les contraintes de la liste pc.
static entity current_callee
const char * module_name(const char *s)
Return the module part of an entity name.
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
bool entities_may_conflict_p(entity e1, entity e2)
Check if two entities may conflict.
void reset_current_module_entity(void)
Reset the current module entity.
entity set_current_module_entity(entity)
static.c
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
#define NIL
The empty list (nil in Lisp)
size_t gen_length(const list l)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#define CAR(pcons)
Get the value of the first element of a list.
void gen_free_list(list l)
free the spine of the list
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define CDR(pcons)
Get the list less its first element.
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
list gen_full_copy_list(list l)
Copy a list structure with element copy.
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_internal_error
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
#define message_assert(msg, ex)
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define DEFINE_LOCAL_STACK(name, type)
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
void print_statement(statement)
Print a statement on stderr.
#define PLUS_OPERATOR_NAME
#define NORMALIZE_EXPRESSION(e)
#define binary_intrinsic_expression(name, e1, e2)
bool entity_special_area_p(entity e)
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...
entity FindOrCreateEntity(const char *package, const char *local_name)
Problem: A functional global entity may be referenced without parenthesis or CALL keyword in a functi...
bool array_entity_p(entity e)
bool same_entity_p(entity e1, entity e2)
predicates on entities
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
code entity_code(entity e)
bool entity_main_module_p(entity e)
const char * module_local_name(entity e)
Returns the module local user name.
void print_entities(list l)
entity find_ith_formal_parameter(entity the_fnct, int rank)
This function gives back the ith formal parameter, which is found in the declarations of a call or a ...
const char * entity_module_name(entity e)
See comments about module_name().
expression reference_to_expression(reference r)
expression Pvecteur_to_expression(Pvecteur vect)
AP, sep 25th 95 : some usefull functions moved from static_controlize/utils.c.
void clean_all_normalized(expression e)
int expression_to_int(expression exp)
================================================================
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
expression find_ith_argument(list args, int n)
list make_list_of_constant(int val, int number)
of expression
expression subscript_value_stride(entity arr, list l_inds)
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
bool expression_reference_p(expression e)
Test if an expression is a reference.
bool expression_equal_integer_p(expression exp, int i)
================================================================
reference expression_reference(expression e)
Short cut, meaningful only if expression_reference_p(e) holds.
bool SizeOfArray(entity, int *)
This function computes the total size of a variable in bytes, ie.
bool variable_is_a_module_formal_parameter_p(entity, entity)
bool variable_in_common_p(entity)
true if v is in a common.
bool same_scalar_location_p(entity, entity)
FI: transferred from semantics (should be used for effect translation as well)
bool formal_parameter_p(entity)
bool variable_in_list_p(entity, list)
_int SizeOfElements(basic)
This function returns the length in bytes of the Fortran or C type represented by a basic,...
struct _newgen_struct_callees_ * callees
#define storage_formal_p(x)
#define syntax_reference(x)
#define normalized_linear_p(x)
#define callees_callees(x)
#define reference_variable(x)
#define statement_ordering(x)
#define entity_storage(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define code_declarations(x)
#define call_domain
newgen_callees_domain_defined
#define storage_formal(x)
#define EXPRESSION(x)
EXPRESSION.
#define expression_undefined
#define transformer_relation(x)
#define reference_indices(x)
#define expression_undefined_p(x)
#define variable_dimensions(x)
#define call_arguments(x)
#define normalized_linear(x)
#define expression_syntax(x)
#define predicate_system(x)
#define variable_basic(x)
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
static statement current_statement
struct Scontrainte * succ
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define exp
Avoid some warnings from "gcc -Wshadow".
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define VECTEUR_UNDEFINED
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define VECTEUR_UNDEFINED_P(v)
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...
Pvecteur vect_del_var(Pvecteur v_in, Variable var)
Pvecteur vect_del_var(Pvecteur v_in, Variable var): allocation d'un nouveau vecteur egal a la project...
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
bool vect_contains_variable_p(Pvecteur v, Variable var)
bool vect_contains_variable_p(Pvecteur v, Variable var) BA 19/05/94 input : a vector and a variable o...