at.dms.kjc.sir.lowering.fission
Class StatelessDuplicate

java.lang.Object
  extended by at.dms.kjc.sir.lowering.fission.StatelessDuplicate

public class StatelessDuplicate
extends Object

This class splits a stateless filter with arbitrary push/pop/peek ratios into a duplicate/round-robin split-join of a user-specified width.


Method Summary
static SIRSplitJoin doit(SIRFilter origFilter, int reps)
          Duplicates into a -way SplitJoin and replaces the filter with the new construct in the parent.
static SIRSplitJoin doit(SIRFilter origFilter, int reps, int[] workRatio)
          Duplicates into a -way SplitJoin and replaces the filter with the new construct in the parent.
static HashSet<String> getMutableState(FilterContent filter)
           
static HashSet<String> getMutableState(SIRFilter filter)
           
static boolean hasMutableState(FilterContent filter)
           
static boolean hasMutableState(SIRFilter filter)
          Returns whether or not has mutable state.
static boolean isFissable(SIRFilter filter)
          Checks whether or not can be fissed.
static int sizeOfMutableState(FilterContent filter)
           
static int sizeOfMutableState(SIRFilter filter)
          Returns the number of bytes of mutable state (using C types) for filter .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doit

public static SIRSplitJoin doit(SIRFilter origFilter,
                                int reps,
                                int[] workRatio)
Duplicates into a -way SplitJoin and replaces the filter with the new construct in the parent. The new filters will be load-balanced according to 'workRatio'. For example, if workRatio = {1, 2}, then the second child will do twice as much work as the first child. Requires workRatio.length == reps.


doit

public static SIRSplitJoin doit(SIRFilter origFilter,
                                int reps)
Duplicates into a -way SplitJoin and replaces the filter with the new construct in the parent. The resulting children will all do the same amount of work.


isFissable

public static boolean isFissable(SIRFilter filter)
Checks whether or not can be fissed.


hasMutableState

public static boolean hasMutableState(SIRFilter filter)
Returns whether or not has mutable state. This is equivalent to checking if there are any assignments to fields outside of the init function.


hasMutableState

public static boolean hasMutableState(FilterContent filter)

getMutableState

public static HashSet<String> getMutableState(SIRFilter filter)

getMutableState

public static HashSet<String> getMutableState(FilterContent filter)

sizeOfMutableState

public static int sizeOfMutableState(SIRFilter filter)
Returns the number of bytes of mutable state (using C types) for filter . Conservatively assumes that if a single location in an array is mutable state, then the entire array is mutable state.


sizeOfMutableState

public static int sizeOfMutableState(FilterContent filter)