A dumb question -- is there a way to dump cfg after each pass, something like: --print-cfg-after=sccp, or is there a standard post-processing script that builds the cfg vcg/dot file from the ir dump? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101027/a7c69de4/attachment.html>
Hi David,> A dumb question -- is there a way to dump cfg after each pass, something like: > --print-cfg-after=sccp, or is there a standard post-processing script that > builds the cfg vcg/dot file from the ir dump?if your IR is dumped to ir.ll, you can do this to see the cfg: opt -disable-output -view-cfg ir.ll You may want to use -view-cfg-only rather than -view-cfg if you are not interested in the instructions, only the cfg. You could probably also do something like the following to output the cfg after each pass: opt -pass1 -view-cfg -pass2 -view-cfg ... -passN -view-cfg file.ll Ciao, Duncan.
On 10/27/2010 01:59 PM, Xinliang David Li wrote:> A dumb question -- is there a way to dump cfg after each pass, something > like: --print-cfg-after=sccp, or is there a standard post-processing script > that builds the cfg vcg/dot file from the ir dump?You can use to create a dot file of everyfunction for an normal llvm-ir.ll file. opt -dot-cfg llvm-ir.ll If you store the dump in a file and use dot this should achieve what you want. Cheers Tobi
Thanks for the tip. It works. David On Wed, Oct 27, 2010 at 11:38 AM, Duncan Sands <baldrick at free.fr> wrote:> Hi David, > > > A dumb question -- is there a way to dump cfg after each pass, something > like: > > --print-cfg-after=sccp, or is there a standard post-processing script > that > > builds the cfg vcg/dot file from the ir dump? > > if your IR is dumped to ir.ll, you can do this to see the cfg: > opt -disable-output -view-cfg ir.ll > You may want to use -view-cfg-only rather than -view-cfg if you are > not interested in the instructions, only the cfg. You could probably > also do something like the following to output the cfg after each pass: > opt -pass1 -view-cfg -pass2 -view-cfg ... -passN -view-cfg file.ll > > Ciao, > > Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101027/47f7a2d6/attachment.html>
Yes, this works -- without invoking the viewer. Thanks, David On Wed, Oct 27, 2010 at 11:45 AM, Tobias Grosser <grosser at fim.uni-passau.de>wrote:> On 10/27/2010 01:59 PM, Xinliang David Li wrote: > >> A dumb question -- is there a way to dump cfg after each pass, something >> like: --print-cfg-after=sccp, or is there a standard post-processing >> script >> that builds the cfg vcg/dot file from the ir dump? >> > > You can use to create a dot file of everyfunction for an normal llvm-ir.ll > file. > > opt -dot-cfg llvm-ir.ll > > If you store the dump in a file and use dot this should achieve what you > want. > > Cheers > Tobi > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101027/e964e86c/attachment.html>