PIPS
|
add outlining support to pips, with two flavors More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "effects-util.h"
#include "text.h"
#include "pipsdbm.h"
#include "syntheses.h"
#include "pipsmake.h"
#include "resources.h"
#include "properties.h"
#include "misc.h"
#include "control.h"
#include "callgraph.h"
#include "effects-generic.h"
#include "effects-convex.h"
#include "preprocessor.h"
#include "expressions.h"
#include "text-util.h"
#include "parser_private.h"
#include "accel-util.h"
#include "transformations.h"
Go to the source code of this file.
Data Structures | |
struct | cpv |
struct | ocontext_t |
outlining | |
#define | STAT_ORDER "PRETTYPRINT_STATEMENT_NUMBER" |
static string | outlining_variable_commenter (__attribute__((unused)) entity e) |
static string | outlining_patched_variable_commenter (__attribute__((unused)) entity e) |
static void | get_loop_locals_and_remove_walker (statement st, set s) |
static set | get_loop_locals_and_remove (statement st) |
static set | get_private_entities (statement st) |
try hard to reproduce in / out regions with only loop_locals it is time to move to regions ... More... | |
static bool | skip_values (void *v) |
static bool | skip_constants_intrinsics_members (entity e) |
static void | sort_entities_with_dep (list *l) |
static void | check_private_variables_call_walker (call c, struct cpv *p) |
static bool | check_private_variables_loop_walker (loop l, struct cpv *p) |
static list | private_variables (statement stat) |
static void | do_outliner_smart_replacment (reference r, ocontext_t *ctxt) |
static void | outliner_smart_replacment (statement in, entity old, entity new, size_t nb_dims) |
list | outliner_statements_referenced_entities (list statements) |
outlining.c More... | |
static hash_table | outliner_smart_references_computation (list outlined_statements, entity new_module) |
purge the list of referenced entities by replacing calls to a[i][j] where i is a constant in statements outlined_statements by a call to a single (new) variable More... | |
static list | statements_localize_declarations (list statements, entity module, statement module_statement) |
static void | outliner_extract_loop_bound (statement sloop, hash_table entity_to_effective_parameter) |
static void | convert_pointer_to_array_aux (expression exp, entity e) |
static void | convert_pointer_to_array_aux2 (statement s, entity e) |
static void | convert_pointer_to_array (entity e, entity re, expression x, list statements) |
static void | outline_remove_duplicates (list *entities) |
hash_table | outliner_init (entity new_fun, list statements_to_outline) |
list | outliner_scan (entity new_fun, list statements_to_outline, statement new_body) |
static type | type_to_named_type (type t, entity cu) |
create a new type from given type, eventually renaming unnamed structures inside all new entities generated in the process are added to cu More... | |
bool | is_entity_in_list (entity e, list l) |
Checks if an entity is in a list. More... | |
void | outliner_parameters (entity new_fun, statement new_body, list referenced_entities, hash_table entity_to_effective_parameter, list *effective_parameters_, list *formal_parameters_) |
void | outliner_patch_parameters (list statements_to_outline, list referenced_entities, list effective_parameters, list formal_parameters, statement new_body, statement begin, statement end) |
we need to patch parameters , effective parameters and body in C because parameters are passed by copy in function call it's not needed if More... | |
static void | do_remove_entity_from_private (loop l, entity e) |
static void | do_remove_entity_from_decl (statement s, entity e) |
static void | outliner_compilation_unit (entity new_fun, list formal_parameters __attribute__((unused))) |
static bool | entity_not_undefined_nor_constant_nor_intrinsic_p (entity e) |
static bool | anonymous_type_p (entity e) |
skipping anonymous enum ... More... | |
static entity | recursive_rename_types (entity e, const char *cun) |
static void | outliner_independent_recursively (entity module, const char *cun, statement s) |
static void | outliner_independent (const char *module_name, statement body) |
redeclare all callees of outlined function in the same compilation unit More... | |
void | outliner_file (entity new_fun, list formal_parameters, statement *new_body) |
statement | outliner_call (entity new_fun, list statements_to_outline, list effective_parameters) |
void | remove_from_formal_parameters (list induction_var, list *formal_parameters) |
void | remove_from_effective_parameters (list induction_var, list *effective_parameters) |
void | add_induction_var_to_local_declarations (statement *new_body, list induction_var) |
statement | outliner (const char *outline_module_name, list statements_to_outline) |
outline the statements in statements_to_outline into a module named outline_module_name the outlined statements are replaced by a call to the newly generated module statements_to_outline is modified in place to represent that call More... | |
bool | outline (const string module_name) |
entry point for outline module outlining will be performed using either comment recognition or interactively More... | |
#define STAT_ORDER "PRETTYPRINT_STATEMENT_NUMBER" |
Definition at line 75 of file outlining.c.
new_body | ew_body |
induction_var | nduction_var |
Definition at line 1307 of file outlining.c.
References add_declaration_statement(), FOREACH, outlining_variable_commenter(), pop_generated_variable_commenter(), and push_generated_variable_commenter().
Referenced by outliner_parameters().
skipping anonymous enum ...
Definition at line 943 of file outlining.c.
References DUMMY_STRUCT_PREFIX, DUMMY_UNION_PREFIX, and entity_local_name().
Referenced by outliner_independent_recursively().
Definition at line 169 of file outlining.c.
References cpv::e, gen_recurse_stop(), get_referenced_entities(), cpv::rm, set_belong_p(), and set_free().
Referenced by private_variables().
Definition at line 179 of file outlining.c.
References cpv::e, has_entity_with_same_name(), and loop_locals.
Referenced by private_variables().
|
static |
crado
Definition at line 494 of file outlining.c.
References basic_pointer, cleanup_subscripts(), CONS, convert_pointer_to_array_aux(), convert_pointer_to_array_aux2(), DEREFERENCING_OPERATOR_NAME, entity_intrinsic(), entity_type, EXPRESSION, expression_domain, expression_syntax, FOREACH, free_type(), gen_context_multi_recurse(), gen_true(), make_call(), make_expression(), make_syntax_call(), NIL, normalized_undefined, pointed_type(), STATEMENT, statement_domain, syntax_undefined, type_undefined, type_variable, update_expression_syntax(), variable_basic, and x.
Referenced by outliner_patch_parameters().
|
static |
Definition at line 469 of file outlining.c.
References ADDRESS_OF_OPERATOR_NAME, CONS, entity_intrinsic(), exp, EXPRESSION, expression_reference(), expression_reference_p(), expression_syntax, make_call(), make_expression(), make_syntax_call(), NIL, normalized_undefined, reference_variable, same_entity_p(), syntax_undefined, and update_expression_syntax().
Referenced by convert_pointer_to_array(), and convert_pointer_to_array_aux2().
Definition at line 489 of file outlining.c.
References convert_pointer_to_array_aux(), ENTITY, entity_initial, expression_domain, FOREACH, gen_context_recurse, gen_true2(), and statement_declarations.
Referenced by convert_pointer_to_array().
|
static |
g:may cause issues if basic_pointer_p(old) ?
Definition at line 209 of file outlining.c.
References basic_pointer_p, DEREFERENCING_OPERATOR_NAME, ENDP, entity_basic(), entity_intrinsic(), entity_to_expression(), expression_domain, expression_syntax, gen_full_copy_list(), gen_full_free_list(), gen_get_ancestor(), indices, make_call(), make_expression_list, make_subscript(), make_syntax_call(), make_syntax_subscript(), MakeUnaryCall(), ocontext_t::nb_dims, ocontext_t::new, ocontext_t::old, pips_assert, POP, reference_indices, reference_variable, same_entity_p(), and unnormalize_expression().
Referenced by outliner_smart_replacment().
Definition at line 918 of file outlining.c.
References gen_remove(), and statement_declarations.
Referenced by outliner().
Definition at line 914 of file outlining.c.
References entity_undefined, gen_remove(), loop_index, loop_locals, and same_entity_p().
Referenced by outliner().
Definition at line 937 of file outlining.c.
References entity_not_constant_or_intrinsic_p(), entity_type, and type_undefined_p.
Referenced by outliner_independent_recursively().
Definition at line 105 of file outlining.c.
References gen_context_recurse, gen_true2(), get_loop_locals_and_remove_walker(), set_make(), set_pointer, and statement_domain.
Referenced by get_private_entities().
loop_locals is sometimes too big, mainly due to the way gpu_ify is done ...
validate everything
remove instructions for later processing
Definition at line 77 of file outlining.c.
References ENTITY, FOREACH, free_instruction(), get_referenced_entities(), instruction_undefined, loop_body, loop_index, loop_locals, loop_range, set_add_element(), set_belong_p(), set_free(), set_union(), statement_instruction, statement_loop(), and statement_loop_p().
Referenced by get_loop_locals_and_remove().
try hard to reproduce in / out regions with only loop_locals it is time to move to regions ...
are they stable enough ?
Definition at line 115 of file outlining.c.
References clone(), copy_statement(), free_statement(), get_loop_locals_and_remove(), get_referenced_entities(), set_difference(), and set_free().
Referenced by private_variables().
Checks if an entity is in a list.
Done by comparing the minimal user name.
Definition at line 688 of file outlining.c.
References ENDP, entity_minimal_user_name(), and FOREACH.
Referenced by outliner_parameters().
entry point for outline module outlining will be performed using either comment recognition or interactively
module_name | name of the module containing the statements to outline |
prelude
retrieve name of the outlined module
retrieve statement to outline
apply outlining
validate
ostlude
module_name | odule_name |
Definition at line 1385 of file outlining.c.
References compute_callees(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, empty_string_p(), ENDP, find_statement_from_label_name(), find_statements_interactively(), find_statements_with_pragma(), fortran_module_p(), free(), get_bool_property(), get_current_module_entity(), get_current_module_name(), get_current_module_statement(), get_string_property(), get_string_property_or_ask(), loop_body, make_statement_list, module_name(), module_name_to_entity(), module_reorder(), outliner(), pips_user_error, reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_rw_effects(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_rw_effects(), statement_loop(), statement_loop_p(), statement_to_outline, statement_undefined_p, strdup(), and strupper().
|
static |
Definition at line 531 of file outlining.c.
References CAR, CDR, ENDP, ENTITY, FOREACH, gen_copy_seq(), gen_free_list(), gen_remove_once(), POP, same_entity_lname_p(), and same_entity_p().
Referenced by outliner_scan().
outline the statements in statements_to_outline into a module named outline_module_name the outlined statements are replaced by a call to the newly generated module statements_to_outline is modified in place to represent that call
outline_module_name | name of the new module |
statements_to_outline | is a list of consecutive statements to outline into outline_module_name |
1 : init
pass loop bounds as parameters if required
2 : scan
3 : parameters
4 : patch parameters
5 : file
6 : call
7: remove obsolete entities, this is needed otherwise the IR keeps some obsolete data
outline_module_name | utline_module_name |
statements_to_outline | tatements_to_outline |
Definition at line 1327 of file outlining.c.
References c_module_p(), copy_language(), do_remove_entity_from_decl(), do_remove_entity_from_private(), ENDP, ENTITY, entity_declarations, find_statement_from_label_name(), FOREACH, free_entity(), gen_context_multi_recurse(), gen_free_list(), gen_remove(), gen_true(), get_bool_property(), get_current_module_entity(), get_current_module_name(), get_current_module_statement(), get_string_property(), loop_domain, loop_label, make_block_statement(), make_empty_subroutine(), module_language, NIL, outliner_call(), outliner_extract_loop_bound(), outliner_file(), outliner_init(), outliner_parameters(), outliner_patch_parameters(), outliner_scan(), pips_assert, STATEMENT, statement_domain, statement_loop(), statement_undefined_p, and statements_to_declarations().
Referenced by do_kernelize(), gpu_ify_statement(), gpu_memory_apply(), outline(), outline_stmts_between_pragmas_in_sequence(), scalopragma(), and taskify_statement().
and return the replacement statement
perform substitution : replace the original statements by a single call and patch the remaining statement (yes it's ugly)
trash any extensions|comments, they may not be valid now
new_fun | ew_fun |
statements_to_outline | tatements_to_outline |
effective_parameters | ffective_parameters |
Definition at line 1235 of file outlining.c.
References empty_comments, empty_extensions(), FOREACH, free(), free_extensions(), gen_free_list(), make_call(), make_continue_instruction(), make_instruction_call(), NIL, STATEMENT, statement_comments, statement_declarations, statement_extensions, statement_instruction, statement_undefined, statement_undefined_p, and string_undefined_p.
Referenced by compile_mpi(), and outliner().
|
static |
Definition at line 922 of file outlining.c.
References add_new_compilation_unit(), asprintf, entity_user_name(), FILE_SEP, FILE_SEP_STRING, fortran_module_p(), free(), get_bool_property(), get_current_module_entity(), strdup(), and strndup().
Referenced by outliner_file().
|
static |
Definition at line 453 of file outlining.c.
References basic_of_expression(), basic_overloaded_p, DEFAULT_INTEGER_TYPE_SIZE, entity_intrinsic(), entity_to_expression(), expression_scalar_p, free_basic(), get_current_module_entity(), hash_put(), int_to_expression(), loop_range, make_basic_int(), make_new_scalar_variable(), MakeBinaryCall(), MINUS_OPERATOR_NAME, PLUS_OPERATOR_NAME, range_upper, and statement_loop().
Referenced by outliner().
prepare parameters and body
5-0 : create new compilation unit
5-1 : add all callees to the same foreign compilation units
5-2: fix the types of the formal parameter in case a new compilation unit is used. Make sure that the function type and the types of the formal parameters are consistent. The function type is correct because the compilation unit has just been parsed.
add a return at the end of the body, in all cases
we can now begin the outlining
et_current_module_entity()
horrible hack to prevent declaration duplication signed : Serge Guelton
we need to free them now, otherwise recompilation fails
new_fun | ew_fun |
formal_parameters | ormal_parameters |
new_body | ew_body |
Definition at line 1138 of file outlining.c.
References add_new_module_from_text(), AddEntityToModuleCompilationUnit(), asprintf, c_module_p(), CAR, CDR, code_declarations, compilation_unit_of_module(), CONS, copy_type(), dummy_identifier, ENTITY, entity_initial, entity_type, entity_user_name(), entity_variable_p, EntityCode(), FILE_SEP, FILE_SEP_STRING, find_ith_parameter(), FOREACH, fortran_module_p(), free(), free_text(), free_type(), functional_parameters, gen_free_list(), gen_length(), gen_nconc(), get_bool_property(), get_current_module_entity(), get_current_module_name(), insert_statement(), make_return_statement(), module_functional_parameters, NIL, outliner_compilation_unit(), outliner_independent(), PARAMETER, parameter_dummy, parameter_type, set_bool_property(), STAT_ORDER, strdup(), string_undefined, string_undefined_p, strndup(), text_named_module(), type_equal_p(), type_functional, type_undefined, type_undefined_p, and value_code.
Referenced by compile_mpi(), and outliner().
|
static |
redeclare all callees of outlined function in the same compilation unit
Definition at line 1065 of file outlining.c.
References asprintf, c_module_p(), compilation_unit_parser(), controlizer(), db_delete_resource(), db_get_current_workspace_directory(), db_get_file_resource, db_get_memory_resource(), db_resource_required_or_available_p(), db_touch_resource(), entity_undefined_p, f(), FILE_SEP, FILE_SEP_STRING, FindEntity(), fortran_module_p(), free(), get_bool_property(), get_current_module_entity(), get_current_module_statement(), MakeCompilationUnitEntity(), module_name(), module_name_to_entity(), outliner_independent_recursively(), print_text(), reset_current_module_entity(), reset_current_module_statement(), safe_fclose(), safe_fopen(), set_current_module_entity(), set_current_module_statement(), statement_undefined_p, strdup(), strndup(), text_named_module(), and TOP_LEVEL_MODULE_NAME.
Referenced by outliner_file().
|
static |
first step : bring all typedefs and global declarations with you
special hook for struct member : consider their structure instead of the field
SG : part of this code is duplicated from inlining
enum member cannot be added to declarations
formal parameters are not considered
second step : bring all callers with you
horrible hack to prevent declaration duplication signed : Serge Guelton
Definition at line 959 of file outlining.c.
References add_new_module_from_text(), AddEntityToCompilationUnit(), AddEntityToModuleCompilationUnit(), anonymous_type_p(), asprintf, basic_derived, basic_derived_p, c_module_p(), callees_callees, code_declarations, code_externs, compute_callees(), CONS, copy_statement(), copy_storage(), copy_type(), copy_value(), db_get_memory_resource(), ENTITY, entity_code(), entity_declarations, entity_enum_member_p(), entity_field_p(), entity_field_to_entity_struct_or_union(), entity_formal_p(), entity_initial, entity_local_name(), entity_not_undefined_nor_constant_nor_intrinsic_p(), entity_storage, entity_type, entity_user_name(), EntityCode(), FOREACH, free_callees(), free_statement(), gen_append(), gen_free_list(), gen_true(), get_bool_property(), get_current_module_entity(), get_referenced_entities_filtered(), get_string_property(), has_entity_with_same_name(), language_fortran_p, make_entity, module, module_language, module_name(), module_name_to_entity(), MODULE_SEP_STRING, NIL, pips_internal_error, recursive_rename_types(), replace_entity(), set_add_element(), set_bool_property(), set_dup(), SET_FOREACH, set_free(), set_to_list(), sort_entities_with_dep(), STAT_ORDER, STRING, text_named_module(), top_level_entity_p(), type_supporting_types(), type_variable, typedef_entity_p(), variable_basic, and variable_static_p().
Referenced by outliner_independent().
hash_table outliner_init | ( | entity | new_fun, |
list | statements_to_outline | ||
) |
try to be smart concerning array references
new_fun | ew_fun |
statements_to_outline | tatements_to_outline |
Definition at line 546 of file outlining.c.
References get_bool_property(), hash_pointer, hash_table_make(), and outliner_smart_references_computation().
Referenced by compile_mpi(), and outliner().
void outliner_parameters | ( | entity | new_fun, |
statement | new_body, | ||
list | referenced_entities, | ||
hash_table | entity_to_effective_parameter, | ||
list * | effective_parameters_, | ||
list * | formal_parameters_ | ||
) |
all variables are promoted parameters
this create the dummy parameter
FI: when a new compilation unit is used, why declare type in the initial compilation unit? It generates derived types within the wrong compilation unit... and back fires in the prettyprinter
this adds the effective parameter
this is a constant variable or fortran function result
new_fun | ew_fun |
new_body | ew_body |
referenced_entities | eferenced_entities |
entity_to_effective_parameter | ntity_to_effective_parameter |
effective_parameters_ | ffective_parameters_ |
formal_parameters_ | ormal_parameters_ |
Definition at line 698 of file outlining.c.
References add_induction_var_to_local_declarations(), AddLocalEntityToDeclarations(), clean_enclosing_loops(), CONS, copy_type(), DEFAULT_INTEGER_TYPE_SIZE, ENTITY, entity_constant_p, entity_function_p(), entity_initial, entity_name, entity_storage, entity_symbolic_p, entity_to_expression(), entity_type, entity_user_name(), entity_variable_p, EXPRESSION, FindOrCreateEntity(), FOREACH, fortran_module_p(), functional_result, gen_free_list(), gen_nreverse(), get_bool_property(), get_current_module_entity(), get_variables_to_remove(), hash_get(), hash_table_free(), HASH_UNDEFINED_VALUE, ifdebug, intptr_t, is_entity_in_list(), loops_mapping_of_statement(), make_basic_int(), make_dummy_identifier(), make_formal(), make_mode_reference(), make_mode_value(), make_parameter(), make_storage_formal(), make_type_variable(), make_value_unknown(), make_variable(), module_entity_to_compilation_unit_entity(), NIL, PARAMETER, pips_debug, print_expressions(), print_parameters(), set_enclosing_loops_map(), type_functional, and type_to_named_type().
Referenced by compile_mpi(), and outliner().
void outliner_patch_parameters | ( | list | statements_to_outline, |
list | referenced_entities, | ||
list | effective_parameters, | ||
list | formal_parameters, | ||
statement | new_body, | ||
statement | begin, | ||
statement | end | ||
) |
we need to patch parameters , effective parameters and body in C because parameters are passed by copy in function call it's not needed if
Here a scalar will be passed by address and a prelude/postlude will be used in the outlined module as below :
void new_module( int *scalar_0 ) { int scalar; scalar = *scalar_0; ... // Work on scalar ... *scalar_0 = scalar; }
Note FI: this is also useless when the variable does not appear in the out region of the outlined piece of code. However, the out effets and out regions are not available for every piece of code.
e is no longer a formal parameter, but a local variable
storage eos = entity_storage(e); // e's old storage
pips_assert("eos is a formal storage", storage_formal_p(eos));
formal fs = storage_formal(eos);
entity f = formal_function(fs); // In fact, f is not a function but a variable!
entity a = module_to_dynamic_area(f);
ram r = make_ram(f, a, UNKNOWN_RAM_OFFSET, NIL);
storage ens = make_storage_ram(r);
entity_storage(e) = ens;
free_storage(eos);
statements_to_outline | tatements_to_outline |
referenced_entities | eferenced_entities |
effective_parameters | ffective_parameters |
formal_parameters | ormal_parameters |
new_body | ew_body |
begin | egin |
end | nd |
Definition at line 809 of file outlining.c.
References add_C_variable_to_area(), add_declaration_statement(), ADDRESS_OF_OPERATOR_NAME, array_type_p(), basic_pointer, basic_pointer_p, CAR, CONS, convert_pointer_to_array(), copy_type(), DEREFERENCING_OPERATOR_NAME, DIMENSION, dummy_identifier, end, ENDP, ENTITY, entity_intrinsic(), entity_name, entity_to_expression(), entity_type, entity_undefined, entity_undefined_p, EXPRESSION, expression_reference(), expression_reference_p(), expression_syntax, find_write_effect_on_entity(), FOREACH, gen_append(), ifdebug, insert_statement(), int_to_expression(), make_assign_statement(), make_call(), make_dimension(), make_entity_copy_with_new_name(), make_expression(), make_syntax_call(), MakeUnaryCall(), NIL, normalized_undefined, offset, out, outlining_patched_variable_commenter(), PARAMETER, parameter_dummy, parameter_type, pips_assert, pips_debug, POP, pop_generated_variable_commenter(), print_statement(), push_generated_variable_commenter(), reference_variable, STATEMENT, store_cumulated_rw_effects_list(), the_current_debug_level, type_variable, type_variable_p, variable_basic, variable_dimensions, X, and x.
Referenced by compile_mpi(), and outliner().
Retrieve referenced entities
Retrieve declared entities
get the relative complements and create the parameter list
purge the functions from the parameter list, we assume they are declared externally also purge the formal parameters from other modules, gathered by get_referenced_entities but wrong here
function should be added to compilation unit
fortran function results must be declared in the new function
remove global variables if needed
sort list, and put parameters first
in some rare case, we can have too functions with the same local name
new_fun | ew_fun |
statements_to_outline | tatements_to_outline |
new_body | ew_body |
Definition at line 555 of file outlining.c.
References AddLocalEntityToDeclarations(), compilation_unit_of_module(), CONS, ENTITY, entity_declarations, entity_function_p(), FOREACH, fortran_module_p(), gen_chunk_undefined_p, gen_copy_seq(), gen_find_eq(), gen_free_list(), gen_list_and_not(), gen_nconc(), gen_remove_once(), get_bool_property(), get_current_module_entity(), get_current_module_name(), ifdebug, module_name_to_entity(), NIL, outline_remove_duplicates(), outliner_statements_referenced_entities(), outlining_variable_commenter(), pips_debug, pop_generated_variable_commenter(), print_entities(), push_generated_variable_commenter(), sort_entities_with_dep(), statements_localize_declarations(), statements_to_declarations(), and top_level_entity_p().
Referenced by compile_mpi(), and outliner().
|
static |
purge the list of referenced entities by replacing calls to a[i][j] where i is a constant in statements outlined_statements by a call to a single (new) variable
this will hold new referenced_entities list
first check candidates, that is array entities accessed by a constant index
we are looking for constant index, so only check equalities
it's ok, we can keep on finding constant indices
check for clashes
abort there , we could be smarter
we have gathered a sub array of e that is constant and we know its mode get ready for substitution in the statement
compute new dimensions
Definition at line 291 of file outlining.c.
References action_read_p, action_undefined, action_write_p, ADDRESS_OF_OPERATOR_NAME, CDR, CONS, contrainte_succ, contrainte_vecteur, copy_basic(), ENDP, ENTITY, entity_basic(), entity_intrinsic(), entity_type, entity_user_name(), EXPRESSION, expression_to_entity(), expression_undefined, expression_undefined_p, FOREACH, gen_equals(), gen_free_list(), gen_full_copy_list(), gen_full_free_list(), gen_length(), gen_nreverse(), HASH_DEFAULT_SIZE, hash_pointer, hash_put(), hash_table_make(), int_to_expression(), load_rw_effects_list(), make_basic_pointer(), make_new_array_variable_with_prefix(), make_new_scalar_variable_with_prefix(), make_reference(), make_type_variable(), make_variable(), MakeUnaryCall(), NIL, outliner_smart_replacment(), outliner_statements_referenced_entities(), pips_assert, POP, Pvecteur_to_expression(), reference_indices, reference_to_expression(), reference_variable, REGION, region_action, region_any_reference, region_system, same_entity_p(), same_expression_p(), STATEMENT, type_variable, VALUE_ONE, VALUE_ZERO, variable_dimensions, variable_qualifiers, vect_chg_sgn(), vect_coeff(), vect_del_var(), vect_rm(), and VECTEUR_NUL_P.
Referenced by outliner_init().
|
static |
Definition at line 245 of file outlining.c.
References do_outliner_smart_replacment(), gen_context_recurse, gen_true2(), and reference_domain.
Referenced by outliner_smart_references_computation().
we don't want initial values of outer entities
gather local initial values skipped by the previous call
set to list
statements | tatements |
Definition at line 251 of file outlining.c.
References ENTITY, entity_initial, entity_type, FOREACH, fprintf(), get_referenced_entities_filtered(), ifdebug, NIL, pips_debug, print_entities(), print_statement(), set_free(), set_make(), set_pointer, set_to_list(), set_union(), skip_constants_intrinsics_members(), skip_values(), STATEMENT, and statement_to_declarations().
Referenced by outliner_scan(), outliner_smart_references_computation(), and update_referenced_entities().
|
static |
Definition at line 70 of file outlining.c.
References strdup().
Referenced by outliner_patch_parameters().
|
static |
Definition at line 65 of file outlining.c.
References strdup().
Referenced by add_induction_var_to_local_declarations(), and outliner_scan().
Definition at line 185 of file outlining.c.
References call_domain, check_private_variables_call_walker(), check_private_variables_loop_walker(), CONS, cpv::e, ENTITY, gen_context_multi_recurse(), gen_null(), gen_true(), get_private_entities(), loop_domain, NIL, cpv::rm, SET_FOREACH, and set_free().
Referenced by statements_localize_declarations().
Definition at line 948 of file outlining.c.
References asprintf, entity_domain, entity_local_name(), entity_undefined_p, free(), gen_find_tabulated(), make_entity_copy_with_new_name(), and MODULE_SEP_STRING.
Referenced by outliner_independent_recursively().
induction_var | nduction_var |
effective_parameters | ffective_parameters |
Definition at line 1288 of file outlining.c.
References entity_minimal_user_name(), entity_undefined_p, exp, expression_to_entity(), FOREACH, gen_copy_seq(), gen_free_list(), gen_remove_once(), and printf().
induction_var | nduction_var |
formal_parameters | ormal_parameters |
Definition at line 1268 of file outlining.c.
References dummy_identifier, entity_minimal_user_name(), entity_undefined_p, FOREACH, gen_copy_seq(), gen_free_list(), gen_remove_once(), parameter_dummy, and printf().
Definition at line 129 of file outlining.c.
References entity_not_constant_or_intrinsic_p(), and member_entity_p().
Referenced by outliner_statements_referenced_entities(), and sort_entities_with_dep().
|
static |
Definition at line 125 of file outlining.c.
References INSTANCE_OF.
Referenced by outliner_statements_referenced_entities(), and sort_entities_with_dep().
|
static |
Definition at line 136 of file outlining.c.
References base, compare_entities(), ENTITY, entity_storage, entity_type, FOREACH, gen_free_list(), gen_nconc(), get_referenced_entities_filtered(), params, set_assign_list(), set_del_element(), set_difference(), set_free(), set_make(), set_pointer, set_to_sorted_list(), set_union(), skip_constants_intrinsics_members(), skip_values(), and storage_rom_p.
Referenced by outliner_independent_recursively(), and outliner_scan().
|
static |
We want to declare private variables that are never used else where as locals, but it may not be valid
Definition at line 420 of file outlining.c.
References AddLocalEntityToDeclarations(), compare_entities(), CONS, copy_basic(), ENTITY, entity_basic(), entity_user_name(), FOREACH, formal_parameter_p(), gen_chunk_undefined_p, gen_find_eq(), gen_free_list(), gen_sort_list(), get_bool_property(), make_new_scalar_variable_with_prefix(), module, module_statement, NIL, private_variables(), replace_entity(), STATEMENT, statements_to_declarations(), and top_level_entity_p().
Referenced by outliner_scan().
create a new type from given type, eventually renaming unnamed structures inside all new entities generated in the process are added to cu
create a new named type
Definition at line 631 of file outlining.c.
References AddEntityToCompilationUnit(), asprintf, basic_derived, basic_derived_p, CONS, copy_storage(), copy_type(), copy_value(), DUMMY_STRUCT_PREFIX, DUMMY_UNION_PREFIX, ENTITY, entity_domain, entity_initial, entity_local_name(), entity_name, entity_storage, entity_type, entity_user_name(), FOREACH, free(), gen_chunk_undefined_p, gen_find_tabulated(), gen_full_copy_list(), gen_nreverse(), make_basic_derived(), make_entity, make_type_struct(), make_type_union(), make_type_variable(), make_variable(), MEMBER_SEP_CHAR, MODULE_SEP_STRING, NIL, strdup(), STRUCT_PREFIX_CHAR, type_struct, type_union, type_variable, UNION_PREFIX_CHAR, variable_basic, variable_dimensions, and variable_qualifiers.
Referenced by outliner_parameters().