[PATCH] Single function IR dump

Eric Christopher echristo at gmail.com
Wed Nov 19 17:45:16 PST 2014


Does seem useful in a few limited cases, one comment - you do know about
llvm-extract right? I see this being useful when debugging cross module
type of optimizations etc, but you can run most of a set of passes on a
module with llvm-extract after you take the function out as well.


On Wed Nov 19 2014 at 5:39:43 PM Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

>
> > On 2014-Nov-19, at 13:30, Gerolf Hoflehner <ghoflehner at apple.com> wrote:
> >
> > Hi dexonsmith, echristo,
> >
> > Dumping the IR of an entire module can take a long time. I found a
> > patch I wrote a while back that allows me to dump the IR for one
> function.
> > It is not pretty but gets the job done. You might find it useful and/or
> have ideas
> > to improve it etc.
> >
> > LTO usage example: -Wl,-mllvm,-dump-function=foo
> -Wl,-mllvm,-mdump-function=foo
> > -Wl,-mllvm,-print-before-all
> >
> > http://reviews.llvm.org/D6326
> >
> > Files:
> >  lib/Analysis/IPA/CallGraphSCCPass.cpp
> >  lib/Analysis/LoopPass.cpp
> >  lib/CodeGen/MachineFunction.cpp
> >  lib/CodeGen/MachineFunctionPrinterPass.cpp
> >  lib/IR/IRPrintingPasses.cpp
> > <D6326.16397.patch>
>
> This seems really useful.  A couple of things:
>
>   - You should add a testcase.  Looks like `-print-after-all` is tested
>     in test/Other.
>
>   - You should remove (and commit separately if at all) the whitespace
>     changes to code you didn't touch.
>
> I guess we could bikeshed on the option name, but -dump-function seems
> fine to me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141120/b07581fd/attachment.html>


More information about the llvm-commits mailing list