25 #include "pips_config.h"
34 #define MUST_APPROXIMATION 0
35 #define MAY_APPROXIMATION 1
36 #define NOT_APPROXIMATION 2
123 if (initial_off == 0)
267 if (
set_belong_p(arcs_processed_set, (
char *)c))
continue;
268 arcs_processed_tmp_set =
set_add_element(arcs_processed_tmp_set, arcs_processed_set, (
char *)c);
273 s_tmp, act_tmp_dest, ent_tmp_dest,
274 s_dest, act_dest, ent_dest))
return true;
280 s_tmp, act_tmp_dest, ent_tmp_dest,
281 s_dest, act_dest, ent_dest))
return true;
293 list vertex_processed_list =
NIL;
297 while(!
ENDP(vertex_rest_list)) {
299 POP(vertex_rest_list);
353 impact_must_p ?
"MUST":
"MAY",
379 for(cl=l2; !
ENDP(cl);
POP(cl)) {
426 bool n_positif, n_negatif;
430 fprintf(stderr,
"n_negatif : %s\n", n_negatif ?
"TRUE" :
"FALSE");
431 fprintf(stderr,
"n_positif : %s\n", n_positif ?
"TRUE" :
"FALSE");
452 bool m3_negatif, m3_positif;
459 sc_add_ineg(ps, pc3);
470 pips_debug(2,
"loop_increment_value positif = %d, negatif = %d\n",
471 m3_positif, m3_negatif);
477 if (m3_positif ^ m3_negatif)
519 hash_put(control_to_set_of_dominators, (
char *)c, (
char *)dominator);
523 return (
set)
hash_get(control_to_set_of_dominators, (
char *)c);
544 if (n == n0)
continue;
557 set dominator_dp = NULL;
558 if (n == n0)
continue;
564 if (dominator_dp == NULL)
576 set_union(dominator_dn, dominator_dn, dominator_dp);
582 hash_update(control_to_set_of_dominators, (
char *)n, dominator_dn);
592 fprintf(stderr,
"dominators of statement\n");
649 switch (statement_exec_appro) {
653 statement_exec_appro1 = statement_exec_appro;
690 switch (statement_exec_appro) {
694 statement_exec_appro2 = statement_exec_appro;
718 bool impact_must_p =
false;
740 impact_must_p = impact_must_p &&
753 }, stat_writes2_old);
772 impact_must_p = impact_must_p &&
800 impact_must_p = impact_must_p &&
813 }, stat_writes2_old);
835 impact_must_p = impact_must_p &&
848 }, stat_writes1_old);
867 impact_must_p = impact_must_p &&
895 impact_must_p = impact_must_p &&
908 }, stat_writes1_old);
976 stat_reads1_old =
NIL;
977 stat_reads2_old =
NIL;
978 stat_writes1_old =
NIL;
979 stat_writes2_old =
NIL;
1027 fprintf(stderr,
"i am here UNSTRUCTURED ");
1089 fprintf(stderr,
"alias entre variable scalaire e1 et variable tableau e2\n");
1094 fprintf(stderr,
"alias entre variable tableau e1 et variable scalaire e2\n");
1099 fprintf(stderr,
"alias entre 2 variables tableau\n");
1296 if (((u1==-1)||(u1>=l2))&&((u2==-1)||(u2>=l1))) {
1322 user_log(
"Varying size of common variable");
1326 if (((u1==-1)||(u1>=l2)) && (u2>=l1)) {
void user_log(const char *format,...)
dynamic_check make_dynamic_check(entity a1, entity a2, bool a3)
expression copy_expression(expression p)
EXPRESSION.
static entity current_caller
static list l_module_aliases
#define dynamic_check_second(x)
#define alias_associations_list(x)
#define alias_association_lower_offset(x)
#define CALL_SITE(x)
CALL_SITE.
#define call_site_function(x)
#define alias_association_upper_offset(x)
#define alias_association_section(x)
#define alias_association_variable(x)
#define ALIAS_ASSOCIATION(x)
ALIAS_ASSOCIATION.
#define dynamic_check_checked(x)
#define alias_association_call_chain(x)
#define dynamic_check_first(x)
#define alias_association_offset(x)
#define DYNAMIC_CHECK(x)
DYNAMIC_CHECK.
#define call_site_ordering(x)
struct _newgen_struct_statement_ * statement
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Pcontrainte contrainte_free(Pcontrainte c)
Pcontrainte contrainte_free(Pcontrainte c): liberation de l'espace memoire alloue a la contrainte c a...
control load_ctrl_graph(statement)
struct _newgen_struct_dg_arc_label_ * dg_arc_label
#define CONFLICT(x)
CONFLICT.
#define dg_arc_label_conflicts(x)
#define conflict_source(x)
list proper_effects_of_expression(expression)
list statement_to_effects(statement)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
action make_action_write_memory(void)
To ease the extension of action with action_kind.
action make_action_read_memory(void)
#define effect_undefined_p(x)
#define approximation_exact_p(x)
#define action_write_p(x)
#define effect_approximation(x)
const char * module_name(const char *s)
Return the module part of an entity name.
#define gen_recurse(start, domain_number, flt, rwt)
#define successor_vertex(x)
#define successor_arc_label(x)
struct _newgen_struct_graph_ * graph
#define vertex_successors(x)
#define SUCCESSOR(x)
SUCCESSOR.
#define graph_vertices(x)
bool entities_may_conflict_p(entity e1, entity e2)
Check if two entities may conflict.
#define BACKWARD_CONTROL_MAP(ctl, code, c, list)
Walk through all the controls backward-reachable from a given control node of an unstructured.
#define CONTROL_MAP(ctl, code, c, list)
Macro to walk through all the controls reachable from a given control node of an unstructured.
void reset_current_module_entity(void)
Reset the current module entity.
entity set_current_module_entity(entity)
static.c
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
#define ENDP(l)
Test if a list is empty.
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
size_t gen_length(const list l)
list gen_cons(const void *item, const list next)
#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
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
#define CDR(pcons)
Get the list less its first element.
#define list_undefined
Undefined list definition :-)
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
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.
loop statement_loop(statement)
Get the loop of a statement.
call statement_call(statement)
Get the call of a statement.
bool statement_call_p(statement)
void insert_comments_to_statement(statement, const char *)
Insert a comment string (if non empty) at the beginning of the comments of a statement.
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void hash_update(hash_table htp, const void *key, const void *val)
update key->val in htp, that MUST be pre-existent.
bool hash_defined_p(const hash_table htp, const void *key)
true if key has e value in htp.
#define ADD_ELEMENT_TO_LIST(_list, _type, _element)
statement vertex_to_statement(vertex v)
Vertex_to_statement looks for the statement that is pointed to by vertex v.
static void display_impact_alias_statistics()
static void check_new_arc_for_structured_statement(statement s)
static statement statement_in_caller
#define MAY_APPROXIMATION
static void impact_check_two_variables(entity e1, entity e2, expression off1, expression off2, list path)
static bool statement_equal_p(statement s1, statement s2)
static list stat_reads2
list of statement_approximation_p
#define MUST_APPROXIMATION
static effect get_effect_read_of_statement_on_variable(statement s, entity var)
static expression offset_in_caller(entity e, call_site cs, list path)
static bool same_call_site_p(call_site cs1, call_site cs2)
static int loop_executed_approximation(statement s)
static string print_call_path(list path)
This function prints the call path , including names of caller functions and orderings of call sites ...
static bool dynamic_checked_p(entity e1, entity e2)
static int __attribute__((unused))
static entity alias_ent1
data dependence graph
static void insert_impact_description_as_comment(statement s1, statement s2, bool impact_must_p, int dep_type)
static int statement_in_caller_ordering
bool impact_check(char *module_name)
static statement mod_stat
We want to keep track of the current statement inside the recurse.
bool find_covering_reference_path(set arcs_processed_set, statement s_src, action act_src, entity ent_src, statement s_dest, action act_dest, entity ent_dest)
Check to see if new dependence is covered by arcs in dependence graph at reference level.
static bool search_statement_by_ordering_flt(statement s)
static void init_dynamic_check_list(entity current_mod)
static void impact_check_in_path(entity e1, entity e2, expression off1, expression off2, list path)
static list stat_writes1
list of statement_approximation_p
static int number_of_impact_alias
static set create_or_get_a_set_from_control(control c, hash_table control_to_set_of_dominators)
static effect get_effect_write_of_statement_on_variable(statement s, entity var)
static entity current_entity
static void set_dynamic_checked(entity e1, entity e2)
static bool variable_is_written_p(entity ent)
static bool tail_call_path_p(call_site cs, list l1, list l2)
static void check_for_effected_statement(statement s, list le)
static expression storage_formal_offset(call_site cs, entity actual_var, expression subval, list path)
static int number_of_processed_modules
static void impact_check_two_scalar_variables_in_path(entity e1, entity e2, expression off1, expression off2, list path)
static expression storage_ram_offset(storage s, expression subval)
static bool included_call_chain_p(list l1, list l2)
#define NOT_APPROXIMATION
static list current_path
list of statement_approximation_p
bool check_way_between_two_statements(statement s1, statement s2, graph g)
Check to see if there is a directed way between 2 statements in the graph specified.
static list stat_writes2
list of statement_approximation_p
static vertex statement_to_vertex(statement s, graph g)
static list l_dynamic_check
This list tells us if two variables have been checked dynamically or not.
static entity current_mod
static const char * caller_name
static bool variable_is_written_by_statement_flt(statement s)
This function returns true if the variable is written directly in the current module,...
list union_list(list l1, list l2)
Union is not typed...
struct _newgen_struct_control_ * control
#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
string concatenate(const char *,...)
Return the concatenation of the given strings.
set set_intersection(set, const set, const set)
#define SET_MAP(element, code, the_set)
set set_assign(set, const set)
Assign a set with the content of another set.
bool set_equal_p(const set, const set)
returns whether s1 == s2
set set_clear(set)
Assign the empty set to s s := {}.
bool set_belong_p(const set, const void *)
set set_union(set, const set, const set)
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
int f2(int off1, int off2, int w, int n, float r[n], float a[n], float b[n])
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 safe_print_statement(statement)
text statement_to_text(statement)
#define PLUS_OPERATOR_NAME
#define ORDERING_NUMBER(o)
#define ORDERING_STATEMENT(o)
#define NORMALIZE_EXPRESSION(e)
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define binary_intrinsic_expression(name, e1, e2)
#define is_instruction_block
soft block->sequence transition
#define eq_expression(e1, e2)
#define instruction_block(i)
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...
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)
const char * module_local_name(entity e)
Returns the module local user name.
void clean_all_normalized(expression e)
int trivial_expression_p(expression e)
This function returns:
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)
expression subscript_value_stride(entity arr, list l_inds)
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_in_common_p(entity)
true if v is in a common.
bool formal_parameter_p(entity)
bool entity_atomic_reference_p(entity)
Any reference r such that reference_variable(r)==e accesses all bytes (or bits) allocated to variable...
_int SizeOfElements(basic)
This function returns the length in bytes of the Fortran or C type represented by a basic,...
#define storage_formal_p(x)
#define normalized_linear_p(x)
#define reference_variable(x)
#define instruction_loop(x)
#define statement_ordering(x)
#define instruction_goto(x)
#define entity_storage(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define code_declarations(x)
#define range_increment(x)
#define storage_formal(x)
#define expression_undefined
@ is_instruction_unstructured
@ is_instruction_whileloop
#define instruction_tag(x)
#define transformer_relation(x)
#define reference_indices(x)
#define control_successors(x)
#define expression_undefined_p(x)
#define test_condition(x)
#define instruction_whileloop(x)
#define whileloop_body(x)
#define statement_instruction(x)
#define call_arguments(x)
#define control_statement(x)
#define instruction_test(x)
#define statement_undefined_p(x)
#define whileloop_condition(x)
#define statement_number(x)
#define normalized_linear(x)
#define predicate_system(x)
#define instruction_unstructured(x)
#define variable_basic(x)
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
int dep_type(action, action)
int dep_type(action ac1,action ac2) This function test the type of the dependence.
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.
bool ineq_redund_with_sc_p(Psysteme sc, Pcontrainte ineq)
This function returns true if the inequation ineq is redundant for the system ps and false otherwise.
bool sc_rational_feasibility_ofl_ctrl(Psysteme sc, int ofl_ctrl, bool ofl_res)
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
transformer load_statement_precondition(statement)
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.
#define CHAIN_SWORD(l, s)
string text_to_string(text t)
SG: moved here from ricedg.
string words_to_string(cons *lw)
A gen_chunk is used to store every object.
#define exp
Avoid some warnings from "gcc -Wshadow".
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2)
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2): allocation d'un vecteur v dont la valeur est la di...