PIPS
|
Go to the source code of this file.
Macros | |
#define | DEP_FLOW 0 |
#define | DEP_ANTI 1 |
#define | DEP_OUTP 2 |
#define | MUST_APPROXIMATION 0 |
#define | MAY_APPROXIMATION 1 |
#define | NOT_APPROXIMATION 2 |
Variables | |
static statement | mod_stat = statement_undefined |
We want to keep track of the current statement inside the recurse. More... | |
static entity | current_mod = entity_undefined |
static graph | dg = NULL |
static entity | alias_ent1 = entity_undefined |
data dependence graph More... | |
static entity | alias_ent2 = entity_undefined |
static list | stat_reads1 = NIL |
static list | stat_writes1 = NIL |
list of statement_approximation_p More... | |
static list | stat_reads2 = NIL |
list of statement_approximation_p More... | |
static list | stat_writes2 = NIL |
list of statement_approximation_p More... | |
static list | current_path = NIL |
list of statement_approximation_p More... | |
static list | l_dynamic_check = NIL |
This list tells us if two variables have been checked dynamically or not. More... | |
static int | statement_in_caller_ordering = 0 |
static statement | statement_in_caller = statement_undefined |
static const char * | caller_name |
static call | current_call = call_undefined |
static int | number_of_processed_modules = 0 |
static int | number_of_impact_alias = 0 |
static bool | written = false |
static entity | current_entity = entity_undefined |
#define DEP_ANTI 1 |
Definition at line 31 of file impact_check.c.
#define DEP_FLOW 0 |
Definition at line 30 of file impact_check.c.
#define DEP_OUTP 2 |
Definition at line 32 of file impact_check.c.
#define MAY_APPROXIMATION 1 |
Definition at line 35 of file impact_check.c.
#define MUST_APPROXIMATION 0 |
Definition at line 34 of file impact_check.c.
#define NOT_APPROXIMATION 2 |
Definition at line 36 of file impact_check.c.
|
static |
Automatic variables read in a CATCH block need to be declared volatile as specified by the documentation
compute the set N of nodes in flowgraph
Initialization D(n) = N
control_graph does not work until load_ctrl_graph is called control c1 = unstructured_control(control_graph(s1)), c2 = unstructured_control(control_graph(s2));
load_ctrl_graph work only if full_control_graph is called before and clean_ctrl_graph is called after
printf(stderr, "TEST......\n");
printf(stderr, "START.....\n"); safe_print_statement(s1); safe_print_statement(s); statement_exec_appro = expression_approximation(s, whileloop_condition(instruction_whileloop(statement_instruction(s))));
consideration of parameters here
printf(stderr, "TEST......\n");
printf(stderr, "START.....\n"); safe_print_statement(s2); safe_print_statement(s); statement_exec_appro = expression_approximation(s, whileloop_condition(instruction_whileloop(statement_instruction(s))));
consideration of parameters here
Definition at line 408 of file impact_check.c.
References CATCH, contrainte_make(), fprintf(), FWD_OFL_CTRL, load_statement_precondition(), MAY_APPROXIMATION, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, overflow_error, predicate_system, sc_dup(), sc_rational_feasibility_ofl_ctrl(), sc_rm(), transformer_relation, TRY, UNCATCH, vect_chg_sgn(), and vect_dup().
default value of dependence : MAY
used for remember to rebuild the list of read statements for alias_ent1
new flow-dependence created
witch (control_approximation_between_statement_p(sw2, s)) {
dependence does not exist so no impact alias
used for remember to rebuild the list of write statements for alias_ent1
new anti-dependence created
witch (control_approximation_between_statement_p(sr2, s)) {
dependence does not exist so don't the impact alias
new output-dependence created
witch (control_approximation_between_statement_p(sw2, s)) {
dependence does not exist so don't the impact alias
rebuild the list of read statements for alias_ent2
new flow-dependence created
witch (control_approximation_between_statement_p(sw1, s)) {
dependence does not exist so don't the impact alias
rebuild the list of write statements for alias_ent2
new anti-dependence created
witch(control_approximation_between_statement_p(sr1, s)) {
dependence does not exist so don't the impact alias
new output-dependence created
witch (control_approximation_between_statement_p(sw1, s)) {
dependence does not exist so don't the impact alias
Definition at line 707 of file impact_check.c.
References action_read_p, alias_ent1, alias_ent2, approximation_exact_p, CONS, DEP_ANTI, DEP_FLOW, DEP_OUTP, EFFECT, effect_action, effect_any_reference, effect_approximation, effect_undefined_p, entities_may_conflict_p(), find_covering_reference_path(), gen_copy_seq(), gen_free_list(), get_effect_read_of_statement_on_variable(), get_effect_write_of_statement_on_variable(), insert_impact_description_as_comment(), make_action_read_memory(), make_action_write_memory(), MAP, MAY_APPROXIMATION, MUST_APPROXIMATION, NIL, NOT_APPROXIMATION, number_of_impact_alias, reference_variable, set_clear(), set_free(), set_make(), set_pointer, stat_reads1, stat_reads2, stat_writes1, stat_writes2, STATEMENT, and statement_undefined_p.
Referenced by check_new_arc_for_structured_statement().
|
static |
of effects
of effects
precondition is used to determine if the statement is executed
f (!statement_feasible_p(s)) return;
save the old read, write statements
read, write statements may be modified after the line below
store the new version
restore the old version
read, write statements may be modified after the line below
afe_print_statement(s); switch (loop_executed_approximation(s)) { case MUST_BE_EXECUTED: fprintf(stderr, "MUST_BE_EXECUTED\n"); break; case MAY_BE_EXECUTED: fprintf(stderr, "MAY_BE_EXECUTED\n"); break; case MUST_NOT_BE_EXECUTED: fprintf(stderr, "MUST_NOT_BE_EXECUTED\n"); break; }
consideration of parameters here
Definition at line 920 of file impact_check.c.
References check_for_effected_statement(), CONTROL_MAP, control_statement, fprintf(), gen_copy_seq(), gen_free_list(), instruction_block, instruction_goto, instruction_loop, instruction_tag, instruction_test, instruction_unstructured, instruction_whileloop, is_instruction_block, is_instruction_call, is_instruction_goto, is_instruction_loop, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, loop_body, loop_range, MAP, NIL, pips_internal_error, proper_effects_of_expression(), range_increment, range_lower, range_upper, safe_print_statement(), stat_reads1, stat_reads2, stat_writes1, stat_writes2, STATEMENT, statement_instruction, statement_to_effects(), statement_undefined_p, test_condition, test_false, test_true, union_list(), unstructured_control, whileloop_body, and whileloop_condition.
Referenced by impact_check_two_scalar_variables_in_path().
Check to see if there is a directed way between 2 statements in the graph specified.
s1 | 1 |
s2 | 2 |
Definition at line 290 of file impact_check.c.
References ADD_ELEMENT_TO_LIST, CAR, ENDP, gen_in_list_p(), MAP, NIL, POP, s1, statement_equal_p(), statement_to_vertex(), SUCCESSOR, successor_vertex, VERTEX, vertex_successors, and vertex_to_statement().
|
static |
Definition at line 513 of file impact_check.c.
References hash_defined_p(), hash_get(), hash_put(), set_make(), and set_pointer.
|
static |
Definition at line 61 of file impact_check.c.
References number_of_impact_alias, number_of_processed_modules, and user_log().
Referenced by impact_check().
Definition at line 1153 of file impact_check.c.
References DYNAMIC_CHECK, dynamic_check_checked, dynamic_check_first, dynamic_check_second, l_dynamic_check, and MAP.
Referenced by impact_check().
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.
arcs_processed_set | rcs_processed_set |
s_src | _src |
act_src | ct_src |
ent_src | nt_src |
s_dest | _dest |
act_dest | ct_dest |
ent_dest | nt_dest |
Definition at line 238 of file impact_check.c.
References action_read_p, action_write_p, CONFLICT, conflict_sink, conflict_source, dg, dg_arc_label_conflicts, effect_action, effect_any_reference, entities_may_conflict_p(), MAP, reference_variable, set_add_element(), set_belong_p(), set_make(), set_pointer, statement_equal_p(), statement_to_vertex(), SUCCESSOR, successor_arc_label, successor_vertex, vertex_successors, and vertex_to_statement().
Referenced by check_for_effected_statement().
Definition at line 388 of file impact_check.c.
References action_read_p, EFFECT, effect_action, effect_any_reference, entities_may_conflict_p(), MAP, reference_variable, and statement_to_effects().
Referenced by check_for_effected_statement().
Definition at line 398 of file impact_check.c.
References action_write_p, EFFECT, effect_action, effect_any_reference, entities_may_conflict_p(), MAP, reference_variable, and statement_to_effects().
Referenced by check_for_effected_statement().
bool impact_check | ( | char * | module_name | ) |
ash_table control_to_set_of_dominators = hash_table_make(hash_pointer, 0);
ull_control_graph(module_name);
omputing_dominators(control_to_set_of_dominators, load_ctrl_graph(mod_stat));
set_precondition_map((statement_mapping) db_get_memory_resource(DBR_PRECONDITIONS, module_name, true));
Looking for another formal variable in the list of alias associations that has same section and included call path. If this variable is checked dynamically with e1 => no need to continue
Looking for common variables in module or callee of modules to check for alias impact ...
formal parameter has a same section with other common variable
If u1 is defined (different to -1) and u1<l2, there is no alias impact The same for: l1 is defined (different to -1) and u2<l1
The common variable always have a good offset off2
ash_table_free(control_to_set_of_dominators);
lean_ctrl_graph();
eset_precondition_map();
module_name | odule_name |
Definition at line 1242 of file impact_check.c.
References ALIAS_ASSOCIATION, alias_association_call_chain, alias_association_lower_offset, alias_association_offset, alias_association_section, alias_association_upper_offset, alias_association_variable, alias_associations_list, array_entity_p(), CAR, CDR, code_declarations, current_mod, db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, dg, display_impact_alias_statistics(), dynamic_checked_p(), ENDP, ENTITY, entity_code(), entity_storage, entity_type, entity_undefined, gen_length(), impact_check_two_variables(), included_call_chain_p(), init_dynamic_check_list(), int_to_expression(), l_dynamic_check, l_module_aliases, local_name_to_top_level_entity(), MAP, mod_stat, module_name(), NIL, number_of_processed_modules, ram_offset, ram_section, reset_current_module_entity(), reset_ordering_to_statement(), same_entity_p(), set_current_module_entity(), set_ordering_to_statement(), SizeOfArray(), SizeOfElements(), statement_undefined, storage_ram, type_variable, user_log(), variable_basic, and variable_in_common_p().
|
static |
Definition at line 1083 of file impact_check.c.
References entity_atomic_reference_p(), fprintf(), and impact_check_two_scalar_variables_in_path().
Referenced by impact_check_two_variables().
|
static |
off1 != off2 => Okay, no alias between these 2 variables
alias
en_recurse(mod_stat, statement_domain, check_new_arc_for_structured_statement, gen_null);
Definition at line 1043 of file impact_check.c.
References alias_ent1, alias_ent2, check_new_arc_for_structured_statement(), clean_all_normalized(), current_path, entity_local_name(), entity_undefined, eq_expression, fprintf(), gen_free_list(), ifdebug, mod_stat, NIL, print_call_path(), print_expression(), stat_reads1, stat_reads2, stat_writes1, stat_writes2, and trivial_expression_p().
Referenced by impact_check_in_path().
|
static |
good offset --> check
As we do not have exact offsets of variables, we have to go to the caller's frame to check for alias impact. The direct caller is CAR(call_path) because of the following concatenation in alias_propagation: path = CONS(CALL_SITE,cs,gen_full_copy_list(alias_association_call_chain(aa)));
To find a call site from its ordering, we have to do a gen_recurse in the caller module.
good offset --> check
Try with special cases : CALL FOO(R(TR(K)),R(TR(K))) ??????? Does this case exist when we create special section + offset for same actual arguments ???
use dynamic alias check
Definition at line 1192 of file impact_check.c.
References CALL_SITE, call_site_function, call_site_ordering, call_undefined, caller_name, CAR, current_call, current_caller, db_get_memory_resource(), expression_undefined_p, gen_null(), gen_recurse, impact_check_in_path(), module_local_name(), offset_in_caller(), pips_user_warning, search_statement_by_ordering_flt(), set_dynamic_checked(), statement_call(), statement_call_p(), statement_domain, statement_in_caller, statement_in_caller_ordering, statement_undefined, statement_undefined_p, and variable_is_written_p().
Referenced by impact_check().
Definition at line 80 of file impact_check.c.
References CALL_SITE, CAR, CDR, ENDP, and same_call_site_p().
Referenced by impact_check(), and tail_call_path_p().
|
static |
search for formal parameters in the declaration list
Definition at line 1162 of file impact_check.c.
References code_declarations, CONS, current_mod, DYNAMIC_CHECK, ENTITY, entity_code(), formal_parameter_p(), gen_nconc(), l_commons, l_dynamic_check, make_dynamic_check(), MAP, NIL, and variable_in_common_p().
Referenced by impact_check().
|
static |
Definition at line 338 of file impact_check.c.
References alias_ent1, alias_ent2, concatenate(), current_path, DEP_ANTI, DEP_FLOW, DEP_OUTP, dep_type(), entity_local_name(), insert_comments_to_statement(), print_call_path(), s1, statement_to_text(), strdup(), and text_to_string().
Referenced by check_for_effected_statement().
Tester le signe de l'incrï¿œment en fonction des prï¿œconditions :
Automatic variables read in a CATCH block need to be declared volatile as specified by the documentation
Vire aussi pv3 & pc3 :
le signe est dᅵterminᅵ et diffᅵrent de 0
pv = m1 - m2
pv_inverse = m2 - m1
??? on overflows, go next ...
??? on overflows, should assume MAY_BE_EXECUTED...
Definition at line 439 of file impact_check.c.
References CATCH, contrainte_free(), contrainte_make(), FWD_OFL_CTRL, ineq_redund_with_sc_p(), load_statement_precondition(), loop_range, MAY_APPROXIMATION, MUST_APPROXIMATION, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, NOT_APPROXIMATION, overflow_error, pips_debug, predicate_system, range_increment, range_lower, range_upper, sc_dup(), sc_rational_feasibility_ofl_ctrl(), sc_rm(), statement_loop(), transformer_relation, TRY, UNCATCH, vect_chg_sgn(), vect_dup(), and vect_substract().
|
static |
compute the subscript value, return expression_undefined if if the actual argument is a scalar variable or array name
The actual argument has a ram storage
The actual argument is a formal parameter of the current caller, we must take the alias_associations of the caller
Definition at line 182 of file impact_check.c.
References call_arguments, current_call, entity_name, entity_storage, expression_reference(), f(), find_ith_argument(), formal_offset, formal_parameter_p(), fprintf(), ifdebug, int_to_expression(), ram_offset, rank, reference_indices, reference_variable, storage_formal, storage_formal_offset(), storage_formal_p, storage_ram, storage_ram_offset(), storage_ram_p, and subscript_value_stride().
Referenced by impact_check_two_variables().
This function prints the call path , including names of caller functions and orderings of call sites in their corresponding functions.
Definition at line 319 of file impact_check.c.
References CALL_SITE, call_site_function, call_site_ordering, CHAIN_SWORD, int2a(), MAP, module_local_name(), NIL, ORDERING_NUMBER, ORDERING_STATEMENT, and words_to_string().
Referenced by impact_check_two_scalar_variables_in_path(), and insert_impact_description_as_comment().
Definition at line 70 of file impact_check.c.
References call_site_function, call_site_ordering, f2(), and same_entity_p().
Referenced by included_call_chain_p(), and tail_call_path_p().
Definition at line 213 of file impact_check.c.
References statement_in_caller, statement_in_caller_ordering, and statement_ordering.
Referenced by impact_check_two_variables().
Definition at line 1144 of file impact_check.c.
References DYNAMIC_CHECK, dynamic_check_checked, dynamic_check_first, dynamic_check_second, l_dynamic_check, and MAP.
Referenced by impact_check_two_variables().
Definition at line 222 of file impact_check.c.
References s1, and statement_number.
Referenced by check_way_between_two_statements(), find_covering_reference_path(), and statement_to_vertex().
Definition at line 227 of file impact_check.c.
References graph_vertices, MAP, statement_equal_p(), VERTEX, vertex_to_statement(), and vertex_undefined.
Referenced by allocate_task_to_cluster(), bdsc_code_instrumentation(), check_way_between_two_statements(), communications_construction(), end_idle_clusters(), find_covering_reference_path(), MCW(), move_task_to_cluster(), parse_instrumented_file(), update_priority_values(), and zeroing_multiple_edges().
|
static |
Definition at line 142 of file impact_check.c.
References ALIAS_ASSOCIATION, alias_association_call_chain, alias_association_offset, alias_association_variable, alias_associations_list, binary_intrinsic_expression, caller_name, copy_expression(), db_get_memory_resource(), exp, expression_equal_integer_p(), expression_undefined, expression_undefined_p, MAP, PLUS_OPERATOR_NAME, same_entity_p(), and tail_call_path_p().
Referenced by offset_in_caller().
|
static |
Definition at line 116 of file impact_check.c.
References binary_intrinsic_expression, copy_expression(), exp, expression_equal_integer_p(), int_to_expression(), PLUS_OPERATOR_NAME, ram_offset, and storage_ram.
Referenced by offset_in_caller().
Definition at line 99 of file impact_check.c.
References CALL_SITE, CAR, CDR, gen_length(), included_call_chain_p(), and same_call_site_p().
Referenced by storage_formal_offset().
Union is not typed...
l1 | 1 |
l2 | 2 |
Definition at line 376 of file impact_check.c.
References CAR, CHUNK, ENDP, gen_cons(), gen_in_list_p(), gen_nconc(), list_undefined, NIL, and POP.
Referenced by check_new_arc_for_structured_statement().
This function returns true if the variable is written directly in the current module, or by its callees.
gen_recurse_stop(NULL);
Definition at line 1109 of file impact_check.c.
References action_write_p, current_entity, EFFECT, effect_action, effect_any_reference, entity_name, fprintf(), ifdebug, MAP, reference_variable, same_entity_p(), statement_call_p(), statement_to_effects(), and written.
Referenced by variable_is_written_p().
Definition at line 1134 of file impact_check.c.
References current_entity, entity_undefined, gen_null(), gen_recurse, mod_stat, statement_domain, variable_is_written_by_statement_flt(), and written.
Referenced by impact_check_two_variables().
|
static |
data dependence graph
Definition at line 44 of file impact_check.c.
Referenced by check_for_effected_statement(), impact_check_two_scalar_variables_in_path(), and insert_impact_description_as_comment().
|
static |
Definition at line 45 of file impact_check.c.
Referenced by check_for_effected_statement(), impact_check_two_scalar_variables_in_path(), and insert_impact_description_as_comment().
|
static |
Definition at line 56 of file impact_check.c.
Referenced by impact_check_two_variables(), and storage_formal_offset().
|
static |
Definition at line 57 of file impact_check.c.
Referenced by impact_check_two_variables(), and offset_in_caller().
|
static |
Definition at line 1105 of file impact_check.c.
Referenced by variable_is_written_by_statement_flt(), and variable_is_written_p().
|
static |
Definition at line 42 of file impact_check.c.
Referenced by impact_check(), and init_dynamic_check_list().
list of statement_approximation_p
Definition at line 51 of file impact_check.c.
Referenced by impact_check_two_scalar_variables_in_path(), and insert_impact_description_as_comment().
|
static |
Definition at line 43 of file impact_check.c.
Referenced by find_covering_reference_path(), and impact_check().
This list tells us if two variables have been checked dynamically or not.
Definition at line 53 of file impact_check.c.
Referenced by dynamic_checked_p(), impact_check(), init_dynamic_check_list(), and set_dynamic_checked().
|
static |
We want to keep track of the current statement inside the recurse.
EFINE_LOCAL_STACK(current_stmt, statement)
Definition at line 41 of file impact_check.c.
Referenced by array_dfg(), atomizer(), cmf_layout_align(), craft_layout_align(), do_it(), freia_compile(), freia_compiler(), freia_remove_scalar_ww_deps(), freia_unroll_while(), full_parallel_loop_nest_p(), get_semantic_text(), impact_check(), impact_check_two_scalar_variables_in_path(), instruction_to_wp65_code(), invariant_code_motion(), loop_nest_movement_generation(), loop_nest_to_wp65_code(), make_filtered_dg_or_dvdg(), module_continuation_conditions(), module_summary_continuation_conditions(), old_reductions(), parallel_tiling(), prettyprint_dependence_graph(), prettyprint_dependence_graph_view(), prettyprint_dot_dependence_graph(), prgm_mapping(), print_code_or_source(), print_code_or_source_comp(), print_dependence_or_chains_graph(), print_dot_dependence_or_chains_graph(), print_filtered_dg_or_dvdg(), print_loopnest_dependence_cone(), print_parallelized_code_common(), print_parallelizedCMF_code(), print_parallelizedCRAFT_code(), reindexing(), remove_simple_scalar_pointers(), rice_dependence_graph(), scheduling(), search_parallel_loops(), single_assign(), static_controlize(), variable_is_written_p(), xml_Chain_Graph(), and xml_Chains().
|
static |
Definition at line 59 of file impact_check.c.
Referenced by check_for_effected_statement(), and display_impact_alias_statistics().
|
static |
Definition at line 58 of file impact_check.c.
Referenced by display_impact_alias_statistics(), and impact_check().
Definition at line 46 of file impact_check.c.
Referenced by check_for_effected_statement(), check_new_arc_for_structured_statement(), and impact_check_two_scalar_variables_in_path().
list of statement_approximation_p
Definition at line 48 of file impact_check.c.
Referenced by check_for_effected_statement(), check_new_arc_for_structured_statement(), and impact_check_two_scalar_variables_in_path().
list of statement_approximation_p
Definition at line 47 of file impact_check.c.
Referenced by check_for_effected_statement(), check_new_arc_for_structured_statement(), and impact_check_two_scalar_variables_in_path().
list of statement_approximation_p
Definition at line 49 of file impact_check.c.
Referenced by check_for_effected_statement(), check_new_arc_for_structured_statement(), and impact_check_two_scalar_variables_in_path().
|
static |
Definition at line 55 of file impact_check.c.
Referenced by impact_check_two_variables(), and search_statement_by_ordering_flt().
|
static |
Definition at line 54 of file impact_check.c.
Referenced by impact_check_two_variables(), and search_statement_by_ordering_flt().
Definition at line 1104 of file impact_check.c.
Referenced by variable_is_written_by_statement_flt(), and variable_is_written_p().