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

Chandler Carruth chandlerc at google.com
Thu Mar 5 01:36:21 PST 2015


On Thu, Mar 5, 2015 at 1:31 AM, Erik Eckstein <eeckstein at apple.com> wrote:

>  As far as I'm aware, the only way this happens is if you continually
> destroy and re-create your passmanager
>
>
> FPPassManager::runOnFunction also (indirectly) calls
> PassRegistry::getPassInfo. I think this is the reason for the 5% (what I'm
> seeing).
>
> But anyway, if you strongly disagree with this patch I can revert it. Both
> problems I mentioned are not big problems.
>

Yea, I'm strongly opposed to using modal synchronization. It is far too
easy to get wrong and hard to debug when it is wrong.

If there is a problem here, we should fix it directly. I'm surprised there
are any uncached calls left to getPassInfo from runOnFunction. Those could
probably also be cached much like I cached the ones in the analysis call
paths. That would address the 5% slowdown.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150305/651c1703/attachment.html>


More information about the llvm-commits mailing list