[PATCH] D72350: [DDG] Data Dependence Graph - Graph Simplification

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 11:02:23 PST 2020


bmahjour created this revision.
bmahjour added reviewers: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert.
bmahjour added a project: LLVM.
Herald added subscribers: wuzish, hiraditya.

This is the last functional patch affecting the representation of DDG. Here we try to simplify the DDG to reduce the number of nodes and edges by iteratively merging pairs of nodes that satisfy the following conditions, until no such pair can be identified. A pair of nodes consisting of `a` and `b` can be merged if:

1. the only edge from `a` is a def-use edge to `b` and
2. the only edge to `b` is a def-use edge from `a` and
3. there is no cyclic edge from `b` to `a` and
4. all instructions in `a` and `b` belong to the same basic block and
5. both `a` and `b` are simple (single or multi instruction) nodes.

These criteria allow us to fold many uninteresting def-use edges that commonly exist in the graph while avoiding the risk of introducing dependencies that didn't exist before. For example consider a graph `G` defined as: `{ (a)->(b), (b)->(c), (a)->(d) }`
The edge in between `(b)` and `(c)` can be folded to give us `{ (a)->(bc), (a)->(d) }`
Note that folding any of the other edges is not legal. For example if the edge between `(a)` and `(b)` is folded, then a new (incorrect) dependence between `(b)` and `(d)` is introduced due to the dependency between `(a)` and `(d)`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72350

Files:
  llvm/include/llvm/Analysis/DDG.h
  llvm/include/llvm/Analysis/DependenceGraphBuilder.h
  llvm/lib/Analysis/DDG.cpp
  llvm/lib/Analysis/DependenceGraphBuilder.cpp
  llvm/test/Analysis/DDG/basic-a.ll
  llvm/test/Analysis/DDG/basic-b.ll
  llvm/test/Analysis/DDG/basic-loopnest.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72350.236625.patch
Type: text/x-patch
Size: 27058 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200107/1a1de8fc/attachment.bin>


More information about the llvm-commits mailing list