at.dms.kjc.sir.lowering.fusion
Class Lifter

java.lang.Object
  extended by at.dms.kjc.sir.lowering.fusion.Lifter
All Implemented Interfaces:
StreamVisitor

public class Lifter
extends Object
implements StreamVisitor

Canonicalize stream structure eliminating some redundancies.

There are several different ways of processing join followed by split.
liftPreservingSync does not attempt to eliminate joins that match a following split.
lift will remove joins that exactly match a following split.
liftAggressiveSync will rewrite split-joins if possible so that it can match a joint to a following split; this may increase code size.

See Also:
RefactorSplitJoin

Method Summary
static void eliminateIdentities(SIRStream str)
          Removes all non-essential identity filters from .
static boolean eliminatePipe(SIRPipeline str)
          If is a pipeline that either: 1) Has a pipeline parent, or 2) Contains only a single stream then eliminate the pipeline (adjusting pipeline's parent accordingly).
static boolean eliminateSJ(SIRSplitJoin str)
          If is a splitjoin that contains only one child, then eliminate it (adjusting splitjoin's parent appropriately.) Returns whether or not the lifting was done.
static void lift(SIRStream str)
          Lift everything we can in and its children.
static void liftAggressiveSync(SIRStream str)
          Lift everything we can, using aggressive sync removal that could possibly add joiners to the graph.
static void liftPreservingSync(SIRStream str)
          Lift everything we can, but don't eliminate matching sync points.
 void postVisitFeedbackLoop(SIRFeedbackLoop self, SIRFeedbackLoopIter iter)
           
 void postVisitPipeline(SIRPipeline self, SIRPipelineIter iter)
          POST-VISITS
 void postVisitSplitJoin(SIRSplitJoin self, SIRSplitJoinIter iter)
           
 void preVisitFeedbackLoop(SIRFeedbackLoop self, SIRFeedbackLoopIter iter)
           
 void preVisitPipeline(SIRPipeline self, SIRPipelineIter iter)
          PRE-VISITS
 void preVisitSplitJoin(SIRSplitJoin self, SIRSplitJoinIter iter)
           
 void visitFilter(SIRFilter self, SIRFilterIter iter)
          PLAIN-VISITS
 void visitPhasedFilter(SIRPhasedFilter self, SIRPhasedFilterIter iter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

lift

public static void lift(SIRStream str)
Lift everything we can in and its children. Do sync removal, but not any kind that will introduce new joiners into the graph.


liftPreservingSync

public static void liftPreservingSync(SIRStream str)
Lift everything we can, but don't eliminate matching sync points.


liftAggressiveSync

public static void liftAggressiveSync(SIRStream str)
Lift everything we can, using aggressive sync removal that could possibly add joiners to the graph.


eliminateIdentities

public static void eliminateIdentities(SIRStream str)
Removes all non-essential identity filters from . (At least, removes the ones that would be inserted by partitioning.)


eliminatePipe

public static boolean eliminatePipe(SIRPipeline str)
If is a pipeline that either: 1) Has a pipeline parent, or 2) Contains only a single stream then eliminate the pipeline (adjusting pipeline's parent accordingly). Returns whether or not the lifting was done.


eliminateSJ

public static boolean eliminateSJ(SIRSplitJoin str)
If is a splitjoin that contains only one child, then eliminate it (adjusting splitjoin's parent appropriately.) Returns whether or not the lifting was done.


visitFilter

public void visitFilter(SIRFilter self,
                        SIRFilterIter iter)
PLAIN-VISITS

Specified by:
visitFilter in interface StreamVisitor

visitPhasedFilter

public void visitPhasedFilter(SIRPhasedFilter self,
                              SIRPhasedFilterIter iter)
Specified by:
visitPhasedFilter in interface StreamVisitor

preVisitPipeline

public void preVisitPipeline(SIRPipeline self,
                             SIRPipelineIter iter)
PRE-VISITS

Specified by:
preVisitPipeline in interface StreamVisitor

preVisitSplitJoin

public void preVisitSplitJoin(SIRSplitJoin self,
                              SIRSplitJoinIter iter)
Specified by:
preVisitSplitJoin in interface StreamVisitor

preVisitFeedbackLoop

public void preVisitFeedbackLoop(SIRFeedbackLoop self,
                                 SIRFeedbackLoopIter iter)
Specified by:
preVisitFeedbackLoop in interface StreamVisitor

postVisitPipeline

public void postVisitPipeline(SIRPipeline self,
                              SIRPipelineIter iter)
POST-VISITS

Specified by:
postVisitPipeline in interface StreamVisitor

postVisitSplitJoin

public void postVisitSplitJoin(SIRSplitJoin self,
                               SIRSplitJoinIter iter)
Specified by:
postVisitSplitJoin in interface StreamVisitor

postVisitFeedbackLoop

public void postVisitFeedbackLoop(SIRFeedbackLoop self,
                                  SIRFeedbackLoopIter iter)
Specified by:
postVisitFeedbackLoop in interface StreamVisitor