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

Lang Hames lhames at gmail.com
Wed Jan 21 15:22:39 PST 2015


Hi Pete,

Strawman StructuredStreamWriter attached. I think the performance should be
on par with your implementation, but in the simple cases it lets you write:

Stream << Bold(Italic(Op->getName())) << NewLine;

and in the more complex cases you call fall back on:

Stream << BoldBegin;
// Render some nontrivial stuff here.
Stream << BoldEnd;

The stream handling seems like a minor nitpick to me though. Like I said,
this looks really handy.

Cheers,
Lang.


On Wed, Jan 21, 2015 at 11:35 AM, Lang Hames <lhames at gmail.com> wrote:

> Oops. Don't hit <tab> in the gmail editor window...
>
> I'll try again when I've actually got my example clear in my head.
>
> - Lang.
>
> On Wed, Jan 21, 2015 at 11:32 AM, Lang Hames <lhames at gmail.com> wrote:
>
>> Hi Pete,
>>
>> This looks really handy.
>>
>> On the IO side I'd be inclined to go for a different scheme: Have the
>> print routines take a StructuredStreamWrapper that wraps an ostream, and
>> then define some stream operators. E.g:
>>
>> class StructuredStreamWriter {
>> public:
>>   void visit(StructuredElement &E) { E.visit(*this); }
>>
>> };
>>
>>
>>
>> Cheers,
>> Lang.
>>
>> 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.
>>>
>>> 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
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150121/75f8952d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StructuredStreamWriter.cpp
Type: text/x-c++src
Size: 2898 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150121/75f8952d/attachment.cpp>


More information about the llvm-commits mailing list