coins.flow
Interface DataFlow

All Known Implementing Classes:
DataFlowImpl

public interface DataFlow

Interface for data flow analysis methods. All the data flow information is available accessing this interface. There are some dependecies between the methods in this interface. For example, findReach() mustn't be called before both findDef() and findKill() have been called, and findKill() in turn depends on the result of findDefined(). Please be careful in using. findAll() method should call those methods in the correct order.

See Also:
DataFlowImpl, SetRefRepr

Method Summary
 int defLookup(int pNodeIndex)
          Changes the IR node index into the "Def" index.
 int defReverseLookup(int pBitPosition)
          Changes the "Def" index into the IR node index.
 int expLookup(int pExpIdIndex)
          Changes the ExpId index into the position in the ExpVector.
 int expReverseLookup(int pBitPosition)
          Changes the position in the ExpVector into the ExpId index.
 void findAll()
          Finds and sets all the data flow information.
 void findAllBitVectors()
          Finds and sets all the BitVectors, that is, Def, Kill, In, Out, Reach, Defined, Exposed, EGen, EKill, AvailIn, AvailOut, LiveIn, LiveOut, DefIn, and DefOut vectors.
 void findAvailInAvailOut()
          Finds and sets the AvailIn/AvailOut vector for the entire flow.
 void findBasic()
          Finds and sets the data flow items that are independent of the control flow, that is, Def, Kill, Defined, Exposed, EGen, and EKill vectors.
 void findDef()
          Finds and sets the Def vector for the entire flow.
 void findDef(BBlock pBBlock)
          Finds and sets the Def vector for the given BBlock.
 void findDefInDefOut()
          Finds and sets the DefIn/DefOut vector for the entire flow.
 void findDefined()
          Finds and sets the Defined vector for the entire flow.
 void findDefined(BBlock pBBlock)
          Finds and sets the Defined vector for the given BBlock.
 void findDefUse()
          Finds and sets the DefUseList for each FlowAnalSym without considering side effects of alias and call.
 void findDefUseExhaustively()
          Finds and sets the DefUseList for each FlowAnalSym considering side effects of alias and call.
 void findEGen()
          Finds and sets the EGen vector for the entire flow considering alias.
 void findEGen(BBlock pBBlock)
          Finds and sets the EGen vector for the given BBlock considering alias.
 void findEKill()
          Finds and sets the EKill vector for the entire flow.
 void findEKill(BBlock pBBlock)
          Finds and sets the EKill vector for the given BBlock considering alias.
 void findExposed()
          Finds and sets the Exposed vector for the entire flow.
 void findExposed(BBlock pBBlock)
          Finds and sets the Exposed vector for the given BBlock.
 void findKill()
          Finds and sets the Kill vector for the entire flow.
 void findKill(BBlock pBBlock)
          Finds and sets the Kill vector for the given BBlock.
 void findLiveInLiveOut()
          Finds and sets the LiveIn/LiveOut vector for the entire flow.
 void findReach()
          Finds and sets the Reach vector for the entire flow.
 void findUsed()
          Finds and sets the Used vector for the entire flow.
 void findUsed(BBlock pBBlock)
          Finds and sets the Used vector for the given BBlock.
 void findUseDef()
          Finds and sets the UseDefList for each FlowAnalSym considering alias and call.
 void findUseDefExhaustively()
          Finds and sets the UseDefList for each FlowAnalSym without considering side effects of alias and call.
 java.util.List getBBlockList()
          Returns the List of BBlocks in this flow.
 int getDefCount()
          Returns the # of value-setting SetRefReprs.
 int getDefIndex(int pIRIndex)
          Returns the DefSetRefRepr index (SetRefRepr no.
 int getDefNodeIndex(int pDefSetRefReprNo)
          Returns the node index corresponding to the given "DefSetRefReprNo", which is the index attached to every value-setting SetRefRepr.
 FlowAnalSym getFlowAnalSym(int pFlowAnalSymIndex)
          Returns the ExpId that has the given index.
 int getFlowAnalSymCount()
          Returns the # of ExpIds generated in this flow.
 IR getNode(int pNodeIndex)
          Returns the node that has the given index.
 IR getNodeFromDefIndex(int pDefIndex)
          Returns the IR node that corresponds to the given DefSetRefRepr index (entry of the DefVector).
 int getPointCount()
          Returns the # of "Points" in this flow.
 java.util.Set getUndefinedUseNodeOfSym(FlowAnalSym lSym)
           
 java.util.Set getUseFlowAnalSyms(IR pSubtree)
          Returns the Set of ExpIds that fall under the given subtree and are used.
 java.util.Set getUseFlowAnalSymsForHir(HIR pSubtree)
           
 void showAll()
          Shows all the information found in this analysis.
 void showAllBitVectors()
          Shows all the BitVectors.
 void showAvailIn()
          Shows the AvailIn vector for every BBlock.
 void showAvailInAvailOutRelated()
          Shows BitVectors related to (needed to solve) AvailIn/AvailOut vectors, that is, EGen, EKill, AvailIn, and AvailOut vectors.
 void showAvailOut()
          Shows the AvailOut vector for every BBlock.
 void showBasic()
          Shows all the data flow items that are independent of the control flow, that is, Def, Kill, Defined, Exposed, EGen, and EKill vectors.
 void showDef()
          Shows the Def vector for every BBlock.
 void showDefIn()
          Shows the DefIn vector for every BBlock.
 void showDefInDefOutRelated()
          Shows BitVectors related to (needed to solve) DefIn/DefOut vectors, that is, Defined, DefIn, and DefOut vectors.
 void showDefined()
          Shows the Defined vector for every BBlock.
 void showDefOut()
          Shows the DefOut vector for every BBlock.
 void showDefUse()
          Shows the DefUseList for each FlowAnalSym.
 void showDefVectors()
          Shows all the DefVectors for every BBlock.
 void showEGen()
          Shows the EGen vector for every BBlock.
 void showEKill()
          Shows the EKill vector for every BBlock.
 void showExposed()
          Shows the Exposed vector for every BBlock.
 void showExpVectors()
          Shows all the ExpVectors for every BBlock.
 void showKill()
          Shows the Kill vector for every BBlock.
 void showLiveIn()
          Shows the LiveIn vector for every BBlock.
 void showLiveInLiveOutRelated()
          Shows BitVectors related to (needed to solve) LiveIn/LiveOut vectors, that is, Exposed, Defined, LiveIn, and LiveOut vectors.
 void showLiveOut()
          Shows the LiveOut vector for every BBlock.
 void showReach()
          Shows the Reach the vector for every BBlock.
 void showReachRelated()
          Shows BitVectors related to (needed to solve) Reach vectors, that is, Def, Kill, and Reach vectors.
 void showSolved()
          Shows all the data flow items data flow equations have found, that is, In, Out, Reach, AvailIn, AvailOut, LiveIn, LiveOut, DefIn, and DefOut vectors.
 void showSummary()
          Show summary of data flow information.
 void showUseDef()
          Shows the UseDefList for each FlowAnalSym.
 void solveAll()
          Solves all the data flow equations to find In, Out, Reach, AvailIn, AvailOut, LiveIn, LiveOut, DefIn, and DefOut vectors.
 

Method Detail

findDef

public void findDef()
Finds and sets the Def vector for the entire flow.


findDef

public void findDef(BBlock pBBlock)
Finds and sets the Def vector for the given BBlock.

Parameters:
pBBlock - BBlock whose Def vector to find.

findKill

public void findKill()
Finds and sets the Kill vector for the entire flow.


findKill

public void findKill(BBlock pBBlock)
Finds and sets the Kill vector for the given BBlock.

Parameters:
pBBlock - BBlock whose Kill vector to find.

findDefined

public void findDefined()
Finds and sets the Defined vector for the entire flow.


findDefined

public void findDefined(BBlock pBBlock)
Finds and sets the Defined vector for the given BBlock.

Parameters:
pBBlock - BBlock whose Defined vector to find.

findUsed

public void findUsed()
Finds and sets the Used vector for the entire flow.


findUsed

public void findUsed(BBlock pBBlock)
Finds and sets the Used vector for the given BBlock.

Parameters:
pBBlock - BBlock whose Used vector to find.

findExposed

public void findExposed()
Finds and sets the Exposed vector for the entire flow.


findExposed

public void findExposed(BBlock pBBlock)
Finds and sets the Exposed vector for the given BBlock.

Parameters:
pBBlock - BBlock whose Exposed vector to find.

findEGen

public void findEGen()
Finds and sets the EGen vector for the entire flow considering alias.


findEGen

public void findEGen(BBlock pBBlock)
Finds and sets the EGen vector for the given BBlock considering alias.

Parameters:
pBBlock - BBlock whose EGen vector to find.

findEKill

public void findEKill()
Finds and sets the EKill vector for the entire flow.


findEKill

public void findEKill(BBlock pBBlock)
Finds and sets the EKill vector for the given BBlock considering alias.

Parameters:
pBBlock - BBlock whose EKill vector to find.

findReach

public void findReach()
Finds and sets the Reach vector for the entire flow.


findAvailInAvailOut

public void findAvailInAvailOut()
Finds and sets the AvailIn/AvailOut vector for the entire flow.


findLiveInLiveOut

public void findLiveInLiveOut()
Finds and sets the LiveIn/LiveOut vector for the entire flow.


findDefInDefOut

public void findDefInDefOut()
Finds and sets the DefIn/DefOut vector for the entire flow.


findBasic

public void findBasic()
Finds and sets the data flow items that are independent of the control flow, that is, Def, Kill, Defined, Exposed, EGen, and EKill vectors.

See Also:
findDef(), findDefined(), findKill(), findExposed(), findEGen(), findEKill()

solveAll

public void solveAll()
Solves all the data flow equations to find In, Out, Reach, AvailIn, AvailOut, LiveIn, LiveOut, DefIn, and DefOut vectors. //@see #findInOut()

See Also:
findReach(), findAvailInAvailOut(), findLiveInLiveOut(), findDefInDefOut()

findAllBitVectors

public void findAllBitVectors()
Finds and sets all the BitVectors, that is, Def, Kill, In, Out, Reach, Defined, Exposed, EGen, EKill, AvailIn, AvailOut, LiveIn, LiveOut, DefIn, and DefOut vectors.

See Also:
findBasic(), solveAll()

findDefUse

public void findDefUse()
Finds and sets the DefUseList for each FlowAnalSym without considering side effects of alias and call.


findDefUseExhaustively

public void findDefUseExhaustively()
Finds and sets the DefUseList for each FlowAnalSym considering side effects of alias and call.


findUseDef

public void findUseDef()
Finds and sets the UseDefList for each FlowAnalSym considering alias and call.


findUseDefExhaustively

public void findUseDefExhaustively()
Finds and sets the UseDefList for each FlowAnalSym without considering side effects of alias and call.


findAll

public void findAll()
Finds and sets all the data flow information. This method consists of findAllBitVectors and findDefUse.

See Also:
findAllBitVectors(), findDefUse()

getDefCount

public int getDefCount()
Returns the # of value-setting SetRefReprs.

Returns:
the # of value-setting SetRefReprs.

getFlowAnalSymCount

public int getFlowAnalSymCount()
Returns the # of ExpIds generated in this flow.

Returns:
the # of FlowAnalSyms generated in this flow.

getPointCount

public int getPointCount()
Returns the # of "Points" in this flow.

Returns:
the # of "Points" in this flow.

getDefIndex

public int getDefIndex(int pIRIndex)
Returns the DefSetRefRepr index (SetRefRepr no. that is assigned to value-setting SetRefReprs) of the node that has the given IR index.

Returns:
the DefSetRefRepr index (SetRefRepr no. that is assigned to value-setting SetRefReprs) of the node that has the given IR index.

getNodeFromDefIndex

public IR getNodeFromDefIndex(int pDefIndex)
Returns the IR node that corresponds to the given DefSetRefRepr index (entry of the DefVector).

Returns:
the IR node that corresponds to the given DefSetRefRepr index (entry of the DefVector).

getBBlockList

public java.util.List getBBlockList()
Returns the List of BBlocks in this flow. (Excluding null and 0-numbered BBlock)

Returns:
the List of BBlocks in this flow.

getUseFlowAnalSyms

public java.util.Set getUseFlowAnalSyms(IR pSubtree)
Returns the Set of ExpIds that fall under the given subtree and are used. The ExpId that is attached to the "Def node" will not be included if the given subtree is a value-setting node (AssignStmt in HIR). The ExpId that corresponds to the given subtree is also included in the Set.

Parameters:
pSubtree - IR node that is the root of the subtree to examine.
Returns:
the Set of ExpIds that fall under the given subtree and are used.

getUseFlowAnalSymsForHir

public java.util.Set getUseFlowAnalSymsForHir(HIR pSubtree)

getFlowAnalSym

public FlowAnalSym getFlowAnalSym(int pFlowAnalSymIndex)
Returns the ExpId that has the given index.

Returns:
the ExpId that has the given index.

expReverseLookup

public int expReverseLookup(int pBitPosition)
Changes the position in the ExpVector into the ExpId index.

Parameters:
pBitPosition - position in the ExpVector.

defLookup

public int defLookup(int pNodeIndex)
Changes the IR node index into the "Def" index.

Parameters:
pNodeIndex - index of the value-setting node (AssignStmt in HIR).

defReverseLookup

public int defReverseLookup(int pBitPosition)
Changes the "Def" index into the IR node index.

Parameters:
pBitPosition - index in the DefVector for which to find the node index.

expLookup

public int expLookup(int pExpIdIndex)
Changes the ExpId index into the position in the ExpVector. Currently does nothing.

Parameters:
pExpIdIndex - index of ExpId.

getDefNodeIndex

public int getDefNodeIndex(int pDefSetRefReprNo)
Returns the node index corresponding to the given "DefSetRefReprNo", which is the index attached to every value-setting SetRefRepr.

Parameters:
pDefSetRefReprNo - index of value-setting SetRefRepr.
Returns:
the node index corresponding to the given "DefSetRefReprNo".

getNode

public IR getNode(int pNodeIndex)
Returns the node that has the given index.

Parameters:
pNodeIndex - index of the node to be gotten.
Returns:
the node that has the given index.

showDef

public void showDef()
Shows the Def vector for every BBlock.


showKill

public void showKill()
Shows the Kill vector for every BBlock.


showReach

public void showReach()
Shows the Reach the vector for every BBlock.


showDefined

public void showDefined()
Shows the Defined vector for every BBlock.


showExposed

public void showExposed()
Shows the Exposed vector for every BBlock.


showEGen

public void showEGen()
Shows the EGen vector for every BBlock.


showEKill

public void showEKill()
Shows the EKill vector for every BBlock.


showAvailIn

public void showAvailIn()
Shows the AvailIn vector for every BBlock.


showAvailOut

public void showAvailOut()
Shows the AvailOut vector for every BBlock.


showLiveIn

public void showLiveIn()
Shows the LiveIn vector for every BBlock.


showLiveOut

public void showLiveOut()
Shows the LiveOut vector for every BBlock.


showDefIn

public void showDefIn()
Shows the DefIn vector for every BBlock.


showDefOut

public void showDefOut()
Shows the DefOut vector for every BBlock.


showDefVectors

public void showDefVectors()
Shows all the DefVectors for every BBlock.

See Also:
showDef(), //@see #showIn() //@see #showOut(), showReach()

showExpVectors

public void showExpVectors()
Shows all the ExpVectors for every BBlock.

See Also:
showDefined(), showExposed(), showEGen(), showEKill(), showAvailIn(), showAvailOut(), showLiveIn(), showLiveOut(), showDefIn(), showDefOut()

showBasic

public void showBasic()
Shows all the data flow items that are independent of the control flow, that is, Def, Kill, Defined, Exposed, EGen, and EKill vectors.

See Also:
showDef(), showKill(), showDefined(), showExposed(), showEGen(), showEKill()

showSolved

public void showSolved()
Shows all the data flow items data flow equations have found, that is, In, Out, Reach, AvailIn, AvailOut, LiveIn, LiveOut, DefIn, and DefOut vectors. //@see #showIn() //@see #showOut()

See Also:
showReach(), showAvailIn(), showAvailOut(), showLiveIn(), showLiveOut(), showDefIn(), showDefOut()

showReachRelated

public void showReachRelated()
Shows BitVectors related to (needed to solve) Reach vectors, that is, Def, Kill, and Reach vectors.

See Also:
showDef(), showKill(), showReach()

showAvailInAvailOutRelated

public void showAvailInAvailOutRelated()
Shows BitVectors related to (needed to solve) AvailIn/AvailOut vectors, that is, EGen, EKill, AvailIn, and AvailOut vectors.

See Also:
showEGen(), showEKill(), showAvailIn(), showAvailOut()

showLiveInLiveOutRelated

public void showLiveInLiveOutRelated()
Shows BitVectors related to (needed to solve) LiveIn/LiveOut vectors, that is, Exposed, Defined, LiveIn, and LiveOut vectors.

See Also:
showExposed(), showDefined(), showLiveIn(), showLiveOut()

showDefInDefOutRelated

public void showDefInDefOutRelated()
Shows BitVectors related to (needed to solve) DefIn/DefOut vectors, that is, Defined, DefIn, and DefOut vectors.

See Also:
showDefined(), showDefIn(), showDefOut()

showAllBitVectors

public void showAllBitVectors()
Shows all the BitVectors.

See Also:
showDefVectors(), showExpVectors()

showDefUse

public void showDefUse()
Shows the DefUseList for each FlowAnalSym.


showUseDef

public void showUseDef()
Shows the UseDefList for each FlowAnalSym.


showAll

public void showAll()
Shows all the information found in this analysis.

See Also:
showAllBitVectors(), showDefUse()

showSummary

public void showSummary()
Show summary of data flow information.


getUndefinedUseNodeOfSym

public java.util.Set getUndefinedUseNodeOfSym(FlowAnalSym lSym)