[LLVMdev] [cfe-dev] OpenMP support in CLANG: A proposal

Mahesha HS mahesha.llvm at gmail.com
Tue Oct 9 22:00:21 PDT 2012

On Wed, Oct 10, 2012 at 5:40 AM, Eli Friedman <eli.friedman at gmail.com>wrote:

> On Tue, Oct 9, 2012 at 4:37 AM, Mahesha HS <mahesha.llvm at gmail.com> wrote:
> > Hello All,
> >
> > We would like to make a proposal to support OpenMP in CLANG. The goal of
> > this effort is to provide support for syntax
> >
> > analysis (parsing), semantic analysis and AST implementation for OpenMP
> > constructs in CLANG.
> >
> >
> >
> > We would like to defer the design for *lowering* based on the outcome of
> the
> > discussion happening in the LLVM dev list.
> >
> > Our design is aimed at implementing the necessary support in CLANG
> > irrespective of how it is finally *lowered*.
> >
> >
> >
> > Please find the details of the proposal and the current status in the
> > document attached.
> Please don't add a separate clangOMP.a; you're implementing new
> parsing and semantic analysis, but it isn't conceptually separate from
> the existing parsing/semantic analysis.

First, I would like to clarify that clangOMP.a implements only, *and only*
the "class OmpPragmaHandler" and nothing else. Parsing and Semantic
Analysis is as usual will be done by clangParse.a and clangSema.a components

Second, the reason for adding a separate clangOMP.a. is as follows. I
looked into the
Clang code base, where few *pragmas* already being supported. I noticed that
few pragmas like "\#pragma once" are implemented in "clangLex.a", and some
pragmas like "\#pragma align" are implemented in "clangParse.a". Also, I
OpenMP includes many pragma directives and clauses, so better to separate
it out in

However, your feedback is well considered. I will remove clangOMP.a and
move the
implementation of "class OmpPragmaHandler" to "clangLex.a".

> I'm not entirely sure what sort of feedback you're expecting; ignoring
> the lowering, the part of implementing OpenMP that's likely to attract
> discussion is the AST representation, and you haven't described that
> in any detail.

As we mentioned in the previous mail, we are currently, deferred the design
*lowering* for the time being based on the outcome of the discussion
in LLVM dev list on the topic of supporting OpenMP in LLVM.

However, AST representation and implementation is completed for all OpenMP
and clauses, except for "critical" directive statement.

In the document, that we attached in our previous mail, we gave an idea of
how the AST looks
for an OpenMP directive statement as we did not want to bloat-up the
proposal document
with too many details. However, we are ready to share code base, which will
give more
information to provide comments.

In summary, we have completed all the required *basic* infrastructure
design and implementation
to implement OpenMP in Clang. We would like to get feedback on it before
proceeding for
further support.

> If you have patches that implement useful functionality; please submit
> sooner rather than later.  Doing a bunch of work in a private branch
> will mean more work for you in the long run because you won't get any
> feedback.

We have all the functionality implemented to provide the basic
infrastructure along with the
implementation of AST classes to represent different OpenMP directives and
and the implementation of the "class OmpPrgamaHandler" as described in the

We can share this code very soon, probably by tomorrow.


> -Eli\

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121010/80db7c02/attachment.html>

More information about the llvm-dev mailing list