[PATCH] D73801: [LoopFission]: Loop Fission Interference Graph (FIG)

Ettore Tiotto via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 12:44:41 PST 2020


etiotto created this revision.
Herald added subscribers: llvm-commits, jfb, hiraditya, mgorny.
Herald added a project: LLVM.

SUMMARY 
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.

PATCH DESCRIPTION
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.

FUTURE PATCHES
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...).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73801

Files:
  llvm/include/llvm/Analysis/DDG.h
  llvm/include/llvm/Transforms/Scalar/LoopFission/FIG.h
  llvm/lib/Transforms/Scalar/CMakeLists.txt
  llvm/lib/Transforms/Scalar/LoopFission/FIG.cpp
  llvm/unittests/Transforms/Scalar/CMakeLists.txt
  llvm/unittests/Transforms/Scalar/LoopFission/CMakeLists.txt
  llvm/unittests/Transforms/Scalar/LoopFission/LoopFissionTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73801.241769.patch
Type: text/x-patch
Size: 47123 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200131/961b6357/attachment.bin>


More information about the llvm-commits mailing list