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

Andrew Trick atrick at apple.com
Sat Apr 26 23:33:33 PDT 2014


On 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
> 
> <0001-PM-Add-pass-run-listeners-to-the-pass-manager.patch>

I like this feature, and your implementation seems quite thorough. The only thing I don’t understand is why passRun() needs to take an LLVMContext when the PassRunListener is already holding a pointer to one.

We should probably have a basic unit test case. Maybe in the MCJIT C API tests?

Thanks!
-Andy



More information about the llvm-commits mailing list