scale.score.dependence
Class DDInfo

java.lang.Object
  extended by scale.score.dependence.DDInfo

public final class DDInfo
extends java.lang.Object

A class which represents data dependence information between two array references.

$Id: DDInfo.java,v 1.20 2007-10-04 19:58:24 burrill Exp $

Copyright 2007 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.

This class represents both direction and distance vectors. The dependence information for a loop nest is an array of n elements, where n is the deepest common loop nest.

The direction vector represents dependence information for each loop level. We represent the direction information as a set of three possible values. These are forward, equal, and backward dependences. If the direction is unknown, we represent the dependence information as a set which contains all three values.

The distance value is valid for loop-carried dependences. It contains the number of iterations that are carried by the dependence (in constant, the direction value only indicates which direction the dependence occurs in). That is, a loop-carried dependence between two references does not mean that the dependence occurs at the next iteration.


Field Summary
static long cDist0
          Data dependence information indicating 0 distance.
static long cDistUnknown
          Data dependence information indicating unknown distance.
static byte ddAll
          Indicates an arbitrary relationship between the components of two iteration vectors.
static int ddBackward
          A backwards data dependence.
static int ddEqual
          An equal dependence.
static int ddForward
          A forward data dependence.
static int ddKnown
          Is the distance known.
 
Constructor Summary
DDInfo()
           
 
Method Summary
static long copy(long ddinfo)
          Create a copy of the data dependence information.
static long copyNot(long ddinfo, int nDirection)
          Create a copy of the data dependence information.
static long create(int distance, boolean distanceKnown, int direction)
          Create an object which represents data dependence information.
static int getDirection(long ddinfo)
          Return the direction.
static int getDistance(long ddinfo)
          Return the distance value.
static long inverseCopy(long ddinfo)
          Create a copy of the data dependence information.
static boolean isAnyDistanceKnown(long[] ddinfo)
          Return true if the distance is known at any level.
static boolean isAnyDistanceNonZero(long[] ddinfo)
          Return true if any distance is unknown or not zero at any level.
static boolean isAnyDistanceNotKnown(long[] ddinfo)
          Return true if the distance is not known at any level.
static boolean isDirectionEqual(long ddinfo)
          Return true if the direction value is ddEqual.
static boolean isDirectionSet(long ddinfo, int direction)
          Return true if the direction value is set to true.
static boolean isDistanceKnown(long ddinfo)
          Have we set the distance information.
static boolean noDirectionSet(long ddinfo)
          Return true if no direction values are set to true.
static void printDDInfo(long[] ddinfo)
          Print the data dependence distance and direction.
static java.lang.String toString(long ddinfo)
          Create a formatted string of the dependence information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ddForward

public static final int ddForward
A forward data dependence. The dependence crosses an iteration boundary in the forward direction (e.g., from iteration i to i+1). Also represented as "<".

See Also:
Constant Field Values

ddEqual

public static final int ddEqual
An equal dependence. The dependence does not cross an iteration. Also reprsented as "=".

See Also:
Constant Field Values

ddBackward

public static final int ddBackward
A backwards data dependence. The dependence crosses an iteration boundary in the backwards direction. Also, represented as ">".

See Also:
Constant Field Values

ddKnown

public static final int ddKnown
Is the distance known.

See Also:
Constant Field Values

ddAll

public static final byte ddAll
Indicates an arbitrary relationship between the components of two iteration vectors. That is, it represents the set of all the direction vectors.

See Also:
Constant Field Values

cDist0

public static final long cDist0
Data dependence information indicating 0 distance.


cDistUnknown

public static final long cDistUnknown
Data dependence information indicating unknown distance.

Constructor Detail

DDInfo

public DDInfo()
Method Detail

create

public static long create(int distance,
                          boolean distanceKnown,
                          int direction)
Create an object which represents data dependence information.

Parameters:
distance - is the data dependence distance
distanceKnown - is true if the distance is known
direction - is the data dependence direction

copy

public static long copy(long ddinfo)
Create a copy of the data dependence information. We make a copy of the direction vector and distance information.

Returns:
a copy of the data dependence information.

inverseCopy

public static long inverseCopy(long ddinfo)
Create a copy of the data dependence information. We make a copy of the direction vector and distance information with the direction reversed.

Returns:
a copy of the data dependence information.

copyNot

public static long copyNot(long ddinfo,
                           int nDirection)
Create a copy of the data dependence information. We make a copy of the direction vector and distance information with the direction reversed.

Returns:
a copy of the data dependence information.

isDirectionSet

public static boolean isDirectionSet(long ddinfo,
                                     int direction)
Return true if the direction value is set to true.


isDirectionEqual

public static boolean isDirectionEqual(long ddinfo)
Return true if the direction value is ddEqual.


noDirectionSet

public static boolean noDirectionSet(long ddinfo)
Return true if no direction values are set to true.


isDistanceKnown

public static boolean isDistanceKnown(long ddinfo)
Have we set the distance information.

Returns:
true if the distance value is known.

getDistance

public static int getDistance(long ddinfo)
Return the distance value.


getDirection

public static int getDirection(long ddinfo)
Return the direction.


isAnyDistanceKnown

public static boolean isAnyDistanceKnown(long[] ddinfo)
Return true if the distance is known at any level.


isAnyDistanceNotKnown

public static boolean isAnyDistanceNotKnown(long[] ddinfo)
Return true if the distance is not known at any level.


isAnyDistanceNonZero

public static boolean isAnyDistanceNonZero(long[] ddinfo)
Return true if any distance is unknown or not zero at any level.


toString

public static java.lang.String toString(long ddinfo)
Create a formatted string of the dependence information.

Returns:
a string representation of the dependence.

printDDInfo

public static void printDDInfo(long[] ddinfo)
Print the data dependence distance and direction.