]> granicus.if.org Git - llvm/commit
Data Dependence Graph Basics
authorBardia Mahjour <bmahjour@ca.ibm.com>
Wed, 18 Sep 2019 17:43:45 +0000 (17:43 +0000)
committerBardia Mahjour <bmahjour@ca.ibm.com>
Wed, 18 Sep 2019 17:43:45 +0000 (17:43 +0000)
commitd23ee4dbce1ac470b215fabd59a4943ba27a2f52
tree24b3c4da320cddd93c533f05aa2be58dfc386d7d
parentb93303087a610e3f14a1bc4d2dbdaf6cbb8d96d5
Data Dependence Graph Basics

Summary:
This is the first patch in a series of patches that will implement data dependence graph in LLVM. Many of the ideas used in this implementation are based on the following paper:
D. J. Kuck, R. H. Kuhn, D. A. Padua, B. Leasure, and M. Wolfe (1981). DEPENDENCE GRAPHS AND COMPILER OPTIMIZATIONS.
This patch contains support for a basic DDGs containing only atomic nodes (one node for each instruction). The edges are two fold: def-use edges and memory-dependence edges.
The implementation takes a list of basic-blocks and only considers dependencies among instructions in those basic blocks. Any dependencies coming into or going out of instructions that do not belong to those basic blocks are ignored.

The algorithm for building the graph involves the following steps in order:

  1. For each instruction in the range of basic blocks to consider, create an atomic node in the resulting graph.
  2. For each node in the graph establish def-use edges to/from other nodes in the graph.
  3. For each pair of nodes containing memory instruction(s) create memory edges between them. This part of the algorithm goes through the instructions in lexicographical order and creates edges in reverse order if the sink of the dependence occurs before the source of it.

Authored By: bmahjour

Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert

Reviewed By: Meinersbur, fhahn, myhsu

Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto

Tag: #llvm

Differential Revision: https://reviews.llvm.org/D65350

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372238 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
docs/DependenceGraphs/cycle.png [new file with mode: 0644]
docs/DependenceGraphs/cycle_pi.png [new file with mode: 0644]
docs/DependenceGraphs/index.rst [new file with mode: 0644]
docs/DependenceGraphs/uml_builder_pattern.png [new file with mode: 0644]
docs/DependenceGraphs/uml_nodes_and_edges.png [new file with mode: 0644]
docs/SubsystemDocumentation.rst
include/llvm/Analysis/DDG.h [new file with mode: 0644]
include/llvm/Analysis/DependenceGraphBuilder.h [new file with mode: 0644]
lib/Analysis/CMakeLists.txt
lib/Analysis/DDG.cpp [new file with mode: 0644]
lib/Analysis/DependenceGraphBuilder.cpp [new file with mode: 0644]
lib/Passes/PassBuilder.cpp
lib/Passes/PassRegistry.def
test/Analysis/DDG/basic-a.ll [new file with mode: 0644]
test/Analysis/DDG/basic-b.ll [new file with mode: 0644]
test/Analysis/DDG/basic-loopnest.ll [new file with mode: 0644]