[cfe-dev] Polly and OpenMP

Tobias Grosser tobias at grosser.es
Tue Jul 26 14:49:21 PDT 2011


On 07/26/2011 04:19 PM, Ruben Van Boxem wrote:
> Hi,
>
> I was looking at the Polly project page and it seemed to imply Polly
> would be able to generate code for OpenMP. Does this mean, that once
> Polly gets of its feet, we will see OpenMP support in Clang/LLVM with
> a bit more work (mostly parsing in Clang)?

Hi Ruben,

OpenMP support in Polly means basically that we can transform loops, for 
which we can prove that there are no problematic dependences, into loops 
that are executed in parallel. This parallel execution takes advantage 
of the GNU OpenMP run time library. Polly itself uses just a small part 
of the GNU OpenMP run time library.

Getting OpenMP support into Clang/LLVM is not very closely related to 
the OpenMP code generation support in Polly. For OpenMP support in clang 
we need OpenMP parsing in clang as Eric pointed out. This parsing needs 
to support the whole OpenMP standard and not only the very limited 
subset Polly is using. Beyond parsing we need efficient code generation 
support for OpenMP and furthermore we need a run time library. Polly 
uses currently libgomp from the GNU project, however for official 
integration into LLVM, we most probably want to have a different 
license. mpc [1] may be an option.

If you are interested into OpenMP support in clang, the first step would 
probably be to extend clang to parse OpenMP directives. I know that 
there are several implementations available, however unfortunately none 
of them was every contributed back to clang.

Cheers
Tobi

[1] http://mpc.sf.net



More information about the cfe-dev mailing list