[LLVMdev] OpenMP/autopar support in LLVM

Tobias Grosser tobias at grosser.es
Wed Jul 4 08:57:17 PDT 2012


On 07/04/2012 10:35 AM, Raghavendra, Prakash wrote:
> Hi
>
> I wanted to know the status of OpenMP (or in general auto
> parallelization) support in
>
> LLVM.
>
> I read some threads discussing about possible effort in that direction
> in 3.1 onwards,
>
> but did not see any further discussion on that.
>
> If someone in the list knows the updated info or can point me to any
> useful info,
>
> that would be useful.

Hi Prakash,

OpenMP consists of several things:

a) Support for parsing C/FORTRAN OpenMP pragmas

For clang (the C frontend) there are patches available from Simone 
Pellegrini <spellegrini at dps.uibk.ac.at>. They have not been reviewed 
and are based on a very generic pragma infrastructure. This is 
especially nice for research, but it needs to be evaluated if this 
generic implementation has performance impacts that are too large for 
production codes.

With dragonegg FORTRAN and C code (including OpenMP pragmas) can be 
lowered to LLVM-IR.

b) Support for representing OpenMP in LLVM-IR

There is no specific support in LLVM-IR for OpenMP. Currently OpenMP is 
represented as a bunch of function calls to a specific openmp run time 
library. It might be nice to formalize this more to represent OpenMP 
code in a runtime independent way and to allow the inlining of simple 
openmp runtime calls directly into the code.

c) An OpenMP runtime

There are two open source runtimes I am aware of. The GNU OpenMP runtime 
and MPC [1]. Both are interesting, but we need to be careful with the 
licenses.

d) Automatic Parallelization

- There is Polly [2] which I am working on. Polly can automatically 
parallelize SCoPs. It uses the algorithm developed in Pluto [3] for this.

- There are a couple of research projects working on speculative 
parallelization. "Jimborean Alexandra" from Strasbourg was e.g. working 
on this.

- There is a project called "Parallelization for LLVM" [4]. They have a 
lot of interesting stuff on the website, but I am not sure about the 
progress. Preston should be able to give details here.

Cheers
Tobi

[1] http://mpc.sourceforge.net/
[2] http://polly.sf.net
[3] pluto-compiler.sourceforge.net/
[4] https://sites.google.com/site/parallelizationforllvm/



More information about the llvm-dev mailing list