InOutAnalyzer ============= .. java:package:: fr.inria.tapenade.analysis :noindex: .. java:type:: public final class InOutAnalyzer extends DataFlowAnalyzer In-out analysis (aka read-write). Fields ------ CONSTANT ^^^^^^^^ .. java:field:: public static final int CONSTANT :outertype: InOutAnalyzer Constant that codes for the CONSTANT sub phase. INOUT ^^^^^ .. java:field:: public static final int INOUT :outertype: InOutAnalyzer Constant that codes for the INOUT phase. OTHER ^^^^^ .. java:field:: public static final int OTHER :outertype: InOutAnalyzer Constant for the three other phases. UNUSED ^^^^^^ .. java:field:: public static final int UNUSED :outertype: InOutAnalyzer Constant that codes for the UNUSED sub phase. USED_UNDEF ^^^^^^^^^^ .. java:field:: public static final int USED_UNDEF :outertype: InOutAnalyzer Constant that codes for the USED_UNDEF sub phase. Methods ------- analyze ^^^^^^^ .. java:method:: @Override protected boolean analyze() :outertype: InOutAnalyzer Runs in-out analysis on "curUnit", plus related analyses. :return: true if the analysis result for this curUnit has changed since the previous time. compareChannelZoneDataDownstream ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected boolean compareChannelZoneDataDownstream(int mpZone, Block refBlock) :outertype: InOutAnalyzer compareChannelZoneDataUpstream ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected boolean compareChannelZoneDataUpstream(int mpZone, Block refBlock) :outertype: InOutAnalyzer compareDownstreamValues ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected boolean compareDownstreamValues() :outertype: InOutAnalyzer 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 ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected boolean compareUpstreamValues() :outertype: InOutAnalyzer 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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected void cumulCycleValueWithAdditional(SymbolTable commonSymbolTable) :outertype: InOutAnalyzer First initialize the cumul cycle-values if they are null, then accumulate the additional value into the cumul cycle-value. cumulValueWithAdditional ^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected void cumulValueWithAdditional(SymbolTable commonSymbolTable) :outertype: InOutAnalyzer First initialize the cumul values if they are null, then accumulate the additional value into the cumul value. getFrontierModifiedZones ^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public BoolVector getFrontierModifiedZones(TapList frontier) :outertype: InOutAnalyzer When "frontier" is a list of converging flow arrows that define the entry into a fragment of the current Unit. :return: the vector of the zones that are modified by this fragment. getFrontierPossiblyReadZones ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public BoolVector getFrontierPossiblyReadZones(TapList frontier) :outertype: InOutAnalyzer When "frontier" is a list of converging flow arrows that define the entry into a fragment of the current Unit. :return: the vector of the zones that are read/used by this fragment. getFrontierPossiblyWrittenZones ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public BoolVector getFrontierPossiblyWrittenZones(TapList frontier) :outertype: InOutAnalyzer When "frontier" is a list of converging flow arrows that define the entry into a fragment of the current Unit. :return: the vector of the zones that are possibly overwritten by this fragment. getFrontierUnusedZones ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public BoolVector getFrontierUnusedZones(TapList frontier) :outertype: InOutAnalyzer When "frontier" is a list of converging flow arrows that define the entry into a fragment of the current Unit. :return: the vector of the zones that are unused by this fragment. getIOeffectOfIOspec ^^^^^^^^^^^^^^^^^^^ .. java:method:: public static Tree getIOeffectOfIOspec(Tree ioSpec, int i, String ioOper, ToBool written, ToBool totally, SymbolTable symbolTable) :outertype: InOutAnalyzer 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". :return: 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 ^^^^^^^^^^^^^^^^ .. java:method:: public TapPair getInOutOfRegion(TapTriplet, TapList, TapList> region, Unit unit) :outertype: InOutAnalyzer 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. getValueFlowingBack ^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected boolean getValueFlowingBack() :outertype: InOutAnalyzer getValueFlowingThrough ^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected boolean getValueFlowingThrough() :outertype: InOutAnalyzer initializeCGForUnit ^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected Object initializeCGForUnit() :outertype: InOutAnalyzer During initialization on the whole CallGraph, do whatever initialization is needed for "unit", i.e. set the results to null for normal units and to the default values for intrinsics, externals, etc... initializeCumulValue ^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected void initializeCumulValue() :outertype: InOutAnalyzer initializeFGForBlock ^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected void initializeFGForBlock() :outertype: InOutAnalyzer Initializes the in-out information through "curBlock". initializeInitBlock ^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected void initializeInitBlock() :outertype: InOutAnalyzer Set an identity information on the given initial block. initializeUnit ^^^^^^^^^^^^^^ .. java:method:: @Override protected void initializeUnit() :outertype: InOutAnalyzer Initialize before one sweep on the curUnit. isCheapDuplicableConstant ^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static boolean isCheapDuplicableConstant(Tree expression, Block block, Instruction instruction) :outertype: InOutAnalyzer :return: true when the "expression" is cheap and is not modified from the beginning of "block" till the end of the enclosing Unit. propagateValuesBackwardThroughBlock ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected boolean propagateValuesBackwardThroughBlock() :outertype: InOutAnalyzer propagateValuesForwardThroughBlock ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected boolean propagateValuesForwardThroughBlock() :outertype: InOutAnalyzer 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 ^^^ .. java:method:: @Override protected void run(TapList rootUnits) :outertype: InOutAnalyzer Runs in-out analysis, upwards from the leaves of the CallGraph. As a result, this function fills the inOut fields of each Unit. runAnalysis ^^^^^^^^^^^ .. java:method:: public static void runAnalysis(CallGraph callGraph, TapList rootUnits) :outertype: InOutAnalyzer 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 ^^^^^^^^^^^^^^ .. java:method:: @Override protected void setCurBlockEtc(Block block) :outertype: InOutAnalyzer Set curBlock, curSymbolTable, nDZ, nDRZ, vectorMap's. :param block: The new current Block. setCurUnitEtc ^^^^^^^^^^^^^ .. java:method:: @Override public void setCurUnitEtc(Unit unit) :outertype: InOutAnalyzer Set the current unit "curUnit", and various other globals specific to curUnit. :param unit: The new current Unit. setEmptyCumulAndCycleValues ^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected void setEmptyCumulAndCycleValues() :outertype: InOutAnalyzer setExternalOrIntrinsicDefaultInOutInfo ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static void setExternalOrIntrinsicDefaultInOutInfo(Unit unit) :outertype: InOutAnalyzer 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 ^^^^^^^^^^ .. java:method:: public void setFgPhase(int fgPhase) :outertype: InOutAnalyzer Set the current phase of the analysis at the flow graph level. setFgSubPhase ^^^^^^^^^^^^^ .. java:method:: public void setFgSubPhase(int fgSubPhase) :outertype: InOutAnalyzer Set the current subphase of the analysis at the flow graph level, when fgPhase==OTHER. terminateCGForUnit ^^^^^^^^^^^^^^^^^^ .. java:method:: @Override protected void terminateCGForUnit() :outertype: InOutAnalyzer terminateUnit ^^^^^^^^^^^^^ .. java:method:: @Override protected boolean terminateUnit() :outertype: InOutAnalyzer Gets and stores the final InOut result on the "curUnit". The result is computed from the InOut value propagated back till the Entry Block. @return true when the result has changed since previous time.