On Tue, Oct 9, 2012 at 12:35 AM, David Chisnall <span dir="ltr"><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank" class="cremed">David.Chisnall@cl.cam.ac.uk</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 8 Oct 2012, at 18:26, Lu Mitnick wrote:<br>
<br>
> 1. Multiple threads handle different modules (Thread : Module = 1 : 1)<br>
> or<br>
<br>
</div>For ModulePasses, yes.<br>
<div class="im"><br>
> 2. Multiple threads handle one module (Thread : Module = N : 1)<br>
<br>
</div>For FunctionPasses, yes.<br>
<br>
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.<br>
</blockquote><div><br></div><div>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).</div><div><br></div><div>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.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" class="cremed">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank" class="cremed">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div>