OpenMP/autopar support in LLVM

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.

Thanks

Regards

Prakash Raghavendra

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] Parallelization for LLVM

I'm at an early stage, still working on dependence analysis.
While the dependence analysis is coming along well,
actual loop transformations based on the analysis
are a ways out.

Preston

Hi Tobi

Thanks a lot for your detailed update on the status of OpenMP in LLVM.

It looks like there is no "official" support of OpenMP in LLVM 3.x at least.

In your descriptive list, I can see that [a] is an optional patch or available in GCC, [b] & [c] are
available as optional runtimes (which have to be carefully bundled). [d] anyway is little
different from OpenMP (can exist without OpenMP support in fact).

Thanks

Regards
Prakash

Hi Tobi

Thanks a lot for your detailed update on the status of OpenMP in LLVM.

It looks like there is no "official" support of OpenMP in LLVM 3.x at least.

For people new to LLVM this is probably not obvious. No, there is no official OpenMP support in the clang/LLVM combination.

In your descriptive list, I can see that [a] is an optional patch or available in GCC, [b]& [c] are
available as optional runtimes (which have to be carefully bundled). [d] anyway is little
different from OpenMP (can exist without OpenMP support in fact).

There are a lot of building blocks available to get OpenMP support working. I would be very interested in any work in this area.

Cheers
Tobi