This is an archive of the discontinued LLVM Phabricator instance.

Introduce -dot-cfg-mssa option which creates dot-cfg style file with mssa comments included in source
ClosedPublic

Authored by jamieschmeiser on Nov 2 2020, 12:33 PM.

Details

Summary

Expand the print-memoryssa and print<memoryssa> passes with a new hidden
option -cfg-dot-mssa that names a file. When set, a dot-cfg style file
will be generated into the named file with the memoryssa comments retained
and those blocks containing them shown in light pink. The option does
nothing in isolation.

Diff Detail

Event Timeline

jamieschmeiser created this revision.Nov 2 2020, 12:33 PM
jamieschmeiser requested review of this revision.Nov 2 2020, 12:33 PM
asbirlea accepted this revision.Nov 2 2020, 5:24 PM
This revision is now accepted and ready to land.Nov 2 2020, 5:24 PM

Needs some test coverage?

llvm/include/llvm/Analysis/CFGPrinter.h
152–156

These could/should be llvm::function_ref, since they're not being captured/outliving the function call.

Could also skip the -> void since it's implicit (& the one statement lambda body seems clear enough that it's not returning anything, and the functor type written a line above has the void return type spelled out), if you like.

Respond to review comments: use llvm::function_ref, add unit test.
Fix option name and MemoryUse search string.
Regarding "-> void", I prefer to have the return type specified.

Seems pretty reasonable to me - @asbirlea could you check the test case to see the expected output, etc, makes sense? MSSA itself is not so much my wheelhouse so I'm not rightly sure myself.

llvm/include/llvm/Analysis/CFGPrinter.h
31

This can now be removed/replaced with STLExtras.h

asbirlea accepted this revision.Nov 4 2020, 6:40 PM

Resulting dot file for the test looks good.

dblaikie accepted this revision.Nov 4 2020, 6:44 PM

Sounds good to me then!

Respond to review comments: replace header include.

anhtuyen reopened this revision.Nov 12 2020, 7:53 AM
anhtuyen added a subscriber: anhtuyen.

Reopen due to a failed build on builder polly-x86_64-linux
Full details are available at:

https://urldefense.proofpoint.com/v2/url?u=http-3A__lab.llvm.org-3A8011_-23builders_10_builds_615&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=Nr2SnYQn80wzIpml4veK2C-U4ilVZzi0kWYCc2WSLoA&m=CQgGRYR_3xNbiZpMevJ_fOqMziVnPdj-Qa8sJXA1NHQ&s=2jJHm84n7dRHKQQ9ax_D-LQiQ6lf_9ypNbnuph-cCAs&e=

Buildbot URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__lab.llvm.org-3A8011_&d=DwICaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=Nr2SnYQn80wzIpml4veK2C-U4ilVZzi0kWYCc2WSLoA&m=CQgGRYR_3xNbiZpMevJ_fOqMziVnPdj-Qa8sJXA1NHQ&s=JFUUxRP6j5j0BPDw9yCc6lMViVmJFWrmcTQN13xbtEE&e=
Worker for this Build: polly-x86_64-gce1

This revision is now accepted and ready to land.Nov 12 2020, 7:53 AM

Fix build problems revealed when delivering changes.