Use an RWMutex instead of a Mutex in PassRegistry

Chris Lattner clattner at apple.com
Thu Jun 27 10:29:57 PDT 2013


On Jun 27, 2013, at 12:27 AM, Alex Crichton <alex at crichton.co> 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).

LGTM!

-chris



More information about the llvm-commits mailing list