[LLVMdev] [PATCH] Before/After IR Dumps

David Greene dag at cray.com
Tue Mar 2 13:45:18 PST 2010


This set of patches adds support for dumping IR before or after specified 
Passes.  It adds the following command-line options:

-print-before=<pass-option>
-print-after=<pass-option>
-print-before-all
-print-after-all

Use it like this:

llc -debug -print-before=linearscan-regalloc file.bc -o file.s

-help will print the pass options available to -print-before and -print-after.

The patches add support to clang, llvm and llvm-gcc, respectively.

We use this extensively to debug Passes by examining IR before and after
they run.

Please review for commit and comment.  It would be great to get this into the 
2.7 release.

Thanks!

                                               -Dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-beforeafter.patch
Type: text/x-patch
Size: 3083 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100302/f2329b58/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-beforeafter.patch
Type: text/x-patch
Size: 113597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100302/f2329b58/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-gcc-beforeafter.patch
Type: text/x-patch
Size: 6035 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100302/f2329b58/attachment-0002.bin>


More information about the llvm-dev mailing list