This is an archive of the discontinued LLVM Phabricator instance.

[DomPrinter] migrate -dot-dom to the new pass manager
ClosedPublic

Authored by YangKeao on May 4 2022, 12:06 AM.

Details

Summary

In D123677 , @YangKeao provide an implementation of DOTGraphTraits{Viewer,Printer} in the new pass manager. This commit migrates the DomPrinter and DomViewer to the new pass manager.

Diff Detail

Event Timeline

YangKeao created this revision.May 4 2022, 12:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2022, 12:06 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
YangKeao requested review of this revision.May 4 2022, 12:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2022, 12:06 AM
YangKeao updated this revision to Diff 427008.May 4 2022, 7:55 AM
YangKeao updated this revision to Diff 427015.EditedMay 4 2022, 8:20 AM

rebase to the latest main branch

Meinersbur added inline comments.
llvm/include/llvm/Analysis/DomPrinter.h
1

This is not the name of the file

36–39
llvm/include/llvm/Analysis/PostDominators.h
120–123

[style] Don’t use else after a return

Can DT.getRootNode() actually return nullptr? AFAIK it always creates a virtual root node.

llvm/include/llvm/IR/Dominators.h
267 ↗(On Diff #427015)

Consider defining the traits of the pointer type GraphTraits<DominatorTree*> for consistency with other GraphTraits, including GraphTraits<DomTreeNode *>. that it derives from. Users of GraphTraits may assume it is a pointer.

YangKeao updated this revision to Diff 427827.May 7 2022, 1:32 AM

Use pointer in the specialization of DOTGraphTraits

YangKeao updated this revision to Diff 427828.May 7 2022, 1:34 AM
YangKeao marked an inline comment as done.
YangKeao marked 2 inline comments as done.
YangKeao added inline comments.
llvm/include/llvm/Analysis/PostDominators.h
120–123

If it's constructed through the default constructor, the RootNode will be nullptr, and the default constructor is only used by the wrapper passes. It seems fine to assume it's not null. I'll remove the condition.

Meinersbur accepted this revision.May 10 2022, 2:15 PM

LGTM.

Do I have permission to commit for you?

This revision is now accepted and ready to land.May 10 2022, 2:15 PM

LGTM.

Do I have permission to commit for you?

@Meinersbur Yes. Thanks 🍻

This revision was landed with ongoing or failed builds.May 16 2022, 1:16 PM
This revision was automatically updated to reflect the committed changes.