#pragma clang loop - documentation

Dmitri Gribenko gribozavr at gmail.com
Wed Jun 11 15:25:42 PDT 2014


On Wed, Jun 11, 2014 at 10:54 PM, Tyler Nowicki <tnowicki at apple.com> wrote:
> Hi Dmitri,
>
> I think the optimization hint docs should be high-level, and the Rpass
> diagnostics should be used to determine if/why an optimization is not being
> applied. What do you think about adding this paragraph to the language
> extensions guide to clarify this?
>
> If an optimization cannot be applied its hints will be ignored. For example,
> the
> hint ``vectorize_width(4)`` is ignored if the loop is not proven safe to
> vectorize. To identify and diagnose optimization issues use `-Rpass`,
> `-Rpass-missed`, and `-Rpass-analysis` command line options. See the user
> guide
> for details.

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.)

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