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

Erik Eckstein eeckstein at apple.com
Thu Mar 5 09:55:50 PST 2015


I reverted in r231385

> On 05 Mar 2015, at 10:36, Chandler Carruth <chandlerc at google.com> wrote:
> 
> 
> On Thu, Mar 5, 2015 at 1:31 AM, Erik Eckstein <eeckstein at apple.com <mailto: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/1c453b3f/attachment.html>


More information about the llvm-commits mailing list