This is an archive of the discontinued LLVM Phabricator instance.

[DDG] Data Dependence Graph - Add query function for memory dependencies between two nodes
ClosedPublic

Authored by bmahjour on May 25 2020, 11:54 AM.

Details

Summary

When working with the DDG it's useful to be able to query details of the memory dependencies between two nodes connected by a memory edge. The DDG does not hold a copy of the dependencies, but it contains a reference to a DependenceInfo object through which dependence information can be queried. This patch adds a query function to the DDG to obtain all the Dependence objects that exist between instructions of two nodes.

The same function has also been proposed under https://reviews.llvm.org/D73801, but since the review may take loner we'd like to add this query function as a separate revision here to unblock other uses of the DDG.

Diff Detail

Event Timeline

bmahjour created this revision.May 25 2020, 11:54 AM
Whitney added inline comments.May 25 2020, 5:34 PM
llvm/unittests/Analysis/DDGTest.cpp
83

line 82 - 89 needed?

102

LI.front() should give you the first loop in a function.

103

should this be an assert instead?

bmahjour updated this revision to Diff 266208.May 26 2020, 7:44 AM

Addressed clang-format issues and Whitney's comments.

bmahjour marked 3 inline comments as done.May 26 2020, 7:45 AM
fhahn added a subscriber: fhahn.May 26 2020, 7:46 AM

LGTM. Will approve tomorrow if no objection.

Whitney accepted this revision.May 27 2020, 5:14 AM
This revision is now accepted and ready to land.May 27 2020, 5:14 AM
This revision was automatically updated to reflect the committed changes.