[PATCH] --print-html-after-all

Pete Cooper peter_cooper at apple.com
Wed Jan 21 02:19:07 PST 2015


Hi all

I wanted to put this patch out to gauge interest.  It adds a new flag which behaves just like —print-after-all, but emits the IR with HTML structure.

I’ve attached an example output using this command "llc --print-html-after-all test/CodeGen/X86/avx-shuffle-x86_32.ll -o /dev/null -O3 &> file.html”.  Note that ‘opt’ also works similarly.

In this file you can see all of the passes LLVM ran, from IR, through selection DAG, and finally the MI passes.  For selection DAG, i made it aggregate all the BBs for each stage.  So you’ll see every BB in the initial DAG, then every BB in the legalized DAG and so on.

Things you can interact with are:
- Functions are all listed separately in a pull-down box so you can view one at a time
- If you have some instructions/values highlighted you can choose to hide anything which isn’t highlighted.  This lets you focus on the instructions/values you’re interested in.
- Instructions/SDNode's which aren’t greyed out will highlight all others with the same DebugLoc
- IR values with names will highlight all others with the same name across all passes.  Same with vreg's
- IR values with numbers will just highlight uses/defs in the pass you are looking at
- SDNode’s are printed as N<#> and will only highlight uses/defs in the BB you are looking at
- If you click on a use of a value, and non-highlited instructions are hidden, then the def will be made visible, along with the defining instruction/node.

The code is quite large, but much of it involves feeding the HTMLStructuredPrinter, a new class, through the various print methods, and adding passes to emit the various constructs with HTML tags.  If there’s interest in landing this then I’m happy to discuss the implementation and split up the code in to multiple patches.  There’s also much more we could do in future, such as use hyperlinks to jump between BBs.

Finally, i’m heavily reliant on a new HTML extension "-webkit-column-count” which i’ve only tested on Safari.  If this gets committed, i’d appreciate someone with HTML expertise to clean up that part of the code.

Thanks,
Pete

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150121/95020f54/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: print-after-html.diff
Type: application/octet-stream
Size: 122518 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150121/95020f54/attachment.obj>


More information about the llvm-commits mailing list