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

Ahmed Bougacha ahmed.bougacha at gmail.com
Wed Jan 21 11:09:15 PST 2015


Hi Pete,

On Wed, Jan 21, 2015 at 2:19 AM, Pete Cooper <peter_cooper at apple.com> wrote:
> 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.

FWIW I like the idea, a lot!  A couple of general comments below.

> 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.

How about specifying the output file directly? Maybe via another
command, say "--print-html-after-all-to=<...>" ?  (For
--print-after-all, it's useful to have it mixed with other standard
output (say --debug, or the final output), so that you can page/grep
through it.  Here, not so much.)

> 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

I guess it falls under "more we could do in the future", but I think
it would be more readable if each highlight had a different color.

-Ahmed

> - 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
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list