next up previous contents index
Next: Controlling the target Up: Various attributes and functions Previous: Various attributes

               
Attributes for data dependencies

A set of attributes have also been implemented in order to provide an access to data dependencies. These one rely on the usual notation to access to the various kind of dependencies which are the following:

In TSF, access to data dependencies requires two steps:

The following attributes are provided:

  $\blacktriangleright$ stat.DEP()
 
  This attribute returns the dependencies list computed from the current statement. This list is returned under the form of an undocumented type that we call a DepObjectList. A DepObjectList is a list of objects of the type DepObject which designate a data dependency. By default, the direct, anti and output dependencies are taken into account if no argument is provided. Otherwise, the following possibilities are also provided:

$\vartriangleright$ Example 49: 

    depList        := currentStat.DEP() // by default get all the direct, anti
    and output dependencies
    directDepList  := currentStat.DEP(DIRECT)  
    antiDepList    := currentStat.DEP(ANTI)    
    outputDepList  := currentStat.DEP(OUT)     
    valueDepList   := currentStat.DEP(VALUE)   
    controlDEpList :=  currentStat.DEP(CONTROL)
    directAndAntiDepList   := currentStat.DEP(DIRECT,ANTI)
    directAndOutputDepList := currentStat.DEP(DIRECT,OUT)
as well as all the other combinations.

The predefined keywords DIRECT, ANTI, OUT, VALUE, CONTROL may be replaced directly by their corresponding values ("direct", "anti", "out", "value", "control").

  $\blacktriangleright$ depObjectList.NBDEP()
 
  This attribute returns the number of dependencies contained in the current depObjectList object.

  $\blacktriangleright$ depObjectList.NBDEP(n)
 
Return the nth depObject contained in the depObjectList object.

  $\blacktriangleright$ depObject.SOURCE
 
  Return the source statement of the considered dependency.

  $\blacktriangleright$ depObject.SOURCEEXPR
 
  Return the source expression involved in the considered dependency.

  $\blacktriangleright$ depObject.DESTINATION
 
  Return the destination statement of the considered dependency.

  $\blacktriangleright$ depObject.DESTINATIONEXPR
 
  Return the destination expression involved in the considered dependency.

  $\blacktriangleright$ depObject.KIND
 
  Return the kind of the considered dependency. Kinds returned are: direct, anti, out, value, control and are of type string.

  $\blacktriangleright$ depObject.DISTANCEVECTOR
 
  Return the whole distance vector of the considered dependency. This distance vector is given from the most internal loop to the most external loop.

  $\blacktriangleright$ depObject.DISTVECTORSIZE()
 
  Return the size of the current distance vector.

  $\blacktriangleright$ depObject.DISTVECTORSIZE(n)
 
Return the nth component of the current distance vector.

$\vartriangleright$ Example 50:Example on the manipulation of the data dependencies.


Script



SCRIPT DisplayOutputDependence ()

outputDep := $cstat.DEP(OUT) // Get just the output data dependencies
nbOutputDep := outputDep.NBDEP() // Number of output data dependencies
it := 1 // Iterator
WHILE (it <= nbOutputDep) // Go over all the output data dependencies
PRINT "Kind of the dataDep: " + outputDep.NBDEP(it).KIND // (P1) Kind of the data dependency
PRINT "SOURCE"
PRINT outputDep.NBDEP(it).SOURCEEXPR // (P2) Source expression of the current data dependency
PRINT outputDep.NBDEP(it).SOURCE // (P3) Source statement of the current data dependency
PRINT "DESTINATION"
PRINT outputDep.NBDEP(it).DESTINATIONEXPR    // (P4) Destination expression of the current data dep.
PRINT outputDep.NBDEP(it).DESTINATION // (P5) Destination statement of the current data dep.
PRINT outputDep.NBDEP(it).DISTANCEVECTOR // (P6) Distance vector
// (from the most internal loop to the most external loop)
// Now deal with each component of the distance vector
vectorSize := outputDep.NBDEP(it).DISTVECTORSIZE() // Get the size of the distance vector
vectorIt := 1 // Iterator
WHILE (vectorIt <= vectorSize) // Go over all the components of the distance vector
value := outputDep.NBDEP(it).DISTVECTORSIZE(vectorIt) // Get the component
PRINT "component " + TOSTRING(vectorIt) + ": " + TOSTRING(value) // (P7) Print its value
// PRINT outputDep.NBDEP(it).DISTVECTORSIZE(vectorIt)
// // value of the component (ex. >=)
vectorIt := vectorIt +1 // Go to the next component of the distance vector
ENDWHILE
it := it + 1 // Go to the next data dependency
ENDWHILE
ENDSCRIPT



Fortran User Selection Results



do 430 i = 1,nsize1

do 440 j = 1,nsize2
s = s + a2(j,i)
440 continue
430 continue






P1 : 				Kind of the dataDep: out

SOURCE
P2 : s
P3 : s = s + a2(j,i)
DESTINATION
P4 : s
P5: s = s + a2(j,i)
P6 : (1 0)
P7 : component 1: 1
P7 : component 2: 0






P1 : 				Kind of the dataDep: out

SOURCE
P2 : s
P3 : s = s + a2(j,i)
DESTINATION
P4 : s
P5 : s = s + a2(j,i)
P6 : (0 >)
P7 : component 1: 0
P7 : component 2: >





next up previous contents index
Next: Controlling the target Up: Various attributes and functions Previous: Various attributes
Yann Mevel
1999-04-30