[cfe-dev] Dumping control flow graph after each optimization pass

Arthur Eubanks via cfe-dev cfe-dev at lists.llvm.org
Sun Nov 7 08:52:41 PST 2021


The problem is probably that --print-after-all is not dumping the whole
module, e.g. after a function pass it only dumps the function. -mllvm
-print-module-scope should force printing of the entire module.

On Sun, Nov 7, 2021 at 7:29 AM Jayakrishna Vadayath via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Dear devs,
>
> I wanted to know if it is possible to dump the control flow graph
> representation of functions before/after each optimization pass.
>
> I found that it is possible to dump the intermediate representation
> after each optimization pass using the flags -mllvm -print-after-all.
> I also found that it is possible to dump the control flow graph from
> the LLVM IR using the command opt -dot-cfg.
>
> I tried to split the output of the -print-after-all flag and saved it
> to multiple files.
> However, when I run the opt -dot-cfg command on each of those files,
> it fails because some variables are not defined.
>
> I wanted to know if it is possible to dump the LLVM IR after every
> optimization pass that could then be passed on to opt to dump the
> control flow graph representation.
> Or is it possible to just dump the control flow graph representation
> itself after each optimization pass ?
>
> Please let me know
>
> Thank you
>
> --
> Regards
> Jayakrishna Menon
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211107/2365d257/attachment.html>


More information about the cfe-dev mailing list