[PATCH] D50479: Expose CFG Update struct. Define GraphTraits to get children given a snapshot CFG.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 8 14:59:59 PDT 2018


asbirlea created this revision.
asbirlea added reviewers: timshen, kuhar, chandlerc.
Herald added subscribers: jlebar, sanjoy.

Certain passes or analysis need to view a CFG snapshot rather than the actual CFG. This patch provides GraphTraits to offer such a view.

The patch defines GraphTraits for BasicBlock* and Inverse<BasicBlock*> to provide CFG successors and predecessors based on a list of CFG updates.

An Update is defined as a triple {InsertOrDeleteKind, BlockStartOfEdge, BlockEndOfEdge}.
A GraphDiff is defined as a list of Updates that has been preprocessed to treat the CFG as a graph rather than a multi-graph. As such, there can only exist a single Update given two nodes. All duplicates will be filtered and Insert/Delete edges that cancel out will be ignored.
The methods GraphDiff exposes are:

- Determine if an existing child needs to be ignored, i.e. an Update exists in the correct direction to assume the removal of that edge.
- Return a list of new children to be considered, i.e. an Update exists in the correct direction for each child in the list to assume the insertion of that edge.


Repository:
  rL LLVM

https://reviews.llvm.org/D50479

Files:
  include/llvm/IR/CFGDiff.h
  include/llvm/Support/CFGUpdate.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50479.159808.patch
Type: text/x-patch
Size: 10301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180808/ec004ede/attachment.bin>


More information about the llvm-commits mailing list