NewBlockGraph

public final class NewBlockGraph

Data-dependence graph on the Instructions of a future Block of the differentiated code. This holds a local Data-Dependence Graph of the future instructions, linked by Data-Dependences (NewBlockGraphArrow’s). Nodes must be inserted either at the head or at the tail of the existing set of nodes. Data-dependences are set when a new node is inserted: at that moment, we are sure that all node’s before (or after when atTail==false) it have been inserted, and only them. The local uses and defs of the new NewBlockGraphNode are required, they are compared to the lists of existing, visible defs and uses of the previous NewBlockGraphNode’s, which results in NewBlockGraphArrow’s being set or not, and they are finally added to these same lists. A notion of Group level exists, so that whenever we are inside a group, all successively added NewBlockGraphNodes must remain in their exact insertion order.

Fields

adEnv

protected DifferentiationEnv adEnv

debug

protected boolean debug

nodes

public TapList<NewBlockGraphNode> nodes

Constructors

NewBlockGraph

protected NewBlockGraph(DifferentiationEnv adEnv, SymbolTable symbolTable, int nbZones)

Methods

addDataDepNode

protected void addDataDepNode(NewBlockGraphNode newNode, boolean atTail, boolean chain, boolean followPointers, boolean incrementalCondense, TapList<Tree> localUses, TapList<Tree> localDefs, TapList<Tree> localBisUses, TapList<Tree> localBisDefs)

buildInstructions

protected void buildInstructions(SymbolTable srcSymbolTable, SymbolTable revSymbolTable, DifferentiationEnv adEnv, Unit diffUnit)

closeGroup

protected void closeGroup()

condense

protected void condense(Unit unit)

Condenses the nodes of this Graph, performing condensation of the nodes when condensation is defined in their relative classes. Hypotheses: The graph “nodes” is the list of all nodes (e.g. instructions) ordered from the first executed to the last executed. Between these nodes are arrows (e.g. data-deps in their normal direction), i.e. they all go from a node to a node AFTER it in the list. Therefore the graph is a DAG. After condensation has begun, the graph is still a DAG, BUT it may happen that some new arrows go UPWARDS !

existsArrow

protected static boolean existsArrow(NewBlockGraphNode node1, NewBlockGraphNode node2)

openGroup

protected void openGroup()

reset

protected void reset()

topoSort

protected TapList<NewBlockGraphNode> topoSort()
Returns

the ordered list of all NewBlockGraphNode’s.