[PATCH] [OPENMP] First changes for Parsing and Sema for 'omp simd' directive support

Alexander Musman alexander.musman at gmail.com
Wed Feb 26 07:24:52 PST 2014


 On 25/02/2014 23:51, Alp Toker wrote:

>
> On 18/02/2014 10:59, Dmitri Gribenko wrote:
>
>>    I don't see any more obvious points for improvement, this patch LGTM,
>> but it would be great if someone else took a quick look as well.
>>
>
> LGTM as an evolution of the existing code. I'm guessing OPENMP_SIMD_CLAUSE
> is stubbed because you intend to fill it out in subsequent patches?
>
> Longer term I think we should look to finding a better AST representation
> for OpenMP directives. There's an amount of do-nothing boilerplate going on
> here which could be handled automatically, say using synthesised
> AttributedStmts or folding the subclasses into a single Stmt node.
>

Hi Alp,

Thank you for review.

Yes, there are 7 clauses I plan to add for directive 'simd' - safelen,
linear, aligned, private, lastprivate, reduction and collapse.

Regarding folding different openmp directives into a single Stmt node in
AST - we'll need to have some directive-specific fields in stmts - for
example, expressions for loop counters calculation/update, which will be
generated by Sema and then used in CodeGen. Such fields are needed (to be
added) in OMPSimdDirective and would be useless in OMPParallelDirective,
for example. Actually, when the directives/clauses behave similar, it
should be possible to use same Stmt node with different DirectiveKind. But
currently our approach is to have a different stmt for each directive - to
keep them more decoupled from each other and from other parts of AST - and
to use parent class like OMPExecutableDirective for decreasing amount of
boilerplate-code a bit...

Best regards,
Alexander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140226/0de2456f/attachment.html>


More information about the cfe-commits mailing list