[PATCH] #pragma vectorize

Tyler Nowicki tnowicki at apple.com
Sun Jun 1 19:39:18 PDT 2014


Hi Richard,

Thanks for the detailed review!

I went with the last syntax you suggested. Seems simple to me and easily extendable: #pragma clang loop vectorize_width(2) interleave_count(4).

Also it helped clean up a lot of the ambiguity you talked about in the LoopHintAttr. A single integer Value has replaced the Kind (Enable/Disable/Value) and a integer value there previously. Hopefully it won’t be too difficult to support constant expressions, and non-type template parameters. I’ll work on those patches next.

I also improved the incompatibility testing as well. I realized there were several cases my previous test wasn’t identifying.


> Objective C is a proper superset of C, so yes. I don't know Objective C very well either, and it might be the case that it would never be possible to vectorize its for loop, because it's too dynamic.

Ok, its on my list.


> I think you want (and what the approach I described above permits) is to callParseConstantExpression.

I think I understand now what you are suggesting. Your thinking that the expression may include more than one token. I gave it a try, but I wasn’t able to get it to work. The expression returned by ParseConstantExpression was always invalid. Perhaps I didn’t implement it correctly. I’m capturing all of the tokens between the brackets and then when handling the annotated token I reinserted them into the stream and called ParseConstantExpression. I tried it with and without the brackets and with and without a trailing eof token. The LHS and Res expressions parsed in ParseConstantExpression were also always invalid <<NULL>>. Lets leave this and other constant expression work for a later patch.


Here is the updated patch.

Tyler

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140601/7502df98/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pragma_loop-svn.patch
Type: application/octet-stream
Size: 45439 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140601/7502df98/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140601/7502df98/attachment-0001.html>


More information about the cfe-commits mailing list