#pragma clang loop - documentation

Dmitri Gribenko gribozavr at gmail.com
Wed Jun 11 22:52:19 PDT 2014


On Thu, Jun 12, 2014 at 12:00 AM, Tyler Nowicki <tnowicki at apple.com> wrote:
>> So this pragma does not communicate extra information about safety of
>> the trasformation, compiler should still prove it as if the pragma was
>> absent?  (IOW, the user can apply this pragma to every loop, and it
>> will not result in incorrect code being produced; suboptimal --
>> certainly, but still correct.)
>
> Yes that is correct. Safety, specified with #pragma clang loop vectorize_safe or similar, is still on the drawing board.

Please explcitly state in the docs that it is always safe to apply
this pragma and the compiler will ignore it if can not prove the
transformation to be safe.  This is critical for understanding how to
use the pragma.  LGTM with that.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list