PIPS
|
it is not unusual to generate a new entity, this helper functions will take care of substituing all referenced to an old entity by reference in new entities More...
Data Structures | |
struct | param |
it is not unusual to generate a new entity, this helper functions will take care of substituing all referenced to an old entity by reference in new entities
void replace_entities | ( | void * | s, |
hash_table | ht | ||
) |
Recursively substitute a set of entities in a statement.
s | newgen type where the substitution must be done |
ht | table of old->new pairs |
Warning: if the intersection between the input and output sets is not empty, the behavior is undefined
ht | t |
Definition at line 91 of file replace.c.
References call_domain, entity_initial, entity_type, expression_domain, gen_context_multi_recurse(), gen_true(), INSTANCE_OF, loop_domain, replace_entities_call_walker(), replace_entities_declaration_walker(), replace_entities_expression_walker(), replace_entities_loop_walker(), statement_domain, value_expression_p, and value_undefined_p.
Referenced by rename_statement_declarations(), replace_entities_declaration_walker(), replace_entity(), slightly_rename_entities(), statement_flatten_declarations(), and sww_seq_rwt().
void replace_entities_by_expression | ( | void * | s, |
hash_table | ht | ||
) |
ht | t |
Definition at line 225 of file replace.c.
References HASH_MAP, and replace_entity_by_expression().
|
static |
Definition at line 33 of file replace.c.
References call_function, hash_get(), and HASH_UNDEFINED_VALUE.
Referenced by replace_entities().
|
static |
Definition at line 23 of file replace.c.
References ENTITY, FOREACH, replace_entities(), and statement_declarations.
Referenced by replace_entities().
|
static |
we need to unormalize the uppermost parent of this expression otherwise its normalized field gets incorrect
otherwise field normalized get wrong
Definition at line 41 of file replace.c.
References entity_constant_p, expression_domain, expression_reference(), expression_reference_p(), gen_get_ancestor(), hash_get(), HASH_UNDEFINED_VALUE, make_call(), make_syntax_call(), NIL, reference_variable, unnormalize_expression(), and update_expression_syntax().
Referenced by replace_entities().
|
static |
Definition at line 64 of file replace.c.
References CAR, ENDP, ENTITY, hash_get(), HASH_UNDEFINED_VALUE, loop_index, loop_locals, and POP.
Referenced by replace_entities().
per variable version of replace_entities.
Much slower if you have an hash table of old/new pairs than the replace_entities version
old | ld |
new | ew |
Definition at line 113 of file replace.c.
References hash_pointer, hash_put(), hash_table_free(), hash_table_make(), and replace_entities().
Referenced by do_kernelize(), do_scalar_renaming_in_successors(), do_scalar_renaming_in_vertex(), do_terapix_argument_handler(), fix_loop_index_sign(), inline_expression_call(), loadstore_type_conversion_string(), make_array_communication_statement(), move_declaration_control_node_declarations_to_statement(), outliner_independent_recursively(), promote_local_entities(), replace_reference(), solve_name_clashes(), statements_localize_declarations(), terapix_loop_handler(), and terapix_optimize_accumulator().
void replace_entity_by_expression | ( | void * | s, |
entity | ent, | ||
expression | exp | ||
) |
replace all reference to entity ent by expression exp in s.
@s can be any newgen type !
ent | nt |
exp | xp |
Definition at line 220 of file replace.c.
References param::ent, exp, gen_true(), and replace_entity_by_expression_with_filter().
Referenced by do_loop_unroll_with_epilogue(), do_loop_unroll_with_prologue(), do_reduction_propagation(), full_loop_unroll(), fusion(), fusion_buffer(), Hierarchical_tiling(), inline_expression_call(), loop_annotate(), make_loadsave_statement(), normalize_microcode(), replace_entities_by_expression(), scalopify(), sesamify(), Tiling2_buffer(), Tiling_buffer_allocation(), and translate_arguments().
|
static |
Definition at line 191 of file replace.c.
References ENTITY, FOREACH, replace_entity_by_expression_entity_walker(), and statement_declarations.
Referenced by replace_entity_by_expression_with_filter().
Definition at line 176 of file replace.c.
References entity_initial, entity_type, expression_domain, gen_context_recurse, gen_true2(), replace_entity_by_expression_expression_walker(), set_add_element(), set_belong_p(), value_expression, value_expression_p, and param::visited_entities.
Referenced by replace_entity_by_expression_declarations_walker(), and replace_entity_by_expression_loop_walker().
|
static |
if both are references , concatenante indices
else generate a subscript
Definition at line 137 of file replace.c.
References call_constant_p, call_function, copy_syntax(), ENDP, param::ent, param::exp, expression_call(), expression_call_p(), expression_reference(), expression_reference_p(), expression_syntax, gen_full_copy_list(), gen_nconc(), indices, make_expression(), make_reference(), make_subscript(), make_syntax_reference(), make_syntax_subscript(), normalized_undefined, reference_indices, reference_variable, same_entity_p(), and update_expression_syntax().
Referenced by replace_entity_by_expression_entity_walker(), and replace_entity_by_expression_with_filter().
Definition at line 199 of file replace.c.
References loop_index, and replace_entity_by_expression_entity_walker().
Referenced by replace_entity_by_expression_with_filter().
void replace_entity_by_expression_with_filter | ( | void * | s, |
entity | ent, | ||
expression | exp, | ||
bool(*)(expression) | filter | ||
) |
ent | nt |
exp | xp |
Definition at line 204 of file replace.c.
References param::ent, exp, expression_domain, gen_context_multi_recurse(), gen_true(), loop_domain, replace_entity_by_expression_declarations_walker(), replace_entity_by_expression_expression_walker(), replace_entity_by_expression_loop_walker(), set_free(), set_make(), set_pointer, statement_domain, and param::visited_entities.
Referenced by do_group_constants_terapix(), and replace_entity_by_expression().
Replace an old reference by a reference to a new entity in a statement.
If the reference is a scalar, it's similar to replace_entity, otherwise, it's replace_entity_by_expression
old | ld |
new | ew |
Definition at line 124 of file replace.c.
References ENDP, pips_internal_error, reference_indices, reference_variable, and replace_entity().
Referenced by add_parameter_variable_to_module(), add_private_variable_to_module(), do_reduction_detection(), and do_reduction_propagation().