Hi,<div><br></div><div>I am looking into something similar as well for auto-parallelization i.e. some sort of low level support at the IR level for parallelization.</div><div>I'd be interested in collaborating with anyone who is working on the same.</div>


<div><br></div><div>From a brief look at the architectural overview of Polly, it seems as if the parallel code generation is being done at the IR level since the input file is an LLVM IR file? </div><div>Would it be possible to re-utilize that functionality for building something to this end?</div>

<div><br></div><div>Thanks</div><div>Nipun</div><div><br><div class="gmail_quote">On Tue, Mar 22, 2011 at 3:28 PM, Tobias Grosser <span dir="ltr"><<a href="mailto:grosser@fim.uni-passau.de" target="_blank">grosser@fim.uni-passau.de</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 03/22/2011 01:56 PM, Reid Kleckner wrote:<br>
> On Tue, Mar 22, 2011 at 1:36 PM, Gokul Ramaswamy<br>
</div><div><div></div><div>> <<a href="mailto:gokulhcramaswamy@gmail.com" target="_blank">gokulhcramaswamy@gmail.com</a> <mailto:<a href="mailto:gokulhcramaswamy@gmail.com" target="_blank">gokulhcramaswamy@gmail.com</a>>> wrote:<br>



><br>
>     Hi Duncan Sands,<br>
><br>
>          As I have understood, GOMP and OpenMP provides support for<br>
>     parallelizing program at source program level. But I am at the IR<br>
>     level. That is I am trying to parallelize the IR code. This is the<br>
>     case of automatic parallelization. The programmer writing the code<br>
>     does not have any idea of parallelization going behind the hood.<br>
><br>
>     So my question is instead of support at the source program level, is<br>
>     the an support at the LLVM IR level to parallelize things ??<br>
><br>
><br>
><br>
> No, you have to insert calls to things like pthreads or GOMP or OpenMP<br>
> or whatever threading runtime you choose.<br>
<br>
</div></div>Which is what we also do in Polly.<br>
<br>
In case you just have the simple case of two statements you want to<br>
execute in parallel, I propose to write this as OpenMP annotated C code,<br>
compile the code with dragonegg to LLVM-IR and have a look what code is<br>
generated. You will need to create similar code and similar function<br>
calls if you want to do it at the LLVM-IR level.<br>
<br>
One thing that might simplify the code is to specify in OpenMP that you<br>
want to be able to select choices at runtime. A common construct is:<br>
<br>
SCHEDULE(runtime)<br>
<br>
This will stop dragonegg from inlining some OpenMP runtime calls, which<br>
could complicate the code unnecessarily.<br>
<br>
Cheers<br>
Tobi<br>
<br>
P.S.: In case of directly inserting OpenMP function callsn it would be<br>
nice to have support for a set of LLVM intrinsics that will<br>
automatically be lowered to the relevant OpenMP/<a href="http://mpc.sf.net" target="_blank">mpc.sf.net</a> function<br>
calls. Let me know when you think about working on such a thing.<br>
<div><div></div><div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div>