scale.score.trans
Class LoopTrans

java.lang.Object
  extended by scale.score.trans.Optimization
      extended by scale.score.trans.LoopTrans
Direct Known Subclasses:
LoopPermute

public abstract class LoopTrans
extends Optimization

The base class for all loop transformation optimizations.

$Id: LoopTrans.java,v 1.68 2007-10-04 19:58:36 burrill Exp $

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


Field Summary
protected static FloatType floatType
           
protected static PointerType intPointer
           
protected static IntegerType intType
           
protected static PointerType unsignedPointer
           
protected static IntegerType unsignedType
           
protected static PointerType voidp
           
 
Fields inherited from class scale.score.trans.Optimization
dChanged, fpReorder, hasDummyAliases, IN_SSA, minimumExecutionCost, NA_SSA, NO_SSA, rChanged, scribble, signedIntsWrapOnOverflow, trace, un, unsafe, unsignedIntsWrapOnOverflow, VALID_SSA
 
Constructor Summary
LoopTrans(Scribble scribble, java.lang.String tempPrefix)
           
 
Method Summary
static void cleanup()
          Clean up for profiling statistics.
protected  ExprChord findIndexInc(Chord c)
           
protected  ExprChord findIndexInit(Chord c)
           
protected  boolean initializeTransform(java.lang.String prefix)
          Initialize everything in preparation for a loop transform.
protected  void performLoopInterchange(LoopHeaderChord innerLoop, LoopHeaderChord outerLoop)
          Interchange two loops.
protected  void performLoopStripMining(LoopHeaderChord loop, int stripSize)
          Perform the strip mining on the loop.
protected  void performLoopTile(LoopHeaderChord oHeader, LoopHeaderChord iHeader, int tileSize, int tileOffset)
          Convert two loops to use tiling.
static int permutedLoops()
          Return the current number of implicit loops found.
protected  Cost tripProduct(Vector<LoopHeaderChord> loopNest, LoopHeaderChord thisLoop)
           
 
Methods inherited from class scale.score.trans.Optimization
assertTrace, assertTrace, assertTrace, assertTrace, assertTrace, genTemp, insertStores, perform, requiresSSA, setTrace, sort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

intType

protected static IntegerType intType

floatType

protected static FloatType floatType

unsignedType

protected static IntegerType unsignedType

intPointer

protected static PointerType intPointer

unsignedPointer

protected static PointerType unsignedPointer

voidp

protected static PointerType voidp
Constructor Detail

LoopTrans

public LoopTrans(Scribble scribble,
                 java.lang.String tempPrefix)
Parameters:
scribble - is the CFG containing the loops
Method Detail

permutedLoops

public static int permutedLoops()
Return the current number of implicit loops found.


initializeTransform

protected boolean initializeTransform(java.lang.String prefix)
Initialize everything in preparation for a loop transform.

Parameters:
prefix - is used in generating temporary variable names
Returns:
true if all dependencies were obtainable

findIndexInit

protected ExprChord findIndexInit(Chord c)

findIndexInc

protected ExprChord findIndexInc(Chord c)

tripProduct

protected Cost tripProduct(Vector<LoopHeaderChord> loopNest,
                           LoopHeaderChord thisLoop)

performLoopTile

protected void performLoopTile(LoopHeaderChord oHeader,
                               LoopHeaderChord iHeader,
                               int tileSize,
                               int tileOffset)
Convert two loops to use tiling.

Parameters:
oHeader - is the outer loop
iHeader - is the inner loop
tileSize - is the size of the tile
tileOffset - is the offset for each tile

performLoopStripMining

protected void performLoopStripMining(LoopHeaderChord loop,
                                      int stripSize)
Perform the strip mining on the loop.

Parameters:
loop - is the loop to be strip mined
stripSize - specifies the size of the strip

performLoopInterchange

protected void performLoopInterchange(LoopHeaderChord innerLoop,
                                      LoopHeaderChord outerLoop)
Interchange two loops. The outerloop must be perfectly nested. Works for Fortran do loops with lots of assumptions.


cleanup

public static void cleanup()
Clean up for profiling statistics.