[PATCH] Add a lock() function in PassRegistry to speed up multi-thread synchronization.

Chandler Carruth chandlerc at google.com
Thu Feb 26 19:46:14 PST 2015


On Fri, Feb 20, 2015 at 5:24 AM, Erik Eckstein <eeckstein at apple.com> wrote:

> With this patch I'm trying to solve the following problem:
>
> I'm running llvm in multiple threads (each instance uses its private
> LLVMContext).
> With a release-asserts build of llvm I got terrible multi-thread
> performance. I found that the problem is the mutex in
> PassRegistry::getPassInfo(), mainly called from
> PMDataManager::verifyPreservedAnalysis().
>

Do you mean with a release *+* asserts build?

I worked with Owen to fix all of the multi-thread performance problems we
could measure in the old pass manager. But we were not measuring the
performance of asserts.

In general, we don't work very hard to make asserts builds super fast. We
try to make them as cheap as we can, but sometimes there is nothing we can
do.

I don't think we want to add a hack like this to the API just to help
asserts builds. Do you have a test case that shows a severe problem without
asserts?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150226/03f610df/attachment.html>


More information about the llvm-commits mailing list