at.dms.kjc.backendSupport
Class CommonPasses

java.lang.Object
  extended by at.dms.kjc.backendSupport.CommonPasses

public class CommonPasses
extends Object

Common passes, useful in new back ends.

Author:
dimock

Constructor Summary
CommonPasses()
           
 
Method Summary
 Map<String,Set<String>> getAssociatedGlobals()
          Get the names of globals that may have been copied into multiple places.
 SIRStream getOrigSTR()
          Get the original stream for statistics gathering.
 Partitioner getPartitioner()
          Get the Partitioner used in run.
 WorkEstimate getWorkEstimate()
          Get the WorkEstimate used in run.
 Slice[] run(SIRStream str, JInterfaceDeclaration[] interfaces, SIRInterfaceTable[] interfaceTables, SIRStructure[] structs, SIRHelper[] helpers, SIRGlobal global, int numCores)
          Top level method for executing passes common to some current and all future StreamIt compilers.
 SpaceTimeScheduleAndPartitioner scheduleSlices()
          Create schedules for init, prime-pump and steady phases.
 void simplifySlices()
          This method performs some standard cleanup on the slice graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonPasses

public CommonPasses()
Method Detail

run

public Slice[] run(SIRStream str,
                   JInterfaceDeclaration[] interfaces,
                   SIRInterfaceTable[] interfaceTables,
                   SIRStructure[] structs,
                   SIRHelper[] helpers,
                   SIRGlobal global,
                   int numCores)
Top level method for executing passes common to some current and all future StreamIt compilers.

Parameters:
str - SIRStream from Kopi2SIR
interfaces - JInterfaceDeclaration[] from Kopi2SIR
interfaceTables - SIRInterfaceTable[] from Kopi2SIR
structs - SIRStructure[] from Kopi2SIR
helpers - SIRHelper[] from Kopi2SIR
global - SIRGlobal from Kopi2SIR
numCores - Number of ComputeNode's to use in partitioning.
Returns:
a slice graph: the optimized program in Slice representation.

simplifySlices

public void simplifySlices()
This method performs some standard cleanup on the slice graph. On return, file readers and file writers are expanded to contain Kopi code to read and write files. The slice graph will have any rate skew corrected and will be converted to SimpleSlice's. The FilterInfo class will be usable. Spacetime does not use this code since it allows general slices and generates its own code for file readers and file writers.


scheduleSlices

public SpaceTimeScheduleAndPartitioner scheduleSlices()
Create schedules for init, prime-pump and steady phases. Affected by KjcOptions.spacetime, KjcOptions.noswpipe.

Returns:
a Scheduler from which the schedules for the phases may be extracted.

getPartitioner

public Partitioner getPartitioner()
Get the Partitioner used in run.

Returns:
the partitioner

getWorkEstimate

public WorkEstimate getWorkEstimate()
Get the WorkEstimate used in run.

Returns:
the workEstimate

getOrigSTR

public SIRStream getOrigSTR()
Get the original stream for statistics gathering. Returns null unless KjcOptions.stats

Returns:
the stream before any graph structure modifications.

getAssociatedGlobals

public Map<String,Set<String>> getAssociatedGlobals()
Get the names of globals that may have been copied into multiple places.

Returns: