This is an archive of the discontinued LLVM Phabricator instance.

[DomTree] Add constructor to create a new DT based on current DT/CFG and a set of Updates.
ClosedPublic

Authored by asbirlea on Aug 13 2018, 3:43 PM.

Details

Summary

Add the posibility of creating a new DT using a set of Updates.
This will essentially create a DT based on a CFG snapshot/view.

Additional refactoring for either this patch or follow-ups:

  • create an utility for building BUI.
  • replace BUI with a GraphDiff.

Diff Detail

Repository
rL LLVM

Event Timeline

asbirlea created this revision.Aug 13 2018, 3:43 PM
kuhar added inline comments.Aug 13 2018, 4:37 PM
include/llvm/IR/Dominators.h
49 ↗(On Diff #160472)

How about CalculateWithUpdates? CalculateNew is not the most informative in my opinion.

lib/IR/Dominators.cpp
79 ↗(On Diff #160472)

nit: a usecase ?

asbirlea updated this revision to Diff 160491.Aug 13 2018, 4:55 PM

Address comments.

asbirlea marked 2 inline comments as done.Aug 13 2018, 4:56 PM
kuhar added a comment.Aug 13 2018, 4:58 PM

Looks fine.

include/llvm/Support/GenericDomTree.h
737 ↗(On Diff #160491)

I think it would be better to take parent function by reference/pointer consistently. Reference implies non-null, which seems better here.

asbirlea updated this revision to Diff 160631.Aug 14 2018, 10:20 AM

Address comment.

asbirlea marked an inline comment as done.Aug 14 2018, 10:21 AM
kuhar accepted this revision.Aug 16 2018, 2:19 PM
This revision is now accepted and ready to land.Aug 16 2018, 2:19 PM
This revision was automatically updated to reflect the committed changes.