scale.score.dependence.banerjee
Class BanerjeeTest

java.lang.Object
  extended by scale.score.dependence.DataDependence
      extended by scale.score.dependence.banerjee.BanerjeeTest

public class BanerjeeTest
extends DataDependence

A class which implements Banerjee's data dependence test.

$Id: BanerjeeTest.java,v 1.29 2007-05-03 18:02:43 burrill Exp $

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

Currently, we have only implemented the Single Loop Index test. The Single Loop Index test is an exact algorithm that works only with subscripts that have a single loop index variable. The SLI test only produces direction information (that is, no distance information). Also, the test only works when the bounds of the loops are constants.

Note that only dependence direction information is computed. Distance values are not computed.

See Also:
OmegaTest

Field Summary
static boolean classTrace
          True if traces are to be performed.
 
Fields inherited from class scale.score.dependence.DataDependence
bnest, cEqDependent, cFailed, cIndependent, cLCDependent, cloop, cUnkDependent, ddinfo, iloop, inode, loopInfo, oloop, onode, precedes, result, scribble
 
Constructor Summary
BanerjeeTest(Scribble scribble)
          Create an object for dependence testing.
 
Method Summary
 int ddTest(SubscriptExpr onode, SubscriptExpr inode, LoopHeaderChord oloop, LoopHeaderChord iloop, int precedes)
          Implements Banerjee's dependence test.
 Vector<long[]> getDependenceInfo(boolean forward)
          Compute data dependences in one direction.
 void spatialTest(SubscriptExpr onode, SubscriptExpr inode, LoopHeaderChord oloop, LoopHeaderChord iloop, int precedes)
           
 
Methods inherited from class scale.score.dependence.DataDependence
getBackwardDependences, getDDInfo, getForwardDependences, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classTrace

public static boolean classTrace
True if traces are to be performed.

Constructor Detail

BanerjeeTest

public BanerjeeTest(Scribble scribble)
Create an object for dependence testing.

Method Detail

ddTest

public int ddTest(SubscriptExpr onode,
                  SubscriptExpr inode,
                  LoopHeaderChord oloop,
                  LoopHeaderChord iloop,
                  int precedes)
Implements Banerjee's dependence test. Currently, we just implement the simple case when the array index expressions are either: Note that only dependence direction information is computed. Distance values are not computed. Also, the loop bounds must be constants.

Specified by:
ddTest in class DataDependence
Parameters:
onode - is a node access
inode - is a node access
oloop - is the loop containing onode
iloop - is the loop containing inode
precedes - specifies the execution order. It is 1 if inode is execute before onode, -1 if onode is executed befoe inode, and 0 if they are "executed in parallel".
Returns:
the data dependence test result
See Also:
DataDependence.cIndependent, DataDependence.cUnkDependent, DataDependence.cLCDependent, DataDependence.cEqDependent, DataDependence.cFailed

getDependenceInfo

public Vector<long[]> getDependenceInfo(boolean forward)
Compute data dependences in one direction.

Specified by:
getDependenceInfo in class DataDependence
Parameters:
forward - is true if we want forward dependence information.
Returns:
the dependence information (in one direction).

spatialTest

public void spatialTest(SubscriptExpr onode,
                        SubscriptExpr inode,
                        LoopHeaderChord oloop,
                        LoopHeaderChord iloop,
                        int precedes)
                 throws java.lang.Exception
Specified by:
spatialTest in class DataDependence
Parameters:
onode - a node access
inode - a node access
oloop - is the loop containing onode
iloop - is the loop containing inode
precedes - specifies the execution order. It is 1 if inode is execute before onode, -1 if onode is executed befoe inode, and 0 if they are "executed in parallel".
Throws:
java.lang.Exception