[PATCH] #pragma vectorize

Tyler Nowicki tnowicki at apple.com
Mon Apr 28 16:53:40 PDT 2014


Hi Alexander,

Thanks for the review. I’ve updated the patch with your most of your suggestions.

Please review the updated patch.

> Do you plan to support substitution of integer template parameters into pragma? Here is example:
> >cat ploop.cpp
> template <int VLEN> void while_test(int *List, int Length) {
>   int i = 0;
>   #pragma loop vectorize(VLEN)
>   while(i < Length) {
>     List[i] = i*2;
>     i++;
>   }
> }
> int main() {
>     int L[100];
>     while_test<4> (L, 100);
>     return 0;
> }

I considered this, it is not currently supported. I’m not sure if it makes sense. Lets leave this as a topic of future work for now.

> 
> ParsePragma.cpp:1619: // Read '('  
> This looks like a good place to use BalancedDelimiterTracker for parsing '(' and ')’.

I don’t think it is needed. It isn’t used by any other #pragma directives and the syntax here is rather simple. What do you think would be the benefit?

Tyler

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pragma_loop-svn.patch
Type: application/octet-stream
Size: 33450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140428/05d3c1fe/attachment.obj>


More information about the cfe-commits mailing list