[PATCH][PM] Add pass run listeners to the pass manager.

Chandler Carruth chandlerc at google.com
Mon Apr 28 16:08:26 PDT 2014


So, I have a bunch of thoughts here.

First and foremost, I'm extremely concerned about baking the Pass type into
the C API. The on-going work to change how the pass manager works at a
fundamental level is going to run completely afoul of this. I would really
like to keep this out of the C API which we have to be backwards compatible
with until the pass manager work settles down. If we don't, the entire
thing is going to be really challenging to make progress on.

Second, why are you defining a new callback type? We have std::function
now, so I would expect this to be std::function<void(Pass *)>.

Third, don't you want to pass the unit of IR which the pass manager just
ran to the callback? I don't actually see how to do anything useful with
real passes here if you don't know *which* function the pass just ran
over... But maybe I missed something in speed reading the patch.

Fourth, the new pass manager is very likely going to want to provide a
substantially different API. How should I design and test this? Can I just
provide an abstract listening mechanism and trust that you'll stitch things
back together?

-Chandler


On Sat, Apr 26, 2014 at 4:20 PM, Juergen Ributzka <juergen at apple.com> wrote:

> Hi @ll,
>
> this patch provides the necessary C/C++ APIs and infastructure to enable
> fine-
> grain progress report and safe suspension points after each pass in the
> pass
> manager.
>
> Clients can provide a callback function to the pass manager to call after
> each
> pass. This can be used in a variety of ways (progress report, dumping of IR
> between passes, safe suspension of threads, etc).
>
> The run listener list is maintained in the LLVMContext, which allows a
> multi-
> threaded client to be only informed for it's own thread. This of course
> assumes
> that the client created a LLVMContext for each thread.
>
> Cheers,
> Juergen
>
>
> _______________________________________________
> 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/20140428/02ec4afc/attachment.html>


More information about the llvm-commits mailing list