InOutAnalyzer¶
-
public final class
InOutAnalyzer
extends DataFlowAnalyzer¶ In-out analysis (aka read-write).
Fields¶
Methods¶
analyze¶
-
protected boolean
analyze
()¶ Runs in-out analysis on “curUnit”, plus related analyses.
- Returns
true if the analysis result for this curUnit has changed since the previous time.
compareChannelZoneDataDownstream¶
compareChannelZoneDataUpstream¶
compareDownstreamValues¶
-
protected boolean
compareDownstreamValues
()¶ Compares the downstream info with the result of previous sweep. Sometimes (e.g. for INOUT) we think comparison might take too long, so we don’t compare and we return the default “true”.
compareUpstreamValues¶
-
protected boolean
compareUpstreamValues
()¶ Compares the in-out data flow information with the same info of the previous sweep. Overwrites the previous info if different. @return true when the new result is different from the previous one, thus asking for a new FG sweep.
cumulCycleValueWithAdditional¶
-
protected void
cumulCycleValueWithAdditional
(SymbolTable commonSymbolTable)¶ First initialize the cumul cycle-values if they are null, then accumulate the additional value into the cumul cycle-value.
cumulValueWithAdditional¶
-
protected void
cumulValueWithAdditional
(SymbolTable commonSymbolTable)¶ First initialize the cumul values if they are null, then accumulate the additional value into the cumul value.
getFrontierModifiedZones¶
-
public BoolVector
getFrontierModifiedZones
(TapList<FGArrow> frontier)¶ When “frontier” is a list of converging flow arrows that define the entry into a fragment of the current Unit.
- Returns
the vector of the zones that are modified by this fragment.
getFrontierPossiblyReadZones¶
-
public BoolVector
getFrontierPossiblyReadZones
(TapList<FGArrow> frontier)¶ When “frontier” is a list of converging flow arrows that define the entry into a fragment of the current Unit.
- Returns
the vector of the zones that are read/used by this fragment.
getFrontierPossiblyWrittenZones¶
-
public BoolVector
getFrontierPossiblyWrittenZones
(TapList<FGArrow> frontier)¶ When “frontier” is a list of converging flow arrows that define the entry into a fragment of the current Unit.
- Returns
the vector of the zones that are possibly overwritten by this fragment.
getFrontierUnusedZones¶
-
public BoolVector
getFrontierUnusedZones
(TapList<FGArrow> frontier)¶ When “frontier” is a list of converging flow arrows that define the entry into a fragment of the current Unit.
- Returns
the vector of the zones that are unused by this fragment.
getIOeffectOfIOspec¶
-
public static Tree
getIOeffectOfIOspec
(Tree ioSpec, int i, String ioOper, ToBool written, ToBool totally, SymbolTable symbolTable)¶ For the IO specification element “ioSpec”, which is at rank “i” in the list of IO specificators of an IO call to IO operation “ioOper”.
- Returns
the Tree of expressions that are affected for this ioSpec, and whether they are read or written, totally or not. VERY specific to FORTRAN (77?) IO syntax. cf VAX-Fortran manual.
getInOutOfRegion¶
-
public TapPair<BoolVector, BoolVector>
getInOutOfRegion
(TapTriplet<TapList<FGArrow>, TapList<Block>, TapList<FGArrow>> region, Unit unit)¶ Run in-out analyzer locally on the piece of code defined by “region”, and return the pair of the possibly read and oberwritten BoolVectors TODO: try use possiblyW info of the INOUT phase instead of MODIFIED of the CONSTANT phase.
initializeCGForUnit¶
initializeFGForBlock¶
-
protected void
initializeFGForBlock
()¶ Initializes the in-out information through “curBlock”.
initializeInitBlock¶
-
protected void
initializeInitBlock
()¶ Set an identity information on the given initial block.
isCheapDuplicableConstant¶
-
public static boolean
isCheapDuplicableConstant
(Tree expression, Block block, Instruction instruction)¶ - Returns
true when the “expression” is cheap and is not modified from the beginning of “block” till the end of the enclosing Unit.
propagateValuesForwardThroughBlock¶
-
protected boolean
propagateValuesForwardThroughBlock
()¶ Only during USED_UNDEF phase, combine the “Initialized zones” info before “curBlock” with in-out infos through “curBlock”, to obtain and store the “Initialized zones” after “curBlock”.
run¶
runAnalysis¶
-
public static void
runAnalysis
(CallGraph callGraph, TapList<Unit> rootUnits)¶ Main trigger method. Runs In-Out analysis under the rootUnits. If the context for calling the differentiated root must be created, then pass rootUnits==null and the analysis will run on the complete CallGraph, including the parts that are not under the root differentiation Units.
setCurBlockEtc¶
setCurUnitEtc¶
setExternalOrIntrinsicDefaultInOutInfo¶
-
public static void
setExternalOrIntrinsicDefaultInOutInfo
(Unit unit)¶ Computes the default in-out signature for an intrinsic, an external or a varFunction: All vars possibly read and possibly written, except for the function result, which is never read and completely written, and for the I-O streams and all system-predefined symbols, which are never read nor written. [llh: the following is arbitrary and may be discussed:] We also assume that variables in COMMON are not read nor writen, i.e. that the external routine does not touch the COMMON, even if it might see it.
setFgPhase¶
-
public void
setFgPhase
(int fgPhase)¶ Set the current phase of the analysis at the flow graph level.