PIPS
|
Go to the source code of this file.
Functions | |
bool | print_code_static_control (const string) |
cproto-generated files More... | |
text | text_static_control (entity, int, statement) |
text | store_sc_text_line (static_control) |
================================================================ More... | |
cons * | words_test_list (list) |
================================================================ More... | |
cons * | words_loop_list (list) |
================================================================ More... | |
list | words_entity_list (list) |
================================================================ More... | |
static_control | static_controlize_call (call) |
================================================================ More... | |
static_control | static_controlize_loop (loop) |
================================================================= More... | |
static_control | static_controlize_forloop (forloop) |
================================================================= More... | |
static_control | static_controlize_whileloop (whileloop) |
================================================================= More... | |
static_control | static_controlize_statement (statement) |
static_control | static_controlize_unstructured (unstructured) |
================================================================= More... | |
bool | static_controlize (string) |
================================================================= More... | |
list | loop_normalize_of_loop (loop, hash_table, list *, list *, list *, int *) |
================================================================= More... | |
list | loop_normalize_of_statement (statement, hash_table, list *, list *, list *, int *) |
================================================================= More... | |
void | loop_normalize_of_unstructured (unstructured, hash_table, list *, list *, list *, int *) |
================================================================= More... | |
list | stco_same_loops (statement_mapping, statement, statement) |
utils.c More... | |
int | stco_renumber_code (statement, int) |
================================================================ More... | |
expression | sc_opposite_exp_of_conjunction (expression, list *) |
================================================================ More... | |
bool | splc_positive_relation_p (expression, list *) |
================================================================ More... | |
list | ndf_normalized_test (expression, list *) |
================================================================ More... | |
expression | normalize_test_leaves (expression, list *) |
================================================================ More... | |
expression | sc_conditional (expression, list *) |
================================================================ More... | |
list | loops_to_indices (list) |
================================================================ More... | |
bool | splc_linear_expression_p (expression, list *) |
================================================================ More... | |
bool | splc_linear_expression_list_p (list, list *) |
================================================================ More... | |
bool | splc_linear_access_to_arrays_p (list, list *) |
================================================================ More... | |
string | print_structurals (list) |
================================================================ More... | |
list | sc_list_of_exp_dup (list) |
================================================================ More... | |
list | sc_list_of_entity_dup (list) |
================================================================ More... | |
list | sc_list_of_loop_dup (list) |
================================================================ More... | |
loop | sc_loop_dup (loop) |
================================================================ More... | |
list | make_undefined_list (void) |
================================================================ More... | |
int | in_forward_defined (entity, list *) |
================================================================ More... | |
bool | in_forward_defined_p (entity, list *) |
================================================================ More... | |
void | verify_structural_parameters (list, list *) |
================================================================ More... | |
list | sc_entity_to_formal_integer_parameters (entity) |
================================================================ More... | |
bool | sp_linear_expression_p (expression) |
================================================================ More... | |
bool | splc_feautrier_expression_p (expression, list *) |
================================================================ More... | |
bool | sp_feautrier_expression_p (expression) |
================================================================ More... | |
entity | sp_feautrier_scalar_assign_call (call) |
================================================================ More... | |
bool | get_sp_of_call_p (call, hash_table, list *) |
================================================================ More... | |
void | forward_substitute_in_anyloop (void *, hash_table) |
void | forward_substitute_in_exp (expression *, hash_table) |
void | forward_substitute_in_call (call *, hash_table) |
bool | normalizable_loop_p (loop) |
bool normalizable_loop_p(loop l) Returns true if "l" has a constant step. More... | |
bool | normalizable_loop_p_retrieved (loop) |
Code retrieved from revision 14476, transformations/loop_normalize.c. More... | |
bool | is_expression_in_list (expression, list) |
State if an expression OR part of that expression corresponds to one of the entity of the list l. More... | |
bool | get_reference_assignments (statement, list *) |
Allows the static_controlize phase to keep and update a list containing all the variables of the program assigned directly or indirectly by an array. More... | |
Variables | |
int | Gcount_nlc |
int | Gcount_nsp |
================================================================ More... | |
int | Gcount_nub |
list | Gstructure_parameters |
static_controlize.c More... | |
statement_mapping | Gstatic_control_map |
list | assigned_var |
================================================================= More... | |
#define ENTITY_AND give_entity(AND_OPERATOR_NAME) |
Definition at line 47 of file static_controlize.h.
#define ENTITY_EQ give_entity(EQUAL_OPERATOR_NAME) |
Definition at line 44 of file static_controlize.h.
#define ENTITY_GE give_entity(GREATER_OR_EQUAL_OPERATOR_NAME) |
Definition at line 39 of file static_controlize.h.
#define ENTITY_GT give_entity(GREATER_THAN_OPERATOR_NAME) |
Definition at line 40 of file static_controlize.h.
#define ENTITY_LE give_entity(LESS_OR_EQUAL_OPERATOR_NAME) |
Definition at line 41 of file static_controlize.h.
#define ENTITY_LT give_entity(LESS_THAN_OPERATOR_NAME) |
Definition at line 42 of file static_controlize.h.
#define ENTITY_NE give_entity(NOT_EQUAL_OPERATOR_NAME) |
Definition at line 45 of file static_controlize.h.
#define ENTITY_NLC_P | ( | e | ) | (strncmp(entity_local_name(e), NLC_PREFIX, 3) == 0) |
Definition at line 49 of file static_controlize.h.
#define ENTITY_NOT give_entity(NOT_OPERATOR_NAME) |
Definition at line 43 of file static_controlize.h.
#define ENTITY_NSP_P | ( | e | ) | (strncmp(entity_local_name(e), NSP_PREFIX, 3) == 0) |
Definition at line 50 of file static_controlize.h.
#define ENTITY_NUB_P | ( | e | ) | (strcmp(entity_local_name(e), NUB_PREFIX, 3) == 0) |
Definition at line 51 of file static_controlize.h.
#define ENTITY_OR give_entity(OR_OPERATOR_NAME) |
Definition at line 46 of file static_controlize.h.
#define ENTITY_SP_P | ( | ent | ) | (gen_find_eq(ent, Gstructure_parameters) != chunk_undefined) |
Definition at line 52 of file static_controlize.h.
#define ENTITY_STRICT_LOGICAL_OPERATOR_P | ( | e | ) |
Definition at line 54 of file static_controlize.h.
#define give_entity | ( | n | ) |
Definition at line 37 of file static_controlize.h.
#define NLC_PREFIX "NLC" |
Definition at line 33 of file static_controlize.h.
#define NSP_PREFIX "NSP" |
Definition at line 34 of file static_controlize.h.
#define NUB_PREFIX "NUB" |
Definition at line 35 of file static_controlize.h.
#define STATIC_CONTROLIZE_MODULE_NAME "STATCON" |
Warning! Do not modify this file that is automatically generated!
Modify src/Libs/static_controlize/static_controlize-local.h instead, to add your own modifications. header file built by cproto static_controlize-local.h
Definition at line 32 of file static_controlize.h.
void forward_substitute_in_anyloop | ( | void * | pl, |
hash_table | fst | ||
) |
Would it be better to loop over with HASH_MAP or to check every reference?
pl | l |
fst | st |
Definition at line 1139 of file utils.c.
References expression_domain, gen_context_multi_recurse(), gen_true(), pl, and substitute_variable_by_expression().
Referenced by loop_normalize_of_statement(), and static_controlize_statement().
void forward_substitute_in_call | ( | call * | pc, |
hash_table | fst | ||
) |
Would it be better to loop over with HASH_MAP or to check every reference?
pc | c |
fst | st |
Definition at line 1157 of file utils.c.
References call_consistent_p(), expression_domain, gen_context_multi_recurse(), gen_true(), pips_assert, and substitute_variable_by_expression().
Referenced by loop_normalize_of_statement(), and static_controlize_statement().
void forward_substitute_in_exp | ( | expression * | pe, |
hash_table | fst | ||
) |
Would it be better to loop over with HASH_MAP or to check every reference?
pe | e |
fst | st |
Definition at line 1148 of file utils.c.
References expression_domain, gen_context_multi_recurse(), gen_true(), and substitute_variable_by_expression().
Referenced by adg_dataflowgraph(), loop_normalize_of_statement(), and static_controlize_statement().
Allows the static_controlize phase to keep and update a list containing all the variables of the program assigned directly or indirectly by an array.
Definition at line 1300 of file utils.c.
References assignment_statement_p(), call_arguments, CDR, chunk_undefined, entity_undefined_p, expression_syntax, expression_to_entity(), gen_car(), gen_cons(), gen_find_eq(), instruction_call, instruction_call_p, is_expression_in_list(), NIL, reference_indices, sp_feautrier_scalar_assign_call(), statement_instruction, syntax_reference, and syntax_reference_p.
Referenced by static_controlize_statement().
bool get_sp_of_call_p | ( | call | c, |
hash_table | fst, | ||
list * | swfl | ||
) |
================================================================
bool get_sp_of_call_p( (call) c, fst) AL 04/93 Updates the global variables Gstructure_parameters and Gforward_substitute_table according to the type of call. Returns true if the call has to be modified (redefinition of a structural parameter), false in all the other cases.
AP, sep 95 : Gforward_substitute_table is no longer a global variable, we pass it as an argument.
I: not too sure about the false parameter...
fst | st |
swfl | bool get_sp_of_call_p( (call) c, fst) AL 04/93 Updates the global variables Gstructure_parameters and Gforward_substitute_table according to the type of call. Returns true if the call has to be modified (redefinition of a structural parameter), false in all the other cases. |
AP, sep 95 : Gforward_substitute_table is no longer a global variable, we pass it as an argument. forward substitute table
Definition at line 1056 of file utils.c.
References ADD_ELEMENT_TO_LIST, call_arguments, call_function, CAR, ENTITY, ENTITY_READ_P, ENTITY_SP_P, entity_undefined, exp, EXPRESSION, expression_int_scalar(), Gstructure_parameters, hash_put(), in_forward_defined(), in_forward_defined_p(), make_entity_expression(), make_nsp_entity(), MAPL, NIL, pips_debug, print_structurals(), sp_feautrier_scalar_assign_call(), Words_Regular_Call(), and words_to_string().
================================================================
int in_forward_defined( (entity) ent ) AL 30/08/93 Returns the number of entities ent in the list Gscalar_written_forward.
ent | nt |
swfl | wfl |
Definition at line 836 of file utils.c.
References CAR, cons::cdr, NIL, and pips_debug.
Referenced by get_sp_of_call_p().
================================================================
bool in_forward_defined_p( (entity) ent ) AL 04/93 Returns true if ent is in global variable Gscalar_written_forward.
ent | nt |
swfl | wfl |
Definition at line 855 of file utils.c.
References entity_undefined, gen_find_eq(), pips_debug, and print_structurals().
Referenced by get_sp_of_call_p().
bool is_expression_in_list | ( | expression | exp, |
list | l | ||
) |
State if an expression OR part of that expression corresponds to one of the entity of the list l.
This function was specifically designed in order to find if an expression is using one of the variable/entity listed in l. The function considers that the list only contains scalar variables.
exp | xp |
Definition at line 1200 of file utils.c.
References application_arguments, application_function, call_arguments, cast_expression, chunk_undefined, exp, expression_syntax, expression_to_entity(), FOREACH, gen_find_eq(), is_expression_in_list(), is_syntax_application, is_syntax_call, is_syntax_cast, is_syntax_range, is_syntax_reference, is_syntax_sizeofexpression, is_syntax_subscript, is_syntax_va_arg, NIL, range_increment, range_lower, range_upper, ref, reference_indices, reference_variable, sizeofexpression_expression, subscript_array, subscript_indices, syntax_application, syntax_call, syntax_cast, syntax_range, syntax_reference, syntax_sizeofexpression, syntax_subscript, syntax_tag, and syntax_va_arg.
Referenced by get_reference_assignments(), and is_expression_in_list().
list loop_normalize_of_loop | ( | loop | l, |
hash_table | fst, | ||
list * | ell, | ||
list * | etl, | ||
list * | swfl, | ||
int * | Gcount_nlc | ||
) |
=================================================================
================================================================= list loop_normalize_of_loop((loop) l, hash_table fst, list *ell, *etl, *swfl, int *Gcount_nlc) AL 04/93
FI/SG Question: why change the loop index when it is not necessary? To have a uniform behavior when it is necessary?
loop_body( l ) = make_block_with_stmt( loop_body( l ));
If it is not a constant step, we just normalize the loop body
new upper bound, or at least iteration count
Generate the new loop index and the new loop bounds
assume C
Generate the change of basis expression: the new index starts at 0 in C and 1 in Fortran:
old_index = rl + (new_index * ri) // C
old_index = rl + (new_index * ri) - ri // Fortran
Compute the value of the index when the loop is exited: exp_max
nub3 is not used any longer
FI: Why copy nub? it does not seem used anywhere else.
fst | st |
ell | ================================================================= list loop_normalize_of_loop((loop) l, hash_table fst, list *ell, *etl, *swfl, int *Gcount_nlc) AL 04/93 |
FI/SG Question: why change the loop index when it is not necessary? To have a uniform behavior when it is necessary? forward substitute table
etl | ================================================================= list loop_normalize_of_loop((loop) l, hash_table fst, list *ell, *etl, *swfl, int *Gcount_nlc) AL 04/93 |
FI/SG Question: why change the loop index when it is not necessary? To have a uniform behavior when it is necessary? enclosing loops list
swfl | ================================================================= list loop_normalize_of_loop((loop) l, hash_table fst, list *ell, *etl, *swfl, int *Gcount_nlc) AL 04/93 |
FI/SG Question: why change the loop index when it is not necessary? To have a uniform behavior when it is necessary? enclosing tests list
Gcount_nlc | ================================================================= list loop_normalize_of_loop((loop) l, hash_table fst, list *ell, *etl, *swfl, int *Gcount_nlc) AL 04/93 |
FI/SG Question: why change the loop index when it is not necessary? To have a uniform behavior when it is necessary? scalar written forward list
Definition at line 616 of file static_controlize.c.
References ADD_ELEMENT_TO_LIST, copy_expression(), DIVIDE_OPERATOR_NAME, ENTITY, entity_domain, entity_empty_label(), expression_constant_p(), expression_to_int(), expression_undefined, fortran_module_p(), Gcount_nlc, gen_find_tabulated(), get_current_module_entity(), hash_del(), hash_put(), int_to_expression(), loop_body, loop_index, loop_label, loop_normalize_of_statement(), loop_range, make_assign_statement(), make_block_with_stmt_if_not_already(), make_continue_statement(), make_entity_expression(), make_entity_fullname(), make_max_exp(), make_nlc_entity(), make_op_exp(), make_undefined_list(), MAX_OPERATOR_NAME, MINUS_OPERATOR_NAME, MULTIPLY_OPERATOR_NAME, NIL, normalizable_loop_p(), pips_debug, PLUS_OPERATOR_NAME, range_increment, range_lower, range_upper, STATEMENT, statement_undefined, stmt_list, and TOP_LEVEL_MODULE_NAME.
Referenced by loop_normalize_of_statement().
list loop_normalize_of_statement | ( | statement | s, |
hash_table | fst, | ||
list * | ell, | ||
list * | etl, | ||
list * | swfl, | ||
int * | Gcount_nlc | ||
) |
=================================================================
list loop_normalize_of_statement(statement s, hash_table fst, list *ell, *etl, *swfl, int *Gcount_nlc): Normalization of a statement.
Before walking down the statements, we forward-substitute the new-loop-counters on each type of statements. We then return a list of two statements to be put before and after statement 's'. These two new statements are generated by loops when they are treated. See document for more detail, section : "Normalisation des boucles".
est_true(t) = make_block_with_stmt( test_true(t) );
test_false(t) = make_block_with_stmt( test_false(t) );
fst | st |
ell | list loop_normalize_of_statement(statement s, hash_table fst, list *ell, *etl, *swfl, int *Gcount_nlc): Normalization of a statement. |
Before walking down the statements, we forward-substitute the new-loop-counters on each type of statements. We then return a list of two statements to be put before and after statement 's'. These two new statements are generated by loops when they are treated. See document for more detail, section : "Normalisation des boucles". forward substitute table
etl | list loop_normalize_of_statement(statement s, hash_table fst, list *ell, *etl, *swfl, int *Gcount_nlc): Normalization of a statement. |
Before walking down the statements, we forward-substitute the new-loop-counters on each type of statements. We then return a list of two statements to be put before and after statement 's'. These two new statements are generated by loops when they are treated. See document for more detail, section : "Normalisation des boucles". enclosing loops list
swfl | list loop_normalize_of_statement(statement s, hash_table fst, list *ell, *etl, *swfl, int *Gcount_nlc): Normalization of a statement. |
Before walking down the statements, we forward-substitute the new-loop-counters on each type of statements. We then return a list of two statements to be put before and after statement 's'. These two new statements are generated by loops when they are treated. See document for more detail, section : "Normalisation des boucles". enclosing tests list
Gcount_nlc | list loop_normalize_of_statement(statement s, hash_table fst, list *ell, *etl, *swfl, int *Gcount_nlc): Normalization of a statement. |
Before walking down the statements, we forward-substitute the new-loop-counters on each type of statements. We then return a list of two statements to be put before and after statement 's'. These two new statements are generated by loops when they are treated. See document for more detail, section : "Normalisation des boucles". scalar written forward list
Definition at line 750 of file static_controlize.c.
References ADD_ELEMENT_TO_LIST, CAR, CDR, EXPRESSION, forward_substitute_in_anyloop(), forward_substitute_in_call(), forward_substitute_in_exp(), Gcount_nlc, gen_remove(), instruction_block, instruction_call, instruction_loop, instruction_tag, instruction_test, instruction_unstructured, is_instruction_block, is_instruction_call, is_instruction_goto, is_instruction_loop, is_instruction_test, is_instruction_unstructured, LOOP, loop_normalize_of_loop(), loop_normalize_of_unstructured(), make_block_with_stmt_if_not_already(), make_undefined_list(), NIL, pips_assert, pips_debug, pips_internal_error, scalar_written_in_call(), STATEMENT, statement_consistent_p(), statement_instruction, statement_undefined, test_condition, test_false, and test_true.
Referenced by loop_normalize_of_loop(), and loop_normalize_of_unstructured().
void loop_normalize_of_unstructured | ( | unstructured | u, |
hash_table | fst, | ||
list * | ell, | ||
list * | etl, | ||
list * | swfl, | ||
int * | Gcount_nlc | ||
) |
=================================================================
void loop_normalize_of_unstructured(unstructured u, fst): Normalization of an unstructured instruction.
tmt = make_block_with_stmt( stmt );
fst | st |
ell | void loop_normalize_of_unstructured(unstructured u, fst): Normalization of an unstructured instruction. forward substitute table |
etl | void loop_normalize_of_unstructured(unstructured u, fst): Normalization of an unstructured instruction. enclosing loops list |
swfl | void loop_normalize_of_unstructured(unstructured u, fst): Normalization of an unstructured instruction. enclosing tests list |
Gcount_nlc | void loop_normalize_of_unstructured(unstructured u, fst): Normalization of an unstructured instruction. scalar written forward list |
Definition at line 845 of file static_controlize.c.
References ADD_ELEMENT_TO_LIST, CAR, CDR, CONTROL, control_map_get_blocs(), control_statement, Gcount_nlc, gen_free_list(), gen_nreverse(), instruction_block, loop_normalize_of_statement(), make_block_with_stmt_if_not_already(), NIL, pips_debug, STATEMENT, statement_instruction, statement_undefined, undefined_statement_list_p(), and unstructured_control.
Referenced by loop_normalize_of_statement().
================================================================
list loops_to_indices((loop) l ) AL 04/93 Returns indices of the loop -list l.
Definition at line 630 of file utils.c.
References ADD_ELEMENT_TO_LIST, CAR, ENTITY, LOOP, loop_index, MAPL, NIL, and pips_debug.
Referenced by splc_linear_expression_p().
list make_undefined_list | ( | void | ) |
================================================================
list make_undefined_list( ) AL 04/93 Duplicates a list of 2 undefined statements.
FI: this is no longer possible. List elements must be defined. Maybe empty/nop statements could be used instead?
Definition at line 815 of file utils.c.
References ADD_ELEMENT_TO_LIST, entity_empty_label(), make_continue_statement(), NIL, pips_debug, and STATEMENT.
Referenced by loop_normalize_of_loop(), and loop_normalize_of_statement().
list ndf_normalized_test | ( | expression | exp, |
list * | ell | ||
) |
================================================================
list ndf_normalized_test( (expression) exp, (list) *ell) AL 04/93 Returns a list of positive linear forms from an input expression which is a logical combinaison of affine forms of structural parameters and of loop counters.
Redon FND propagation : see document.
We propagate an Exclusive Normal Disjunctive Form
if (ENTITY_OR_P( fun )) { list not_l1, not_l2, l1, l2;
l1 = ndf_normalized_test(arg1, ell); l2 = ndf_normalized_test( arg2, ell); not_l1 = ndf_normalized_test( MakeUnaryCall(ENTITY_NOT, arg1), ell ); not_l2 = ndf_normalized_test( MakeUnaryCall(ENTITY_NOT, arg2), ell );
MAPL( exp_ptr, { expression S1 = EXPRESSION(CAR( exp_ptr )); MAPL( exp_ptr2, { expression T1 = EXPRESSION(CAR( exp_ptr )); ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, MakeBinaryCall( ENTITY_AND, S1, T1 ) ); }, l2); }, not_l1 );
MAPL( exp_ptr, { expression S1 = EXPRESSION(CAR( exp_ptr )); MAPL( exp_ptr2, { expression T1 = EXPRESSION(CAR( exp_ptr )); ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, MakeBinaryCall( ENTITY_AND, S1, T1 ) ); }, l2); }, l1 );
MAPL( exp_ptr, { expression S1 = EXPRESSION(CAR( exp_ptr )); MAPL( exp_ptr2, { expression T1 = EXPRESSION(CAR( exp_ptr )); ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, MakeBinaryCall( ENTITY_AND, S1, T1 ) ); }, not_l2); }, l1 );
return( ret_list ); }
exp | xp |
ell | ll |
Definition at line 306 of file utils.c.
References ADD_ELEMENT_TO_LIST, call_arguments, call_function, CAR, CDR, copy_expression(), ENDP, ENTITY_AND, ENTITY_AND_P, ENTITY_GE, ENTITY_NOT_P, ENTITY_OR_P, exp, EXPRESSION, expression_syntax, expression_to_string(), expression_undefined, int_to_expression(), is_syntax_call, make_op_exp(), MakeBinaryCall(), MAPL, MINUS_OPERATOR_NAME, ndf_normalized_test(), NIL, pips_debug, sc_opposite_exp_of_conjunction(), splc_positive_relation_p(), syntax_call, and syntax_tag.
Referenced by ndf_normalized_test(), and sc_conditional().
bool normalizable_loop_p(loop l) Returns true if "l" has a constant step.
Definition at line 1172 of file utils.c.
References expression_constant_p(), loop_range, pips_debug, and range_increment.
Referenced by loop_normalize_of_loop().
Code retrieved from revision 14476, transformations/loop_normalize.c.
Code to be retrieved: I suppose you need a constant increment?
Definition at line 1183 of file utils.c.
References loop_index, loop_range, normalizable_and_linear_loop_p(), and ok.
expression normalize_test_leaves | ( | expression | exp, |
list * | ell | ||
) |
================================================================
expression normalize_test_leaves((expression) exp, (list) *ell) AL 04/93 If exp is linear in structurals and loop-counters, it returns the same expression with linear positive forms
We return expression_undefined if we can not normalize
exp | xp |
ell | ll |
Definition at line 445 of file utils.c.
References ADD_ELEMENT_TO_LIST, call_arguments, call_function, CAR, CDR, copy_expression(), ENTITY_AND, ENTITY_EQUAL_P, ENTITY_EQUIV_P, ENTITY_GE, ENTITY_GREATER_OR_EQUAL_P, ENTITY_GREATER_THAN_P, ENTITY_LESS_OR_EQUAL_P, ENTITY_LESS_THAN_P, ENTITY_NON_EQUAL_P, ENTITY_NON_EQUIV_P, ENTITY_NOT, ENTITY_NOT_P, ENTITY_OR, ENTITY_RELATIONAL_OPERATOR_P, ENTITY_STRICT_LOGICAL_OPERATOR_P, exp, EXPRESSION, expression_syntax, expression_to_string(), expression_undefined, int_to_expression(), is_syntax_call, make_op_exp(), MakeBinaryCall(), MakeUnaryCall(), MAPL, MINUS_OPERATOR_NAME, NIL, normalize_test_leaves(), pips_debug, splc_linear_expression_p(), syntax_call, and syntax_tag.
Referenced by normalize_test_leaves(), and sc_conditional().
cproto-generated files
prettyprint.c
cproto-generated files
void print_code_static_control((char*) module_name) AL 05/93 Prettyprints a static_control mapping attached to a module_name.
module_name | odule_name |
Definition at line 87 of file prettyprint.c.
References close_prettyprint(), CODE_WITH_STATIC_CONTROLIZE_EXT, db_get_memory_resource(), debug_off, debug_on, Gsc_map, ifdebug, init_prettyprint(), local_name_to_top_level_entity(), make_text(), make_text_resource(), MERGE_TEXTS, module, module_name(), NIL, text_module(), text_static_control(), and user_log().
================================================================
char* print_structurals( (list) l ) AL 04/93 Prints structural parameters.
Definition at line 732 of file utils.c.
References strdup(), words_entity_list(), and words_to_string().
Referenced by get_sp_of_call_p(), in_forward_defined_p(), static_controlize(), static_controlize_statement(), static_controlize_unstructured(), and verify_structural_parameters().
expression sc_conditional | ( | expression | exp, |
list * | ell | ||
) |
================================================================
expression sc_conditional( (expression) exp, (list) *ell ) AL 04/93 If exp is linear in structurals and loop-counters, it returns the same expression with a normal disjunctive form.
exp | xp |
ell | ll |
Definition at line 596 of file utils.c.
References CAR, CDR, copy_expression(), ENTITY_OR, exp, EXPRESSION, expression_syntax, expression_to_string(), expression_undefined, is_syntax_call, MakeBinaryCall(), MAPL, ndf_normalized_test(), NIL, normalize_test_leaves(), pips_debug, and syntax_tag.
Referenced by static_controlize_statement().
================================================================
list sc_entity_to_formal_integer_parameters((entity) f) This is a strict copy of entity_to_formal_integer_parameters from semantics/interprocedural.c . This function is copied here to keep locality of local functions to each pass.
FI: Well, but it was modified to handle all integer scalar variables and a bug was added because a COMMON has a RAM storage (OK, this could be discussed). I add a test on type_variable_p()
Definition at line 900 of file utils.c.
References CAR, code_declarations, CONS, ENTITY, entity_code(), entity_integer_scalar_p(), entity_module_p(), entity_storage, entity_type, f(), MAPL, NIL, pips_assert, storage_formal_p, storage_ram_p, and type_variable_p.
Referenced by static_controlize().
================================================================
list sc_list_of_entity_dup( (list) l ) AL 04/93 Duplicates a list of entities.
Definition at line 761 of file utils.c.
References ADD_ELEMENT_TO_LIST, CAR, ENTITY, MAPL, NIL, and pips_debug.
Referenced by static_controlize_call(), static_controlize_statement(), and static_controlize_unstructured().
================================================================
list sc_list_of_exp_dup( (list) l ) AL 04/93 Duplicates a list of expressions.
Definition at line 741 of file utils.c.
References ADD_ELEMENT_TO_LIST, CAR, copy_expression(), ENDP, exp, EXPRESSION, NIL, pips_debug, and POP.
Referenced by static_controlize_call(), static_controlize_statement(), and static_controlize_unstructured().
================================================================
list sc_list_of_loop_dup( (list) l ) AL 04/93 Duplicates a list of loops. See Newgen gen_copy_seq()?
Definition at line 778 of file utils.c.
References ADD_ELEMENT_TO_LIST, CAR, LOOP, MAPL, NIL, and pips_debug.
Referenced by static_controlize_statement(), and static_controlize_unstructured().
================================================================
list sc_loop_dup( (list) l ) AL 04/93 Duplicates a loop with sharing of the loop_body and sharing of the loop locals.
Definition at line 796 of file utils.c.
References copy_range(), loop_body, loop_execution, loop_index, loop_label, loop_locals, loop_range, make_loop(), and pips_debug.
expression sc_opposite_exp_of_conjunction | ( | expression | exp, |
list * | ell | ||
) |
================================================================
expression sc_opposite_exp_of_conjunction(expression exp, (list) *ell) AL 08/19/93 Input : exp a conjunction of linear expressions Output : simplified value of NOT( exp )
exp | xp |
ell | ll |
Definition at line 236 of file utils.c.
References call_arguments, call_function, CAR, CDR, ENTITY_AND_P, ENTITY_GE, ENTITY_OR, exp, EXPRESSION, expression_syntax, expression_undefined, int_to_expression(), is_syntax_call, make_op_exp(), MakeBinaryCall(), MINUS_OPERATOR_NAME, NIL, pips_debug, sc_opposite_exp_of_conjunction(), splc_positive_relation_p(), syntax_call, and syntax_tag.
Referenced by ndf_normalized_test(), and sc_opposite_exp_of_conjunction().
bool sp_feautrier_expression_p | ( | expression | exp | ) |
================================================================
bool sp_feautrier_expression_p( (expression) exp) Returns true if exp quasi affine form.
exp | xp |
Definition at line 995 of file utils.c.
References call_arguments, call_function, CAR, CDR, ENTITY_DIVIDE_P, exp, EXPRESSION, expression_constant_p(), expression_syntax, expression_to_string(), expression_undefined, is_syntax_call, pips_debug, sp_feautrier_expression_p(), sp_linear_expression_p(), syntax_call, and syntax_tag.
Referenced by sp_feautrier_expression_p(), sp_feautrier_scalar_assign_call(), and static_controlize_statement().
================================================================
entity sp_feautrier_scalar_assign_call( (call) c ) Returns the left-hand-side entity if it is an assignement of a linear combinaison of structural parameters.
Definition at line 1029 of file utils.c.
References call_arguments, CAR, CDR, entity_name, entity_undefined, EXPRESSION, pips_debug, scalar_assign_call(), and sp_feautrier_expression_p().
Referenced by get_reference_assignments(), and get_sp_of_call_p().
bool sp_linear_expression_p | ( | expression | exp | ) |
================================================================
bool sp_linear_expression_p( (expression) exp) Returns true if the expression is a linear combinaison of structural parameters.
exp | xp |
Definition at line 928 of file utils.c.
References ENTITY_SP_P, exp, expression_normalized, expression_to_string(), is_normalized_complex, NORMALIZE_EXPRESSION, normalized_linear, normalized_tag, pips_debug, Svecteur::succ, term_cst, unnormalize_expression(), Svecteur::var, and VECTEUR_NUL_P.
Referenced by sp_feautrier_expression_p().
bool splc_feautrier_expression_p | ( | expression | exp, |
list * | ell | ||
) |
================================================================
bool splc_feautrier_expression_p( (expression) exp ) Returns true if exp quasi affine form in structural parameters and in surrounding loop-counters.
exp | xp |
ell | ll |
Definition at line 962 of file utils.c.
References call_arguments, call_function, CAR, CDR, ENTITY_DIVIDE_P, exp, EXPRESSION, expression_constant_p(), expression_syntax, expression_to_string(), expression_undefined, is_syntax_call, pips_debug, splc_feautrier_expression_p(), splc_linear_expression_p(), syntax_call, and syntax_tag.
Referenced by splc_feautrier_expression_p(), and static_controlize_loop().
================================================================
bool splc_linear_access_to_arrays_p((list) l, (list) *ell) AL 04/93 Returns true if all expressions exp are structural parameters and loop counters linear functions.
ell | ll |
Definition at line 700 of file utils.c.
References call_arguments, CAR, exp, EXPRESSION, expression_syntax, is_syntax_call, is_syntax_reference, MAPL, NIL, pips_debug, reference_indices, splc_linear_access_to_arrays_p(), splc_linear_expression_list_p(), syntax_call, syntax_reference, and syntax_tag.
Referenced by splc_linear_access_to_arrays_p(), and static_controlize_call().
================================================================
bool splc_linear_expression_list_p((list) l) AL 04/93 Returns true if all expressions exp are structural parameters and loop counters linear functions.
ell | ll |
Definition at line 682 of file utils.c.
References CAR, exp, EXPRESSION, MAPL, pips_debug, and splc_linear_expression_p().
Referenced by splc_linear_access_to_arrays_p().
bool splc_linear_expression_p | ( | expression | exp, |
list * | ell | ||
) |
================================================================
bool splc_linear_expression_p((expression) exp) AL 04/93 Returns true if exp is linear in structural parameters and loop counters.
exp | xp |
ell | ll |
Definition at line 648 of file utils.c.
References chunk_undefined, entity_assigned_by_array_p, ENTITY_SP_P, exp, expression_normalized, expression_to_string(), gen_find_eq(), is_normalized_complex, loops_to_indices(), NORMALIZE_EXPRESSION, normalized_linear, normalized_tag, pips_debug, Svecteur::succ, term_cst, unnormalize_expression(), Svecteur::var, and VECTEUR_NUL_P.
Referenced by normalize_test_leaves(), splc_feautrier_expression_p(), splc_linear_expression_list_p(), and splc_positive_relation_p().
bool splc_positive_relation_p | ( | expression | exp, |
list * | ell | ||
) |
================================================================
bool splc_positive_relation_p((expression) exp, list *ell) AL 04/93 Returns true if exp is an affine form of structural parameters and of loop-counters.
exp | xp |
ell | ll |
Definition at line 282 of file utils.c.
References call_arguments, call_function, CAR, CDR, ENTITY_GREATER_OR_EQUAL_P, exp, EXPRESSION, expression_equal_integer_p(), expression_syntax, expression_to_string(), is_syntax_call, pips_debug, splc_linear_expression_p(), syntax_call, and syntax_tag.
Referenced by ndf_normalized_test(), and sc_opposite_exp_of_conjunction().
=================================================================
void static_controlize((char*) mod_name) AL 05/93 Computes the static_control attached to module-name : mod_name.
HAS TO BE REMOVED AS SOON AS POSSIBLE: as the IOs are not treated as they would, all the instructions containing IOs are put inside comments. AP, oct 9th 1995
Normalization of all loops
Modification: loop_normalize_of_statement is used instead of
loop_normalize_of_unstructured since we cannot ensure that
mod_inst is an unstructured –11th Dec 1995, DB
oop_normalize_of_statement(mod_stat, Gforward_substitute_table, &Genclosing_loops, &Genclosing_tests, &Gscalar_written_forward, &Gcount_nlc);
The code has been modified, so the orderings are recomputed.
We compute the static control infos for each instruction.
Same remark as before –DB
mod_name | od_name |
Definition at line 495 of file static_controlize.c.
References assigned_var, code_language, db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, entity_initial, Gcount_nsp, Gcount_nub, gen_free_list(), gen_null(), gen_recurse, Genclosing_loops, Genclosing_tests, Gforward_substitute_table, Gscalar_written_forward, Gstatic_control_map, Gstructure_parameters, hash_pointer, hash_table_make(), hash_warn_on_redefinition(), ifdebug, io_filter(), language_tag, local_name_to_top_level_entity(), MAKE_STATEMENT_MAPPING, mod_stat, module, module_name_to_entity(), module_reorder(), NIL, pips_assert, pips_debug, print_structurals(), reset_current_module_entity(), sc_entity_to_formal_integer_parameters(), set_current_module_entity(), set_prettyprint_language_from_property(), SET_STATEMENT_MAPPING, statement_consistent_p(), statement_domain, statement_instruction, static_control_consistent_p(), static_controlize_statement(), stco_renumber_code(), strdup(), user_log(), value_code, value_code_p, and verify_structural_parameters().
static_control static_controlize_call | ( | call | c | ) |
================================================================
static_control static_controlize_call( (call) c ) AL 05/93 It computes now just a static-control assignement if it is an ASSIGN statement.
_list_of_loop_dup( Genclosing_loops ),
_list_of_loop_dup( Genclosing_loops ),
Definition at line 95 of file static_controlize.c.
References call_arguments, call_function, copy_loops(), entity_initial, entity_local_name(), Genclosing_loops, Genclosing_tests, Gstructure_parameters, make_static_control(), pips_debug, sc_list_of_entity_dup(), sc_list_of_exp_dup(), splc_linear_access_to_arrays_p(), static_control_yes, and value_intrinsic_p.
Referenced by static_controlize_statement().
static_control static_controlize_forloop | ( | forloop | fl | ) |
=================================================================
static_control static_controlize_forloop( (forloop) fl ) It computes the forloop's static_control.
fl | l |
Definition at line 165 of file static_controlize.c.
References forloop_body, Gstatic_control_map, pips_debug, SET_STATEMENT_MAPPING, static_control_yes, and static_controlize_statement().
Referenced by static_controlize_statement().
static_control static_controlize_loop | ( | loop | l | ) |
=================================================================
static_control static_controlize_loop( (loop) l ) It computes the loop's static_control.
Definition at line 135 of file static_controlize.c.
References ADD_ELEMENT_TO_LIST, constant_step_loop_p(), gen_remove(), Genclosing_loops, Gstatic_control_map, LOOP, loop_body, loop_range, pips_debug, range_lower, range_upper, SET_STATEMENT_MAPPING, splc_feautrier_expression_p(), static_control_yes, and static_controlize_statement().
Referenced by static_controlize_statement().
static_control static_controlize_statement | ( | statement | s | ) |
We put condition under a normal disjunctive form
ontinue_statement_p(s) ||
Definition at line 209 of file static_controlize.c.
References ADD_ELEMENT_TO_LIST, assigned_var, call_function, copy_expression(), declaration_statement_p(), ENTITY_NOT, exp, EXPRESSION, expression_undefined, FOREACH, forward_substitute_in_anyloop(), forward_substitute_in_call(), forward_substitute_in_exp(), gen_length(), gen_remove(), Genclosing_loops, Genclosing_tests, get_bool_property(), get_reference_assignments(), Gforward_substitute_table, Gstatic_control_map, Gstructure_parameters, instruction_block, instruction_call, instruction_forloop, instruction_loop, instruction_tag, instruction_test, instruction_unstructured, instruction_whileloop, io_intrinsic_p(), is_instruction_block, is_instruction_call, is_instruction_expression, is_instruction_forloop, is_instruction_goto, is_instruction_loop, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, make_static_control(), MakeUnaryCall(), pips_debug, pips_internal_error, print_structurals(), sc_conditional(), sc_list_of_entity_dup(), sc_list_of_exp_dup(), sc_list_of_loop_dup(), SET_STATEMENT_MAPPING, sp_feautrier_expression_p(), STATEMENT, statement_contains_user_call_p(), statement_instruction, statement_ordering, static_control_yes, static_controlize_call(), static_controlize_forloop(), static_controlize_loop(), static_controlize_unstructured(), static_controlize_whileloop(), test_condition, test_false, and test_true.
Referenced by static_controlize(), static_controlize_forloop(), static_controlize_loop(), static_controlize_unstructured(), and static_controlize_whileloop().
static_control static_controlize_unstructured | ( | unstructured | u | ) |
=================================================================
static_control static_controlize_unstructered((unstructured) u) AL 05/93 Computes an unstructured's static_control
Definition at line 358 of file static_controlize.c.
References CONTROL, control_map_get_blocs(), control_statement, FOREACH, gen_free_list(), gen_length(), gen_nreverse(), Genclosing_loops, Genclosing_tests, Gstatic_control_map, Gstructure_parameters, make_static_control(), NIL, pips_assert, pips_debug, print_structurals(), sc_list_of_entity_dup(), sc_list_of_exp_dup(), sc_list_of_loop_dup(), SET_STATEMENT_MAPPING, statement_consistent_p(), static_control_undefined, static_control_yes, static_controlize_statement(), and unstructured_control.
Referenced by static_controlize_statement().
static_control static_controlize_whileloop | ( | whileloop | wl | ) |
=================================================================
static_control static_controlize_whileloop( (whileloop) l ) It computes the whileloop's static_control.
wl | l |
Definition at line 185 of file static_controlize.c.
References Gstatic_control_map, pips_debug, SET_STATEMENT_MAPPING, static_control_yes, static_controlize_statement(), and whileloop_body.
Referenced by static_controlize_statement().
================================================================
int stco_renumber_code( (statement) in_st, (int) in_ct ) AL 25/10/93 Input : A statement in_st and a begin count number in_ct. Output : Renumber statement_number in an textual order and return the last number attributed.
I've removed many renumbering since it is done by a deeper call to stco_renumber_code() and renumbering sequences kill an assert in the prettyprinter...
Renumber all the statement but the sequence:
in_st | n_st |
in_ct | n_ct |
Definition at line 137 of file utils.c.
References CAR, CONTROL, control_map_get_blocs(), control_statement, count, gen_free_list(), gen_nreverse(), instruction_block, instruction_goto, instruction_loop, instruction_tag, instruction_test, instruction_unstructured, is_instruction_block, is_instruction_call, is_instruction_expression, is_instruction_forloop, is_instruction_goto, is_instruction_loop, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, loop_body, MAPL, NIL, pips_debug, pips_internal_error, STATEMENT, statement_instruction, statement_number, stco_renumber_code(), test_false, test_true, and unstructured_control.
Referenced by static_controlize(), and stco_renumber_code().
list stco_same_loops | ( | statement_mapping | in_map, |
statement | in_s, | ||
statement | in_s2 | ||
) |
utils.c
utils.c
list stco_same_loops( in_map, in_s, in_s2 ) AL 25/10/93 Input : A static_control mapping on statements and 2 statements. Output : A list of loops common to in_s and in_s2.
in_map | n_map |
in_s | n_s |
in_s2 | n_s2 |
Definition at line 98 of file utils.c.
References ADD_ELEMENT_TO_LIST, CAR, ENDP, GET_STATEMENT_MAPPING, LOOP, loop_body, NIL, pips_debug, POP, statement_ordering, and static_control_loops.
Referenced by stco_common_loops_of_statements().
text store_sc_text_line | ( | static_control | sc | ) |
================================================================
text store_sc_text_line((static_control) sc) AL 05/93 Stores a static_control prettyprinted.
pips_assert("store_text_line", sefs_list != NIL);
sc | c |
Definition at line 152 of file prettyprint.c.
References ADD_SENTENCE_TO_TEXT, comment(), concatenate(), get_prettyprint_language_tag(), is_language_c, is_sentence_formatted, make_sentence(), make_text(), NIL, static_control_loops, static_control_params, static_control_tests, static_control_yes, strdup(), words_entity_list(), words_loop_list(), words_test_list(), and words_to_string().
Referenced by text_static_control().
================================================================
void verify_structural_parameters( (list) l ) AL 04/93 Updates the global variable Gstructure_parameters. 'l' is a list of entities, which are structural-parameters candidates. An entity will be a structural parameter if it is a candidate and if it is not written forward.
the_list | he_list |
swfl | wfl |
Definition at line 873 of file utils.c.
References ADD_ELEMENT_TO_LIST, CAR, chunk_undefined, ENTITY, gen_find_eq(), Gstructure_parameters, MAPL, pips_debug, and print_structurals().
Referenced by static_controlize().
================================================================
cons *words_entity_list((list) obj) AL 05/93 Returns a list of strings from a list of entities.
FI: Should be moved in ri-util/entity.c or entities.c when it exists
obj | bj |
Definition at line 265 of file prettyprint.c.
References ADD_ELEMENT_TO_LIST, CHAIN_SWORD, concatenate(), ENTITY, entity_local_name(), FOREACH, NIL, pips_debug, strdup(), and STRING.
Referenced by print_structurals(), and store_sc_text_line().
================================================================
cons *words_loop_list((list) obj) AL 05/93 Returns a list of strings from a list of loops.
obj | bj |
Definition at line 226 of file prettyprint.c.
References CHAIN_SWORD, entity_local_name(), FOREACH, gen_copy_seq(), gen_nconc(), get_prettyprint_language_tag(), is_language_c, LOOP, loop_index, loop_range, NIL, pips_debug, range_lower, range_upper, strdup(), and Words_Expression().
Referenced by store_sc_text_line().
================================================================
cons *words_test_list((list) obj) AL 05/93 Makes a list of strings from a list of test expressions.
obj | bj |
Definition at line 195 of file prettyprint.c.
References CAR, CHAIN_SWORD, exp, EXPRESSION, gen_copy_seq(), gen_nconc(), get_prettyprint_language_tag(), is_language_c, MAPL, NIL, pips_debug, strdup(), and Words_Expression().
Referenced by store_sc_text_line().
|
extern |
=================================================================
static_control static_controlize_statement((statement) s) AL 05/93 Computes s's static_control
Definition at line 207 of file static_controlize.c.
|
extern |
|
extern |
================================================================
Definition at line 158 of file misc_paf_utils.c.
|
extern |
Definition at line 160 of file misc_paf_utils.c.
|
extern |
Definition at line 87 of file static_controlize.c.
Referenced by static_controlize(), static_controlize_forloop(), static_controlize_loop(), static_controlize_statement(), static_controlize_unstructured(), and static_controlize_whileloop().
|
extern |