Use an RWMutex instead of a Mutex in PassRegistry

Alex Crichton alex at
Fri Jun 28 10:12:32 PDT 2013

I don't have commit access, can someone commit this for me?

On Thu, Jun 27, 2013 at 10:29 AM, Chris Lattner <clattner at> wrote:
> On Jun 27, 2013, at 12:27 AM, Alex Crichton <alex at> wrote:
>> When using a LLVM's MCJIT from multiple threads, there was a huge
>> amount of contention in llvm::PassRegistry::getPassInfo. For the
>> particular suite of tests I was running, moving from a Mutex to an
>> RWMutex reduced the overall time from 6min to 20s. In both cases the
>> single-threaded case took about 40s (not all of this time is LLVM).
> -chris

More information about the llvm-commits mailing list