[cfe-dev] Polly and OpenMP

"C. Bergström" cbergstrom at pathscale.com
Tue Jul 26 19:27:48 PDT 2011

  On 07/27/11 04:49 AM, Tobias Grosser wrote:
> 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.
Sorry MPC is not a very good recommendation for runtime because
1) It's basically still LGPL
2) It's only OMP-2.5
3) Can it actually demonstrate scalable performance and production quality?

OMP 3.x as a whole is a pretty big chunk of work and parsing is the 
smallest part of it imho.  It would take months and months of work for 
someone to get it all together to what effect?  How many people would 
use it?  Is there also Fortran support?

/* Disclaimer - I'm biased - The company I work for has clang parsing 
OpenMP and an OMP/HMPP compiler */
Further I'd argue against OMP *entirely*
1) It's evolving at a slug rate
2) If you actually go to those meetings where they discuss the "future" 
it's nearly comical.
     2.a) The proposed standards will have really ugly parsing/semantic 
analysis if accepted
     2.b) Everything they are trying to steal from others is more or 
less available today (OpenHMPP[1])
     2.c) Today it's GPGPU support sucks and I'm not convinced that will 
3) Instead of being an elegant design it's getting bigger and bigger

With OpenHMPP you should be able to get 1) equal or greater scalability 
vs OMP *now* 2) The model also works for NVIDIA GPU *today* 3) It has a 
simple/elegant design which is relatively easy to parse/sema

Anyone who thinks OpenHMPP would be useful to them/clang ping me off list.



More information about the cfe-dev mailing list