PIPS
|
Go to the source code of this file.
Data Structures | |
struct | sSimpBound |
bounds are retained as high level tree structures to accommodate symbolic information in boundary expressions. More... | |
struct | DadComponent |
Simple Section part of DAD An array of type SimpBound struct allocated dynamically based on rank of array. More... | |
struct | Variants |
}} More... | |
Macros | |
#define | LIN_INVARIANT 2 |
Warning! Do not modify this file that is automatically generated! More... | |
#define | LIN_VARIANT 1 |
#define | NON_LINEAR -1 |
#define | LSEC(x, i) GetBoundary(x,i,1) |
accessing DAD components More... | |
#define | USEC(x, i) GetBoundary(x,i,0) |
#define | PUT_NEST(d, val) context_info_nest(simple_section_context(comp_sec_hull(comp_desc_section(d)))) = val |
#define | GET_NEST(d) context_info_nest(simple_section_context(comp_sec_hull(comp_desc_section(d)))) |
#define | MAX_RANK 8 |
only used for in print routines. More... | |
#define | LinExpr Pvecteur |
A linear expression in Pips ; Pvecteur is a pointer. More... | |
#define | SEQUENTIAL_COMPSEC_SUFFIX ".csec" |
#define | USER_COMPSEC_SUFFIX ".ucsec" |
Typedefs | |
typedef unsigned int | tRT |
{{ Dad definition More... | |
typedef struct sSimpBound | tSS |
bounds are retained as high level tree structures to accommodate symbolic information in boundary expressions. More... | |
typedef struct DadComponent | DadComp |
Simple Section part of DAD An array of type SimpBound struct allocated dynamically based on rank of array. More... | |
typedef struct Variants | tVariants |
}} More... | |
typedef simple_section | tDad |
}} More... | |
Enumerations | |
enum | BoundType { LOWER , UPPER , LOWER , UPPER , LOWER , UPPER } |
}} More... | |
enum | RefType { READ , WRITE , READ , WRITE , READ , WRITE } |
enum | NestType { ZERO , SINGLE , MULTI , ZERO , SINGLE , MULTI , ZERO , SINGLE , MULTI } |
enum | OpFlag { PLUS , MINUS , PLUS , MINUS , PLUS , MINUS } |
used for merging linear expressions More... | |
#define GET_NEST | ( | d | ) | context_info_nest(simple_section_context(comp_sec_hull(comp_desc_section(d)))) |
Definition at line 44 of file comp_sections.h.
#define LIN_INVARIANT 2 |
Warning! Do not modify this file that is automatically generated!
Modify src/Libs/comp_sections/comp_sections-local.h instead, to add your own modifications. header file built by cproto comp_sections-local.h {{ defines classifying subscript types for reference template done in newgen now
Definition at line 36 of file comp_sections.h.
#define LIN_VARIANT 1 |
Definition at line 37 of file comp_sections.h.
A linear expression in Pips ; Pvecteur is a pointer.
Definition at line 67 of file comp_sections.h.
#define LSEC | ( | x, | |
i | |||
) | GetBoundary(x,i,1) |
accessing DAD components
Definition at line 41 of file comp_sections.h.
#define MAX_RANK 8 |
only used for in print routines.
The analysis does not pose any limit on the number of array dimensions
Definition at line 58 of file comp_sections.h.
#define NON_LINEAR -1 |
Definition at line 38 of file comp_sections.h.
#define PUT_NEST | ( | d, | |
val | |||
) | context_info_nest(simple_section_context(comp_sec_hull(comp_desc_section(d)))) = val |
Definition at line 43 of file comp_sections.h.
#define SEQUENTIAL_COMPSEC_SUFFIX ".csec" |
Definition at line 110 of file comp_sections.h.
#define USEC | ( | x, | |
i | |||
) | GetBoundary(x,i,0) |
Definition at line 42 of file comp_sections.h.
#define USER_COMPSEC_SUFFIX ".ucsec" |
Definition at line 111 of file comp_sections.h.
typedef struct DadComponent DadComp |
Simple Section part of DAD An array of type SimpBound struct allocated dynamically based on rank of array.
typedef simple_section tDad |
{{ Dad definition
data structures for data access descriptor Reference Template part of DAD, an array of integers allocated dynamically
Definition at line 64 of file comp_sections.h.
typedef struct sSimpBound tSS |
bounds are retained as high level tree structures to accommodate symbolic information in boundary expressions.
When all the symbolic information gets resolved then the tree nodes are collapsed into a single instruction holding the constant value
}}
{{ Data structures required for computing Dads {{ structures for TranslateToLoop structure to hold both Old and New variants
enum BoundType |
enum NestType |
Enumerator | |
---|---|
ZERO | |
SINGLE | |
MULTI | |
ZERO | |
SINGLE | |
MULTI | |
ZERO | |
SINGLE | |
MULTI |
Definition at line 50 of file comp_sections.h.
enum OpFlag |
used for merging linear expressions
Enumerator | |
---|---|
PLUS | |
MINUS | |
PLUS | |
MINUS | |
PLUS | |
MINUS |
Definition at line 53 of file comp_sections.h.
enum RefType |
list affect_comp_regions | ( | entity | , |
list | , | ||
transformer | |||
) |
dad_struct AllocateDadStruct | ( | int | Rank | ) |
}}
{{ allocate simple section allocate a structure to hold Dad
initialize the reference template
initialize the shape
Rank | ank |
Definition at line 440 of file ss.c.
References BOUND_PAIR, CONS, gen_nconc(), is_rtype_nonlinear, make_bound_pair(), make_dad_struct(), make_ref_temp(), make_rtype(), NIL, Ref, REF_TEMP, and UU.
Referenced by AllocateSimpleSection().
simple_section AllocateSimpleSection | ( | reference | ref | ) |
{{ intialize the data structure
}}
ref | ef |
Definition at line 467 of file ss.c.
References AllocateDadStruct(), CardinalityOf(), entity_type, LINE, make_context_info(), make_simple_section(), ref, reference_variable, type_variable, variable_dimensions, and ZERO.
Referenced by InitCompDesc().
re-used Pips functional programs !!!
gl | l |
Definition at line 428 of file ss.c.
References gen_length().
Referenced by AllocateSimpleSection(), and TransSimpSec().
void CheckStride | ( | loop | ) |
list comp_desc_set_to_list | ( | comp_desc_set | cset | ) |
cset | set |
Definition at line 40 of file dbase.c.
References comp_desc_set_comp_descs.
Referenced by comp_secs_map_to_listmap(), and get_any_comp_regions_text().
void region_add_to_regions(region reg, list l_reg) input : a region and a list of regions.
output : nothing. modifies : l_reg. comment : adds reg at the end of l_reg.
reg | eg |
l_reg | _reg |
Definition at line 111 of file dbase.c.
References COMP_DESC, CONS, gen_nconc(), and NIL.
Referenced by comp_regions_dup().
debug_region_consistency(reg);
work around persistency of comp_desc reference
reg | eg |
Definition at line 95 of file dbase.c.
References comp_desc_reference, copy_comp_desc(), and copy_reference().
Referenced by comp_regions_dup().
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().
REGIONS AND LISTS OF REGIONS MANIPULATION
list comp_regions_dup(list l_reg) input : a list of comp_regions. output : a new list of regions, in which each region of the initial list is duplicated. modifies : nothing.
l_reg | _reg |
Definition at line 82 of file dbase.c.
References COMP_DESC, comp_region_add_to_regions(), comp_region_dup(), MAP, and NIL.
Referenced by comp_regions_of_statement().
}}}
{{{ 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_implied_do | ( | expression | exp, |
tag | act, | ||
transformer | context | ||
) |
}}
{{ comp_regions_of_implied_do an implied do is a call to an intrinsic function named IMPLIED-DO; its first argument is the loop index, the second one is a range, and the remaining ones are expressions to be written or references to be read, or another implied_do (BA).
loop index
range
regions of implied do index it is must_written but may read because the implied loop might execute no iteration.
the loop index is must-written
Read effects are masked by the first write to the implied-do loop variable
regions of implied-loop bounds and increment
the preconditions of the current statement don't include those induced by the implied_do, because they are local to the statement. But we need them to properly calculate the regions. the solution is to add to the current context the preconditions due to the current implied_do (think of nested implied_do). the regions are calculated, and projected along the index. BA, September 27, 1993.
on a un autre implied_do imbrique'
indices are removed from regions because this is a loop
exp | xp |
act | ct |
context | ontext |
Definition at line 544 of file myintrinsics.c.
References add_index_range_conditions(), arguments_add_entity(), call_arguments, CAR, CDR, comp_regions_of_expression(), comp_regions_of_implied_do(), comp_regions_of_write(), CompRegionsExactUnion(), debug(), effects_same_action_p(), entity_to_new_value(), exp, EXPRESSION, expression_implied_do_p(), expression_syntax, fprintf(), gen_free_list(), ifdebug, is_action_write, make_reference(), MAP, NIL, pips_assert, precondition_to_string(), print_regions(), project_regions_along_loop_index(), ref, reference_variable, REGION, region_add_to_regions(), region_entity, region_free(), syntax_call, syntax_range, syntax_range_p, syntax_reference, syntax_reference_p, transformer_arguments, transformer_dup(), transformer_free(), and transformer_undefined.
Referenced by comp_regions_of_implied_do(), and comp_regions_of_iolist().
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_intrinsic | ( | entity | e, |
list | args, | ||
transformer | context | ||
) |
{{ comp_regions_of_intrinsic list comp_regions_of_intrinsic(entity e, list args, transformer context) input : a intrinsic function name, the list or arguments, and the calling context. output : the corresponding list of regions. modifies : nothing. comment :
args | rgs |
context | ontext |
Definition at line 270 of file myintrinsics.c.
References proper_comp_regions_of_intrinsic().
Referenced by comp_regions_of_call().
list comp_regions_of_ioelem | ( | expression | exp, |
tag | act, | ||
transformer | context | ||
) |
}}
{{ comp_regions_of_io_element ==============================================================================
exp | xp |
act | ct |
context | ontext |
Definition at line 461 of file myintrinsics.c.
References comp_regions_of_expression(), comp_regions_of_write(), debug(), exp, expression_syntax, is_action_write, pips_assert, syntax_reference, and syntax_reference_p.
Referenced by io_comp_regions().
list comp_regions_of_iolist | ( | list | exprs, |
tag | act, | ||
transformer | context | ||
) |
}}
{{ comp_regions_of_io_list ==============================================================================
There is a bug with effects of io list
READ *,N,(T(I),I=1,N)
there is write effect on N but for the io list, we don't have this effect !
Cause : there is no loop for the list exprs !!! /NN:2000/
exprs | xprs |
act | ct |
context | ontext |
Definition at line 489 of file myintrinsics.c.
References CAR, CDR, comp_regions_of_expression(), comp_regions_of_implied_do(), comp_regions_of_write(), CompRegionsExactUnion(), debug(), effects_same_action_p(), ENDP, exp, EXPRESSION, expression_implied_do_p(), expression_syntax, is_action_write, NIL, pips_assert, syntax_reference, and syntax_reference_p.
Referenced by io_comp_regions().
list comp_regions_of_loop | ( | loop | , |
transformer | , | ||
transformer | , | ||
list * | |||
) |
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 | , |
transformer | , | ||
list * | |||
) |
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().
statement_mapping comp_secs_map_to_listmap | ( | statement_mapping | compsecs_map | ) |
compsecs_map | ompsecs_map |
Definition at line 60 of file dbase.c.
References comp_desc_set_to_list(), hash_put(), MAKE_STATEMENT_MAPPING, and STATEMENT_MAPPING_MAP.
Referenced by get_any_comp_regions_text().
bool complementary_sections | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 40 of file comp_sections.c.
References comp_regions(), and module_name().
Referenced by affect_comp_regions(), comp_regions_of_implied_do(), comp_regions_of_iolist(), and io_comp_regions().
void ComputeBoundaries | ( | simple_section | Dad, |
loop | Loop, | ||
Pvecteur | lbExpr, | ||
Pvecteur | ubExpr, | ||
unsigned | Offset | ||
) |
compute both boundary expression and store in the tSS array
{{ about
}}
Dad | ad |
Loop | oop |
lbExpr | bExpr |
ubExpr | bExpr |
Offset | ffset |
Definition at line 765 of file ss.c.
References DivExists(), Lbound(), PutBoundPair(), and Ubound().
Referenced by TransSimpSec().
}}
{{ ComputeIndex compute index of tSS array for a boundary
Rank | ank |
Definition at line 362 of file ss.c.
References Index.
Referenced by TransSimpSec(), and UpdateUnresolved().
void ComputeRTandSS | ( | expression | Sub, |
unsigned | DimNo, | ||
simple_section | Dad, | ||
loop | Loop | ||
) |
initialise reference template and shapes for inner most references
for an access vector
{{ non-linear
}}
{{ linear
copy the subscript expression into the shape descriptor
linear subscripts : update if DIV exists
}}
Sub | ub |
DimNo | imNo |
Dad | ad |
Loop | oop |
Definition at line 524 of file ss.c.
References CopyAccVec(), DivExists(), is_rtype_lininvariant, is_rtype_linvariant, is_rtype_nonlinear, IsExprConst(), Lbound(), LSEC, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, PutBoundPair(), PutRefTemp(), Ubound(), and USEC.
Referenced by ScanAllDims().
}}
{{ CopyAccVec
re-used function from alloc.c
Expr | xpr |
Definition at line 378 of file ss.c.
References vect_dup().
Referenced by ComputeRTandSS(), Lbound(), TransSimpSec(), and Ubound().
void delete_statement_local_comp_regions | ( | statement | ) |
void DisplayDad | ( | comp_desc | TheDad | ) |
TheDad | heDad |
Definition at line 107 of file ss.c.
References comp_desc_reference, comp_desc_section, comp_sec_hull, DisplayRefTemp(), DisplaySimpleSection(), entity_minimal_name(), fprintf(), and reference_variable.
Referenced by PrintSimp().
void DisplayRefTemp | ( | simple_section | Dad | ) |
}}
{{ DisplayRefTemp
Dad | ad |
Definition at line 123 of file ss.c.
References context_info_rank, fprintf(), GetRefTemp(), is_rtype_lininvariant, is_rtype_linvariant, is_rtype_nonlinear, simple_section_context, and tag_undefined.
Referenced by DisplayDad().
void DisplaySimpleSection | ( | simple_section | Dad | ) |
}}
{{ DisplaySimpSec
{{ xi = c
}}
{{ Xi+Xj = c
}}
{{ index
}}
}}
{{ Xi-Xj
}}
Dad | ad |
Definition at line 161 of file ss.c.
References context_info_rank, fprintf(), LSEC, PrintLinExpr(), simple_section_context, and USEC.
Referenced by DisplayDad().
check whether loop index variable var is contained in LinExpr
Loop | oop |
Lin | in |
Definition at line 396 of file ss.c.
References loop_index, Val, and vect_contains_variable_p().
Referenced by ComputeBoundaries(), ComputeRTandSS(), TransRefTemp(), and UpdateUnresolved().
void free_local_comp_regions_map | ( | void | ) |
Referenced by comp_regions(), and get_any_comp_regions_text().
statement_mapping get_local_comp_regions_map | ( | void | ) |
text get_text_comp_regions | ( | const char * | module_name | ) |
prettyprint.c
prettyprint.c
module_name | odule_name |
Definition at line 72 of file prettyprint.c.
References get_any_comp_regions_text(), in_out_comp_regions_p, is_user_view_p, and module_name().
expression GetAccVec | ( | unsigned | No, |
const | reference | ||
) |
return the n'th subscript expression
No | o |
reference | ef |
Definition at line 411 of file ss.c.
References EXPRESSION, MAP, ref, and reference_indices.
Referenced by TransRefTemp().
Pvecteur GetBoundary | ( | simple_section | Dad, |
int | DimNo, | ||
unsigned | Low | ||
) |
}}
{{ GetBoundaryPair return the lower or upper boundary
Dad | ad |
DimNo | imNo |
Low | ow |
Definition at line 266 of file ss.c.
References BOUND_PAIR, bound_pair_index, bound_pair_lb, bound_pair_ub, dad_struct_shape, MAP, and simple_section_dad.
tag GetRefTemp | ( | simple_section | Dad, |
_int | DimNo | ||
) |
}}
}} {{ auxilliary functions {{ GetRefTemp
Dad | ad |
DimNo | imNo |
Definition at line 229 of file ss.c.
References dad_struct_rtemps, FOREACH, Ref, REF_TEMP, ref_temp_index, ref_temp_rtype, rtype_tag, simple_section_dad, and tag_undefined.
Referenced by DisplayRefTemp(), SimpUnion(), TransRefTemp(), and UpdateUnresolved().
precondition : this function should be called for array varaibles only
{{ code
{{ inits
}}
{{ code
}}
}}
ref | ef |
ReadWrite | eadWrite |
Definition at line 30 of file operators.c.
References AllocateSimpleSection(), copy_reference(), entity_scalar_p(), func_entity_name(), make_action(), make_comp_desc(), make_comp_sec(), NIL, pips_debug, ref, reference_variable, and UU.
Referenced by comp_regions_of_read(), and comp_regions_of_write().
list io_comp_regions | ( | entity | e, |
list | args, | ||
transformer | context | ||
) |
}}
{{ io_comp_regions
regions effects on logical units - taken from effects/io.c
We simulate actions on files by read/write actions to a static integer array GO: It is necessary to do a read and and write action to the array, because it updates the file-pointer so it reads it and then writes it ...
args | rgs |
context | ontext |
Definition at line 378 of file myintrinsics.c.
References approximation_tag, call_function, CAR, CDR, comp_regions_of_ioelem(), comp_regions_of_iolist(), comp_regions_of_read(), comp_regions_of_write(), CompRegionsExactUnion(), CONS, debug(), effect_approximation, effects_same_action_p(), entity_local_name(), entity_undefined, EXPRESSION, expression_syntax, FindEntity(), gen_nconc(), get_bool_property(), indices, IO_EFFECTS_ARRAY_NAME, IoElementDescriptor::IoElementName, is_approximation_may, make_reference(), MAP, IoElementDescriptor::MayOrMust, NIL, pips_assert, IoElementDescriptor::ReadOrWrite, ref, REGION, SearchIoElement(), syntax_call, syntax_call_p, and TOP_LEVEL_MODULE_NAME.
}}
check whether a given expresion is a constant
Expr | xpr |
Definition at line 388 of file ss.c.
References vect_constant_p().
Referenced by ComputeRTandSS(), and UpdateUnresolved().
}}
}} {{ lbound and ubound
only one step in pips ! it provides direct substitution functions
{{ substitution step
substitute with lower bound
substitute with upper bound
make a copy because vect_var_subst modifies NewVect
}}
Loop | oop |
Lin | in |
Definition at line 910 of file ss.c.
References CopyAccVec(), loop_index, loop_range, my_vect_var_subst(), NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, range_lower, range_upper, Val, and vect_coeff().
Referenced by ComputeBoundaries(), ComputeRTandSS(), and UpdateUnresolved().
comp_desc_set list_to_comp_secs | ( | list | l_eff | ) |
l_eff | _eff |
Definition at line 33 of file dbase.c.
References make_comp_desc_set().
Referenced by listmap_to_compsecs_map().
statement_mapping listmap_to_compsecs_map | ( | statement_mapping | l_map | ) |
l_map | _map |
Definition at line 47 of file dbase.c.
References hash_put(), list_to_comp_secs(), MAKE_STATEMENT_MAPPING, and STATEMENT_MAPPING_MAP.
Referenced by comp_regions().
bool local_comp_regions_map_undefined_p | ( | void | ) |
void make_local_comp_regions_map | ( | void | ) |
}}
{{ MaxBoundary substitute with new boundary
Lin1 | in1 |
Lin2 | in2 |
Definition at line 335 of file ss.c.
References vect_compare(), and vect_dup().
Referenced by SimpUnion().
}}
{{ MergeLinExprs
must free Expr1 because vect_add will return a copy : check later
Expr1 | xpr1 |
Expr2 | xpr2 |
Op | p |
Definition at line 349 of file ss.c.
References my_vect_substract(), PLUS, and vect_add().
Referenced by TransSimpSec(), and UpdateUnresolved().
}}
{{ MinBoundary substitute with new boundary
Lin1 | in1 |
Lin2 | in2 |
Definition at line 320 of file ss.c.
References vect_compare(), and vect_dup().
Referenced by SimpUnion().
Pvecteur var_val; for (var_val = pvec2; var_val!= NIL; vect_add_elem (&dvec,var_of(var_val),-val_of(var_val)),var_val=var_val->succ);
pvec1 | vec1 |
pvec2 | vec2 |
Definition at line 50 of file ss.c.
References Svecteur::succ, val_of, var_of, vect_add_elem(), and vect_dup().
Referenced by MergeLinExprs().
mimicked this function from paf-tuil/utils.c because it was misbehaving !!
vect | ect |
var | ar |
new_vect | ew_vect |
Definition at line 35 of file ss.c.
References vect_add(), vect_aux, vect_coeff(), vect_erase_var(), and vect_multiply().
Referenced by Lbound(), and Ubound().
list no_write_comp_regions | ( | entity | , |
list | , | ||
transformer | |||
) |
bool print_code_comp_regions | ( | const char * | ) |
bool print_code_complementary_sections | ( | const char * | module_name | ) |
module_name | odule_name |
Definition at line 46 of file comp_sections.c.
References module_name(), and print_code_comp_regions().
bool print_source_comp_regions | ( | const char * | ) |
void PrintCompRegions | ( | list | CompList | ) |
}}
{{ PrintSimpleSection {{ PrintCompRegions
CompList | ompList |
Definition at line 74 of file ss.c.
References COMP_DESC, MAP, NIL, and PrintSimp().
Referenced by comp_regions_of_loop().
void PrintLinExpr | ( | LinExpr | Lin | ) |
}}
{{ PrintLinExpr
call the approprite print routine : check later
Lin | in |
Definition at line 87 of file ss.c.
References fprintf(), and vect_debug().
Referenced by DisplaySimpleSection(), and PutBoundPair().
void PrintSimp | ( | comp_desc | Dad | ) |
}}
{{ PrintSimp
Dad | ad |
Definition at line 99 of file ss.c.
References DisplayDad(), and fprintf().
Referenced by PrintCompRegions().
list proper_comp_regions_of_intrinsic | ( | entity | e, |
list | args, | ||
transformer | context | ||
) |
}}
{{ proper_comp_regions_of_intrinsic list proper_comp_regions_of_intrinsic(entity e, list args, transformer context) input : a intrinsic function name, the list or arguments, and the calling context. output : the corresponding list of regions. modifies : nothing. comment :
args | rgs |
context | ontext |
Definition at line 286 of file myintrinsics.c.
References debug(), entity_local_name(), IntrinsicEffectDescriptor::f, IntrinsicDescriptorTable, IntrinsicEffectDescriptor::name, NIL, and pips_internal_error.
Referenced by comp_regions_of_intrinsic().
void PutBoundPair | ( | simple_section | Dad, |
_int | DimNo, | ||
LinExpr | Low, | ||
LinExpr | Up | ||
) |
}}
{{ PutBoundryPair substitute with new boundary
check later vect_rm(bound_pair_lb(bp));
check later vect_rm(bound_pair_ub(bp));
Dad | ad |
DimNo | imNo |
Low | ow |
Up | p |
Definition at line 290 of file ss.c.
References BOUND_PAIR, bound_pair_index, bound_pair_lb_, bound_pair_ub_, dad_struct_shape, ifdebug, MAP, pips_debug, PrintLinExpr(), and simple_section_dad.
Referenced by ComputeBoundaries(), ComputeRTandSS(), SimpUnion(), and UpdateUnresolved().
void PutRefTemp | ( | simple_section | Dad, |
int | DimNo, | ||
tag | Val | ||
) |
}}
{{ PutRefTemp
Dad | ad |
DimNo | imNo |
Val | al |
Definition at line 248 of file ss.c.
References dad_struct_rtemps, MAP, REF_TEMP, ref_temp_index, ref_temp_rtype, rtype_tag, simple_section_dad, and Val.
Referenced by ComputeRTandSS(), SimpUnion(), and TransRefTemp().
void reset_local_comp_regions_map | ( | void | ) |
}}
{{ translate inner most references
{{ init RT and SS
}}
Loop | oop |
Desc | esc |
Definition at line 490 of file ss.c.
References CAR, CDR, comp_desc_reference, comp_desc_section, comp_sec_hull, ComputeRTandSS(), EXPRESSION, NIL, pips_debug, ref, and reference_indices.
Referenced by TranslateToLoop().
void set_local_comp_regions_map | ( | statement_mapping | ) |
Referenced by comp_regions(), and get_any_comp_regions_text().
simple_section SimpUnion | ( | simple_section | S1, |
simple_section | S2 | ||
) |
}}
{{ SimpUnion
SG: i am unsure this is a valid init
allocate a simple_section
{{ update reference template
update reference template
if a subscript is invariant or boundary expression is not constant
then whole dimension is assumed to be used
}}
{{ update simple sections
scan all boundary pairs
later insert code for releasing the space of LSEC and USEC
compute new lower boundary in the union
compute new upper boundary in the union
}}
S1 | 1 |
S2 | 2 |
Definition at line 1013 of file ss.c.
References context_info_rank, context_info_undefined, GetRefTemp(), is_rtype_linvariant, is_rtype_nonlinear, LSEC, make_dad_struct(), make_simple_section(), MaxBoundary(), MinBoundary(), NIL, PutBoundPair(), PutRefTemp(), simple_section_context, and USEC.
bool summary_complementary_sections | ( | const char * | module_name | ) |
cproto-generated files
cproto-generated files
}}
omp_global_regions(module_name);
module_name | odule_name |
Definition at line 31 of file comp_sections.c.
References DB_PUT_MEMORY_RESOURCE, make_comp_desc_set(), module_name(), NIL, and strdup().
}}
{{ text all comp_regions text text_all_comp_regions(list l_reg) input : a list of comp_regions output : a text representing this list (with non-array comp_regions)
l_reg | _reg |
Definition at line 329 of file prettyprint.c.
References EFFECT, make_text(), MAP, MERGE_TEXTS, NIL, and text_region().
}}
{{ text region text text_region(effect reg) input : a region output : a text consisting of several lines of commentaries, representing the region modifies : nothing
reg | eg |
Definition at line 375 of file prettyprint.c.
References ADD_SENTENCE_TO_TEXT, effect_undefined, free_text(), get_bool_property(), make_pred_commentary_sentence(), make_text(), NIL, PIPS_NORMAL_PREFIX, REGION_FORESYS_PREFIX, strdup(), user_log(), words_effect(), and words_predicate_to_commentary().
Referenced by text_comp_regions().
}}
{{ text comp_regions text text_comp_regions(list l_reg) input : a list of comp_regions output : a text representing this list (with non-array comp_regions)
change later
l_reg | _reg |
Definition at line 347 of file prettyprint.c.
References EFFECT, effect_entity(), entity_scalar_p(), make_text(), MAP, MERGE_TEXTS, NIL, and text_comp_region().
}}
{{ translate to outer loop comp list {{ translate the set to the outer loop
ThisLoop | hisLoop |
ListOfComps | istOfComps |
Definition at line 577 of file ss.c.
References COMP_DESC, MAP, and TranslateToLoop().
Referenced by comp_regions_of_loop().
}}
{{ translate to loop
ThisLoop | hisLoop |
Desc | esc |
Definition at line 589 of file ss.c.
References comp_desc_section, comp_sec_hull, GET_NEST, MULTI, PUT_NEST, ScanAllDims(), SINGLE, TransRefTemp(), TransSimpSec(), UpdateUnresolved(), and ZERO.
Referenced by TranslateRefsToLoop().
}}
{{ TransRefTemp
iterate through all entries of reference template
process only linear elements
Pass only normalized expression into Divexists
variant w.r.t this loop index
ThisLoop | hisLoop |
Desc | esc |
Definition at line 612 of file ss.c.
References comp_desc_reference, comp_desc_section, comp_sec_hull, CONS, context_info_rank, DivExists(), gen_nconc(), GetAccVec(), GetRefTemp(), INT, is_rtype_linvariant, is_rtype_nonlinear, Variants::New, NIL, NORMALIZE_EXPRESSION, normalized_linear, Variants::Old, pips_debug, PutRefTemp(), Ref, and simple_section_context.
Referenced by TranslateToLoop().
{{ declarations
}}
{{ Diagonal Boundaries for old and new
{{ compute offset in the tSS array to store diagonal boundaries
}}
{{ compute diagonal boundaries Xi + Xj
compute index for tSS array
copying done inside MergeLinExprs lbExpr = CopyAccVec(LSEC(Dad, I)); TmpExpr1 = CopyAccVec(LSEC(Dad, J));
ubExpr = CopyAccVec(USEC(Dad, I)); TmpExpr2 = CopyAccVec(USEC(Dad, J));
}}
{{ compute diagonal boundaries Xi - Xj
compute index for tSS array
}}
}}
{{ Compute parallel boundaries only for new variants
{{ compute Xi = c
bug unsigned Offset = J;
}}
}}
{{ Compute diagonal boundaries for new variants
set size must be atleast 2
{{ compute diagonals
set an iterator for the newvar
{{ iterators 1 and 2
set this iterator to next element in the first list
}}
{{ compute index for storing in tSS array
}}
{{ compute diagonal boundary Xi + Xj
}}
{{ compute diagonal boundary Xi - Xj
}}
}}
}}
Desc | esc |
Loop | oop |
Vars | ars |
Definition at line 782 of file ss.c.
References CAR, CardinalityOf(), CDR, comp_desc_section, comp_sec_hull, ComputeBoundaries(), ComputeIndex(), context_info_rank, CopyAccVec(), ENDP, Index, INT, LSEC, MAP, MergeLinExprs(), MINUS, Variants::New, New, Variants::Old, pips_debug, PLUS, simple_section_context, and USEC.
Referenced by TranslateToLoop().
only one step in pips ! it provides direct substitution functions
{{ substitution step
substitute with lower bound
substitute with upper bound
make a copy because vect_var_subst modifies NewVect
}}
Loop | oop |
Lin | in |
Definition at line 961 of file ss.c.
References CopyAccVec(), loop_index, loop_range, my_vect_var_subst(), NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, range_lower, range_upper, Val, and vect_coeff().
Referenced by ComputeBoundaries(), ComputeRTandSS(), and UpdateUnresolved().
void UpdateUnresolved | ( | simple_section | Dad, |
loop | Loop | ||
) |
}}
{{ TransSimpSec
{{ declarations
}}
{{ Update unresolved boundaries
{{ update parallel or diagonal boundaries with induction variable
{{ scan all dimensions
ComputeBoundaries(Dad, Loop, lbExpr, ubExpr, ZhiExprNo);
}}
}}
{{ update diagonal boundaries whose parallel components are constants
{{ process only linear subscripts
{{ compute index
}}
{{ update diagonals
{{ update Xi + Xj
lower boundary
bug fix : check boundary otherwise it will get overwritten
{{ update
copy done in MergeLinExpr lbExpr = CopyAccVec(LSEC(Dad, I));
LSEC(Dad,PlusOffset) = lbExpr;
}}
upper boundary
{{ update
USEC(PlusOffset) = ubExpr;
}}
}}
{{ update Xi - Xj
lower boundary
{{ upate
lbExpr = CopyAccVec(LSEC(J));
LSEC(MinusOffset) = lbExpr;
}}
upper boundary
{{ update
ubExpr = CopyAccVec(USEC(J));
USEC(MinusOffset) = ubExpr;
}}
}}
}}
}}
}}
}}
Dad | ad |
Loop | oop |
Definition at line 667 of file ss.c.
References ComputeIndex(), context_info_rank, DivExists(), GetRefTemp(), Index, is_rtype_nonlinear, IsExprConst(), Lbound(), LSEC, MergeLinExprs(), MINUS, PLUS, PutBoundPair(), simple_section_context, Ubound(), and USEC.
Referenced by TranslateToLoop().