PIPS
|
Go to the source code of this file.
Macros | |
#define | IS_EG TRUE |
{{{ banner More... | |
#define | NOT_EG FALSE |
#define | PHI_FIRST TRUE |
#define | NOT_PHI_FIRST FALSE |
#define IS_EG TRUE |
{{{ banner
package complementary sections : Manjunathaiah M , 18-4-96
This File contains the functions computing the regions of a module : proper, local and global. }}}
Definition at line 40 of file propagate.c.
#define NOT_EG FALSE |
Definition at line 41 of file propagate.c.
#define NOT_PHI_FIRST FALSE |
Definition at line 44 of file propagate.c.
#define PHI_FIRST TRUE |
Definition at line 43 of file propagate.c.
void CheckStride | ( | loop __attribute__((unused)) | Loop | ) |
global static variable local_regions_map, and its access functions
{{{ auxilliary functions
expression Stride = range_increment(loop_range(Loop));
Definition at line 50 of file propagate.c.
bool comp_regions | ( | const char * | module_name | ) |
}}}
{{{ process the body of a procedure ===============================================================================
INTRAPROCEDURAL ARRAY REGIONS ANALYSIS
{{{ intra procedural entry point "complementary_sections" calls comp_regions {{{ comments bool regions(const char* module_name) input : the name of the current module output : nothing. modifies : computes the local regions of a module. comment : local regions can contain local variables. }}}
{{{ code
{{{ initialize
get the current properties concerning regions
Get the code of the module.
}}}
{{{ transformers and preconditions
Get the transformers and preconditions of the module.
}}}
{{{ predicates for purpose of debugging
predicates defining summary regions from callees have to be translated into variables local to module
}}}
}}}
Compute the regions of the module.
{{{ for dependence analysis : currently masked
set_proper_regions_map( MAKE_STATEMENT_MAPPING() );
}}}
{{{ code
{{{ debug stmts
if (op_statistics_p()) print_regions_op_statistics(module_name, R_RW);
}}}
{{{ store in database : modify later
DB_PUT_MEMORY_RESOURCE(DBR_PROPER_REGIONS, strdup(module_name), (char*) listmap_to_effectsmap(get_proper_regions_map()));
}}}
{{{ finalise
}}}
}}}
module_name | odule_name |
Definition at line 87 of file propagate.c.
References comp_regions_of_statement(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, free_local_comp_regions_map(), get_current_module_entity(), get_current_module_statement(), get_local_comp_regions_map(), get_regions_properties(), listmap_to_compsecs_map(), local_name_to_top_level_entity(), MAKE_STATEMENT_MAPPING, module_name(), module_to_value_mappings(), pips_debug, reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_precondition_map(), reset_proper_rw_effects(), reset_transformer_map(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_local_comp_regions_map(), set_precondition_map(), set_proper_rw_effects(), set_transformer_map(), and strdup().
Referenced by complementary_sections().
}}}
{{{ comp_region_of_block {{{ comment list comp_regions_of_block(list linst) input : a list of instructions, representing a sequential block of instructions, and the context before the block. output : a list of regions modifies : linst. comment : calls itself recursively to calculate the list of regions.
}}}
{{{ init
}}}
{{{ Is it end of list ?
}}}
{{{ else process list
{{{ regions of CAR(linst)
}}}
{{{ any more statements in CDR(linst)
{{{ load transformer
}}}
{{{ perform union
{{{ don't know that this means ???
blocked : check later list current_transformer = load_statement_transformer(first_statement);
debug_regions_consistency(r_block_regions); project_regions_with_transformer_inverse(r_block_regions, current_transformer, NIL);
debug_regions_consistency(r_block_regions);
}}}
}}}
}}}
{{{ if not lres = first_s_regions
}}}
}}}
linst | inst |
Definition at line 301 of file propagate.c.
References CAR, CDR, comp_regions_of_block(), comp_regions_of_statement(), CompRegionsExactUnion(), effects_same_action_p(), ENDP, NIL, pips_debug, STATEMENT, and user_warning.
Referenced by comp_regions_of_block(), and comp_regions_of_instruction().
list comp_regions_of_call | ( | call | c, |
transformer | context, | ||
list * | plpropreg | ||
) |
}}}
{{{ comp_regions of call list comp_regions_of_call(call c, transformer context, list *plpropreg) input : a call, which can be a call to a subroutine, but also to an function, or to an intrinsic, or even an assignement. And a pointer that will be the proper regions of the call; NIL, except for an intrinsic (assignment or real FORTRAN intrinsic). output : the corresponding list of regions. modifies : nothing. comment :
{{{ code
masked now : change later
masked now : *plpropreg = regions_dup(le);
}}}
context | ontext |
plpropreg | lpropreg |
Definition at line 510 of file propagate.c.
References call_arguments, call_function, comp_regions_of_intrinsic(), entity_initial, is_value_code, is_value_constant, is_value_intrinsic, is_value_symbolic, is_value_unknown, module_local_name(), NIL, pips_debug, pips_internal_error, and value_tag.
Referenced by comp_regions_of_instruction(), and comp_regions_of_syntax().
list comp_regions_of_expression | ( | expression | e, |
transformer | context | ||
) |
{{{ comp_regions_of_expression
list comp_regions_of_expression(expression e, transformer context) input : an expression and the current context output : the correpsonding list of regions. modifies : nothing. comment :
context | ontext |
Definition at line 701 of file propagate.c.
References comp_regions_of_syntax(), and expression_syntax.
Referenced by affect_comp_regions(), comp_regions_of_expressions(), comp_regions_of_implied_do(), comp_regions_of_ioelem(), comp_regions_of_iolist(), comp_regions_of_range(), and comp_regions_of_test().
list comp_regions_of_expressions | ( | list | exprs, |
transformer | context | ||
) |
}}}
{{{ comp_regions_of_expressions list comp_regions_of_expressions(list exprs, transformer context) input : a list of expressions and the current context. output : the correpsonding list of regions. modifies : nothing. comment :
exprs | xprs |
context | ontext |
Definition at line 678 of file propagate.c.
References comp_regions_of_expression(), CompRegionsExactUnion(), effects_same_action_p(), exp, EXPRESSION, MAP, NIL, and pips_debug.
Referenced by comp_regions_of_read(), comp_regions_of_write(), and no_write_comp_regions().
list comp_regions_of_instruction | ( | instruction | i, |
transformer | t_inst, | ||
transformer | context, | ||
list * | plpropreg | ||
) |
}}}
{{{ comp_regions_of_instruction {{{ comments list comp_regions_of_instruction(instruction i, transformer t_inst, context, list *plpropreg) input : the current instruction and the corresponding transformer and context (i.e. precondition), and a pointer that will contain the proper regions of the instruction. output : the corresponding list of regions. modifies : nothing. }}}
{{{ init
}}}
{{{ code
{{{ code
}}}
{{{ code
}}}
{{{ code
}}}
{{{ code
}}}
{{{ code
}}}
{{{ code
}}}
}}}
t_inst | _inst |
context | ontext |
plpropreg | lpropreg |
Definition at line 224 of file propagate.c.
References call_function, comp_regions_of_block(), comp_regions_of_call(), comp_regions_of_loop(), comp_regions_of_test(), comp_regions_of_unstructured(), entity_local_name(), expression_to_string(), ifdebug, 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_index, module_local_name(), NIL, pips_debug, and test_condition.
Referenced by comp_regions_of_statement().
list comp_regions_of_loop | ( | loop | l, |
transformer __attribute__((unused)) | loop_trans, | ||
transformer | context, | ||
list __attribute__((unused)) * | plpropreg | ||
) |
}}}
{{{ comp_regions of loop list comp_regions_of_loop(loop l, transfomer loop_trans, context, list *plpropreg) input : a loop, its transformer and its context, and a pointer toward a list, that will contain the proper regions of the loop, which are the regions of its range. output : the corresponding list of regions. modifies : nothing. comment :
{{{ init
}}}
CheckStride(l);
regions of loop index.
{{{ code
loop index is must-written but may-read because the loop might execute no iterations.
the loop index is must-written
FI, RK: the may-read effect on the index variable is masked by the intial unconditional write on it (see standard page 11-7, 11.10.3); if masking is not performed, the read may prevent privatization somewhere else in the module (12 March 1993)
}}}
{{{ regions of loop induction variable
regions of loop bound expressions.
}}}
regions of loop body statement.
insert code to eliminate private variables later
projection of regions along the variables modified by the loop; it includes the projection along the loop index
{{{ In simple sections it is called translation !!
}}}
Definition at line 416 of file propagate.c.
References comp_regions_of_range(), comp_regions_of_statement(), comp_regions_of_write(), CompRegionsExactUnion(), effects_same_action_p(), entity_local_name(), execution_sequential_p, ifdebug, loop_body, loop_execution, loop_index, loop_range, make_reference(), NIL, pips_debug, PrintCompRegions(), ref, and TranslateRefsToLoop().
Referenced by comp_regions_of_instruction().
list comp_regions_of_range | ( | range | r, |
transformer | context | ||
) |
}}}
{{{ comp_regions_of_range list comp_regions_of_range(range r, context) input : a loop range (bounds and stride) and the context. output : the corresponding list of regions. modifies : nothing. comment :
context | ontext |
Definition at line 610 of file propagate.c.
References comp_regions_of_expression(), CompRegionsExactUnion(), effects_same_action_p(), pips_debug, range_increment, range_lower, and range_upper.
Referenced by comp_regions_of_loop(), and comp_regions_of_syntax().
list comp_regions_of_read | ( | reference | ref, |
transformer | context | ||
) |
}}}
}}} {{{ comp_regions_of_read list comp_regions_of_read(reference ref, transformer context) input : a reference that is read, and the current context. output : the corresponding list of regions. modifies : nothing. comment :
{{{ init
}}}
{{{ code
{{{ this read reference
}}}
{{{ rest of the references in an expression
}}}
}}}
ref | ef |
context | ontext |
Definition at line 715 of file propagate.c.
References COMP_DESC, comp_regions_of_expressions(), CompRegionsExactUnion(), CONS, effects_same_action_p(), ENDP, entity_scalar_p(), InitCompDesc(), is_action_read, NIL, pips_debug, ref, reference_indices, and reference_variable.
Referenced by comp_regions_of_syntax(), and io_comp_regions().
}}}
{{{ comp_regions_of_statement {{{ comments list comp_regions_of_statement(statement s) input : the current statement. output : a list of regions. modifies : the local regions_map. comment : computes the local regions of a statement and stores it in the local_regions_map. }}}
{{{ code
{{{ inits
}}}
{{{ transformer and preconditions
compute the regions on the instruction of the statement
}}}
}}}
{{{ code
{{{ store the result : currently masked, modify later
FI: make a copy to safely store that intermediate state in the mapping
debug_regions_consistency(lreg); debug_regions_consistency(lpropreg); store_statement_proper_regions(s, lpropreg);
}}}
}}}
Definition at line 173 of file propagate.c.
References comp_regions_dup(), comp_regions_of_instruction(), ifdebug, load_statement_precondition(), load_statement_transformer(), NIL, pips_debug, statement_instruction, statement_number, and store_statement_local_comp_regions().
Referenced by comp_regions(), comp_regions_of_block(), comp_regions_of_loop(), comp_regions_of_test(), and comp_regions_of_unstructured().
list comp_regions_of_syntax | ( | syntax | s, |
transformer | context | ||
) |
}}}
{{{ comp_regions_of_syntax list comp_regions_of_syntax(syntax s, transformer context) input : output : modifies : comment :
{{{ code
comp_desc_free(lpropreg);
}}}
context | ontext |
Definition at line 636 of file propagate.c.
References comp_regions_of_call(), comp_regions_of_range(), comp_regions_of_read(), ifdebug, is_syntax_call, is_syntax_range, is_syntax_reference, NIL, pips_debug, pips_internal_error, print_regions(), syntax_call, syntax_range, syntax_reference, syntax_tag, Words_Syntax(), and words_to_string().
Referenced by comp_regions_of_expression().
list comp_regions_of_test | ( | test | t, |
transformer | context, | ||
list __attribute__((unused)) * | plpropreg | ||
) |
}}}
{{{ comp_regions of test list regions_of_test(test t, transformer context, list *plpropreg) input : a test instruction, the context of the test, and a pointer toward a list that will contain the proper regions of the test, which are the regions of its conditionnal part. output : the corresponding list of regions. modifies : nothing.
{{{ init
}}}
{{{ if-then-else including if-condition
regions of the true branch
regions of the false branch
regions of the combination of both
regions of the condition
check later plpropreg = comp_regions_dup(lc);
}}}
{{{ union the regions : currently just add to the list
}}}
Definition at line 375 of file propagate.c.
References comp_regions_of_expression(), comp_regions_of_statement(), CompRegionsExactUnion(), CompRegionsMayUnion(), effects_same_action_p(), pips_debug, test_condition, test_false, and test_true.
Referenced by comp_regions_of_instruction().
list comp_regions_of_unstructured | ( | unstructured | u, |
transformer | t_unst | ||
) |
}}}
{{{ comp_regions of unstructured Computes the effects of the control graph. list comp_regions_of_unstructured( u , t_unst) input : an unstructured control flow graph and the corresponding transformer. output : the corresponding list of regions. modifies : nothing. comment :
there is only one statement in u; no need for a fix-point
t_unst | _unst |
Definition at line 571 of file propagate.c.
References comp_regions_of_statement(), CompRegionsMayUnion(), CONTROL_MAP, control_predecessors, control_statement, control_successors, effects_same_action_p(), gen_free_list(), NIL, pips_debug, project_regions_along_parameters(), transformer_arguments, and unstructured_control.
Referenced by comp_regions_of_instruction().
list comp_regions_of_write | ( | reference | ref, |
transformer | context | ||
) |
}}}
{{{ comp_regions_of_write regions of a reference that is written list comp_regions_of_write(reference ref, transformer context) input : a reference that is written, and the current context. output : the corresponding list of regions. modifies : nothing. comment :
{{{ init
}}}
{{{ this write
}}}
{{{ check for arrays in subscripts
}}}
ref | ef |
context | ontext |
Definition at line 753 of file propagate.c.
References COMP_DESC, comp_regions_of_expressions(), CompRegionsExactUnion(), CONS, effects_same_action_p(), ENDP, entity_scalar_p(), InitCompDesc(), is_action_write, NIL, pips_debug, ref, reference_indices, and reference_variable.
Referenced by affect_comp_regions(), comp_regions_of_implied_do(), comp_regions_of_ioelem(), comp_regions_of_iolist(), comp_regions_of_loop(), and io_comp_regions().
list CompRegionsExactUnion | ( | list | l1, |
list | l2, | ||
bool __attribute__((unused))(*)(effect, effect) | union_combinable_p | ||
) |
just concatentate list for now : change later
Definition at line 57 of file propagate.c.
References gen_nconc().
Referenced by comp_regions_of_block(), comp_regions_of_expressions(), comp_regions_of_loop(), comp_regions_of_range(), comp_regions_of_read(), comp_regions_of_test(), and comp_regions_of_write().
list CompRegionsMayUnion | ( | list | l1, |
list | l2, | ||
bool __attribute__((unused))(*)(effect, effect) | union_combinable_p | ||
) |
just concatentate list for now : change later
Definition at line 63 of file propagate.c.
References gen_nconc().
Referenced by comp_regions_of_test(), and comp_regions_of_unstructured().