PIPS
comp_sections.h File Reference
+ This graph shows which files directly or indirectly include this file:

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...
 

Functions

bool summary_complementary_sections (const char *)
 cproto-generated files More...
 
bool complementary_sections (const char *)
 
bool print_code_complementary_sections (const char *)
 
bool local_comp_regions_map_undefined_p (void)
 propagate.c More...
 
void set_local_comp_regions_map (statement_mapping)
 
statement_mapping get_local_comp_regions_map (void)
 
void reset_local_comp_regions_map (void)
 
void free_local_comp_regions_map (void)
 
void make_local_comp_regions_map (void)
 
list load_statement_local_comp_regions (statement)
 
void delete_statement_local_comp_regions (statement)
 
bool statement_local_comp_regions_undefined_p (statement)
 
void store_statement_local_comp_regions (statement, list)
 
void update_statement_local_comp_regions (statement, list)
 
void CheckStride (loop)
 
list CompRegionsExactUnion (list, list, bool(*)(effect, effect))
 
list CompRegionsMayUnion (list, list, bool(*)(effect, effect))
 
bool comp_regions (const char *)
 }}} More...
 
list comp_regions_of_statement (statement)
 }}} More...
 
list comp_regions_of_instruction (instruction, transformer, transformer, list *)
 }}} More...
 
list comp_regions_of_block (list)
 }}} More...
 
list comp_regions_of_test (test, transformer, list *)
 
list comp_regions_of_loop (loop, transformer, transformer, list *)
 
list comp_regions_of_call (call, transformer, list *)
 }}} More...
 
list comp_regions_of_unstructured (unstructured, transformer)
 }}} More...
 
list comp_regions_of_range (range, transformer)
 }}} More...
 
list comp_regions_of_syntax (syntax, transformer)
 }}} More...
 
list comp_regions_of_expressions (list, transformer)
 }}} More...
 
list comp_regions_of_expression (expression, transformer)
 {{{ comp_regions_of_expression More...
 
list comp_regions_of_read (reference, transformer)
 }}} More...
 
list comp_regions_of_write (reference, transformer)
 }}} More...
 
Pvecteur my_vect_var_subst (Pvecteur, Variable, Pvecteur)
 ss.c More...
 
Pvecteur my_vect_substract (Pvecteur, Pvecteur)
 
void PrintCompRegions (list)
 }} More...
 
void PrintLinExpr (Pvecteur)
 }} More...
 
void PrintSimp (comp_desc)
 }} More...
 
void DisplayDad (comp_desc)
 
void DisplayRefTemp (simple_section)
 }} More...
 
void DisplaySimpleSection (simple_section)
 }} More...
 
tag GetRefTemp (simple_section, _int)
 }} More...
 
void PutRefTemp (simple_section, int, tag)
 }} More...
 
Pvecteur GetBoundary (simple_section, int, unsigned)
 }} More...
 
void PutBoundPair (simple_section, _int, Pvecteur, Pvecteur)
 }} More...
 
Pvecteur MinBoundary (Pvecteur, Pvecteur)
 }} More...
 
Pvecteur MaxBoundary (Pvecteur, Pvecteur)
 }} More...
 
Pvecteur MergeLinExprs (Pvecteur, Pvecteur, OpFlag)
 }} More...
 
unsigned int ComputeIndex (unsigned int, unsigned int, unsigned int)
 }} More...
 
Pvecteur CopyAccVec (Pvecteur)
 }} More...
 
bool IsExprConst (Pvecteur)
 }} More...
 
bool DivExists (loop, Pvecteur)
 check whether loop index variable var is contained in LinExpr More...
 
expression GetAccVec (unsigned, const reference)
 return the n'th subscript expression More...
 
unsigned int CardinalityOf (list)
 
dad_struct AllocateDadStruct (int)
 }} More...
 
simple_section AllocateSimpleSection (reference)
 
void ScanAllDims (loop, comp_desc)
 }} More...
 
void ComputeRTandSS (expression, unsigned, simple_section, loop)
 initialise reference template and shapes for inner most references More...
 
void TranslateRefsToLoop (loop, list)
 }} More...
 
void TranslateToLoop (loop, comp_desc)
 }} More...
 
tVariants TransRefTemp (loop, comp_desc)
 }} More...
 
void UpdateUnresolved (simple_section, loop)
 }} More...
 
void ComputeBoundaries (simple_section, loop, Pvecteur, Pvecteur, unsigned)
 compute both boundary expression and store in the tSS array More...
 
void TransSimpSec (comp_desc, loop, tVariants *)
 
Pvecteur Lbound (loop, Pvecteur)
 }} More...
 
Pvecteur Ubound (loop, Pvecteur)
 
simple_section SimpUnion (simple_section, simple_section)
 }} More...
 
comp_desc InitCompDesc (reference, tag)
 operators.c More...
 
comp_sec CompUnion (comp_sec, comp_sec)
 
bool CompIntersection (comp_sec, comp_sec)
 
list comp_regions_of_intrinsic (entity, list, transformer)
 myintrinsics.c More...
 
list proper_comp_regions_of_intrinsic (entity, list, transformer)
 }} More...
 
list no_write_comp_regions (entity, list, transformer)
 
list affect_comp_regions (entity, list, transformer)
 
list io_comp_regions (entity, list, transformer)
 }} More...
 
list comp_regions_of_ioelem (expression, tag, transformer)
 }} More...
 
list comp_regions_of_iolist (list, tag, transformer)
 }} More...
 
list comp_regions_of_implied_do (expression, tag, transformer)
 }} More...
 
comp_desc_set list_to_comp_secs (list)
 dbase.c More...
 
list comp_desc_set_to_list (comp_desc_set)
 
statement_mapping listmap_to_compsecs_map (statement_mapping)
 
statement_mapping comp_secs_map_to_listmap (statement_mapping)
 
list comp_regions_dup (list)
 REGIONS AND LISTS OF REGIONS MANIPULATION
More...
 
comp_desc comp_region_dup (comp_desc)
 
list comp_region_add_to_regions (comp_desc, list)
 void region_add_to_regions(region reg, list l_reg) input : a region and a list of regions. More...
 
text get_text_comp_regions (const char *)
 prettyprint.c More...
 
bool print_source_comp_regions (const char *)
 
bool print_code_comp_regions (const char *)
 
text text_all_comp_regions (list)
 }} More...
 
text text_comp_regions (list)
 }} More...
 
text text_comp_region (effect)
 }} More...
 

Macro Definition Documentation

◆ GET_NEST

Definition at line 44 of file comp_sections.h.

◆ LIN_INVARIANT

#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.

◆ LIN_VARIANT

#define LIN_VARIANT   1

Definition at line 37 of file comp_sections.h.

◆ LinExpr

#define LinExpr   Pvecteur

A linear expression in Pips ; Pvecteur is a pointer.

Definition at line 67 of file comp_sections.h.

◆ LSEC

#define LSEC (   x,
 
)    GetBoundary(x,i,1)

accessing DAD components

Definition at line 41 of file comp_sections.h.

◆ MAX_RANK

#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.

◆ NON_LINEAR

#define NON_LINEAR   -1

Definition at line 38 of file comp_sections.h.

◆ PUT_NEST

#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.

◆ SEQUENTIAL_COMPSEC_SUFFIX

#define SEQUENTIAL_COMPSEC_SUFFIX   ".csec"

Definition at line 110 of file comp_sections.h.

◆ USEC

#define USEC (   x,
 
)    GetBoundary(x,i,0)

Definition at line 42 of file comp_sections.h.

◆ USER_COMPSEC_SUFFIX

#define USER_COMPSEC_SUFFIX   ".ucsec"

Definition at line 111 of file comp_sections.h.

Typedef Documentation

◆ DadComp

typedef struct DadComponent DadComp

Simple Section part of DAD An array of type SimpBound struct allocated dynamically based on rank of array.

◆ tDad

}}

}}

Definition at line 107 of file comp_sections.h.

◆ tRT

typedef unsigned int tRT

{{ 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.

◆ tSS

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

◆ tVariants

typedef struct Variants tVariants

}}

{{ Data structures required for computing Dads {{ structures for TranslateToLoop structure to hold both Old and New variants

Enumeration Type Documentation

◆ BoundType

enum BoundType

}}

Enumerator
LOWER 
UPPER 
LOWER 
UPPER 
LOWER 
UPPER 

Definition at line 48 of file comp_sections.h.

48 {LOWER, UPPER};
@ LOWER
Definition: comp_sections.h:48
@ UPPER
Definition: comp_sections.h:48

◆ NestType

enum NestType
Enumerator
ZERO 
SINGLE 
MULTI 
ZERO 
SINGLE 
MULTI 
ZERO 
SINGLE 
MULTI 

Definition at line 50 of file comp_sections.h.

50 {ZERO, SINGLE, MULTI};
@ SINGLE
Definition: comp_sections.h:50
@ MULTI
Definition: comp_sections.h:50
@ ZERO
Definition: comp_sections.h:50

◆ OpFlag

enum OpFlag

used for merging linear expressions

Enumerator
PLUS 
MINUS 
PLUS 
MINUS 
PLUS 
MINUS 

Definition at line 53 of file comp_sections.h.

53 { PLUS, MINUS} OpFlag;
OpFlag
used for merging linear expressions
Definition: comp_sections.h:53
@ PLUS
Definition: comp_sections.h:53
@ MINUS
Definition: comp_sections.h:53

◆ RefType

enum RefType
Enumerator
READ 
WRITE 
READ 
WRITE 
READ 
WRITE 

Definition at line 49 of file comp_sections.h.

49 {READ, WRITE};
@ WRITE
Definition: comp_sections.h:49
@ READ
Definition: comp_sections.h:49

Function Documentation

◆ affect_comp_regions()

list affect_comp_regions ( entity  ,
list  ,
transformer   
)

◆ AllocateDadStruct()

dad_struct AllocateDadStruct ( int  Rank)

}}

{{ allocate simple section allocate a structure to hold Dad

initialize the reference template

initialize the shape

Parameters
Rankank

Definition at line 440 of file ss.c.

441 {
442  dad_struct Dad;
443  bound_pair Bounds;
444  int cnt;
445  list RefTempList = NIL;
446  list BoundList = NIL;
448 
449  /* initialize the reference template */
450  for (cnt = 0; cnt < Rank; cnt++) {
451  RefTempList = gen_nconc(RefTempList,
452  CONS(REF_TEMP,make_ref_temp(cnt, Ref), NIL));
453  }
454 
455  /* initialize the shape */
456  for (cnt = 0; cnt < Rank * Rank; cnt++) {
457  Bounds = make_bound_pair(cnt, NULL, NULL);
458  BoundList = gen_nconc(BoundList, CONS(BOUND_PAIR, Bounds, NIL));
459  }
460 
461  Dad = make_dad_struct(RefTempList, BoundList);
462 
463  return (Dad);
464 }
ref_temp make_ref_temp(intptr_t a1, rtype a2)
Definition: compsec.c:306
rtype make_rtype(enum rtype_utype tag, void *val)
Definition: compsec.c:356
bound_pair make_bound_pair(intptr_t a1, Pvecteur a2, Pvecteur a3)
Definition: compsec.c:54
dad_struct make_dad_struct(list a1, list a2)
Definition: compsec.c:264
static hash_table Ref
Refs maps each statement to the effects it references.
Definition: chains.c:96
#define BOUND_PAIR(x)
newgen_simple_section_domain_defined
Definition: compsec.h:107
#define REF_TEMP(x)
REF_TEMP.
Definition: compsec.h:328
@ is_rtype_nonlinear
Definition: compsec.h:385
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define UU
Definition: newgen_types.h:98
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AllocateSimpleSection()

simple_section AllocateSimpleSection ( reference  ref)

{{ intialize the data structure

}}

Parameters
refef

Definition at line 467 of file ss.c.

468 {
469 #define LINE 0
470  unsigned int Rank;
471  context_info Context;
472  dad_struct DadStruct;
473  simple_section Dad;
474  variable TmpVar;
475 
477 
478  /*{{{ intialize the data structure */
479  Rank = CardinalityOf(variable_dimensions(TmpVar));
480  Context = make_context_info(LINE, Rank, ZERO);
481  DadStruct = AllocateDadStruct(Rank);
482  Dad = make_simple_section(Context, DadStruct);
483  /*}}}*/
484  return (Dad);
485 }
simple_section make_simple_section(context_info a1, dad_struct a2)
Definition: compsec.c:407
context_info make_context_info(intptr_t a1, intptr_t a2, intptr_t a3)
Definition: compsec.c:222
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
#define reference_variable(x)
Definition: ri.h:2326
#define type_variable(x)
Definition: ri.h:2949
#define variable_dimensions(x)
Definition: ri.h:3122
#define entity_type(x)
Definition: ri.h:2792
dad_struct AllocateDadStruct(int Rank)
}}
Definition: ss.c:440
unsigned int CardinalityOf(list gl)
Definition: ss.c:428
#define LINE

References AllocateDadStruct(), CardinalityOf(), entity_type, LINE, make_context_info(), make_simple_section(), ref, reference_variable, type_variable, variable_dimensions, and ZERO.

Referenced by InitCompDesc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CardinalityOf()

unsigned int CardinalityOf ( list  gl)

re-used Pips functional programs !!!

Parameters
gll

Definition at line 428 of file ss.c.

429 {
430  /* re-used Pips functional programs !!! */
431  return gen_length(gl);
432 }
size_t gen_length(const list l)
Definition: list.c:150

References gen_length().

Referenced by AllocateSimpleSection(), and TransSimpSec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckStride()

void CheckStride ( loop  )

◆ comp_desc_set_to_list()

list comp_desc_set_to_list ( comp_desc_set  cset)
Parameters
csetset

Definition at line 40 of file dbase.c.

42 {
43  list l_res = comp_desc_set_comp_descs(cset);
44  return l_res;
45 }
#define comp_desc_set_comp_descs(x)
Definition: compsec.h:213

References comp_desc_set_comp_descs.

Referenced by comp_secs_map_to_listmap(), and get_any_comp_regions_text().

+ Here is the caller graph for this function:

◆ comp_region_add_to_regions()

list comp_region_add_to_regions ( comp_desc  reg,
list  l_reg 
)

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.

Parameters
regeg
l_reg_reg

Definition at line 111 of file dbase.c.

112 {
113  return gen_nconc(l_reg, CONS(COMP_DESC, reg, NIL));
114 }
#define COMP_DESC(x)
COMP_DESC.
Definition: compsec.h:146

References COMP_DESC, CONS, gen_nconc(), and NIL.

Referenced by comp_regions_dup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_region_dup()

comp_desc comp_region_dup ( comp_desc  reg)

debug_region_consistency(reg);

work around persistency of comp_desc reference

Parameters
regeg

Definition at line 95 of file dbase.c.

96 {
97  comp_desc new_reg;
98 
99  /* debug_region_consistency(reg); */
100  new_reg = copy_comp_desc(reg);
101  /* work around persistency of comp_desc reference */
103  return(new_reg);
104 }
comp_desc copy_comp_desc(comp_desc p)
COMP_DESC.
Definition: compsec.c:60
reference copy_reference(reference p)
REFERENCE.
Definition: ri.c:2047
#define comp_desc_reference(x)
Definition: compsec.h:177

References comp_desc_reference, copy_comp_desc(), and copy_reference().

Referenced by comp_regions_dup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions()

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

regions_init();

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

}}}

}}}

Parameters
module_nameodule_name

Definition at line 87 of file propagate.c.

88 {
89  /* {{{ code*/
90  /* {{{ initialize*/
91  /* regions_init(); */
92 
93  /* get the current properties concerning regions */
95 
96  /* Get the code of the module. */
98  db_get_memory_resource(DBR_CODE, module_name, true) );
99  /* }}} */
100  /* {{{ transformers and preconditions*/
101  /* Get the transformers and preconditions of the module. */
103  db_get_memory_resource(DBR_TRANSFORMERS, module_name, true) );
105  db_get_memory_resource(DBR_PRECONDITIONS, module_name, true) );
106  /* }}} */
107  /* {{{ predicates for purpose of debugging*/
108  /* predicates defining summary regions from callees have to be
109  translated into variables local to module */
111 
112 
114  db_get_memory_resource(DBR_CUMULATED_EFFECTS, module_name, true));
116  db_get_memory_resource(DBR_PROPER_EFFECTS, module_name, true));
118 
119  debug_on("COMP_REGIONS_DEBUG_LEVEL");
120  pips_debug(3, "begin\n");
121 
122  /* }}} */
123  /* }}} */
124  /* Compute the regions of the module. */
126  /* {{{ for dependence analysis : currently masked */
127  /* set_proper_regions_map( MAKE_STATEMENT_MAPPING() ); */
128  /* }}} */
130  /* {{{ code*/
131  /* {{{ debug stmts*/
132  /* if (op_statistics_p()) print_regions_op_statistics(module_name, R_RW); */
133 
134  pips_debug(3, "end\n");
135 
136  debug_off();
137  /* }}} */
138  /* {{{ store in database : modify later*/
139  DB_PUT_MEMORY_RESOURCE(DBR_COMPSEC,
142 
143 
144  /* DB_PUT_MEMORY_RESOURCE(DBR_PROPER_REGIONS,
145  strdup(module_name),
146  (char*) listmap_to_effectsmap(get_proper_regions_map()));
147  */
148  /* }}} */
149  /* {{{ finalise*/
157  /* }}} */
158  /* }}} */
159 
160  return(true);
161 }
statement_mapping get_local_comp_regions_map(void)
statement_mapping listmap_to_compsecs_map(statement_mapping)
Definition: dbase.c:47
void free_local_comp_regions_map(void)
void set_local_comp_regions_map(statement_mapping)
void get_regions_properties(void)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
void reset_cumulated_rw_effects(void)
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
void reset_current_module_statement(void)
Reset the current module statement.
Definition: static.c:221
statement set_current_module_statement(statement)
Set the current module statement.
Definition: static.c:165
statement get_current_module_statement(void)
Get the current module statement.
Definition: static.c:208
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
#define debug_on(env)
Definition: misc-local.h:157
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define debug_off()
Definition: misc-local.h:160
#define MAKE_STATEMENT_MAPPING()
Definition: newgen-local.h:43
list comp_regions_of_statement(statement s)
}}}
Definition: propagate.c:173
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
Definition: entity.c:1450
char * strdup()
void module_to_value_mappings(entity m)
void module_to_value_mappings(entity m): build hash tables between variables and values (old,...
Definition: mappings.c:624
void set_transformer_map(statement_mapping)
void reset_precondition_map(void)
void set_precondition_map(statement_mapping)
void reset_transformer_map(void)

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_dup()

list comp_regions_dup ( list  l_reg)

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.

Parameters
l_reg_reg

Definition at line 82 of file dbase.c.

83 {
84  list l_reg_dup = NIL;
85 
86  MAP(COMP_DESC, reg,
87  {
88  comp_desc reg_dup = comp_region_dup(reg);
89  l_reg_dup = comp_region_add_to_regions(reg_dup, l_reg_dup);
90  }, l_reg);
91 
92  return(l_reg_dup);
93 }
list comp_region_add_to_regions(comp_desc reg, list l_reg)
void region_add_to_regions(region reg, list l_reg) input : a region and a list of regions.
Definition: dbase.c:111
comp_desc comp_region_dup(comp_desc reg)
Definition: dbase.c:95
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
Definition: newgen_list.h:226

References COMP_DESC, comp_region_add_to_regions(), comp_region_dup(), MAP, and NIL.

Referenced by comp_regions_of_statement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_block()

list comp_regions_of_block ( list  linst)

}}}

{{{ 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

}}}

}}}

Parameters
linstinst

Definition at line 301 of file propagate.c.

302 {
303  /* {{{ init*/
304  statement first_statement;
305  list remaining_block, first_s_regions, lres = NIL;
306 
307  pips_debug(3, "begin\n");
308  /* }}} */
309 
310  /* {{{ Is it end of list ? */
311  if (ENDP(linst))
312  {
313  user_warning("regions_of_block", "empty block\n");
314  lres = NIL;
315  }
316  /* }}} */
317  /* {{{ else process list*/
318  else
319  {
320  /* {{{ regions of CAR(linst)*/
321  first_statement = STATEMENT(CAR(linst));
322  remaining_block = CDR(linst);
323 
324  first_s_regions = comp_regions_of_statement(first_statement);
325  /* }}} */
326  /* {{{ any more statements in CDR(linst)*/
327  if (!ENDP(remaining_block))
328  {
329  /* {{{ load transformer*/
330  list r_block_regions = NIL;
331 
332  /* }}} */
333  r_block_regions = comp_regions_of_block(remaining_block);
334  /* {{{ perform union*/
335  /* {{{ don't know that this means ???*/
336  /* blocked : check later
337  list current_transformer = load_statement_transformer(first_statement);
338  debug_regions_consistency(r_block_regions);
339  project_regions_with_transformer_inverse(r_block_regions,
340  current_transformer,
341  NIL);
342 
343  debug_regions_consistency(r_block_regions);
344  */
345  /* }}} */
346  lres = CompRegionsExactUnion(first_s_regions, r_block_regions, effects_same_action_p);
347  /*
348  debug_regions_consistency(lres);
349  */
350  /* }}} */
351 
352  }
353  /* }}} */
354  /* {{{ if not lres = first_s_regions*/
355  else
356  lres = first_s_regions;
357  /* }}} */
358 
359  }
360  /* }}} */
361 
362  pips_debug(3, "end\n");
363  return lres;
364 }
bool effects_same_action_p(effect, effect)
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define user_warning(fn,...)
Definition: misc-local.h:262
list comp_regions_of_block(list linst)
}}}
Definition: propagate.c:301
list CompRegionsExactUnion(list l1, list l2, bool __attribute__((unused))(*union_combinable_p)(effect, effect))
just concatentate list for now : change later
Definition: propagate.c:57
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_call()

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);

}}}

Parameters
contextontext
plpropreglpropreg

Definition at line 510 of file propagate.c.

511 {
512  list le = NIL;
513  entity e = call_function(c);
514  tag t = value_tag(entity_initial(e));
515  const char* n = module_local_name(e);
516  list pc = call_arguments(c);
517 
518  *plpropreg = NIL;
519 
520  pips_debug(3, "begin\n");
521 
522  switch (t)
523  {
524  /* {{{ code*/
525  case is_value_code:
526  pips_debug(3, "external function %s\n", n);
527  /* masked now : change later */
528  /*
529  le = comp_regions_of_external(e, pc, context);
530  */
531  break;
532 
533  case is_value_intrinsic:
534  pips_debug(3, "intrinsic function %s\n", n);
535  le = comp_regions_of_intrinsic(e, pc, context);
536  /* masked now : *plpropreg = regions_dup(le); */
537  break;
538 
539  case is_value_symbolic:
540  pips_debug(3, "symbolic\n");
541  break;
542 
543  case is_value_constant:
544  pips_debug(3, "constant\n");
545  break;
546 
547  case is_value_unknown:
548  pips_internal_error("unknown function %s", n);
549  break;
550 
551  default:
552  pips_internal_error("unknown tag %d", t);
553  /* }}} */
554  }
555 
556  pips_debug(3, "end\n");
557 
558  return(le);
559 }
list comp_regions_of_intrinsic(entity, list, transformer)
myintrinsics.c
Definition: myintrinsics.c:270
#define pips_internal_error
Definition: misc-local.h:149
int tag
TAG.
Definition: newgen_types.h:92
const char * module_local_name(entity e)
Returns the module local user name.
Definition: entity.c:582
#define value_tag(x)
Definition: ri.h:3064
#define call_function(x)
Definition: ri.h:709
@ is_value_intrinsic
Definition: ri.h:3034
@ is_value_unknown
Definition: ri.h:3035
@ is_value_constant
Definition: ri.h:3033
@ is_value_code
Definition: ri.h:3031
@ is_value_symbolic
Definition: ri.h:3032
#define call_arguments(x)
Definition: ri.h:711
#define entity_initial(x)
Definition: ri.h:2796
Definition: delay.c:253

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_expression()

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 :

Parameters
contextontext

Definition at line 701 of file propagate.c.

702 {
704 }
list comp_regions_of_syntax(syntax s, transformer context)
}}}
Definition: propagate.c:636
#define expression_syntax(x)
Definition: ri.h:1247

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_expressions()

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 :

Parameters
exprsxprs
contextontext

Definition at line 678 of file propagate.c.

679 {
680  list le = NIL;
681 
682  pips_debug(3, "begin\n");
683 
684  MAP(EXPRESSION, exp,
685  {
688  },
689  exprs);
690 
691  pips_debug(5, "end\n");
692  return(le);
693 }
list comp_regions_of_expression(expression e, transformer context)
{{{ comp_regions_of_expression
Definition: propagate.c:701
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_implied_do()

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

Parameters
expxp
actct
contextontext

Definition at line 544 of file myintrinsics.c.

548 {
549  list le, lep, lr, args;
550  transformer local_context;
551  expression arg1, arg2;
552  entity index;
553  range r;
554  reference ref;
555 
556  pips_assert("comp_regions_of_implied_do", expression_implied_do_p(exp));
557 
558  debug(5, "comp_regions_of_implied_do", "begin\n");
559 
561  arg1 = EXPRESSION(CAR(args)); /* loop index */
562  arg2 = EXPRESSION(CAR(CDR(args))); /* range */
563 
564  pips_assert("comp_regions_of_implied_do",
566 
567  pips_assert("comp_regions_of_implied_do",
569 
570 
572  ref = make_reference(index, NIL);
573 
574  r = syntax_range(expression_syntax(arg2));
575 
576  /* regions of implied do index
577  * it is must_written but may read because the implied loop
578  * might execute no iteration.
579  */
580 
581  le = comp_regions_of_write(ref, context); /* the loop index is must-written */
582  /* Read effects are masked by the first write to the implied-do loop variable */
583 
584  /* regions of implied-loop bounds and increment */
587 
588 
589  /* the preconditions of the current statement don't include those
590  * induced by the implied_do, because they are local to the statement.
591  * But we need them to properly calculate the regions.
592  * the solution is to add to the current context the preconditions
593  * due to the current implied_do (think of nested implied_do).
594  * the regions are calculated, and projected along the index.
595  * BA, September 27, 1993.
596  */
597 
598  local_context = transformer_dup(context);
599  local_context = add_index_range_conditions(local_context, index, r,
601  transformer_arguments(local_context) =
603  entity_to_new_value(index));
604 
605  ifdebug(7) {
606  debug(7, "comp_regions_of_implied_do", "local context : \n%s\n",
607  precondition_to_string(local_context));
608  }
609 
610  MAP(EXPRESSION, expr,
611  {
612  syntax s = expression_syntax(expr);
613 
614  if (syntax_reference_p(s))
615  if (act == is_action_write)
616  lep = comp_regions_of_write(syntax_reference(s),local_context);
617  else
618  lep = comp_regions_of_expression(expr, local_context);
619  else
620  /* on a un autre implied_do imbrique' */
621  lep = comp_regions_of_implied_do(expr, act, local_context);
622 
623 
624  /* indices are removed from regions because this is a loop */
625  lr = NIL;
626  MAP(REGION, reg,
627  {
628  if (region_entity(reg) != index)
629  lr = region_add_to_regions(reg,lr);
630  else
631  {
632  debug(5, "comp_regions_of_implied_do", "index removed");
633  region_free(reg);
634  }
635  }, lep);
636  gen_free_list(lep);
638 
639  }, CDR(CDR(args)));
640 
641  ifdebug(7) {
642  debug(7, "comp_regions_of_implied_do", "regions before projection :\n");
643  print_regions(le);
644  fprintf(stderr, "\n");
645  }
646 
648  entity_to_new_value(index),
649  r);
650 
651  ifdebug(6) {
652  debug(6, "comp_regions_of_implied_do", "regions after projection :\n");
653  print_regions(le);
654  fprintf(stderr, "\n");
655  }
656 
657 
658  transformer_free(local_context);
659  local_context = transformer_undefined;
660 
661  debug(5, "comp_regions_of_implied_do", "end\n");
662 
663  return(le);
664 }
reference make_reference(entity a1, list a2)
Definition: ri.c:2083
cons * arguments_add_entity(cons *a, entity e)
Definition: arguments.c:85
transformer transformer_dup(transformer t_in)
transformer package - basic routines
Definition: basic.c:49
void transformer_free(transformer t)
Definition: basic.c:68
list comp_regions_of_write(reference, transformer)
}}}
Definition: propagate.c:753
list CompRegionsExactUnion(list, list, bool(*)(effect, effect))
list comp_regions_of_expression(expression, transformer)
{{{ comp_regions_of_expression
Definition: propagate.c:701
#define region_entity(reg)
#define REGION
list region_add_to_regions(effect, list)
void region_free(effect)
void print_regions(list)
void project_regions_along_loop_index(list, entity, range)
void project_regions_along_loop_index(list l_reg, entity index, l_range) input : a list l_reg of regi...
@ is_action_write
Definition: effects.h:293
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189
list comp_regions_of_implied_do(expression exp, tag act, transformer context)
}}
Definition: myintrinsics.c:544
bool expression_implied_do_p(e)
Definition: expression.c:817
#define syntax_reference_p(x)
Definition: ri.h:2728
#define transformer_undefined
Definition: ri.h:2847
#define syntax_reference(x)
Definition: ri.h:2730
#define syntax_range(x)
Definition: ri.h:2733
#define transformer_arguments(x)
Definition: ri.h:2871
#define syntax_call(x)
Definition: ri.h:2736
#define syntax_range_p(x)
Definition: ri.h:2731
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
transformer add_index_range_conditions(transformer pre, entity i, range r, transformer tfb)
Definition: loop.c:711
#define ifdebug(n)
Definition: sg.c:47
string precondition_to_string(transformer pre)
Definition: prettyprint.c:58
entity entity_to_new_value(entity)
Definition: value.c:859

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_instruction()

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

}}}

}}}

Parameters
t_inst_inst
contextontext
plpropreglpropreg

Definition at line 224 of file propagate.c.

226 {
227  /* {{{ init*/
228  list lreg = NIL;
229 
230  *plpropreg = NIL;
231 
232  /* }}} */
233  switch(instruction_tag(i))
234  {
235  /* {{{ code*/
236  case is_instruction_goto:
237  /* {{{ code*/
238  pips_debug(3, "goto\n");
239  break;
240  /* }}} */
241  case is_instruction_test:
242  /* {{{ code*/
243  ifdebug(3)
244  {
245  pips_debug(3, "test : %s\n",
247  }
248  lreg = comp_regions_of_test(instruction_test(i), context, plpropreg);
249  break;
250  /* }}} */
251  case is_instruction_loop:
252  /* {{{ code*/
253  ifdebug(3)
254  {
255  pips_debug(3, "loop : index %s\n",
257  }
258  lreg = comp_regions_of_loop(instruction_loop(i), t_inst, context, plpropreg);
259  break;
260  /* }}} */
261  case is_instruction_call:
262  /* {{{ code*/
263  ifdebug(3)
264  {
265  pips_debug(3, "call : %s\n",
267  }
268  lreg = comp_regions_of_call(instruction_call(i), context, plpropreg);
269  break;
270  /* }}} */
272  /* {{{ code*/
273  pips_debug(3, "unstructured\n");
275  break ;
276  /* }}} */
277  case is_instruction_block:
278  /* {{{ code*/
279  pips_debug(3, "inst block\n");
281  break;
282  /* }}} */
283  default:
284  pips_debug(3, "unexpected tag %d\n", instruction_tag(i));
285  /* }}} */
286  }
287 
288  return(lreg);
289 }
string expression_to_string(expression e)
Definition: expression.c:77
list comp_regions_of_unstructured(unstructured u, transformer t_unst)
}}}
Definition: propagate.c:571
list comp_regions_of_test(test t, transformer context, list __attribute__((unused)) *plpropreg)
}}}
Definition: propagate.c:375
list comp_regions_of_loop(loop l, transformer __attribute__((unused)) loop_trans, transformer context, list __attribute__((unused)) *plpropreg)
}}}
Definition: propagate.c:416
list comp_regions_of_call(call c, transformer context, list *plpropreg)
}}}
Definition: propagate.c:510
#define is_instruction_block
soft block->sequence transition
#define instruction_block(i)
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
#define instruction_loop(x)
Definition: ri.h:1520
@ is_instruction_goto
Definition: ri.h:1473
@ is_instruction_unstructured
Definition: ri.h:1475
@ is_instruction_test
Definition: ri.h:1470
@ is_instruction_call
Definition: ri.h:1474
@ is_instruction_loop
Definition: ri.h:1471
#define instruction_tag(x)
Definition: ri.h:1511
#define test_condition(x)
Definition: ri.h:2833
#define instruction_call(x)
Definition: ri.h:1529
#define instruction_test(x)
Definition: ri.h:1517
#define instruction_unstructured(x)
Definition: ri.h:1532
#define loop_index(x)
Definition: ri.h:1640

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_intrinsic()

list comp_regions_of_intrinsic ( entity  e,
list  args,
transformer  context 
)

myintrinsics.c

myintrinsics.c

{{ 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 :

Parameters
argsrgs
contextontext

Definition at line 270 of file myintrinsics.c.

274 {
275  return (proper_comp_regions_of_intrinsic(e, args, context));
276 }
list proper_comp_regions_of_intrinsic(entity e, list args, transformer context)
}}
Definition: myintrinsics.c:286

References proper_comp_regions_of_intrinsic().

Referenced by comp_regions_of_call().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_ioelem()

list comp_regions_of_ioelem ( expression  exp,
tag  act,
transformer  context 
)

}}

{{ comp_regions_of_io_element ==============================================================================

Parameters
expxp
actct
contextontext

Definition at line 461 of file myintrinsics.c.

465 {
466  list lr;
467 
468  debug(5, "comp_regions_of_io_elem", "begin\n");
469  if (act == is_action_write) {
471 
472  debug(6, "comp_regions_of_io_elem", "is_action_write\n");
473  pips_assert("comp_regions_of_ioelem", syntax_reference_p(s));
474 
476  }
477  else {
478  debug(6, "comp_regions_of_io_elem", "is_action_read\n");
480  }
481 
482  debug(5, "comp_regions_of_elem", "end\n");
483 
484  return(lr);
485 }

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_iolist()

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/

Parameters
exprsxprs
actct
contextontext

Definition at line 489 of file myintrinsics.c.

493 {
494  list le = NIL;
495  debug(5, "comp_regions_of_io_list", "begin\n");
496  while (!ENDP(exprs))
497  {
498  expression exp = EXPRESSION(CAR(exprs));
499  list lep = NIL;
500 
501  /* There is a bug with effects of io list
502 
503  READ *,N,(T(I),I=1,N)
504 
505  there is write effect on N but for the io list,
506  we don't have this effect !
507 
508  Cause : there is no loop for the list exprs !!! /NN:2000/ */
509 
512  }
513  else {
514  if (act == is_action_write) {
516 
517  debug(6, "comp_regions_of_io_list", "is_action_write");
518  pips_assert("comp_regions_of_iolist", syntax_reference_p(s));
520  }
521  else {
522  debug(6, "comp_regions_of_io_elem", "is_action_read");
524  }
525  }
526 
528 
529  exprs = CDR(exprs);
530  }
531 
532  debug(5, "comp_regions_of_io_list", "end\n");
533 
534  return(le);
535 }

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_loop()

list comp_regions_of_loop ( loop  ,
transformer  ,
transformer  ,
list  
)

◆ comp_regions_of_range()

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 :

Parameters
contextontext

Definition at line 610 of file propagate.c.

611 {
612  list le;
613  expression el = range_lower(r);
614  expression eu = range_upper(r);
615  expression ei = range_increment(r);
616 
617  pips_debug(3, "begin\n");
618 
624 
625  pips_debug(3, "end\n");
626  return(le);
627 }
#define range_upper(x)
Definition: ri.h:2290
#define range_increment(x)
Definition: ri.h:2292
#define range_lower(x)
Definition: ri.h:2288

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_read()

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

}}}

}}}

Parameters
refef
contextontext

Definition at line 715 of file propagate.c.

716 {
717  /* {{{ init*/
718  list inds = reference_indices(ref);
719  list le = NIL;
720  comp_desc Cdesc;
722 
723  pips_debug(3, "begin\n");
724  /* }}} */
725 
726  /* {{{ code*/
727  /* {{{ this read reference*/
728  if (! entity_scalar_p(e) )
729  {
730  Cdesc = InitCompDesc(ref, is_action_read);
731  le = CONS(COMP_DESC, Cdesc, le);
732  }
733  /* }}} */
734  /* {{{ rest of the references in an expression*/
735  if (! ENDP(inds))
737 
738  /* }}} */
739  /* }}} */
740 
741  pips_debug(3, "end\n");
742  return(le);
743 }
comp_desc InitCompDesc(reference, tag)
operators.c
Definition: operators.c:30
@ is_action_read
Definition: effects.h:292
list comp_regions_of_expressions(list exprs, transformer context)
}}}
Definition: propagate.c:678
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
Definition: variable.c:1113
#define reference_indices(x)
Definition: ri.h:2328

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_statement()

list comp_regions_of_statement ( statement  s)

}}}

{{{ 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.

174 {
175  /* {{{ code*/
176  /* {{{ inits*/
177  transformer t_stat, context;
178  list lreg, lpropreg = NIL;
179 
180  ifdebug(3)
181  {
182  pips_debug(3, "begin\n\tComputation of regions of statement %03td\n",
183  statement_number(s));
184  }
185  /* }}} */
186  /* {{{ transformer and preconditions*/
188 
189  /* compute the regions on the instruction of the statement */
190  t_stat = load_statement_transformer(s);
191 
192  /* }}} */
193  /* }}} */
194 
196  t_stat, context, &lpropreg);
197 
198  /* {{{ code*/
199  /* {{{ store the result : currently masked, modify later*/
200  /* FI: make a copy to safely store that intermediate state in the mapping */
201  /* debug_regions_consistency(lreg);
202  debug_regions_consistency(lpropreg);
203  store_statement_proper_regions(s, lpropreg);
204  */
206  /* }}} */
207  /* }}} */
208 
209  return(lreg);
210 }
void store_statement_local_comp_regions(statement, list)
list comp_regions_dup(list)
REGIONS AND LISTS OF REGIONS MANIPULATION
Definition: dbase.c:82
list comp_regions_of_instruction(instruction i, transformer t_inst, transformer context, list *plpropreg)
}}}
Definition: propagate.c:224
#define statement_instruction(x)
Definition: ri.h:2458
#define statement_number(x)
Definition: ri.h:2452
transformer load_statement_precondition(statement)
transformer load_statement_transformer(statement)

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_syntax()

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);

}}}

Parameters
contextontext

Definition at line 636 of file propagate.c.

637 {
638  list le = NIL, lpropreg = NIL;
639 
640  pips_debug(3, "begin\n");
641 
642  switch(syntax_tag(s))
643  {
644  /* {{{ code*/
645  case is_syntax_reference:
647  break;
648  case is_syntax_range:
650  break;
651  case is_syntax_call:
652  le = comp_regions_of_call(syntax_call(s), context, &lpropreg);
653  /* comp_desc_free(lpropreg); */
654  break;
655  default:
656  pips_internal_error("unexpected tag %d", syntax_tag(s));
657  /* }}} */
658  }
659 
660  ifdebug(3)
661  {
662  pips_debug(3, "Regions of expression %s :\n",
664  print_regions(le);
665  }
666 
667  pips_debug(3, "end\n");
668  return(le);
669 }
list Words_Syntax(syntax obj)
Definition: misc.c:2664
list comp_regions_of_range(range r, transformer context)
}}}
Definition: propagate.c:610
list comp_regions_of_read(reference ref, transformer context)
}}}
Definition: propagate.c:715
#define syntax_tag(x)
Definition: ri.h:2727
@ is_syntax_range
Definition: ri.h:2692
@ is_syntax_call
Definition: ri.h:2693
@ is_syntax_reference
Definition: ri.h:2691
string words_to_string(cons *lw)
Definition: print.c:211

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_test()

list comp_regions_of_test ( test  ,
transformer  ,
list  
)

◆ comp_regions_of_unstructured()

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

Parameters
t_unst_unst

Definition at line 571 of file propagate.c.

572 {
573  control ct;
574  list blocs = NIL ;
575  list le = NIL ;
576 
577  pips_debug(3, "begin\n");
578 
579  ct = unstructured_control( u );
580 
581  if(control_predecessors(ct) == NIL && control_successors(ct) == NIL)
582  {
583  /* there is only one statement in u; no need for a fix-point */
584  pips_debug(3, "unique node\n");
586  }
587  else
588  {
589  CONTROL_MAP(c,
590  {
592  le, effects_same_action_p) ;
593  },ct, blocs) ;
595  gen_free_list(blocs) ;
596  }
597 
598  pips_debug(3, "end\n");
599 
600  return( le ) ;
601 }
void project_regions_along_parameters(list, list)
void project_regions_along_parameters(list l_reg, list l_param) input : a list of regions to project,...
#define CONTROL_MAP(ctl, code, c, list)
Macro to walk through all the controls reachable from a given control node of an unstructured.
list CompRegionsMayUnion(list l1, list l2, bool __attribute__((unused))(*union_combinable_p)(effect, effect))
just concatentate list for now : change later
Definition: propagate.c:63
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define control_predecessors(x)
Definition: ri.h:943
#define control_successors(x)
Definition: ri.h:945
#define control_statement(x)
Definition: ri.h:941

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_regions_of_write()

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

}}}

Parameters
refef
contextontext

Definition at line 753 of file propagate.c.

754 {
755  /* {{{ init*/
756  comp_desc Cdesc;
757  list le = NIL;
759  list inds = reference_indices(ref);
760  /* }}} */
761 
762  pips_debug(3, "begin\n");
763 
764  /* {{{ this write */
765  if (! entity_scalar_p(e) )
766  {
767  Cdesc = InitCompDesc(ref, is_action_write);
768  le = CONS(COMP_DESC, Cdesc, le);
769  }
770  /* }}} */
771  /* {{{ check for arrays in subscripts*/
772  if (! ENDP(inds))
774 
775  /* }}} */
776 
777  pips_debug(3, "end\n");
778 
779  return(le);
780 }

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ comp_secs_map_to_listmap()

statement_mapping comp_secs_map_to_listmap ( statement_mapping  compsecs_map)
Parameters
compsecs_mapompsecs_map

Definition at line 60 of file dbase.c.

62 {
64 
65  STATEMENT_MAPPING_MAP(s,val,{
66  hash_put((hash_table) l_map, (char *) s, (char *) comp_desc_set_to_list((comp_desc_set) val));
67  }, compsecs_map);
68 
69  return l_map;
70 }
list comp_desc_set_to_list(comp_desc_set cset)
Definition: dbase.c:40
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
Definition: hash.c:364
#define STATEMENT_MAPPING_MAP(s, v, code, h)
Definition: newgen-local.h:53

References comp_desc_set_to_list(), hash_put(), MAKE_STATEMENT_MAPPING, and STATEMENT_MAPPING_MAP.

Referenced by get_any_comp_regions_text().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CompIntersection()

bool CompIntersection ( comp_sec  ,
comp_sec   
)

◆ complementary_sections()

bool complementary_sections ( const char *  module_name)
Parameters
module_nameodule_name

Definition at line 40 of file comp_sections.c.

41 {
43  return(true);
44 }
bool comp_regions(const char *)
}}}
Definition: propagate.c:87

References comp_regions(), and module_name().

+ Here is the call graph for this function:

◆ CompRegionsExactUnion()

list CompRegionsExactUnion ( list  ,
list  ,
bool(*)(effect, effect  
)

Referenced by affect_comp_regions(), comp_regions_of_implied_do(), comp_regions_of_iolist(), and io_comp_regions().

+ Here is the caller graph for this function:

◆ CompRegionsMayUnion()

list CompRegionsMayUnion ( list  ,
list  ,
bool(*)(effect, effect  
)

◆ CompUnion()

comp_sec CompUnion ( comp_sec  ,
comp_sec   
)

◆ ComputeBoundaries()

void ComputeBoundaries ( simple_section  Dad,
loop  Loop,
Pvecteur  lbExpr,
Pvecteur  ubExpr,
unsigned  Offset 
)

compute both boundary expression and store in the tSS array

{{ about

}}

Parameters
Dadad
Loopoop
lbExprbExpr
ubExprbExpr
Offsetffset

Definition at line 765 of file ss.c.

766 {
767  LinExpr Low, Up;
768 
769  Low = lbExpr;
770  Up = ubExpr;
771 
772  /*{{{ about */
773  if (DivExists(Loop, lbExpr))
774  Low = Lbound(Loop, lbExpr);
775  if (DivExists(Loop, ubExpr))
776  Up = Ubound(Loop, ubExpr);
777  PutBoundPair(Dad, Offset, Low, Up);
778  /*}}}*/
779 }
LinExpr Ubound(loop Loop, LinExpr Lin)
Definition: ss.c:961
LinExpr Lbound(loop Loop, LinExpr Lin)
}}
Definition: ss.c:910
void PutBoundPair(simple_section Dad, _int DimNo, LinExpr Low, LinExpr Up)
}}
Definition: ss.c:290
bool DivExists(loop Loop, LinExpr Lin)
check whether loop index variable var is contained in LinExpr
Definition: ss.c:396
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89

References DivExists(), Lbound(), PutBoundPair(), and Ubound().

Referenced by TransSimpSec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ComputeIndex()

unsigned int ComputeIndex ( unsigned int  I,
unsigned int  J,
unsigned int  Rank 
)

}}

{{ ComputeIndex compute index of tSS array for a boundary

Parameters
Rankank

Definition at line 362 of file ss.c.

363 {
364  unsigned int LoIndex, HiIndex, Index, i;
365 
366  LoIndex = (I < J) ? I : J;
367  HiIndex = (I < J) ? J : I;
368  Index = 0;
369  for (i = 1; i < (LoIndex + 1); i++)
370  Index = Index + (Rank - i);
371  Index = Index + (HiIndex - LoIndex) - 1;
372  return (Index);
373 }
#define Index(p, i, j)
Definition: pip__tab.h:45

References Index.

Referenced by TransSimpSec(), and UpdateUnresolved().

+ Here is the caller graph for this function:

◆ ComputeRTandSS()

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

}}

Parameters
Subub
DimNoimNo
Dadad
Loopoop

Definition at line 524 of file ss.c.

525 {
526  normalized Nexpr;
527 
528  Nexpr = NORMALIZE_EXPRESSION(Sub);
529 
530  if (!normalized_linear_p(Nexpr)) {
531  /*{{{ non-linear */
532  /*
533  * non linear subscripts if it is non-linear we don't bother to
534  * distinguish between invariant and variant ; they are just non-linear
535  */
536  PutRefTemp(Dad, DimNo, is_rtype_nonlinear);
537  /*}}}*/
538  }
539  else {
540  LinExpr Low, Up;
541 
542  /*{{{ linear */
543  /* copy the subscript expression into the shape descriptor */
544  Low = CopyAccVec(normalized_linear(Nexpr));
545  Up = CopyAccVec(normalized_linear(Nexpr));
546 
547  PutBoundPair(Dad, DimNo, Low, Up);
548 
549  if(IsExprConst(normalized_linear(Nexpr)) == true ) {
550  PutRefTemp(Dad, DimNo, is_rtype_linvariant);
551  }
552  else {
553  /* linear subscripts : update if DIV exists */
554  if (DivExists(Loop, normalized_linear(Nexpr))) {
555  Low = Lbound(Loop, LSEC(Dad, DimNo));
556  Up = Ubound(Loop, USEC(Dad, DimNo));
557  PutBoundPair(Dad, DimNo, Low, Up);
558  PutRefTemp(Dad, DimNo, is_rtype_linvariant);
559  }
560  else {
561  PutRefTemp(Dad, DimNo, is_rtype_lininvariant);
562  }
563  }
564  /*}}}*/
565  }
566 }
#define USEC(x, i)
#define LSEC(x, i)
accessing DAD components
@ is_rtype_lininvariant
Definition: compsec.h:387
@ is_rtype_linvariant
Definition: compsec.h:386
#define NORMALIZE_EXPRESSION(e)
#define normalized_linear_p(x)
Definition: ri.h:1779
#define normalized_linear(x)
Definition: ri.h:1781
bool IsExprConst(LinExpr Expr)
}}
Definition: ss.c:388
LinExpr CopyAccVec(LinExpr Expr)
}}
Definition: ss.c:378
void PutRefTemp(simple_section Dad, int DimNo, tag Val)
}}
Definition: ss.c:248

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CopyAccVec()

Pvecteur CopyAccVec ( LinExpr  Expr)

}}

{{ CopyAccVec

re-used function from alloc.c

Parameters
Exprxpr

Definition at line 378 of file ss.c.

379 {
380  /* re-used function from alloc.c */
381  return (vect_dup(Expr));
382 }
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Definition: alloc.c:51

References vect_dup().

Referenced by ComputeRTandSS(), Lbound(), TransSimpSec(), and Ubound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete_statement_local_comp_regions()

void delete_statement_local_comp_regions ( statement  )

◆ DisplayDad()

void DisplayDad ( comp_desc  TheDad)
Parameters
TheDadheDad

Definition at line 107 of file ss.c.

108 {
111 
112  fprintf(stderr, "\nData Access Descriptor for %s \n", entity_minimal_name(Var));
113 
114  DisplayRefTemp(Dad);
116  fprintf(stderr, "\n");
117 
118 }
#define comp_desc_section(x)
Definition: compsec.h:181
#define comp_sec_hull(x)
Definition: compsec.h:247
const char * entity_minimal_name(entity e)
Do preserve scope informations.
Definition: naming.c:214
void DisplaySimpleSection(simple_section Dad)
}}
Definition: ss.c:161
void DisplayRefTemp(simple_section Dad)
}}
Definition: ss.c:123

References comp_desc_reference, comp_desc_section, comp_sec_hull, DisplayRefTemp(), DisplaySimpleSection(), entity_minimal_name(), fprintf(), and reference_variable.

Referenced by PrintSimp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DisplayRefTemp()

void DisplayRefTemp ( simple_section  Dad)

}}

{{ DisplayRefTemp

Parameters
Dadad

Definition at line 123 of file ss.c.

124 {
125  unsigned Rank;
126  unsigned int i;
128 
130 
131  fprintf(stderr, "\nReference Template :: \n[ ");
132  for (i = 0; i < Rank; i++) {
133  RefType = GetRefTemp(Dad, i);
134  switch (RefType) {
136  fprintf(stderr, "INV");
137  break;
138  case is_rtype_linvariant:
139  fprintf(stderr, "VAR");
140  break;
141  case is_rtype_nonlinear:
142  fprintf(stderr, "NON");
143  break;
144  default:
145  fprintf(stderr, "NUL");
146  break;
147  }
148 
149  if (i < (Rank - 1))
150  fprintf(stderr, ", ");
151  else
152  fprintf(stderr, " ]\n");
153  }
154  fprintf(stderr, "\n");
155 }
#define simple_section_context(x)
Definition: compsec.h:449
#define context_info_rank(x)
Definition: compsec.h:286
#define tag_undefined
Definition: newgen_types.h:93
tag GetRefTemp(simple_section Dad, _int DimNo)
}}
Definition: ss.c:229

References context_info_rank, fprintf(), GetRefTemp(), is_rtype_lininvariant, is_rtype_linvariant, is_rtype_nonlinear, simple_section_context, and tag_undefined.

Referenced by DisplayDad().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DisplaySimpleSection()

void DisplaySimpleSection ( simple_section  Dad)

}}

{{ DisplaySimpSec

{{ xi = c

}}

{{ Xi+Xj = c

{{ print

}}

{{ index

}}

}}

{{ Xi-Xj

}}

Parameters
Dadad

Definition at line 161 of file ss.c.

162 {
163  unsigned int i, I, J, K;
164  unsigned Rank = context_info_rank(simple_section_context(Dad));
165 
166  fprintf(stderr, "\nBoundary Pairs ::\n");
167  /*{{{ xi = c */
168 
169  for (i = 0; i < Rank; i++) {
170  PrintLinExpr(LSEC(Dad, i));
171  fprintf(stderr, " <= X%d <= ", i);
172  PrintLinExpr(USEC(Dad, i));
173  fprintf(stderr, "\n");
174  }
175  /*}}}*/
176 
177  /*{{{ Xi+Xj = c */
178  I = 0;
179  K = Rank - I - 2;
180  J = I + 1;
181  for (; i < ((Rank * (Rank + 1)) / 2); i++) {
182  /*{{{ print */
183  PrintLinExpr(LSEC(Dad, i));
184  fprintf(stderr, " <= X%d + X%d <= ", I, J);
185  PrintLinExpr(USEC(Dad, i));
186  fprintf(stderr, "\n");
187  /*}}}*/
188  /*{{{ index */
189  if (K < 1) {
190  I += 1;
191  J = I + 1;
192  K = Rank - I - 2;
193  } else {
194  K -= 1;
195  J += 1;
196  }
197  /*}}}*/
198  }
199  /*}}}*/
200  /*{{{ Xi-Xj */
201  I = 0;
202  K = Rank - I - 2;
203  J = I + 1;
204  for (; i < (Rank * Rank); i++) {
205  PrintLinExpr(LSEC(Dad, i));
206  fprintf(stderr, " <= X%d - X%d <= ", I, J);
207  PrintLinExpr(USEC(Dad, i));
208  fprintf(stderr, "\n");
209  if (K < 1) {
210  I += 1;
211  J = I + 1;
212  K = Rank - I - 2;
213  } else {
214  K -= 1;
215  J += 1;
216  }
217  }
218  /*}}}*/
219 
220  fprintf(stderr, "\n");
221 
222 }
void PrintLinExpr(LinExpr Lin)
}}
Definition: ss.c:87

References context_info_rank, fprintf(), LSEC, PrintLinExpr(), simple_section_context, and USEC.

Referenced by DisplayDad().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DivExists()

bool DivExists ( loop  Loop,
Pvecteur  Lin 
)

check whether loop index variable var is contained in LinExpr

Parameters
Loopoop
Linin

Definition at line 396 of file ss.c.

397 {
398  entity ent;
399  Pvecteur Vec;
400  bool Val;
401 
402  ent = loop_index(Loop);
403  Vec = (Pvecteur) Lin;
404  Val = vect_contains_variable_p(Vec, (Variable) ent);
405  return (Val);
406 
407 }
#define Val
struct Svecteur * Pvecteur
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60
bool vect_contains_variable_p(Pvecteur v, Variable var)
bool vect_contains_variable_p(Pvecteur v, Variable var) BA 19/05/94 input : a vector and a variable o...
Definition: unaires.c:415

References loop_index, Val, and vect_contains_variable_p().

Referenced by ComputeBoundaries(), ComputeRTandSS(), TransRefTemp(), and UpdateUnresolved().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_local_comp_regions_map()

void free_local_comp_regions_map ( void  )

Referenced by comp_regions(), and get_any_comp_regions_text().

+ Here is the caller graph for this function:

◆ get_local_comp_regions_map()

statement_mapping get_local_comp_regions_map ( void  )

Referenced by comp_regions().

+ Here is the caller graph for this function:

◆ get_text_comp_regions()

text get_text_comp_regions ( const char *  module_name)

prettyprint.c

prettyprint.c

Parameters
module_nameodule_name

Definition at line 72 of file prettyprint.c.

73 {
74  is_user_view_p = false;
75  in_out_comp_regions_p = false;
76 
78  DBR_REGIONS,
79  DBR_SUMMARY_REGIONS,
80  false);
81 }
static text get_any_comp_regions_text(const char *, string, string, bool)
{{ get any comp_regions text
Definition: prettyprint.c:154
static bool is_user_view_p
Definition: prettyprint.c:62
static bool in_out_comp_regions_p
{{{ function prototype
Definition: prettyprint.c:61

References get_any_comp_regions_text(), in_out_comp_regions_p, is_user_view_p, and module_name().

+ Here is the call graph for this function:

◆ GetAccVec()

expression GetAccVec ( unsigned  No,
const  reference 
)

return the n'th subscript expression

Parameters
Noo
referenceef

Definition at line 411 of file ss.c.

412 {
413  unsigned Cur = 0;
414  list inds = reference_indices(ref);
415 
416  MAP(EXPRESSION, index,
417  {
418  if (Cur == No)
419  return (index);
420  Cur++;
421  }, inds);
422 
423  return (NULL);
424 
425 }

References EXPRESSION, MAP, ref, and reference_indices.

Referenced by TransRefTemp().

+ Here is the caller graph for this function:

◆ GetBoundary()

Pvecteur GetBoundary ( simple_section  Dad,
int  DimNo,
unsigned  Low 
)

}}

{{ GetBoundaryPair return the lower or upper boundary

Parameters
Dadad
DimNoimNo
Lowow

Definition at line 266 of file ss.c.

267 {
268  list BoundPair = dad_struct_shape(simple_section_dad(Dad));
269  LinExpr Lin = NULL;
270 
271  MAP(BOUND_PAIR, bp,
272  {
273  if (bound_pair_index(bp) == DimNo) {
274  if (Low == 1) {
275  Lin = bound_pair_lb(bp);
276  } else {
277  Lin = bound_pair_ub(bp);
278  }
279  break;
280  }
281  }, BoundPair);
282 
283  return(Lin);
284 }
#define bound_pair_ub(x)
Definition: compsec.h:142
#define dad_struct_shape(x)
Definition: compsec.h:324
#define bound_pair_index(x)
Definition: compsec.h:138
#define simple_section_dad(x)
Definition: compsec.h:451
#define bound_pair_lb(x)
Definition: compsec.h:140

References BOUND_PAIR, bound_pair_index, bound_pair_lb, bound_pair_ub, dad_struct_shape, MAP, and simple_section_dad.

◆ GetRefTemp()

tag GetRefTemp ( simple_section  Dad,
_int  DimNo 
)

}}

}} {{ auxilliary functions {{ GetRefTemp

Parameters
Dadad
DimNoimNo

Definition at line 229 of file ss.c.

230 {
232  tag ret_tag = tag_undefined;
233 
234  FOREACH(REF_TEMP, Ref, Rtemp)
235  {
236  if (ref_temp_index(Ref) == DimNo) {
237  ret_tag = rtype_tag(ref_temp_rtype(Ref));
238  break;
239  }
240  }
241 
242  return(ret_tag);
243 }
#define ref_temp_index(x)
Definition: compsec.h:358
#define dad_struct_rtemps(x)
Definition: compsec.h:322
#define rtype_tag(x)
Definition: compsec.h:406
#define ref_temp_rtype(x)
Definition: compsec.h:360
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179

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().

+ Here is the caller graph for this function:

◆ InitCompDesc()

comp_desc InitCompDesc ( reference  ref,
tag  ReadWrite 
)

operators.c

operators.c

precondition : this function should be called for array varaibles only

{{ code

{{ inits

}}

{{ code

}}

}}

Parameters
refef
ReadWriteeadWrite

Definition at line 30 of file operators.c.

31 {
32  /* precondition : this function should be called
33  for array varaibles only
34  */
35 
36  /*{{{ code*/
37  /*{{{ inits*/
38  comp_desc Descriptor;
39  simple_section Hull;
40  reference DupRef;
41  entity e;
42  action DupAct;
43  comp_sec DupSec;
44  /*}}}*/
45 
46  pips_debug(3, "begin\n");
47  DupRef = copy_reference(ref);
48 
49  e = reference_variable(DupRef);
50 
51  /*{{{ code*/
52  if (entity_scalar_p(e)) {
53  pips_debug(1, "InitCompDesc : scalar variable encountered \n ");
54  return NULL;
55  }
56 
57  pips_debug(3, "InitCompDesc : Array entity name %s \n ",func_entity_name(e) );
58 
59  Hull = AllocateSimpleSection(DupRef);
60  DupAct = make_action(ReadWrite, UU);
61  DupSec = make_comp_sec(Hull, NIL);
62  Descriptor = make_comp_desc (DupRef, DupAct, DupSec) ;
63  /*}}}*/
64  pips_debug(3, "end\n");
65 
66  return(Descriptor);
67  /*}}}*/
68 }
comp_desc make_comp_desc(reference a1, action a2, comp_sec a3)
Definition: compsec.c:96
comp_sec make_comp_sec(simple_section a1, list a2)
Definition: compsec.c:180
action make_action(enum action_utype tag, void *val)
Definition: effects.c:120
simple_section AllocateSimpleSection(reference)
Definition: ss.c:467
char * func_entity_name(entity)

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ io_comp_regions()

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 ...

Parameters
argsrgs
contextontext

Definition at line 378 of file myintrinsics.c.

382 {
383  list le = NIL, pc, lep;
384 
385  debug(5, "io_comp_regions", "begin\n");
386 
387  for (pc = args; pc != NIL; pc = CDR(pc)) {
389  entity ci;
391 
392  pips_assert("io_comp_regions", syntax_call_p(s));
393 
394  ci = call_function(syntax_call(s));
396 
397  pc = CDR(pc);
398 
399  if (strcmp(p->IoElementName, "IOLIST=") == 0) {
401  }
402  else {
404  p->ReadOrWrite, context);
405  }
406 
407  if (p->MayOrMust == is_approximation_may)
408  {
409  MAP(REGION, reg,
410  {
413  }, lep);
414  }
415 
417 
418  /* regions effects on logical units - taken from effects/io.c */
419  if ((get_bool_property ("PRETTYPRINT_IO_EFFECTS")) &&
420  (pc != NIL) &&
421  (strcmp(p->IoElementName, "UNIT=") == 0))
422  {
423  /* We simulate actions on files by read/write actions
424  to a static integer array
425  GO:
426  It is necessary to do a read and and write action to
427  the array, because it updates the file-pointer so
428  it reads it and then writes it ...*/
429  entity private_io_entity;
430  reference ref;
431  list indices = NIL;
432 
435  EXPRESSION(CAR(pc)),NIL));
436 
437  private_io_entity = FindEntity(TOP_LEVEL_MODULE_NAME,
439 
440  pips_assert("regions_effects", private_io_entity != entity_undefined);
441 
442  ref = make_reference(private_io_entity,indices);
443  le = CompRegionsExactUnion(le,
446  le = CompRegionsExactUnion(le,
449 
450  }
451 
452  }
453 
454  debug(5, "io_comp_regions", "end\n");
455 
456  return(le);
457 }
list comp_regions_of_read(reference, transformer)
}}}
Definition: propagate.c:715
#define approximation_tag(x)
Definition: effects.h:362
@ is_approximation_may
Definition: effects.h:341
#define effect_approximation(x)
Definition: effects.h:644
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
static list indices
Definition: icm.c:204
static IoElementDescriptor * SearchIoElement(char *s, char *i) const
}}
Definition: myintrinsics.c:361
list comp_regions_of_iolist(list exprs, tag act, transformer context)
}}
Definition: myintrinsics.c:489
list comp_regions_of_ioelem(expression exp, tag act, transformer context)
}}
Definition: myintrinsics.c:461
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
Definition: naming-local.h:101
#define IO_EFFECTS_ARRAY_NAME
array of Logical UNits; it is more or less handled as the current file pointer; in C,...
entity FindEntity(const char *package, const char *name)
Retrieve an entity from its package/module name and its local name.
Definition: entity.c:1503
#define syntax_call_p(x)
Definition: ri.h:2734
#define entity_undefined
Definition: ri.h:2761

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.

+ Here is the call graph for this function:

◆ IsExprConst()

bool IsExprConst ( LinExpr  Expr)

}}

check whether a given expresion is a constant

Parameters
Exprxpr

Definition at line 388 of file ss.c.

389 {
390  return (vect_constant_p(Expr));
391 }
bool vect_constant_p(Pvecteur)
bool vect_constant_p(Pvecteur v): v contains only a constant term, may be zero
Definition: predicats.c:211

References vect_constant_p().

Referenced by ComputeRTandSS(), and UpdateUnresolved().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Lbound()

Pvecteur Lbound ( loop  Loop,
LinExpr  Lin 
)

}}

}} {{ 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

}}

Parameters
Loopoop
Linin

Definition at line 910 of file ss.c.

911 {
912  /*
913  * preconditions : lbound is invoked only if DivExists and if only on
914  * LinExprs
915  */
916 
917  expression TmpExpr;
918  normalized Nexpr;
919  LinExpr NewLin, NewVect;
920  entity Var = loop_index(Loop);
921 
922  /* only one step in pips ! it provides direct substitution functions */
923  /*{{{ substitution step */
924  /*
925  * use the lower/upper bound of the index variable depending on the sign of
926  * the coefficient
927  */
928  /*
929  * this needs to be changed if the representation for linear expression is
930  * changed to accommodate symbolic coefficients
931  */
932 
933  int Val = vect_coeff((Variable) Var, Lin);
934  if ((Val > 0)) {
935  /* substitute with lower bound */
936  TmpExpr = range_lower(loop_range(Loop));
937  } else {
938  /* substitute with upper bound */
939  TmpExpr = range_upper(loop_range(Loop));
940  }
941 
942  Nexpr = NORMALIZE_EXPRESSION(TmpExpr);
943  if (normalized_linear_p(Nexpr)) {
944  /* make a copy because vect_var_subst modifies NewVect */
945  NewVect = CopyAccVec(normalized_linear(Nexpr));
946  NewLin = my_vect_var_subst(Lin, (Variable) Var, NewVect);
947  }
948  else {
949  NewLin = NULL;
950  }
951 
952  /*}}}*/
953  return (NewLin);
954 }
#define loop_range(x)
Definition: ri.h:1642
Pvecteur my_vect_var_subst(Pvecteur vect, Variable var, Pvecteur new_vect)
{{ my vect var subst function
Definition: ss.c:35
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
Definition: unaires.c:228

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ list_to_comp_secs()

comp_desc_set list_to_comp_secs ( list  l_eff)

dbase.c

dbase.c



Parameters
l_eff_eff

Definition at line 33 of file dbase.c.

35 {
36  comp_desc_set res = make_comp_desc_set(l_eff);
37  return res;
38 }
comp_desc_set make_comp_desc_set(list a)
Definition: compsec.c:138

References make_comp_desc_set().

Referenced by listmap_to_compsecs_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listmap_to_compsecs_map()

statement_mapping listmap_to_compsecs_map ( statement_mapping  l_map)
Parameters
l_map_map

Definition at line 47 of file dbase.c.

49 {
50  statement_mapping comp_secs_map = MAKE_STATEMENT_MAPPING();
51 
53  {
54  hash_put((hash_table) comp_secs_map, (char *) s, (char *) list_to_comp_secs((list) val));
55  }, l_map);
56 
57  return comp_secs_map;
58 }
comp_desc_set list_to_comp_secs(list l_eff)
list-comp_desc conversion functions
Definition: dbase.c:33

References hash_put(), list_to_comp_secs(), MAKE_STATEMENT_MAPPING, and STATEMENT_MAPPING_MAP.

Referenced by comp_regions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_statement_local_comp_regions()

list load_statement_local_comp_regions ( statement  )

Referenced by text_statement_array_comp_regions().

+ Here is the caller graph for this function:

◆ local_comp_regions_map_undefined_p()

bool local_comp_regions_map_undefined_p ( void  )

◆ make_local_comp_regions_map()

void make_local_comp_regions_map ( void  )

◆ MaxBoundary()

Pvecteur MaxBoundary ( LinExpr  Lin1,
LinExpr  Lin2 
)

}}

{{ MaxBoundary substitute with new boundary

Parameters
Lin1in1
Lin2in2

Definition at line 335 of file ss.c.

336 {
337  int Result;
338 
339  Result = vect_compare(&Lin1, &Lin2);
340  if (Result > 0)
341  return (vect_dup(Lin1));
342  else
343  return (vect_dup(Lin2));
344 }
int vect_compare(Pvecteur *pv1, Pvecteur *pv2)
for qsort, returns:
Definition: unaires.c:352

References vect_compare(), and vect_dup().

Referenced by SimpUnion().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MergeLinExprs()

Pvecteur MergeLinExprs ( LinExpr  Expr1,
LinExpr  Expr2,
OpFlag  Op 
)

}}

{{ MergeLinExprs

must free Expr1 because vect_add will return a copy : check later

Parameters
Expr1xpr1
Expr2xpr2
Opp

Definition at line 349 of file ss.c.

350 {
351  /* must free Expr1 because vect_add will return a copy : check later */
352  if (Op == PLUS)
353  return (vect_add(Expr1, Expr2));
354  else
355  return (my_vect_substract(Expr1, Expr2));
356 }
#define PLUS
Definition: sc_gram.c:200
Pvecteur my_vect_substract(Pvecteur pvec1, Pvecteur pvec2)
Definition: ss.c:50
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Definition: binaires.c:53

References my_vect_substract(), PLUS, and vect_add().

Referenced by TransSimpSec(), and UpdateUnresolved().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MinBoundary()

Pvecteur MinBoundary ( LinExpr  Lin1,
LinExpr  Lin2 
)

}}

{{ MinBoundary substitute with new boundary

Parameters
Lin1in1
Lin2in2

Definition at line 320 of file ss.c.

321 {
322  int Result;
323 
324  Result = vect_compare(&Lin1, &Lin2);
325  if (Result < 0)
326  return (vect_dup(Lin1));
327  else
328  return (vect_dup(Lin2));
329 }

References vect_compare(), and vect_dup().

Referenced by SimpUnion().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ my_vect_substract()

Pvecteur my_vect_substract ( Pvecteur  pvec1,
Pvecteur  pvec2 
)

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);

Parameters
pvec1vec1
pvec2vec2

Definition at line 50 of file ss.c.

52 {
53  int coeff;
54  Pvecteur dvec = vect_dup (pvec1);
55 /* Pvecteur var_val;
56  for (var_val = pvec2; var_val!= NIL;
57  vect_add_elem (&dvec,var_of(var_val),-val_of(var_val)),var_val=var_val->succ);
58  */
59 
60  Pvecteur v2 = pvec2;
61  for ( ; v2!= NULL; v2=v2->succ) {
62  coeff = 0-(val_of(v2));
63  vect_add_elem (&dvec,var_of(v2), coeff);
64  }
65 
66  return (dvec);
67 }
struct Svecteur * succ
Definition: vecteur-local.h:92
#define val_of(varval)
#define var_of(varval)
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...
Definition: unaires.c:72

References Svecteur::succ, val_of, var_of, vect_add_elem(), and vect_dup().

Referenced by MergeLinExprs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ my_vect_var_subst()

Pvecteur my_vect_var_subst ( Pvecteur  vect,
Variable  var,
Pvecteur  new_vect 
)

ss.c

ss.c

mimicked this function from paf-tuil/utils.c because it was misbehaving !!

Parameters
vectect
varar
new_vectew_vect

Definition at line 35 of file ss.c.

36 {
38  Value val;
39 
40  if ((val = vect_coeff(var,vect)) != 0)
41  {
42  vect_erase_var(&vect,var);
43  vect_aux = vect_multiply(new_vect,val);
44  vect = vect_add(vect, vect_aux);
45  }
46 
47  return(vect);
48 }
int Value
Pvecteur vect_multiply(Pvecteur v, Value x)
Pvecteur vect_multiply(Pvecteur v, Value x): multiplication du vecteur v par le scalaire x,...
Definition: scalaires.c:123
Pvecteur vect_aux
Definition: solpip.c:102
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....
Definition: unaires.c:106

References vect_add(), vect_aux, vect_coeff(), vect_erase_var(), and vect_multiply().

Referenced by Lbound(), and Ubound().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ no_write_comp_regions()

list no_write_comp_regions ( entity  ,
list  ,
transformer   
)

◆ print_code_comp_regions()

bool print_code_comp_regions ( const char *  )

Referenced by print_code_complementary_sections().

+ Here is the caller graph for this function:

◆ print_code_complementary_sections()

bool print_code_complementary_sections ( const char *  module_name)
Parameters
module_nameodule_name

Definition at line 46 of file comp_sections.c.

47 {
49  return(true);
50 }
bool print_code_comp_regions(const char *)

References module_name(), and print_code_comp_regions().

+ Here is the call graph for this function:

◆ print_source_comp_regions()

bool print_source_comp_regions ( const char *  )

◆ PrintCompRegions()

void PrintCompRegions ( list  CompList)

}}

{{ PrintSimpleSection {{ PrintCompRegions

Parameters
CompListompList

Definition at line 74 of file ss.c.

75 {
76  if (CompList != NIL) {
77  MAP(COMP_DESC, Cdesc,
78  {
79  PrintSimp(Cdesc);
80  }, CompList);
81  }
82 }
void PrintSimp(comp_desc Dad)
}}
Definition: ss.c:99

References COMP_DESC, MAP, NIL, and PrintSimp().

Referenced by comp_regions_of_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintLinExpr()

void PrintLinExpr ( LinExpr  Lin)

}}

{{ PrintLinExpr

call the approprite print routine : check later

Parameters
Linin

Definition at line 87 of file ss.c.

88 {
89  /* call the approprite print routine : check later */
90  if (Lin != NULL)
91  vect_debug(Lin);
92  else
93  fprintf(stderr, "NULL");
94 }
void vect_debug(Pvecteur v)
constraint.c
Definition: constraint.c:43

References fprintf(), and vect_debug().

Referenced by DisplaySimpleSection(), and PutBoundPair().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintSimp()

void PrintSimp ( comp_desc  Dad)

}}

{{ PrintSimp

Parameters
Dadad

Definition at line 99 of file ss.c.

100 {
101  fprintf(stderr, "*********************************************************************\n");
102  DisplayDad(Dad);
103  fprintf(stderr, "---------------------------------------------------------------------\n");
104 }
void DisplayDad(comp_desc TheDad)
Definition: ss.c:107

References DisplayDad(), and fprintf().

Referenced by PrintCompRegions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ proper_comp_regions_of_intrinsic()

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 :

Parameters
argsrgs
contextontext

Definition at line 286 of file myintrinsics.c.

290 {
291  const char* s = entity_local_name(e);
293  list lr;
294 
295  debug(3, "proper_comp_regions_of_intrinsic", "begin\n");
296 
297  while (pid->name != NULL) {
298  if (strcmp(pid->name, s) == 0) {
299  lr = (*(pid->f))(e, args, context);
300  debug(3, "proper_comp_regions_of_intrinsic", "end\n");
301  return(lr);
302  }
303 
304  pid += 1;
305  }
306 
307  pips_internal_error("unknown intrinsic %s", s);
308 
309  return(NIL);
310 }
static IntrinsicEffectDescriptor IntrinsicDescriptorTable[]
Definition: myintrinsics.c:125
the following data structure describes an intrinsic function: its name and the function to apply on a...
Definition: myintrinsics.c:120

References debug(), entity_local_name(), IntrinsicEffectDescriptor::f, IntrinsicDescriptorTable, IntrinsicEffectDescriptor::name, NIL, and pips_internal_error.

Referenced by comp_regions_of_intrinsic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PutBoundPair()

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));

Parameters
Dadad
DimNoimNo
Lowow
Upp

Definition at line 290 of file ss.c.

291 {
292  list BoundPair = dad_struct_shape(simple_section_dad(Dad));
293 
294  ifdebug(5) {
295  pips_debug(5, "PutBoundPair : dump Low and Up vectors \n");
296  PrintLinExpr(Low);
297  PrintLinExpr(Up);
298  }
299 
300  MAP(BOUND_PAIR, bp,
301  {
302  if (bound_pair_index(bp) == DimNo) {
303  if (Low != NULL) {
304  /* check later vect_rm(bound_pair_lb(bp)); */
305  bound_pair_lb_(bp) = (Pvecteur) Low;
306  }
307  if (Up != NULL) {
308  /* check later vect_rm(bound_pair_ub(bp)); */
309  bound_pair_ub_(bp) = (Pvecteur) Up;
310  }
311  return;
312  }
313  }, BoundPair);
314 }
#define bound_pair_lb_(x)
Definition: compsec.h:139
#define bound_pair_ub_(x)
Definition: compsec.h:141

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PutRefTemp()

void PutRefTemp ( simple_section  Dad,
int  DimNo,
tag  Val 
)

}}

{{ PutRefTemp

Parameters
Dadad
DimNoimNo
Valal

Definition at line 248 of file ss.c.

249 {
251 
252  MAP(REF_TEMP, rt,
253  {
254  if (ref_temp_index(rt) == DimNo) {
256  return;
257  }
258  }, Rtemp);
259 
260 }

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().

+ Here is the caller graph for this function:

◆ reset_local_comp_regions_map()

void reset_local_comp_regions_map ( void  )

◆ ScanAllDims()

void ScanAllDims ( loop  Loop,
comp_desc  Desc 
)

}}

{{ translate inner most references

{{ init RT and SS

}}

Parameters
Loopoop
Descesc

Definition at line 490 of file ss.c.

491 {
492  /*
493  * unfortunately an access vector cannot tell to which dimension it
494  * corresponds hence this round about of explicitly tracking the dimension
495  * number
496  */
497  unsigned int DimNo;
498  expression exp_ind;
499  simple_section Dad;
500  reference ref;
501  list inds;
502 
503  pips_debug(3, "begin\n");
504 
505  Dad = comp_sec_hull(comp_desc_section(Desc));
506  ref = comp_desc_reference(Desc);
507 
508  inds = reference_indices(ref);
509 
510  for (DimNo = 0; inds != NIL; DimNo++, inds = CDR(inds)) {
511  /*{{{ init RT and SS */
512  exp_ind = EXPRESSION(CAR(inds));
513  ComputeRTandSS(exp_ind, DimNo, Dad, Loop);
514  /*}}}*/
515  }
516 
517  pips_debug(3, "end\n");
518 
519 }
void ComputeRTandSS(expression Sub, unsigned DimNo, simple_section Dad, loop Loop)
initialise reference template and shapes for inner most references
Definition: ss.c:524

References CAR, CDR, comp_desc_reference, comp_desc_section, comp_sec_hull, ComputeRTandSS(), EXPRESSION, NIL, pips_debug, ref, and reference_indices.

Referenced by TranslateToLoop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_local_comp_regions_map()

void set_local_comp_regions_map ( statement_mapping  )

Referenced by comp_regions(), and get_any_comp_regions_text().

+ Here is the caller graph for this function:

◆ SimpUnion()

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

}}

Parameters
S11
S22

Definition at line 1013 of file ss.c.

1014 {
1015 /* SG: i am unsure this is a valid init */
1017  tag Variant;
1018  size_t i;
1019  LinExpr Low = NULL, Up = NULL;
1020  size_t Rank = context_info_rank(simple_section_context(S1));
1021 
1022  /* allocate a simple_section */
1023 
1024  /*{{{ update reference template */
1025  /* update reference template */
1026  /* if a subscript is invariant or boundary expression is not constant */
1027  /* then whole dimension is assumed to be used */
1028  for (i = 0; i < Rank; i++) {
1029  Variant = ((GetRefTemp(S1, i) == is_rtype_linvariant) &&
1030  (GetRefTemp(S2, i) == is_rtype_linvariant)) ?
1032  PutRefTemp(UnionDad, i, Variant);
1033  }
1034  /*}}}*/
1035  /*{{{ update simple sections */
1036  /* scan all boundary pairs */
1037  for (i = 0; i < (Rank * Rank); i++) {
1038  /* later insert code for releasing the space of LSEC and USEC */
1039  if ((LSEC(S1, i) != NULL) && (LSEC(S2, i) != NULL)) {
1040  /* compute new lower boundary in the union */
1041  Low = MinBoundary(LSEC(S1, i), LSEC(S2, i));
1042  }
1043  if ((USEC(S1, i) != NULL) && (USEC(S2, i) != NULL)) {
1044  /* compute new upper boundary in the union */
1045  Up = MaxBoundary(USEC(S1, i), USEC(S2, i));
1046  }
1047  PutBoundPair(UnionDad, i, Low, Up);
1048  }
1049  /*}}}*/
1050 
1051  return (UnionDad);
1052 }
#define context_info_undefined
Definition: compsec.h:259
LinExpr MaxBoundary(LinExpr Lin1, LinExpr Lin2)
}}
Definition: ss.c:335
LinExpr MinBoundary(LinExpr Lin1, LinExpr Lin2)
}}
Definition: ss.c:320

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.

+ Here is the call graph for this function:

◆ statement_local_comp_regions_undefined_p()

bool statement_local_comp_regions_undefined_p ( statement  )

◆ store_statement_local_comp_regions()

void store_statement_local_comp_regions ( statement  ,
list   
)

Referenced by comp_regions_of_statement().

+ Here is the caller graph for this function:

◆ summary_complementary_sections()

bool summary_complementary_sections ( const char *  module_name)

cproto-generated files

comp_sections.c

cproto-generated files

}}

omp_global_regions(module_name);

Parameters
module_nameodule_name

Definition at line 31 of file comp_sections.c.

32 {
33  /*comp_global_regions(module_name);*/
34  DB_PUT_MEMORY_RESOURCE(DBR_SUMMARY_COMPSEC,
36  (char*) make_comp_desc_set(NIL));
37  return(true);
38 }

References DB_PUT_MEMORY_RESOURCE, make_comp_desc_set(), module_name(), NIL, and strdup().

+ Here is the call graph for this function:

◆ text_all_comp_regions()

text text_all_comp_regions ( list  l_reg)

}}

{{ 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)

Parameters
l_reg_reg

Definition at line 329 of file prettyprint.c.

331 {
332  text reg_text = make_text(NIL);
333 
334  MAP(EFFECT, reg,
335  {
336  MERGE_TEXTS(reg_text, text_region(reg));
337  },
338  l_reg);
339  return(reg_text);
340 }
text make_text(list a)
Definition: text.c:107
text text_region(effect)
#define EFFECT(x)
EFFECT.
Definition: effects.h:608
#define MERGE_TEXTS(r, t)

References EFFECT, make_text(), MAP, MERGE_TEXTS, NIL, and text_region().

+ Here is the call graph for this function:

◆ text_comp_region()

text text_comp_region ( effect  reg)

}}

{{ text region text text_region(effect reg) input : a region output : a text consisting of several lines of commentaries, representing the region modifies : nothing

Parameters
regeg

Definition at line 375 of file prettyprint.c.

377 {
378  text t_reg = make_text(NIL);
379  bool foresys = get_bool_property("PRETTYPRINT_FOR_FORESYS");
380  string str_prefix;
381 
382  if (foresys)
383  str_prefix = REGION_FORESYS_PREFIX;
384  else
385  str_prefix = PIPS_NORMAL_PREFIX;
386 
387  if(reg == effect_undefined)
388  {
389  ADD_SENTENCE_TO_TEXT(t_reg,
390  make_pred_commentary_sentence(strdup("<REGION_UNDEFINED>"),
391  str_prefix));
392  user_log("[region_to_string] unexpected effect undefined\n");
393  }
394  else
395  {
396  free_text(t_reg);
397  t_reg = words_predicate_to_commentary(words_effect(reg), str_prefix);
398  }
399 
400  return(t_reg);
401 }
void user_log(const char *format,...)
Definition: message.c:234
void free_text(text p)
Definition: text.c:74
#define REGION_FORESYS_PREFIX
Definition: prettyprint.c:56
#define PIPS_NORMAL_PREFIX
Definition: prettyprint.c:57
list words_effect(effect)
#define effect_undefined
Definition: effects.h:614
sentence make_pred_commentary_sentence(string str_pred, string comment_prefix)
sentence make_pred_commentary_sentence(string str_pred, string comment_prefix) input : a substring fo...
Definition: prettyprint.c:678
text words_predicate_to_commentary(list w_pred, string comment_prefix)
text words_predicate_to_commentary(list w_pred, string comment_prefix) input : a list of strings,...
Definition: prettyprint.c:653
#define ADD_SENTENCE_TO_TEXT(t, p)

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ text_comp_regions()

text text_comp_regions ( list  l_reg)

}}

{{ 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

Parameters
l_reg_reg

Definition at line 347 of file prettyprint.c.

349 {
350 
351  text reg_text = make_text(NIL);
352  /* change later */
353  return(reg_text);
354 
355  MAP(EFFECT, reg,
356  {
357  entity ent = effect_entity(reg);
358  if (! entity_scalar_p(ent))
359  {
360  MERGE_TEXTS(reg_text, text_comp_region(reg));
361  }
362  },
363  l_reg);
364 
365  return(reg_text);
366 }
text text_comp_region(effect reg)
}}
Definition: prettyprint.c:375
entity effect_entity(effect)
cproto-generated files
Definition: effects.c:52

References EFFECT, effect_entity(), entity_scalar_p(), make_text(), MAP, MERGE_TEXTS, NIL, and text_comp_region().

+ Here is the call graph for this function:

◆ TranslateRefsToLoop()

void TranslateRefsToLoop ( loop  ThisLoop,
list  ListOfComps 
)

}}

{{ translate to outer loop comp list {{ translate the set to the outer loop

Parameters
ThisLoophisLoop
ListOfCompsistOfComps

Definition at line 577 of file ss.c.

578 {
579  MAP(COMP_DESC, Desc,
580  {
581  TranslateToLoop(ThisLoop, Desc);
582  }, ListOfComps);
583 
584 }
void TranslateToLoop(loop ThisLoop, comp_desc Desc)
}}
Definition: ss.c:589

References COMP_DESC, MAP, and TranslateToLoop().

Referenced by comp_regions_of_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TranslateToLoop()

void TranslateToLoop ( loop  ThisLoop,
comp_desc  Desc 
)

}}

{{ translate to loop

Parameters
ThisLoophisLoop
Descesc

Definition at line 589 of file ss.c.

590 {
591  tVariants Vars;
592  simple_section Dad;
593 
594  if (GET_NEST(Desc) == ZERO) {
595  ScanAllDims(ThisLoop, Desc);
596  PUT_NEST(Desc,SINGLE);
597  }
598  else {
599  Vars = TransRefTemp(ThisLoop, Desc);
600  TransSimpSec(Desc, ThisLoop, &Vars);
601  PUT_NEST(Desc,MULTI);
602  }
603 
604  Dad = comp_sec_hull(comp_desc_section(Desc));
605  UpdateUnresolved(Dad, ThisLoop);
606 
607 }
#define GET_NEST(d)
@ SINGLE
#define PUT_NEST(d, val)
void TransSimpSec(comp_desc Desc, loop Loop, tVariants *Vars)
Definition: ss.c:782
tVariants TransRefTemp(loop ThisLoop, comp_desc Desc)
}}
Definition: ss.c:612
void UpdateUnresolved(simple_section Dad, loop Loop)
}}
Definition: ss.c:667
void ScanAllDims(loop Loop, comp_desc Desc)
}}
Definition: ss.c:490

References comp_desc_section, comp_sec_hull, GET_NEST, MULTI, PUT_NEST, ScanAllDims(), SINGLE, TransRefTemp(), TransSimpSec(), UpdateUnresolved(), and ZERO.

Referenced by TranslateRefsToLoop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TransRefTemp()

tVariants TransRefTemp ( loop  ThisLoop,
comp_desc  Desc 
)

}}

{{ 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

Parameters
ThisLoophisLoop
Descesc

Definition at line 612 of file ss.c.

613 {
614  tVariants Vars;
615  simple_section Dad;
616  _int DimNo, Rank;
617  normalized Nexpr;
618  expression TmpExpr;
619  list OldList, NewList, NewEle;
620 
621 
622  comp_sec Csec = comp_desc_section(Desc);
624 
625  Dad = comp_sec_hull(Csec);
627 
628  pips_debug(3, "begin\n");
629 
630  OldList = NIL;
631  NewList = NIL;
632 
633  /* iterate through all entries of reference template */
634  for (DimNo = 0; DimNo < Rank; DimNo++) {
635  /* process only linear elements */
636  if (!(GetRefTemp(Dad, DimNo) == is_rtype_nonlinear)) {
637  /* Pass only normalized expression into Divexists */
638  TmpExpr = GetAccVec(DimNo, Ref);
639  Nexpr = NORMALIZE_EXPRESSION(TmpExpr);
640 
641  if (DivExists(ThisLoop, normalized_linear(Nexpr))) {
642  /* variant w.r.t this loop index */
643  NewEle = CONS(INT, DimNo, NIL);
644  NewList = gen_nconc(NewList, NewEle);
645  PutRefTemp(Dad, DimNo, is_rtype_linvariant);
646  } else {
647  /*
648  * invariant w.r.t. this loop index; but variant w.r.t. previous loop
649  * constant subscripts will also get included in the old list
650  */
651  if (GetRefTemp(Dad, DimNo) == is_rtype_linvariant)
652  OldList = gen_nconc(OldList, CONS(INT, DimNo, NIL));
653  }
654  }
655  }
656 
657  Vars.Old = OldList;
658  Vars.New = NewList;
659 
660  pips_debug(3, "end\n");
661  return (Vars);
662 }
@ INT
Definition: atomic.c:48
intptr_t _int
_INT
Definition: newgen_types.h:53
expression GetAccVec(unsigned No, const reference ref)
return the n'th subscript expression
Definition: ss.c:411

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TransSimpSec()

void TransSimpSec ( comp_desc  Desc,
loop  Loop,
tVariants Vars 
)

{{ 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

}}

}}

}}

Parameters
Descesc
Loopoop
Varsars

Definition at line 782 of file ss.c.

783 {
784  /*{{{ declarations */
785  unsigned Index, Offset;
786  LinExpr lbExpr, ubExpr, TmpExpr1, TmpExpr2;
787 
789  unsigned Rank = context_info_rank(simple_section_context(Dad));
790  list Old = Vars->Old;
791  list New = Vars->New;
792  /*}}}*/
793 
794  pips_debug(3, "begin\n");
795 
796  /*{{{ Diagonal Boundaries for old and new */
797  MAP(INT, I,
798  {
799  MAP(INT, J,
800  {
801  /*{{{ compute offset in the tSS array to store diagonal boundaries */
802  Index = ComputeIndex(I, J, Rank);
803  /*}}}*/
804  /*{{{ compute diagonal boundaries Xi + Xj */
805  /* compute index for tSS array */
806  Offset = Rank + Index;
807  /* copying done inside MergeLinExprs
808  lbExpr = CopyAccVec(LSEC(Dad, I));
809  TmpExpr1 = CopyAccVec(LSEC(Dad, J));
810  */
811  lbExpr = LSEC(Dad, I);
812  TmpExpr1 = LSEC(Dad, J);
813  lbExpr = MergeLinExprs(lbExpr, TmpExpr1, PLUS);
814  /*
815  ubExpr = CopyAccVec(USEC(Dad, I));
816  TmpExpr2 = CopyAccVec(USEC(Dad, J));
817  */
818  ubExpr = USEC(Dad, I);
819  TmpExpr2 = USEC(Dad, J);
820  ubExpr = MergeLinExprs(ubExpr, TmpExpr2, PLUS);
821  ComputeBoundaries(Dad, Loop, lbExpr, ubExpr, Offset);
822  /*}}}*/
823  /*{{{ compute diagonal boundaries Xi - Xj */
824  /* compute index for tSS array */
825  Offset = (Rank * (Rank + 1)) / 2 + Index;
826  /*
827  lbExpr = CopyAccVec(LSEC(Dad, I));
828  TmpExpr1 = CopyAccVec(USEC(Dad, J));
829  */
830  lbExpr = LSEC(Dad, I);
831  TmpExpr1 = USEC(Dad, J);
832  lbExpr = MergeLinExprs(lbExpr, TmpExpr1, MINUS);
833  /*
834  ubExpr = CopyAccVec(USEC(Dad, I));
835  TmpExpr2 = CopyAccVec(LSEC(Dad, J));
836  */
837  ubExpr = USEC(Dad, I);
838  TmpExpr2 = LSEC(Dad, J);
839  ubExpr = MergeLinExprs(ubExpr, TmpExpr2, MINUS);
840  ComputeBoundaries(Dad, Loop, lbExpr, ubExpr, Offset);
841  /*}}}*/
842  }, New);
843  }, Old);
844  /*}}}*/
845  /*{{{ Compute parallel boundaries only for new variants */
846  MAP(INT, J,
847  {
848  /*{{{ compute Xi = c */
849  /* bug unsigned Offset = J; */
850  lbExpr = CopyAccVec(LSEC(Dad, J));
851  ubExpr = CopyAccVec(USEC(Dad, J));
852  ComputeBoundaries(Dad, Loop, lbExpr, ubExpr, J);
853  /*}}}*/
854  }, New);
855  /*}}}*/
856  /*{{{ Compute diagonal boundaries for new variants */
857  /* set size must be atleast 2 */
858  if (CardinalityOf(New) > 1) {
859  int I, J;
860 
861  /*{{{ compute diagonals */
862  /* set an iterator for the newvar */
863  list New_iter1;
864  list New_iter2;
865  New_iter1 = Vars->New;
866  for (; !ENDP(New_iter1); (New_iter1 = CDR(New_iter1))) {
867  /*{{{ iterators 1 and 2 */
868  I = INT(CAR(New_iter1));
869  /* set this iterator to next element in the first list */
870  New_iter2 = CDR(New_iter1);
871  /*}}}*/
872  for (; !ENDP(New_iter2); New_iter2 = CDR(New_iter2)) {
873  J = INT(CAR(New_iter2));
874  /*{{{ compute index for storing in tSS array */
875  Index = ComputeIndex(I, J, Rank);
876  /*}}}*/
877  /*{{{ compute diagonal boundary Xi + Xj */
878  Offset = Rank + Index;
879  TmpExpr1 = LSEC(Dad, J);
880  lbExpr = MergeLinExprs(LSEC(Dad, I), TmpExpr1, PLUS);
881  TmpExpr2 = USEC(Dad, J);
882  ubExpr = MergeLinExprs(USEC(Dad, I), TmpExpr2, PLUS);
883  ComputeBoundaries(Dad, Loop, lbExpr, ubExpr, Offset);
884  /*}}}*/
885  /*{{{ compute diagonal boundary Xi - Xj */
886  Offset = ((Rank * (Rank + 1)) / 2) + Index;
887  TmpExpr1 = USEC(Dad, J);
888  lbExpr = MergeLinExprs(LSEC(Dad, I), TmpExpr1, MINUS);
889  TmpExpr2 = LSEC(Dad, J);
890  ubExpr = MergeLinExprs(USEC(Dad, I), TmpExpr2, MINUS);
891  ComputeBoundaries(Dad, Loop, lbExpr, ubExpr, Offset);
892  /*}}}*/
893  }
894  }
895  /*}}}*/
896  }
897  /*}}}*/
898 
899  pips_debug(3, "end\n");
900 }
#define MINUS
Definition: operator.h:42
#define New
unsigned int ComputeIndex(unsigned int I, unsigned int J, unsigned int Rank)
}}
Definition: ss.c:362
void ComputeBoundaries(simple_section Dad, loop Loop, LinExpr lbExpr, LinExpr ubExpr, unsigned Offset)
compute both boundary expression and store in the tSS array
Definition: ss.c:765
LinExpr MergeLinExprs(LinExpr Expr1, LinExpr Expr2, OpFlag Op)
}}
Definition: ss.c:349

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Ubound()

Pvecteur Ubound ( loop  Loop,
Pvecteur  Lin 
)

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

}}

Parameters
Loopoop
Linin

Definition at line 961 of file ss.c.

962 {
963  /*
964  * preconditions : Ubound is invoked only if DivExists and only on LinExprs
965  */
966  expression TmpExpr;
967  LinExpr NewLin, NewVect;
968  normalized Nexpr;
969 
970  entity Var = loop_index(Loop);
971 
972  /* only one step in pips ! it provides direct substitution functions */
973  /*{{{ substitution step */
974  /*
975  * use the lower/upper bound of the index variable depending on the sign of
976  * the coefficient
977  */
978  /*
979  * this needs to be changed if the representation for linear expression is
980  * changed to accommodate symbolic coefficients
981  */
982 
983  int Val = vect_coeff((Variable) Var, Lin);
984  if ((Val < 0)) {
985  /* substitute with lower bound */
986  TmpExpr = range_lower(loop_range(Loop));
987  } else {
988  /* substitute with upper bound */
989  TmpExpr = range_upper(loop_range(Loop));
990  }
991 
992  Nexpr = NORMALIZE_EXPRESSION(TmpExpr);
993  if (normalized_linear_p(Nexpr) ) {
994  /* make a copy because vect_var_subst modifies NewVect */
995  NewVect = CopyAccVec(normalized_linear(Nexpr));
996  NewLin = my_vect_var_subst(Lin, (Variable) Var, NewVect);
997  }
998  else {
999  NewLin = NULL;
1000  }
1001 
1002  /*}}}*/
1003  return (NewLin);
1004 }

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_statement_local_comp_regions()

void update_statement_local_comp_regions ( statement  ,
list   
)

◆ 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;

}}

}}

}}

}}

}}

}}

Parameters
Dadad
Loopoop

Definition at line 667 of file ss.c.

668 {
669  /*{{{ declarations */
670  unsigned Index, I, J;
671  LinExpr lbExpr, ubExpr;
672  unsigned ZhiExprNo;
673  unsigned Rank = context_info_rank(simple_section_context(Dad));
674  /*}}}*/
675  /*{{{ Update unresolved boundaries */
676  /*{{{ update parallel or diagonal boundaries with induction variable */
677  if (Loop != NULL) {
678  /*{{{ scan all dimensions */
679  for (ZhiExprNo = 0; ZhiExprNo < Rank; ZhiExprNo++) {
680  lbExpr = LSEC(Dad, ZhiExprNo);
681  ubExpr = USEC(Dad, ZhiExprNo);
682  if (DivExists(Loop, lbExpr))
683  lbExpr = Lbound(Loop, lbExpr);
684  if (DivExists(Loop, ubExpr))
685  ubExpr = Ubound(Loop, ubExpr);
686  PutBoundPair(Dad, ZhiExprNo, lbExpr, ubExpr);
687 
688  /* ComputeBoundaries(Dad, Loop, lbExpr, ubExpr, ZhiExprNo); */
689 
690  }
691  /*}}}*/
692  }
693  /*}}}*/
694  /*{{{ update diagonal boundaries whose parallel components are constants */
695  for (I = 0; I < Rank; I++) {
696  for (J = I + 1; J < Rank; J++) {
697  if ((GetRefTemp(Dad, I) != is_rtype_nonlinear) && (GetRefTemp(Dad, J) != is_rtype_nonlinear)) {
698  /*{{{ process only linear subscripts */
699  /*{{{ compute index */
700  int PlusOffset, MinusOffset;
701  Index = ComputeIndex(I, J, Rank);
702  PlusOffset = Rank + Index;
703  MinusOffset = ((Rank * (Rank + 1)) / 2) + Index;
704  /*}}}*/
705  /*{{{ update diagonals */
706  /*{{{ update Xi + Xj */
707  /* lower boundary */
708  /* bug fix : check boundary otherwise it will get overwritten */
709  if (LSEC(Dad, PlusOffset) == NULL) {
710  /*{{{ update */
711  if (IsExprConst(LSEC(Dad, I)) && IsExprConst(LSEC(Dad, J))) {
712  /* copy done in MergeLinExpr lbExpr = CopyAccVec(LSEC(Dad, I)); */
713  lbExpr = MergeLinExprs(LSEC(Dad, I), LSEC(Dad, J), PLUS);
714  /* LSEC(Dad,PlusOffset) = lbExpr; */
715  PutBoundPair(Dad, PlusOffset, lbExpr, NULL);
716  }
717  /*}}}*/
718  }
719  /* upper boundary */
720  if (USEC(Dad, PlusOffset) == NULL) {
721  /*{{{ update */
722  if (IsExprConst(USEC(Dad, I)) && IsExprConst(USEC(Dad, J))) {
723  ubExpr = MergeLinExprs(USEC(Dad, I), USEC(Dad, J), PLUS);
724  /* USEC(PlusOffset) = ubExpr; */
725  PutBoundPair(Dad, PlusOffset, NULL, ubExpr);
726  }
727  /*}}}*/
728  }
729  /*}}}*/
730  /*{{{ update Xi - Xj */
731  /* lower boundary */
732  if (LSEC(Dad, MinusOffset) == NULL) {
733  /*{{{ upate */
734  if (IsExprConst(LSEC(Dad, J)) && IsExprConst(USEC(Dad, I))) {
735  /* lbExpr = CopyAccVec(LSEC(J)); */
736  lbExpr = MergeLinExprs(LSEC(Dad, J), USEC(Dad, I), MINUS);
737  /* LSEC(MinusOffset) = lbExpr; */
738  PutBoundPair(Dad, MinusOffset, lbExpr, NULL);
739  }
740  /*}}}*/
741  }
742  /* upper boundary */
743  if (USEC(Dad, MinusOffset) == NULL) {
744  /*{{{ update */
745  if (IsExprConst(USEC(Dad, J)) && IsExprConst(LSEC(Dad, I))) {
746  /* ubExpr = CopyAccVec(USEC(J)); */
747  ubExpr = MergeLinExprs(USEC(Dad, J), LSEC(Dad, I), MINUS);
748  /* USEC(MinusOffset) = ubExpr; */
749  PutBoundPair(Dad, MinusOffset, NULL, ubExpr);
750  }
751  /*}}}*/
752  }
753  /*}}}*/
754  /*}}}*/
755  /*}}}*/
756  }
757  }
758  }
759  /*}}}*/
760  /*}}}*/
761 }

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: