This is an archive of the discontinued LLVM Phabricator instance.

Single function IR dump
Needs ReviewPublic

Authored by Gerolf on Nov 19 2014, 1:30 PM.

Details

Summary

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

Diff Detail

Event Timeline

Gerolf updated this revision to Diff 16397.Nov 19 2014, 1:30 PM
Gerolf retitled this revision from to Single function IR dump.
Gerolf updated this object.
Gerolf edited the test plan for this revision. (Show Details)
Gerolf added reviewers: dexonsmith, echristo.
Gerolf added a subscriber: Unknown Object (MLST).
echristo edited edge metadata.Nov 19 2014, 5:45 PM

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.

dexonsmith resigned from this revision.Aug 25 2019, 8:23 AM