[cfe-dev] Adding "simd" pragma to Clang

Nadav Rotem nrotem at apple.com
Mon Feb 10 12:56:31 PST 2014


> Hi All,
> 
> Continuing (and forking :-)) the discussion started by Renato (http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-February/035162.html), what is the community's opinion on introducing pragma simd support in clang?
> 
> One possibility is to commit "#pragma omp simd" implementation, which is a part of OpenMP 4 standard (http://www.openmp.org/mp-documents/OpenMP4.0.0.pdf, section 2.8). I see two downsides here: a) "omp" prefix (which might be confusing to some) and b) necessity to add -fopenmp to enable support (this also automatically links OpenMP RTL, which has nothing to do with this particular pragma).
> 

Andrey,  thanks for continuing the discussion and the work on Renato’s proposal. I’d be happy to help with hooking up the vectorizer to the OpenMP front end implementation. This work will certainly improve our OMP implementation.

> Another possibility is to drop omp prefix -- this removes the downsides mentioned above (and yes, makes the pragma similar to what is proposed in CilkPlus -- not necessarily a bad thing in itself).
> 
> IMHO, both alternatives provide a useful, standards-based tool to control vectorization in clang / llvm compiler -- while also advancing clang's compatibility with existing standards.
> 

Personally, I am interested in providing a small set of pragmas/attributes, like the ones that Arnold and Renato proposed, that will allow low-level programmers control the vectorization of loops.  The vectorization pragmas that I envision are similar to Intel’s and Cray's #pragma ivdep/simd.  AFAIK it been many decades since the introduction of the ivdep pragmas in Cray’s compiler and I think that this is a good opportunity to add a new syntax that will fit modern C++ and modern vectorization techniques. If we like we can provide aliases to the old terms.  

> We (Intel) can contribute all required code -- implementation is ready, just needs some massaging before submission to clang trunk.
> 

This sounds excellent!  Can you provide more details on which pragmas are already implemented? 

Thanks,
Nadav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140210/dbdbef88/attachment.html>


More information about the cfe-dev mailing list