PIPS
|
#include <stdio.h>
#include <stdlib.h>
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "misc.h"
#include "ri-util.h"
#include "effects-util.h"
#include "transformer.h"
Go to the source code of this file.
Macros | |
#define | TRANSFORMER_CONSISTENCY_P_DEBUG_LEVEL 0 |
#define TRANSFORMER_CONSISTENCY_P_DEBUG_LEVEL 0 |
void add_value_to_transformer_space | ( | entity | v, |
transformer | tf | ||
) |
tf | f |
Definition at line 859 of file basic.c.
References predicate_system, sc_base_add_variable(), and transformer_relation.
Referenced by transformer_add_variable_type_information().
transformer empty_transformer | ( | transformer | t | ) |
Do not allocate an empty transformer, but transform an allocated transformer into an empty_transformer.
Pretty dangerous because the predicate contained in t may have been deleted before empty_transformer is called. It is not clear that the predicate of t can be freed or not: it is up to the caller to be aware of the problem.
This function is risky to use. It can cause either a memory leak if the predicate is not freed, or a double free if the pointer in the transformer is already dangling. If the predicate has already been freed during some processing at the linear level, the caller must update the pointer transformer_relation(t) with:
transformer_relation(t) = relation_undefined;
before the call.
Definition at line 144 of file basic.c.
References BASE_NULLE, free_predicate(), gen_free_list(), make_predicate(), NIL, sc_empty(), transformer_arguments, and transformer_relation.
Referenced by modulo_by_a_constant_to_transformer(), statement_to_postcondition(), transformer_combine(), transformer_convex_hulls(), transformer_projection_with_redundancy_elimination_and_check(), and whileloop_to_postcondition().
void free_transformers | ( | transformer | t, |
... | |||
) |
Analyze in args the variadic arguments that may be after t:
Since a variadic function in C must have at least 1 non variadic argument (here the s), just skew the varargs analysis:
Get the next argument:
Release the variadic analyzis:
Definition at line 73 of file basic.c.
References free_transformer().
Referenced by loop_to_enter_transformer().
transformer move_transformer | ( | transformer | t1, |
transformer | t2 | ||
) |
Move arguments and predicate of t2 into t1, free old arguments and predicate of t1, free what's left of t2.
This is used to perform a side effect on an argument when a function allocates a new transformer to return a result. t2 should not be used after a call to move_transformer()
t1 | 1 |
t2 | 2 |
Definition at line 939 of file basic.c.
References free_arguments(), free_transformer(), NIL, pips_assert, predicate_system, sc_rm(), transformer_arguments, transformer_consistency_p(), and transformer_relation.
Referenced by transformer_domain_intersection().
void old_transformer_free | ( | transformer | t | ) |
I should use gen_free directly but Psysteme is not yet properly interfaced with NewGen
gen_free should stop before trying to free a Psysteme and won't free entities in arguments because they are tabulated
commented out for DRET demo
end of DRET demo
Definition at line 89 of file basic.c.
References pips_assert, predicate_system, predicate_system_, sc_rm(), transformer_relation, and transformer_undefined.
transformer precondition_to_abstract_store | ( | transformer | pre | ) |
Get rid of all old values and arguments.
Argument pre is unchanged and result as is allocated. Should be a call to transformer_range(). Should not be in basic.c.
Project all old values
Redefine the arguments
pre | re |
Definition at line 871 of file basic.c.
References gen_free_list(), NIL, transformer_arguments, transformer_dup(), and transformer_projection().
Referenced by test_to_transformer(), and test_to_transformer_list().
transformer transformer_add_3d_affine_constraint | ( | transformer | tf, |
int | a1, | ||
entity | v1, | ||
int | a2, | ||
entity | v2, | ||
int | a3, | ||
entity | v3, | ||
int | cst, | ||
bool | equation_p | ||
) |
Add the constraint a1 v1 + a2 v2 + a3 v3 + cst <= or == 0.
tf | f |
a1 | 1 |
v1 | 1 |
a2 | 2 |
v2 | 2 |
a3 | 3 |
v3 | 3 |
cst | st |
equation_p | quation_p |
Definition at line 536 of file basic.c.
References eq, TCST, transformer_equality_add(), transformer_inequality_add(), vect_add_elem(), and vect_new().
Referenced by process_bounds_for_divide(), and update_cp_with_rhs_to_transformer().
transformer transformer_add_equality | ( | transformer | tf, |
entity | v1, | ||
entity | v2 | ||
) |
Add an equality between two values (two variables?)
tf | f |
v1 | 1 |
v2 | 2 |
Definition at line 436 of file basic.c.
References eq, transformer_equality_add(), VALUE_MONE, vect_add_elem(), and vect_new().
Referenced by any_basic_update_operation_to_transformer(), assign_operation_to_transformer(), generic_abs_to_transformer(), generic_reference_to_transformer(), generic_unary_operation_to_transformer(), lhs_expression_to_transformer(), transformer_apply_field_assignments_or_equalities(), and update_operation_to_transformer().
transformer transformer_add_equality_with_affine_term | ( | transformer | tf, |
entity | v, | ||
entity | x, | ||
int | a, | ||
int | cst | ||
) |
Add the equality v = a x + cst.
tf | f |
cst | st |
Definition at line 517 of file basic.c.
References eq, TCST, transformer_equality_add(), VALUE_ONE, vect_add_elem(), vect_new(), and x.
Referenced by generic_abs_to_transformer().
transformer transformer_add_equality_with_integer_constant | ( | transformer | tf, |
entity | v, | ||
long long int | cst | ||
) |
Add an equality between a value and an integer constant: v==cst.
tf | f |
cst | st |
Definition at line 450 of file basic.c.
References eq, TCST, transformer_equality_add(), VALUE_MONE, vect_add_elem(), and vect_new().
Referenced by add_type_information(), bitwise_xor_to_transformer(), constant_to_transformer(), generic_abs_to_transformer(), integer_expression_to_transformer(), integer_left_shift_to_transformer(), integer_power_to_transformer(), logical_binary_function_to_transformer(), logical_expression_to_transformer(), logical_not_to_transformer(), modulo_by_a_constant_to_transformer(), modulo_of_a_constant_to_transformer(), and transformer_add_condition_information_updown().
transformer transformer_add_identity | ( | transformer | tf, |
entity | v | ||
) |
tf | f |
Definition at line 421 of file basic.c.
References arguments_add_entity(), entity_to_new_value(), entity_to_old_value(), eq, transformer_arguments, transformer_equality_add(), vect_add_elem(), and vect_new().
transformer transformer_add_inequality | ( | transformer | tf, |
entity | v1, | ||
entity | v2, | ||
bool | strict_p | ||
) |
Add the equality v1 <= v2 or v1 < v2.
tf | f |
v1 | 1 |
v2 | 2 |
strict_p | trict_p |
Definition at line 464 of file basic.c.
References eq, TCST, transformer_inequality_add(), VALUE_MONE, VALUE_ONE, vect_add_elem(), and vect_new().
Referenced by add_index_bound_conditions(), integer_left_shift_to_transformer(), and integer_multiply_to_transformer().
transformer transformer_add_inequality_with_affine_term | ( | transformer | tf, |
entity | v, | ||
entity | x, | ||
int | a, | ||
int | cst, | ||
bool | less_than_p | ||
) |
Add the inequality v <= a x + cst or v >= a x + cst.
tf | f |
cst | st |
less_than_p | ess_than_p |
Definition at line 496 of file basic.c.
References eq, TCST, transformer_inequality_add(), VALUE_MONE, VALUE_ONE, vect_add_elem(), vect_new(), VECTEUR_NUL, and x.
Referenced by integer_left_shift_to_transformer(), integer_multiply_to_transformer(), and transformer_add_inequality_with_linear_term().
transformer transformer_add_inequality_with_integer_constraint | ( | transformer | tf, |
entity | v, | ||
long long int | cst, | ||
bool | less_than_p | ||
) |
Add the inequality v <= cst or v >= cst.
tf | f |
cst | st |
less_than_p | ess_than_p |
Definition at line 477 of file basic.c.
References eq, TCST, transformer_inequality_add(), VALUE_MONE, VALUE_ONE, vect_add_elem(), and vect_new().
Referenced by add_type_information(), integer_call_expression_to_transformer(), integer_left_shift_to_transformer(), integer_minmax_to_transformer(), integer_power_to_transformer(), logical_binary_function_to_transformer(), logical_not_to_transformer(), modulo_by_a_constant_to_transformer(), modulo_of_a_constant_to_transformer(), modulo_of_a_negative_value_to_transformer(), modulo_of_a_positive_value_to_transformer(), and modulo_to_transformer().
transformer transformer_add_inequality_with_linear_term | ( | transformer | tf, |
entity | v, | ||
entity | x, | ||
int | a, | ||
bool | less_than_p | ||
) |
Add the inequality v <= a x or v >= a x.
tf | f |
less_than_p | ess_than_p |
Definition at line 530 of file basic.c.
References transformer_add_inequality_with_affine_term(), VALUE_ZERO, and x.
Referenced by expression_multiply_sizeof_to_transformer(), integer_multiply_to_transformer(), and loop_to_enter_transformer().
transformer transformer_add_modified_variable | ( | transformer | tf, |
entity | var | ||
) |
FI: this function does not end up with a consistent transformer because the old value is not added to the basis of sc.
Also, the variable should be transformed into a new value... See next function.
Should we check that var has values?
tf | f |
var | ar |
Definition at line 889 of file basic.c.
References arguments_add_entity(), base_dimension, predicate_system, transformer_arguments, transformer_relation, and vect_add_variable().
Referenced by any_assign_operation_to_transformer(), any_scalar_assign_to_transformer_list(), any_scalar_assign_to_transformer_without_effect(), transformer_apply_field_assignments_or_equalities(), and transformer_apply_unknown_field_assignments_or_equalities().
transformer transformer_add_modified_variable_entity | ( | transformer | tf, |
entity | var | ||
) |
FI: like the previous function, but supposed to end up with a consistent transformer.
When the transformer is empty/unfeasible, the variable is not added to conform to rules about standard empty transformer: how could a variable be updated by a non-existing transition?
FI: it is not well specifived if the argument should be made of new values or of progtram variables because up to now the two are the same, except when printed out.
tf | f |
var | ar |
Definition at line 909 of file basic.c.
References arguments_add_entity(), base_dimension, entity_has_values_p(), entity_name, entity_to_new_value(), entity_to_old_value(), pips_internal_error, predicate_system, transformer_arguments, transformer_empty_p(), transformer_relation, and vect_add_variable().
Referenced by safe_assigned_expression_to_transformer(), and safe_assigned_expression_to_transformer_list().
transformer transformer_add_sign_information | ( | transformer | tf, |
entity | v, | ||
int | v_sign | ||
) |
CHANGE THIS NAME: no loop index please, it's not directly linked to loops!!!
Add in tf the information that v is striclty positive, strictly negative or zero.
Assume that v is a value and tf is defined.
v_sign<0
v_sign==0
tf | f |
v_sign | _sign |
Definition at line 200 of file basic.c.
References Ssysteme::base, base_add_variable(), base_dimension, contrainte_make(), Ssysteme::dimension, eq, ifdebug, local_temporary_value_entity_p(), pips_assert, predicate_system, sc_add_egalite(), sc_add_inegalite(), TCST, transformer_consistency_p(), transformer_relation, value_entity_p(), VALUE_MONE, VALUE_ONE, vect_add_elem(), and vect_new().
Referenced by condition_to_transformer().
transformer transformer_add_value_update | ( | transformer | t, |
entity | v | ||
) |
Add an update of variable v to t (a value cannot be updated)
Definition at line 321 of file basic.c.
References arguments_add_entity(), Ssysteme::base, base_add_variable(), base_contains_variable_p(), Ssysteme::dimension, entity_to_new_value(), entity_to_old_value(), predicate_system, transformer_arguments, transformer_empty_p(), transformer_relation, and vect_size().
Referenced by assigned_expression_to_transformer(), assigned_expression_to_transformer_list(), c_return_to_transformer(), and transformer_add_variables_update().
transformer transformer_add_variable_incrementation | ( | transformer | t, |
entity | i, | ||
Pvecteur | incr | ||
) |
transformer transformer_add_loop_index(transformer t, entity i, Pvecteur incr): add the index incrementation expression incr for loop index i to transformer t.
t = intersection(t, i::new = i::old + incr)
incr is supposed to be compatible with the value mappings
Pvecteur incr should not be used after a call to transformer_add_index because it is shared by t and modified
Psysteme * ps = &((Psysteme) predicate_system(transformer_relation(t)));
incr | ncr |
Definition at line 260 of file basic.c.
References arguments_add_entity(), Ssysteme::base, contrainte_make(), Ssysteme::dimension, entity_to_new_value(), entity_to_old_value(), predicate_system, sc_equation_add(), transformer_arguments, transformer_relation, value_to_variable(), vect_add_variable(), vect_chg_coeff(), and vect_size().
Referenced by transformer_add_loop_index_incrementation().
transformer transformer_add_variable_update | ( | transformer | t, |
entity | v | ||
) |
Add an update of variable v into t.
NL : this function is not finish do the same thing than transformer_add_value_update for the moment TODO
Definition at line 289 of file basic.c.
References arguments_add_entity(), Ssysteme::base, base_add_variable(), base_contains_variable_p(), Ssysteme::dimension, entity_to_new_value(), entity_to_old_value(), predicate_system, transformer_arguments, transformer_relation, value_to_variable(), and vect_size().
Referenced by apply_abstract_effect_to_transformer(), apply_array_effect_to_transformer(), apply_concrete_effect_to_transformer(), generic_apply_effect_to_transformer(), and generic_reference_to_transformer().
transformer transformer_add_variables_update | ( | transformer | t, |
list | vl | ||
) |
vl | l |
Definition at line 340 of file basic.c.
References ENTITY, FOREACH, and transformer_add_value_update().
Referenced by c_user_call_to_transformer().
bool transformer_argument_consistency_p | ( | transformer | t | ) |
Definition at line 551 of file basic.c.
References transformer_argument_general_consistency_p().
Referenced by transformer_add_any_relation_information(), and transformer_general_consistency_p().
bool transformer_argument_general_consistency_p | ( | transformer | t, |
bool | is_weak | ||
) |
If no final state can be reached, no variable can be changed in between
If a variable appears as argument, its new value must be in the basis See for instance, effects_to_transformer()
pips_user_warning("No value for argument %s in relation basis\n", entity_name(e));
is_weak | s_weak |
Definition at line 561 of file basic.c.
References base_contains_variable_p(), ENDP, ENTITY, entity_name, entity_to_new_value(), MAP, pips_assert, pips_internal_error, predicate_system, sc_empty_p(), transformer_arguments, and transformer_relation.
Referenced by transformer_argument_consistency_p(), and transformer_argument_weak_consistency_p().
bool transformer_argument_weak_consistency_p | ( | transformer | t | ) |
Definition at line 556 of file basic.c.
References transformer_argument_general_consistency_p().
bool transformer_consistency_p | ( | transformer | t | ) |
FI: I do not know if this procedure should always return or fail when an inconsistency is found.
For instance, summary transformers for callees are inconsistent with respect to the current module. FC/CA: help...
I do not understand why errors are reported only if the debug level is greater than 1. A demo effect? No, this routine is coded that way to save time on regular runs.
Also, since no precise information about the inconsistency is displayed, a core dump would be welcome to retrieve pieces of information with gdb. The returned value should always be tested and a call to pips_internal_error() should always be performed if an inconsistency is detected.
But, see final comment... In spite of it, I do not always return any longer.
Definition at line 612 of file basic.c.
References transformer_general_consistency_p().
Referenced by block_to_transformer(), block_to_transformer_list(), call_to_transformer(), declarations_to_transformer(), declarations_to_transformer_list(), generic_module_name_to_transformers(), initial_precondition(), loop_to_total_precondition(), module_name_to_total_preconditions(), move_transformer(), node_to_path_transformer_or_postcondition(), print_cycle_head_to_fixpoint(), program_postcondition(), program_precondition(), propagate_preconditions_in_declarations(), safe_assigned_expression_to_transformer(), statement_to_postcondition(), statement_to_total_precondition(), statement_to_transformer(), statement_to_transformer_list(), store_control_fix_point(), store_control_postcondition(), transformer_add_loop_index_incrementation(), transformer_add_sign_information(), transformer_combine(), transformer_derivative_fix_point(), transformer_internal_consistency_p(), transformer_inverse_apply(), transformer_list_closure_to_precondition(), transformer_list_closure_to_precondition_depth_two(), transformer_list_generic_transitive_closure(), transformer_list_multiple_closure_to_precondition(), transformer_normalize(), unstructured_to_flow_sensitive_postconditions(), and unstructured_to_flow_sensitive_total_preconditions().
transformer transformer_constraint_add | ( | transformer | tf, |
Pvecteur | i, | ||
bool | equality | ||
) |
tf | f |
equality | quality |
Definition at line 348 of file basic.c.
References contrainte_make(), pips_assert, predicate_system, sc_constraint_add(), transformer_relation, transformer_undefined, user_warning, and VECTEUR_NUL_P.
Referenced by transformer_equalities_add(), transformer_equality_add(), transformer_inequalities_add(), and transformer_inequality_add().
transformer transformer_dup | ( | transformer | t_in | ) |
transformer package - basic routines
cproto-generated files
Francois Irigoin
FI: I do not reduce transformer_dup() to a macro calling copy_transformer() because I do not want to create problems with the link edit and because I want to keep the assertion
t_in | _in |
Definition at line 49 of file basic.c.
References copy_transformer(), pips_assert, predicate_system, transformer_relation, and transformer_undefined.
Referenced by add_index_bound_conditions(), add_loop_index_exit_value(), any_transformer_to_k_closure(), block_to_postcondition(), block_to_total_precondition(), block_to_transformer(), call_site_to_module_precondition_text(), call_to_summary_precondition(), check_condition_wrt_precondition(), comp_regions_of_implied_do(), complete_loop_transformer(), complete_loop_transformer_list(), cycle_to_flow_sensitive_preconditions(), dag_to_flow_sensitive_preconditions(), declarations_to_transformer(), declarations_to_transformer_list(), eval_condition_wrt_precondition_p(), forloop_to_postcondition(), fortran_user_call_to_transformer(), generic_module_name_to_transformers(), generic_transformer_intra_to_inter(), integer_expression_and_precondition_to_integer_interval(), interprocedural_abc_arrays(), load_arc_precondition(), loop_to_postcondition(), loop_to_total_precondition(), loop_to_transformer(), module_name_to_total_preconditions(), old_complete_whileloop_transformer(), precondition_to_abstract_store(), process_call_for_summary_precondition(), process_ready_node(), program_precondition(), propagate_preconditions_in_declarations(), recompute_loop_transformer(), standard_whileloop_to_transformer(), test_to_postcondition(), test_to_transformer(), test_to_transformer_list(), transformer_add_anded_conditions_updown(), transformer_add_any_relation_information(), transformer_add_integer_relation_information(), transformer_add_ored_conditions_updown(), transformer_apply(), transformer_convex_hulls(), transformer_derivative_fix_point(), transformer_domain_intersection(), transformer_equality_fix_point(), transformer_halbwachs_fix_point(), transformer_inverse_apply(), transformer_pattern_fix_point(), transformer_range(), transformer_to_domain(), unstructured_continuation_conditions(), unstructured_to_postcondition(), unstructured_to_postconditions(), unstructured_to_total_precondition(), unstructured_to_transformer(), update_summary_precondition(), update_temporary_precondition(), and whileloop_to_postcondition().
transformer transformer_empty | ( | void | ) |
Allocate an empty transformer.
Definition at line 120 of file basic.c.
References BASE_NULLE, make_predicate(), make_transformer(), NIL, and sc_empty().
Referenced by add_index_range_conditions(), block_continuation_conditions(), call_continuation_conditions(), complete_repeatloop_transformer_list(), dag_or_cycle_to_flow_sensitive_postconditions_or_transformers(), expression_multiply_sizeof_to_transformer(), generic_transformer_list_to_transformer(), get_control_precondition(), integer_binary_operation_to_transformer(), intrinsic_to_transformer(), intrinsic_to_transformer_list(), load_arc_precondition(), loop_continuation_conditions(), loop_to_postcondition(), loop_to_total_precondition(), module_summary_continuation_conditions(), modulo_of_a_constant_to_transformer(), modulo_to_transformer(), new_array_elements_backward_substitution_in_transformer(), new_array_elements_forward_substitution_in_transformer(), new_substitute_stubs_in_transformer(), ordinary_summary_precondition(), pointer_binary_operation_to_transformer(), points_to_unary_operation_to_transformer(), precondition_intra_to_inter(), process_bounds_for_divide(), process_unreachable_node(), ready_to_be_processed_p(), repeatloop_to_postcondition(), standard_whileloop_to_transformer(), statement_to_total_precondition(), summary_total_postcondition(), test_continuation_conditions(), transformer_add_call_condition_information_updown(), transformer_add_condition_information_updown(), transformer_general_intersection(), transformer_list_generic_transitive_closure(), unstructured_continuation_conditions(), unstructured_to_flow_insensitive_transformer(), unstructured_to_postconditions(), unstructured_to_transformer(), whileloop_to_postcondition(), and whileloop_to_total_precondition().
transformer transformer_equalities_add | ( | transformer | tf, |
Pcontrainte | eqs | ||
) |
please, do not introduce any sharing at the Pcontrainte level you do not know how they have to be chained in diferent transformers; do not introduce any sharing at the Pvecteur level; I'm not sure it's so useful, but think of what would happen if one transformer is renamed...
tf | f |
eqs | qs |
Definition at line 391 of file basic.c.
References CONTRAINTE_UNDEFINED, contrainte_vecteur, Scontrainte::succ, transformer_constraint_add(), and vect_dup().
Referenced by tf_equivalence_equalities_add().
transformer transformer_equality_add | ( | transformer | tf, |
Pvecteur | i | ||
) |
tf | f |
Definition at line 383 of file basic.c.
References transformer_constraint_add().
Referenced by add_loop_index_exit_value(), add_type_information(), bitwise_xor_to_transformer(), expression_multiply_sizeof_to_transformer(), formal_and_actual_parameters_association(), fortran_data_to_prec_for_variables(), integer_left_shift_to_transformer(), integer_multiply_to_transformer(), logical_unary_operation_to_transformer(), transformer_add_3d_affine_constraint(), transformer_add_condition_information_updown(), transformer_add_equality(), transformer_add_equality_with_affine_term(), transformer_add_equality_with_integer_constant(), transformer_add_identity(), and transformer_add_integer_relation_information().
bool transformer_equations_constrain_variable_p | ( | const transformer | t, |
const entity | v | ||
) |
Is value v used with a non-zero coefficient by the equations of transformer t?
Definition at line 963 of file basic.c.
References predicate_system, sc_equations_constrain_variable_p(), and transformer_relation.
void transformer_free | ( | transformer | t | ) |
Definition at line 68 of file basic.c.
References free_transformer().
Referenced by add_loop_index_exit_value(), add_loop_index_initialization(), add_module_call_site_precondition(), comp_regions_of_implied_do(), complete_loop_transformer(), complete_loop_transformer_list(), do_array_expansion(), invariant_wrt_transformer(), loop_to_postcondition(), loop_to_total_precondition(), process_call_for_summary_precondition(), statement_to_transformer(), statement_to_transformer_list(), test_to_transformer(), test_to_transformer_list(), transformer_add_any_relation_information(), transformer_halbwachs_fix_point(), unstructured_to_postcondition(), unstructured_to_postconditions(), unstructured_to_total_precondition(), update_summary_precondition(), whileloop_to_postcondition(), and whileloop_to_total_precondition().
bool transformer_general_consistency_p | ( | transformer | tf, |
bool | is_weak | ||
) |
the relation should be consistent and any variable corresponding to an old value should appear in the argument list since an old value cannot (should not) be introduced unless the variable is changed and since every changed variable is in the argument list.
Apparently, a variable may appear as an argument but its old value does not have to appear in the basis if it is not required by the constraints. This does not seem very safe to me (FI, 13 Nov. 95)
The NewGen data structure must be fully defined
The predicate must be weakly consistent. Every variable in the constraints must be in the basis (but not the other way round).
If an old value appears in the predicate, the corresponding variable should be an argument of the transformer
test aliasing between arguments and relations high cost testing
FI: the next test is not safe because val can be a global value not recognized in the current context. old_value_entity_p() returns true or FALSE or pips_error.
A general version of this routine is needed... The return value of a function is not recognized as a global value by old_value_entity_p
old_value_entity_p() is likely to core dump on interprocedural transformers and preconditions.
The constant term should not appear in the basis
The constant term should not be an argument
Check that the transformer is compatible with the current value mappings.
This is not always true as you may need to import the summary transformer of a callee. Before translation, this check will most likely fail.
Debugging step which does not return if an incompatibility is found.
Check that every argument has a value. This is not redundant with the printout procedure which uses entity_minimal_name() and not the value mappings.
Values returned by callees may appear in interprocedural transformers
FI: let the user react and print info before core dumping
pips_assert("transformer_consistency_p", consistent);
tf | f |
is_weak | s_weak |
Definition at line 632 of file basic.c.
References BASE_UNDEFINED, BASE_UNDEFINED_P, CAR, debug(), dump_transformer, entities_may_conflict_p(), ENTITY, entity_has_values_p(), entity_in_formal_area_p(), entity_is_argument_p(), entity_local_name(), entity_module_name(), entity_name, entity_storage, entity_stub_sink_p(), FOREACH, ifdebug, MAP, old_value_entity_p(), pips_debug, pips_internal_error, pips_user_warning, POP, predicate_system, same_string_p, sc_weak_consistent_p(), storage_return_p, Svecteur::succ, TCST, term_cst, transformer_argument_consistency_p(), transformer_arguments, TRANSFORMER_CONSISTENCY_P_DEBUG_LEVEL, transformer_defined_p(), transformer_relation, value_to_variable(), and vecteur_var.
Referenced by transformer_consistency_p(), transformer_weak_consistency_p(), and transformers_consistency_p().
transformer transformer_identity | ( | void | ) |
Allocate an identity transformer.
return make_transformer(NIL, make_predicate(SC_RN));
en fait, on voudrait initialiser a "liste de contraintes vide"
Definition at line 110 of file basic.c.
References CONTRAINTE_UNDEFINED, make_predicate(), make_transformer(), NIL, and sc_make().
Referenced by __attribute__(), addition_operation_to_transformer(), any_expression_to_transformer(), any_expressions_to_transformer(), any_user_call_site_to_transformer(), args_to_transformer(), bitwise_xor_to_transformer(), block_continuation_conditions(), block_to_transformer(), c_data_to_prec_for_variables(), c_return_to_transformer(), call_continuation_conditions(), call_to_transformer(), clean_up_transformer_list(), complete_loop_transformer(), complete_loop_transformer_list(), complete_repeatloop_transformer_list(), compute_postcondition(), condition_to_transformer(), constant_to_transformer(), dag_or_cycle_to_flow_sensitive_postconditions_or_transformers(), declaration_to_transformer(), declaration_to_transformer_list(), declarations_to_transformer(), declarations_to_transformer_list(), dimensions_to_transformer(), effects_to_transformer(), expression_multiply_sizeof_to_transformer(), expressions_to_transformer(), forloop_to_transformer(), fortran_data_to_prec_for_variables(), generic_abs_to_transformer(), generic_module_name_to_transformers(), generic_transformer_list_to_transformer(), iabs_to_transformer(), instruction_to_transformer(), integer_binary_operation_to_transformer(), integer_call_expression_to_transformer(), integer_expression_to_transformer(), integer_left_shift_to_transformer(), integer_minmax_to_transformer(), integer_multiply_to_transformer(), integer_power_to_transformer(), interprocedural_abc_arrays(), intrinsic_to_transformer(), load_completed_statement_transformer(), logical_binary_function_to_transformer(), logical_expression_to_transformer(), loop_continuation_conditions(), loop_to_continue_transformer(), loop_to_enter_transformer(), merge_transformer_lists(), module_name_to_total_preconditions(), module_summary_continuation_conditions(), modulo_by_a_constant_to_transformer(), modulo_of_a_constant_to_transformer(), modulo_of_a_negative_value_to_transformer(), modulo_of_a_positive_value_to_transformer(), modulo_to_transformer(), new_complete_whileloop_transformer_list(), new_whileloop_to_k_transformer(), new_whileloop_to_transformer(), old_complete_whileloop_transformer(), old_summary_precondition(), ordinary_summary_precondition(), pointer_unary_operation_to_transformer(), precondition_intra_to_inter(), program_postcondition(), program_precondition(), repeatloop_to_postcondition(), repeatloop_to_transformer(), safe_any_assign_operation_to_transformer(), safe_any_expression_to_transformer(), safe_assigned_expression_to_transformer(), safe_assigned_expression_to_transformer_list(), safe_expression_to_transformer(), sequence_dg(), standard_whileloop_to_transformer(), statement_continuation_conditions(), statement_to_transformer(), statement_to_transformer_list(), summary_total_postcondition(), test_continuation_conditions(), test_to_transformer(), test_to_transformer_list(), transformer_add_any_relation_information(), transformer_apply_field_assignments_or_equalities(), transformer_apply_unknown_field_assignments_or_equalities(), transformer_convex_hulls(), transformer_derivative_fix_point(), transformer_equality_fix_point(), transformer_general_intersection(), transformer_list_generic_transitive_closure(), transformer_safe_domain_intersection(), translate_to_module_frame(), unstructured_continuation_conditions(), unstructured_to_transformer(), and whileloop_to_postcondition().
bool transformer_identity_p | ( | transformer | t | ) |
Check that t is an identity function.
no variables are modified; no constraints exist on their values
Definition at line 154 of file basic.c.
References NIL, pips_assert, predicate_system, transformer_arguments, transformer_relation, and transformer_undefined.
Referenced by add_module_call_site_precondition(), check_transformer_list(), clean_up_transformer_list(), merge_transformer_lists(), modulo_to_transformer(), process_call_for_summary_precondition(), and two_transformers_to_list().
transformer transformer_inequalities_add | ( | transformer | tf, |
Pcontrainte | ineqs | ||
) |
Warning:
tf | f |
ineqs | neqs |
Definition at line 409 of file basic.c.
References contrainte_succ, CONTRAINTE_UNDEFINED, CONTRAINTE_UNDEFINED_P, contrainte_vecteur, and transformer_constraint_add().
Referenced by generic_minmax_to_transformer().
bool transformer_inequalities_constrain_variable_p | ( | const transformer | t, |
const entity | v | ||
) |
Is value v used with a non-zero coefficient by the inequalities of transformer t?
Definition at line 972 of file basic.c.
References predicate_system, sc_inequalities_constrain_variable_p(), and transformer_relation.
transformer transformer_inequality_add | ( | transformer | tf, |
Pvecteur | i | ||
) |
tf | f |
Definition at line 375 of file basic.c.
References transformer_constraint_add().
Referenced by add_affine_bound_conditions(), add_declaration_list_information(), add_loop_index_exit_value(), add_loop_skip_condition(), add_reference_information(), bitwise_xor_to_transformer(), expression_multiply_sizeof_to_transformer(), generic_abs_to_transformer(), iabs_to_transformer(), integer_left_shift_to_transformer(), integer_minmax_to_transformer(), integer_multiply_to_transformer(), integer_power_to_transformer(), logical_binary_operation_to_transformer(), loop_bound_evaluation_to_transformer(), transformer_add_3d_affine_constraint(), transformer_add_condition_information_updown(), transformer_add_inequality(), transformer_add_inequality_with_affine_term(), transformer_add_inequality_with_integer_constraint(), transformer_add_integer_relation_information(), and transformer_logical_inequalities_add().
bool transformer_internal_consistency_p | ( | transformer | t | ) |
Same as above but equivalenced variables should not appear in the argument list or in the predicate basis.
Definition at line 790 of file basic.c.
References BASE_NULLE_P, BASE_UNDEFINED, ENTITY, entity_constant_p, entity_local_name(), entity_null_locations_p(), entity_symbolic_p, entity_to_new_value(), FOREACH, intermediate_value_entity_p(), new_value_entity_p(), old_value_entity_p(), pips_assert, pips_user_warning, predicate_system, transformer_arguments, transformer_consistency_p(), transformer_relation, vecteur_succ, and vecteur_var.
Referenced by recompute_loop_transformer(), statement_to_transformer(), statement_to_transformer_list(), transformer_add_integer_relation_information(), and unstructured_to_flow_insensitive_transformer().
bool transformer_is_empty_p | ( | transformer | t | ) |
Check that transformer t is the canonical representation of an empty transformer.
See transformer_empty_p(), transformer_strongly_empty_p() if you need to check that a set of affine constraints is not feasible.
Definition at line 172 of file basic.c.
References ENDP, pips_assert, predicate_system, sc_empty_p(), transformer_arguments, transformer_relation, and transformer_undefined.
Referenced by generic_apply_effects_to_transformer(), transformer_combine(), and transformer_normalize().
bool transformer_is_rn_p | ( | transformer | t | ) |
Check that transformer t is the canonical representation of the whole afine space defined by its basis.
Definition at line 183 of file basic.c.
References pips_assert, predicate_system, transformer_relation, and transformer_undefined.
Referenced by eval_linear_expression(), and transformer_combine().
list transformer_projectable_values | ( | transformer | tf | ) |
tf | f |
Definition at line 827 of file basic.c.
References BASE_NULLE_P, BASE_UNDEFINED, CONS, ENTITY, NIL, predicate_system, transformer_relation, vecteur_succ, and vecteur_var.
Referenced by recompute_loop_transformer().
bool transformer_weak_consistency_p | ( | transformer | t | ) |
Interprocedural transformers do not meet all conditions.
Definition at line 626 of file basic.c.
References transformer_general_consistency_p().
Referenced by c_user_call_to_transformer(), fortran_user_call_to_transformer(), transformer_filter(), transformer_formal_parameter_projection(), transformer_projection_with_redundancy_elimination_and_check(), and transformer_return_value_projection().
tl | l |
Definition at line 616 of file basic.c.
References FOREACH, TRANSFORMER, and transformer_general_consistency_p().
Referenced by safe_assigned_expression_to_transformer_list().
bool value_belongs_to_transformer_space | ( | entity | v, |
transformer | tf | ||
) |
tf | f |
Definition at line 842 of file basic.c.
References BASE_NULLE_P, BASE_UNDEFINED, predicate_system, transformer_relation, vecteur_succ, and vecteur_var.
Referenced by transformer_add_variable_type_information().