[cfe-dev] Adding a new pragma to Clang

Hal Finkel hfinkel at anl.gov
Wed Jan 8 08:55:32 PST 2014


----- Original Message -----
> From: "Renato Golin" <renato.golin at linaro.org>
> To: "Alp Toker" <alp at nuanti.com>, "Arnold Schwaighofer" <aschwaighofer at apple.com>
> Cc: "Hal Finkel" <hfinkel at anl.gov>, "Aaron Ballman" <aaron at aaronballman.com>, "Richard Smith"
> <richard at metafoo.co.uk>, "Clang Dev" <cfe-dev at cs.uiuc.edu>, "Nadav Rotem" <nrotem at apple.com>
> Sent: Wednesday, January 8, 2014 10:43:28 AM
> Subject: Re: [cfe-dev] Adding a new pragma to Clang
> 
> 
> 
> 
> On 8 January 2014 14:48, Alp Toker < alp at nuanti.com > wrote:
> 
> 
> 
> 
> I'll think about this a bit more and see if it's viable. Very smart
> idea from Aaron if we can make it work in some form.
> 
> 
> Hi Alp,
> 
> 
> Following the discussions in the IRC, I think we might have some
> entry point into the vectorizer metadata using C++11 attributes
> first, than pragmas later.
> 
> 
> Having tried to add a pragma, I know how hard it is, and given the
> high levels of community interest, I think starting with the
> attributes will be the fastest way to get it working.

I agree that adding attributes is much easier; and I'm fine with taking this approach. I think that, in general, we should work on an infrastructure that lets the pragma parsing build off of the attribute handing. I don't see any real reason to have separate code paths for the two (in those cases where they are doing similar things).

In the long run we should, however, definitely support a pragma syntax. That is the proper, standard, way of providing these kinds of extensions in pre-C++11 languages.

I'll add that, as I understand it, one of the original design motivations for C++11 attributes was so that extensions like OpenMP could be specified in terms of C++ attributes instead of or in addition to pragmas. I don't think the OpenMP ARB has yet acted on this, but I expect that as C++11 support is specifically addressed in upcoming versions of the OpenMP specification, we might see movement in this direction.

 -Hal

> 
> 
> Arnold,
> 
> 
> Do you think this would be a set-back? Having C++11 handled, we can
> at least start creating specialized tests and benchmarks, which is
> the most important thing for the vectorizer right now. How the
> pragmas will behave is a matter for further discussion, but in the
> end, both attribute and pragma should generate the same metadata in
> IR.
> 
> 
> cheers,
> --renato

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-dev mailing list