[LLVMdev] "Multithreaded LLVM" in "Writing an LLVM Pass"

Chandler Carruth chandlerc at google.com
Tue Oct 9 00:46:06 PDT 2012


On Tue, Oct 9, 2012 at 12:35 AM, David Chisnall <David.Chisnall at cl.cam.ac.uk
> wrote:

> On 8 Oct 2012, at 18:26, Lu Mitnick wrote:
>
> > 1. Multiple threads handle different modules (Thread : Module = 1 : 1)
> > or
>
> For ModulePasses, yes.
>
> > 2. Multiple threads handle one module (Thread : Module = N : 1)
>
> For FunctionPasses, yes.
>
> Note that this part is in the future work section, meaning that no one has
> done it yet.  FunctionPasses are independent of each other when running on
> different functions, so it would be fairly simple to use something like
> libdispatch to optimise every function within a module independently.
>  FunctionPasses are not (in theory) allowed to modify any module state
> outside of a function, so they should be able to be run concurrently.
>

To the best of my knowledge this is not true: global variables' use-def
chains are shared (as are Constants, but for less good reason there).

I have a completely crazy plan for how to parallelize function passes, but
it is not at all clear that it will work, and even if it does, it is a very
significant and invasive change to LLVM's core infrastructure.


>
> David
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121009/f733e31f/attachment.html>


More information about the llvm-dev mailing list