The Loop Fission Interference Graph (FIG) is generated with the nodes of the data dependence graph (DDG). Weights are generated for the edges of the interference graph reflecting the affinity between statements represented by the nodes joined by the edges. Nodes in the interference graph are given weights reflecting resource usage by the statements associated with the nodes. The interference graph is partitioned using a profitability test based on the weights of edges and nodes in the data dependence graph. Code (e.g. loops) is emitted based on the partitioned interference graph.
In this first patch we introduce the basic components of the Loop Fission Interference Graph:
- the FIGNode (and derived class) representing nodes in the graph
- and the FIGEdge (and its derived classes) representing edges in the graph
The graph is constructed based on the DDG for a loop. Each interference graph node encapsulates one or more DDG nodes.
Edges connect the nodes in the interference and are used to enforce data dependencies.
A unit test is provided to test the graph structure and ensure nodes are connected properly.
In future patches we plan to:
- add the ability to merge nodes in the interference graph
- summarize node connectivity informations and use the the information to prevent merging nodes that would create cycles in the graph
Merged nodes will represent the largest unit of code that can be distributed into a loop without violating data dependencies.
Afterward we will start to add to the graph the infrastructure needed to develop a cost model which will be used to determine which nodes should be merged to achieve data reuse.
Nodes found to exhibit data reuse will be connected by affinity edges with a weight that represent the desirability to merge them.
Nodes will also be given a set of Resources to represent the computational resource the code in the node consumes (e.g. code size, HW streams, etc...).