PIPS
|
#include "all.h"
Go to the source code of this file.
Macros | |
#define | LINE 0 |
#define LINE 0 |
dad_struct AllocateDadStruct | ( | int | Rank | ) |
}}
{{ allocate simple section allocate a structure to hold Dad
initialize the reference template
initialize the shape
Rank | ank |
Definition at line 440 of file ss.c.
References BOUND_PAIR, CONS, gen_nconc(), is_rtype_nonlinear, make_bound_pair(), make_dad_struct(), make_ref_temp(), make_rtype(), NIL, Ref, REF_TEMP, and UU.
Referenced by AllocateSimpleSection().
simple_section AllocateSimpleSection | ( | reference | ref | ) |
{{ intialize the data structure
}}
ref | ef |
Definition at line 467 of file ss.c.
References AllocateDadStruct(), CardinalityOf(), entity_type, LINE, make_context_info(), make_simple_section(), ref, reference_variable, type_variable, variable_dimensions, and ZERO.
Referenced by InitCompDesc().
re-used Pips functional programs !!!
gl | l |
Definition at line 428 of file ss.c.
References gen_length().
Referenced by AllocateSimpleSection(), and TransSimpSec().
void ComputeBoundaries | ( | simple_section | Dad, |
loop | Loop, | ||
LinExpr | lbExpr, | ||
LinExpr | ubExpr, | ||
unsigned | Offset | ||
) |
compute both boundary expression and store in the tSS array
{{ about
}}
Dad | ad |
Loop | oop |
lbExpr | bExpr |
ubExpr | bExpr |
Offset | ffset |
Definition at line 765 of file ss.c.
References DivExists(), Lbound(), PutBoundPair(), and Ubound().
Referenced by TransSimpSec().
}}
{{ ComputeIndex compute index of tSS array for a boundary
Rank | ank |
Definition at line 362 of file ss.c.
References Index.
Referenced by TransSimpSec(), and UpdateUnresolved().
void ComputeRTandSS | ( | expression | Sub, |
unsigned | DimNo, | ||
simple_section | Dad, | ||
loop | Loop | ||
) |
initialise reference template and shapes for inner most references
for an access vector
{{ non-linear
}}
{{ linear
copy the subscript expression into the shape descriptor
linear subscripts : update if DIV exists
}}
Sub | ub |
DimNo | imNo |
Dad | ad |
Loop | oop |
Definition at line 524 of file ss.c.
References CopyAccVec(), DivExists(), is_rtype_lininvariant, is_rtype_linvariant, is_rtype_nonlinear, IsExprConst(), Lbound(), LSEC, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, PutBoundPair(), PutRefTemp(), Ubound(), and USEC.
Referenced by ScanAllDims().
}}
{{ CopyAccVec
re-used function from alloc.c
Expr | xpr |
Definition at line 378 of file ss.c.
References vect_dup().
Referenced by ComputeRTandSS(), Lbound(), TransSimpSec(), and Ubound().
void DisplayDad | ( | comp_desc | TheDad | ) |
TheDad | heDad |
Definition at line 107 of file ss.c.
References comp_desc_reference, comp_desc_section, comp_sec_hull, DisplayRefTemp(), DisplaySimpleSection(), entity_minimal_name(), fprintf(), and reference_variable.
Referenced by PrintSimp().
void DisplayRefTemp | ( | simple_section | Dad | ) |
}}
{{ DisplayRefTemp
Dad | ad |
Definition at line 123 of file ss.c.
References context_info_rank, fprintf(), GetRefTemp(), is_rtype_lininvariant, is_rtype_linvariant, is_rtype_nonlinear, simple_section_context, and tag_undefined.
Referenced by DisplayDad().
void DisplaySimpleSection | ( | simple_section | Dad | ) |
}}
{{ DisplaySimpSec
{{ xi = c
}}
{{ Xi+Xj = c
}}
{{ index
}}
}}
{{ Xi-Xj
}}
Dad | ad |
Definition at line 161 of file ss.c.
References context_info_rank, fprintf(), LSEC, PrintLinExpr(), simple_section_context, and USEC.
Referenced by DisplayDad().
check whether loop index variable var is contained in LinExpr
Loop | oop |
Lin | in |
Definition at line 396 of file ss.c.
References loop_index, Val, and vect_contains_variable_p().
Referenced by ComputeBoundaries(), ComputeRTandSS(), TransRefTemp(), and UpdateUnresolved().
expression GetAccVec | ( | unsigned | No, |
const reference | ref | ||
) |
return the n'th subscript expression
No | o |
ref | ef |
Definition at line 411 of file ss.c.
References EXPRESSION, MAP, ref, and reference_indices.
Referenced by TransRefTemp().
LinExpr GetBoundary | ( | simple_section | Dad, |
int | DimNo, | ||
unsigned | Low | ||
) |
}}
{{ GetBoundaryPair return the lower or upper boundary
Dad | ad |
DimNo | imNo |
Low | ow |
Definition at line 266 of file ss.c.
References BOUND_PAIR, bound_pair_index, bound_pair_lb, bound_pair_ub, dad_struct_shape, MAP, and simple_section_dad.
tag GetRefTemp | ( | simple_section | Dad, |
_int | DimNo | ||
) |
}}
}} {{ auxilliary functions {{ GetRefTemp
Dad | ad |
DimNo | imNo |
Definition at line 229 of file ss.c.
References dad_struct_rtemps, FOREACH, Ref, REF_TEMP, ref_temp_index, ref_temp_rtype, rtype_tag, simple_section_dad, and tag_undefined.
Referenced by DisplayRefTemp(), SimpUnion(), TransRefTemp(), and UpdateUnresolved().
}}
check whether a given expresion is a constant
Expr | xpr |
Definition at line 388 of file ss.c.
References vect_constant_p().
Referenced by ComputeRTandSS(), and UpdateUnresolved().
}}
}} {{ lbound and ubound
only one step in pips ! it provides direct substitution functions
{{ substitution step
substitute with lower bound
substitute with upper bound
make a copy because vect_var_subst modifies NewVect
}}
Loop | oop |
Lin | in |
Definition at line 910 of file ss.c.
References CopyAccVec(), loop_index, loop_range, my_vect_var_subst(), NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, range_lower, range_upper, Val, and vect_coeff().
Referenced by ComputeBoundaries(), ComputeRTandSS(), and UpdateUnresolved().
}}
{{ MaxBoundary substitute with new boundary
Lin1 | in1 |
Lin2 | in2 |
Definition at line 335 of file ss.c.
References vect_compare(), and vect_dup().
Referenced by SimpUnion().
}}
{{ MergeLinExprs
must free Expr1 because vect_add will return a copy : check later
Expr1 | xpr1 |
Expr2 | xpr2 |
Op | p |
Definition at line 349 of file ss.c.
References my_vect_substract(), PLUS, and vect_add().
Referenced by TransSimpSec(), and UpdateUnresolved().
}}
{{ MinBoundary substitute with new boundary
Lin1 | in1 |
Lin2 | in2 |
Definition at line 320 of file ss.c.
References vect_compare(), and vect_dup().
Referenced by SimpUnion().
Pvecteur var_val; for (var_val = pvec2; var_val!= NIL; vect_add_elem (&dvec,var_of(var_val),-val_of(var_val)),var_val=var_val->succ);
pvec1 | vec1 |
pvec2 | vec2 |
Definition at line 50 of file ss.c.
References Svecteur::succ, val_of, var_of, vect_add_elem(), and vect_dup().
Referenced by MergeLinExprs().
{{ my vect var subst function
mimicked this function from paf-tuil/utils.c because it was misbehaving !!
vect | ect |
var | ar |
new_vect | ew_vect |
Definition at line 35 of file ss.c.
References vect_add(), vect_aux, vect_coeff(), vect_erase_var(), and vect_multiply().
Referenced by Lbound(), and Ubound().
void PrintCompRegions | ( | list | CompList | ) |
}}
{{ PrintSimpleSection {{ PrintCompRegions
CompList | ompList |
Definition at line 74 of file ss.c.
References COMP_DESC, MAP, NIL, and PrintSimp().
Referenced by comp_regions_of_loop().
void PrintLinExpr | ( | LinExpr | Lin | ) |
}}
{{ PrintLinExpr
call the approprite print routine : check later
Lin | in |
Definition at line 87 of file ss.c.
References fprintf(), and vect_debug().
Referenced by DisplaySimpleSection(), and PutBoundPair().
void PrintSimp | ( | comp_desc | Dad | ) |
}}
{{ PrintSimp
Dad | ad |
Definition at line 99 of file ss.c.
References DisplayDad(), and fprintf().
Referenced by PrintCompRegions().
void PutBoundPair | ( | simple_section | Dad, |
_int | DimNo, | ||
LinExpr | Low, | ||
LinExpr | Up | ||
) |
}}
{{ PutBoundryPair substitute with new boundary
check later vect_rm(bound_pair_lb(bp));
check later vect_rm(bound_pair_ub(bp));
Dad | ad |
DimNo | imNo |
Low | ow |
Up | p |
Definition at line 290 of file ss.c.
References BOUND_PAIR, bound_pair_index, bound_pair_lb_, bound_pair_ub_, dad_struct_shape, ifdebug, MAP, pips_debug, PrintLinExpr(), and simple_section_dad.
Referenced by ComputeBoundaries(), ComputeRTandSS(), SimpUnion(), and UpdateUnresolved().
void PutRefTemp | ( | simple_section | Dad, |
int | DimNo, | ||
tag | Val | ||
) |
}}
{{ PutRefTemp
Dad | ad |
DimNo | imNo |
Val | al |
Definition at line 248 of file ss.c.
References dad_struct_rtemps, MAP, REF_TEMP, ref_temp_index, ref_temp_rtype, rtype_tag, simple_section_dad, and Val.
Referenced by ComputeRTandSS(), SimpUnion(), and TransRefTemp().
}}
{{ translate inner most references
{{ init RT and SS
}}
Loop | oop |
Desc | esc |
Definition at line 490 of file ss.c.
References CAR, CDR, comp_desc_reference, comp_desc_section, comp_sec_hull, ComputeRTandSS(), EXPRESSION, NIL, pips_debug, ref, and reference_indices.
Referenced by TranslateToLoop().
simple_section SimpUnion | ( | simple_section | S1, |
simple_section | S2 | ||
) |
}}
{{ SimpUnion
SG: i am unsure this is a valid init
allocate a simple_section
{{ update reference template
update reference template
if a subscript is invariant or boundary expression is not constant
then whole dimension is assumed to be used
}}
{{ update simple sections
scan all boundary pairs
later insert code for releasing the space of LSEC and USEC
compute new lower boundary in the union
compute new upper boundary in the union
}}
S1 | 1 |
S2 | 2 |
Definition at line 1013 of file ss.c.
References context_info_rank, context_info_undefined, GetRefTemp(), is_rtype_linvariant, is_rtype_nonlinear, LSEC, make_dad_struct(), make_simple_section(), MaxBoundary(), MinBoundary(), NIL, PutBoundPair(), PutRefTemp(), simple_section_context, and USEC.
}}
{{ translate to outer loop comp list {{ translate the set to the outer loop
ThisLoop | hisLoop |
ListOfComps | istOfComps |
Definition at line 577 of file ss.c.
References COMP_DESC, MAP, and TranslateToLoop().
Referenced by comp_regions_of_loop().
}}
{{ translate to loop
ThisLoop | hisLoop |
Desc | esc |
Definition at line 589 of file ss.c.
References comp_desc_section, comp_sec_hull, GET_NEST, MULTI, PUT_NEST, ScanAllDims(), SINGLE, TransRefTemp(), TransSimpSec(), UpdateUnresolved(), and ZERO.
Referenced by TranslateRefsToLoop().
}}
{{ TransRefTemp
iterate through all entries of reference template
process only linear elements
Pass only normalized expression into Divexists
variant w.r.t this loop index
ThisLoop | hisLoop |
Desc | esc |
Definition at line 612 of file ss.c.
References comp_desc_reference, comp_desc_section, comp_sec_hull, CONS, context_info_rank, DivExists(), gen_nconc(), GetAccVec(), GetRefTemp(), INT, is_rtype_linvariant, is_rtype_nonlinear, Variants::New, NIL, NORMALIZE_EXPRESSION, normalized_linear, Variants::Old, pips_debug, PutRefTemp(), Ref, and simple_section_context.
Referenced by TranslateToLoop().
{{ declarations
}}
{{ Diagonal Boundaries for old and new
{{ compute offset in the tSS array to store diagonal boundaries
}}
{{ compute diagonal boundaries Xi + Xj
compute index for tSS array
copying done inside MergeLinExprs lbExpr = CopyAccVec(LSEC(Dad, I)); TmpExpr1 = CopyAccVec(LSEC(Dad, J));
ubExpr = CopyAccVec(USEC(Dad, I)); TmpExpr2 = CopyAccVec(USEC(Dad, J));
}}
{{ compute diagonal boundaries Xi - Xj
compute index for tSS array
}}
}}
{{ Compute parallel boundaries only for new variants
{{ compute Xi = c
bug unsigned Offset = J;
}}
}}
{{ Compute diagonal boundaries for new variants
set size must be atleast 2
{{ compute diagonals
set an iterator for the newvar
{{ iterators 1 and 2
set this iterator to next element in the first list
}}
{{ compute index for storing in tSS array
}}
{{ compute diagonal boundary Xi + Xj
}}
{{ compute diagonal boundary Xi - Xj
}}
}}
}}
Desc | esc |
Loop | oop |
Vars | ars |
Definition at line 782 of file ss.c.
References CAR, CardinalityOf(), CDR, comp_desc_section, comp_sec_hull, ComputeBoundaries(), ComputeIndex(), context_info_rank, CopyAccVec(), ENDP, Index, INT, LSEC, MAP, MergeLinExprs(), MINUS, Variants::New, New, Variants::Old, pips_debug, PLUS, simple_section_context, and USEC.
Referenced by TranslateToLoop().
only one step in pips ! it provides direct substitution functions
{{ substitution step
substitute with lower bound
substitute with upper bound
make a copy because vect_var_subst modifies NewVect
}}
Loop | oop |
Lin | in |
Definition at line 961 of file ss.c.
References CopyAccVec(), loop_index, loop_range, my_vect_var_subst(), NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, range_lower, range_upper, Val, and vect_coeff().
Referenced by ComputeBoundaries(), ComputeRTandSS(), and UpdateUnresolved().
void UpdateUnresolved | ( | simple_section | Dad, |
loop | Loop | ||
) |
}}
{{ TransSimpSec
{{ declarations
}}
{{ Update unresolved boundaries
{{ update parallel or diagonal boundaries with induction variable
{{ scan all dimensions
ComputeBoundaries(Dad, Loop, lbExpr, ubExpr, ZhiExprNo);
}}
}}
{{ update diagonal boundaries whose parallel components are constants
{{ process only linear subscripts
{{ compute index
}}
{{ update diagonals
{{ update Xi + Xj
lower boundary
bug fix : check boundary otherwise it will get overwritten
{{ update
copy done in MergeLinExpr lbExpr = CopyAccVec(LSEC(Dad, I));
LSEC(Dad,PlusOffset) = lbExpr;
}}
upper boundary
{{ update
USEC(PlusOffset) = ubExpr;
}}
}}
{{ update Xi - Xj
lower boundary
{{ upate
lbExpr = CopyAccVec(LSEC(J));
LSEC(MinusOffset) = lbExpr;
}}
upper boundary
{{ update
ubExpr = CopyAccVec(USEC(J));
USEC(MinusOffset) = ubExpr;
}}
}}
}}
}}
}}
}}
Dad | ad |
Loop | oop |
Definition at line 667 of file ss.c.
References ComputeIndex(), context_info_rank, DivExists(), GetRefTemp(), Index, is_rtype_nonlinear, IsExprConst(), Lbound(), LSEC, MergeLinExprs(), MINUS, PLUS, PutBoundPair(), simple_section_context, Ubound(), and USEC.
Referenced by TranslateToLoop().