Package at.dms.kjc.sir.lowering

Provides compiler passes that analyze or optimize the SIR, primarily within the code of each filter.

See:
          Description

Class Summary
ArrayDestroyer This class breaks up arrays into local vars as much as possible
ArrayInitExpander This class expands array initializers that read from files into static constants.
BlockFlattener This class flattens nested blocks in methods.
BranchAnalyzer This class aggressively analyzes branches in control flow for information gained and calls constant prop on the rest of the method with the new information gained.
CollapseDataParallelism OVERVIEW ---------------------------------------------------- The goal of this class is to identify big splitjoins of data-parallel components that can be collapsed to a single filter, WITHOUT duplicating any code.
ConstantProp This class propagates constants and unrolls loops.
ConstructSIRTree This class inputs a stream representation where child/parent relationships and initialization arguments are given via SIRInitStatements.
DataFlow Basic dataflow framework.
DeadCodeElimination Removes what dead code we can detect within a filter.
EnqueueToInitPath Create initPath() functions for feedback loops that don't have them.
FieldInitMover This class converts joint field definition/assignment statements to a field decl and a corresponding field assignment statement in the init function.
FieldProp This class propagates constant assignments to field variables from the init function into other functions.
FinalUnitOptimize Final agressive filter optimization before code emission.
FindTapeOps  
Flattener This is the main class for decomposing the high SIR into lower-level function calls for the uniprocessor backend.
InlinePhases This class inlines each phase (i.e., a helper function that does I/O) of a filter into the call site of that phase.
IntroduceMultiPops Introduce multi-pops.
JVectorLiteral Vector literals: a literal of a numeric base type duplicated to fill a vector.
LoopIterInfo Information about loops with fixed number of iterations.
LoweringConstants Contains various constants for the lowering process.
LowerInitFunctions This class adds LIR hooks to the init functions.
LowerWorkFunctions This class adds LIR hooks to work functions.
MarkFilterBoundaries Inserts an SIRMarker at the beginning and end of every filter's work function.
PopToPeek This class converts all pops in a program into peeks.
Propagator This class propagates constants and partially evaluates all expressions as much as possible.
RemoveDynamicRates NOTE: This class is deprecated in favor of SIRDynamicRateManager.
RemoveMultiPops Remove multi-pops.
RenameAll This visitor renames every variable, method, and field to a globally unique name.
RenameDestroyedVars  
RoundToFloor This class converts calls "round(x)" to "floor(x+0.5)".
SimplifyArguments Re-write code so function arguments are either literal, local, field, or array access.
SimplifyPopPeekPush Re-write code so push, pop, and peek are separate statements, and arguments to them are either literal, local, field, or array access.
SIRSchedule This provides an SIR wrapper for the underlying schedule (from the scheduler package).
SIRScheduler This builds a schedule for the stream and instantiates the schedule in a series of calls to filter's work functions.
StaticsProp StaticsProp propagates constants from 'static' sections.
StaticsProp.IterOverAllFieldsAndMethods Methods to iterate a EmptyAttributeVisitor over all fields / methods / parameters of a stream, or of a subgraph of the stream graph.
StructDestroyer This class breaks up structures as much as possible.
Structurer This creates structures (inner classes) to encapsulate the state of each hierarchical unit of a stream graph.
ThreeAddressCode Turn statements into three-address code optionally depending on overridable simpleExpression and shouldConvertExpression methods.
ThreeAddressExpressionCheck A Expression visitor, walking the structure and allowing overridable pre- or post-visits to the nodes.
Unroller This class unrolls loops where it can.
VarDeclRaiser This class raises Variable Declaration to the beginning of blocks for C friendly code Use visitBlockStatement to move Var Decls to top of block or have it run on the method and have it recurse
Vectorizable Determine if code is naively vectorizable by interleaving executions of different steady states.
Vectorize Transform methods for a filter to use vector types as appropriate.
VectorizeEnable Mung code to allow naive vectorization.
 

Package at.dms.kjc.sir.lowering Description

Provides compiler passes that analyze or optimize the SIR, primarily within the code of each filter.

Also contains Flattener, the entry point for the original (and mostly obsolete) uniprocessor backend. Other files in this directory that are used solely by this backend include Structurer, LowerInitFunctions, and LowerWorkFunctions. They can be ignored for the sake of most compiler development.

This package also provides the primary interface from the compiler to the scheduler (in SIRScheduler). While some other parts of the compiler call the scheduler as well (for example, to calculate messaging constraints), this class provides the fundamental operation of calculating execution multiplicities for a set of filters.

The remaining files in this package perform various node-level transformations on the IR. They can be broadly categorized into passes that are often necessary for correctness, vs. passes that affect only performance or readability.

Passes that are needed (at least in part) due to correctness:

Several of these passes are run in all backends to prepare the program for processing by the compiler. For example, the first step in building the stream graph is to use ConstantProp, FieldProp and Unroller to statically evaluate the contents of the init function. The ConstructSIRTree pass verifies that this process is complete and cements the graph structure. Note that Unroller is also used to further optimize the work function if unrolling is enabled.

In contrast, passes that are used strictly for performance or readability include:

The at.dms.kjc.sir.lowering.FilterPhaser and DataFlow classes do not appear in either of the previous lists because they are not currently utilized by the compiler.

RemoveDynamicRates was an unsafe transormation converting all dynamic rates to rate 1. It is superceded by use of SIRDynamicRateManager.

Some classes in this package are usually invoked from other passes.

Some classes in this package are only used by the obsolete C library (uni) backend. These include:

LoweringConstants contains some constants unly used by the obsolete C library (uni) backend, and some constants used by other backends.