DifferentiationEnv¶
-
public final class
DifferentiationEnv
¶ Differentiation environment.
Constant objects kept by the DifferentiationEnv: callGraphDifferentiator, FlowGraphDifferentiator, BlockDifferentiator, procedureCallDifferentiator, dynMemoryDifferentiator, expressionDifferentiator (soon), VarRefDifferentiator, multiDirMode, suffixes srcCallGraph, diffCallGraph Modifiable "current" objects during navigation inside IR and construction of IR: curUnit curActivity curDiffUnit curFwdDiffUnit curDiffUnitSort curDiffVarSort curBlock curVectorMap, curDiffVectorMap, curPtrVectorMap, curSymbolTable curInstruction curFwdSymbolTable, curBwdSymbolTable
Fields¶
activeRootCalledFromContext¶
-
protected boolean
activeRootCalledFromContext
¶ True when the curInstruction being differentiated is in context code and is a call to an active.
blockDifferentiator¶
-
protected BlockDifferentiator
blockDifferentiator
¶ The object that knows how to differentiate Basic Blocks.
callGraphDifferentiator¶
-
protected CallGraphDifferentiator
callGraphDifferentiator
¶ The object that knows how to differentiate a callGraph.
commonActivityMemoryMap¶
-
protected MemoryMaps
commonActivityMemoryMap
¶
copiedIncludes¶
-
protected TapList<TapPair<Instruction, Instruction>>
copiedIncludes
¶ Association original include instruction to include instruction in diff.
copiedUnits¶
-
protected UnitStorage<Unit>
copiedUnits
¶ Association original Unit to copied original Unit in diff.
copiedUnitsBack¶
-
protected UnitStorage<Unit>
copiedUnitsBack
¶ Association copied original Unit in diff to original Unit.
curBwdSymbolTable¶
-
protected SymbolTable
curBwdSymbolTable
¶ The current bwd differentiated SymbolTable (i.e. of the current bwd diff Block).
curDiffUnit¶
curDiffUnitPushesPointers¶
-
protected boolean
curDiffUnitPushesPointers
¶ True when differentiation notices that there must be a F90 INTERFACE declaration for PUSH/LOOK/POP POINTER().
curDiffVectorMap¶
-
protected int[]
curDiffVectorMap
¶ The current diffVectorMap (i.e. of the current Unit+SymbolTable).
curFwdDiffUnit¶
curFwdSymbolTable¶
-
protected SymbolTable
curFwdSymbolTable
¶ The current fwd differentiated SymbolTable (i.e. of the current fwd diff Block).
curPtrVectorMap¶
-
protected int[]
curPtrVectorMap
¶ The current ptrVectorMap (i.e. of the current Unit+SymbolTable).
curUnitIsActiveUnit¶
-
protected boolean
curUnitIsActiveUnit
¶ Global boolean true when “curUnit” is an active subroutine.
curUnitIsContext¶
-
protected boolean
curUnitIsContext
¶ Global boolean true when “curUnit” is currently differentiated as context.
curVectorMap¶
-
protected int[]
curVectorMap
¶ The current vectorMap (i.e. of the current Unit+SymbolTable).
debugADHereUnit¶
diffKind¶
-
protected int
diffKind
¶ The kind of zones that are currently differentiated. Usually, it is SymbolTableConstants.REALKIND, but in a special mode, it can be ALLKIND!…
dynMemoryDifferentiator¶
-
protected DynMemoryDifferentiator
dynMemoryDifferentiator
¶ The object that knows how to differentiate Dynamic Memory manipulations.
emptyCopiedUnitSuffix¶
-
protected boolean
emptyCopiedUnitSuffix
¶ True when copied Units keep their original name.
expressionDifferentiator¶
-
protected ExpressionDifferentiator
expressionDifferentiator
¶ The object that knows how to differentiate expressions.
flowGraphDifferentiator¶
-
protected FlowGraphDifferentiator
flowGraphDifferentiator
¶ The object that knows how to differentiate FlowGraphs.
integer4TypeSpec¶
-
protected WrapperTypeSpec
integer4TypeSpec
¶ INTEGER*4 type
integerTypeSpec¶
-
protected WrapperTypeSpec
integerTypeSpec
¶ The “INTEGER” WrapperTypeSpec, necessary to create new INTEGER variables.
multiDirMode¶
-
protected boolean
multiDirMode
¶ True to get vector loops around derivative instructions.
procedureCallDifferentiator¶
-
protected ProcedureCallDifferentiator
procedureCallDifferentiator
¶ The object that knows how to differentiate procedure calls.
realTypeSpec¶
-
protected WrapperTypeSpec
realTypeSpec
¶ The “REAL” WrapperTypeSpec, necessary to create new REAL variables.
toActiveTmpZones¶
-
protected TapIntList
toActiveTmpZones
¶
toIndexSymbolHolders¶
-
protected TapList<NewSymbolHolder>
toIndexSymbolHolders
¶ List of already created newSymbolHolders for variables named “indexN”, used in sub-expressions in actual arguments of calls. This list is ordered with increasing N’s.
toTotalZones¶
-
protected TapIntList
toTotalZones
¶
traceCurBlock¶
-
protected int
traceCurBlock
¶ 1 means trace on current Block. 2 means trace in even more detail (when traceCurDifferentiation is true).
traceCurDifferentiation¶
-
protected boolean
traceCurDifferentiation
¶ Detailled trace of differentiation on the standard output: True when we want to trace differentiation on-the-fly on the current Unit (curUnit).
traceDifferentiationUnits¶
unitActivities¶
-
protected BlockStorage<TapList<BoolVector>>
unitActivities
¶ Activity info for the current Unit (curUnit).
unitAvlXs¶
-
protected BlockStorage<TapList<BoolVector>>
unitAvlXs
¶ AvlX info for the current Unit (curUnit).
unitRecomputations¶
-
protected BlockStorage<TapList<TapPair<TapList<Instruction>, TapList<Instruction>>>>
unitRecomputations
¶ Recomputation (see TBR) info for the current Unit (curUnit).
unitReqXs¶
-
protected BlockStorage<TapList<BoolVector>>
unitReqXs
¶ ReqX info for the current Unit (curUnit).
unitTBRs¶
-
protected BlockStorage<TapList<TapPair<BoolVector, BoolVector>>>
unitTBRs
¶ TBR info for the current Unit (curUnit).
unitUsefulnesses¶
-
protected BlockStorage<TapList<BoolVector>>
unitUsefulnesses
¶ Usefulness info for the current Unit (curUnit).
varRefDifferentiator¶
-
protected VarRefDifferentiator
varRefDifferentiator
¶ The object that knows how to differentiate memory references.
Constructors¶
Methods¶
allocateTmpZone¶
-
protected int
allocateTmpZone
()¶ Allocate a new zone number for a new temporary variable. increments the head of “toTotalZones”, that contains the last zone used.
curActivity¶
-
protected ActivityPattern
curActivity
()¶ - Returns
The activity pattern for which we are differentiating the current Unit.
curInstruction¶
-
protected Instruction
curInstruction
()¶ - Returns
The current (source) Instruction.
curSymbolTable¶
-
protected SymbolTable
curSymbolTable
()¶ - Returns
The current source SymbolTable (i.e. of the current source Block).
curUnit¶
getCurrentFilename¶
getDiffOfUnit¶
-
protected Unit
getDiffOfUnit
(Unit unit, ActivityPattern pattern, int diffMode)¶
getPatternsForCallingUnitPattern¶
-
protected TapList<ActivityPattern>
getPatternsForCallingUnitPattern
(ActivityPattern callerPattern, Unit calledUnit)¶ - Parameters
callerPattern – The activity pattern of this particular call site.
calledUnit – The called unit
- Returns
the ActivityPatterns for a “calledUnit” that are used at a particular call site, i.e. only the patterns of “calledUnit” that may be called here in the caller’s pattern. When the call site is a module, the callerPattern is null and all called patterns are returned.
pushCurDiffVectorMap¶
-
protected void
pushCurDiffVectorMap
(int[] diffVectorMap)¶ Current pointer Type vectorMap
- Parameters
diffVectorMap – current diff vectorMap
pushCurSymbolTable¶
-
protected void
pushCurSymbolTable
(SymbolTable symbolTable)¶
setCurActivity¶
-
protected void
setCurActivity
(ActivityPattern activity)¶ Sets and redistributes the global current activity pattern for the current Unit.
setCurBwdSymbolTable¶
-
protected void
setCurBwdSymbolTable
(SymbolTable symbolTable)¶
setCurFwdSymbolTable¶
-
protected void
setCurFwdSymbolTable
(SymbolTable symbolTable)¶
setCurInstruction¶
-
protected void
setCurInstruction
(Instruction instr)¶
setCurSymbolTable¶
-
protected void
setCurSymbolTable
(SymbolTable symbolTable)¶