<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Dmitri,<div><br></div><div>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?</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">If an optimization cannot be applied its hints will be ignored. For example, the</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">hint ``vectorize_width(4)`` is ignored if the loop is not proven safe to</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">vectorize. To identify and diagnose optimization issues use `-Rpass`,</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">`-Rpass-missed`, and `-Rpass-analysis` command line options. See the user guide</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">for details.</div></div><div><br></div><div>Tyler</div><div><br><div><div><div>On Jun 11, 2014, at 8:06 AM, Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Wed, Jun 11, 2014 at 2:20 AM, Tyler Nowicki <<a href="mailto:tnowicki@apple.com">tnowicki@apple.com</a>> wrote:<br><blockquote type="cite">Hi,<br><br>Here is a patch for the loop hints documentation. I’m not exactly sure if I wrote the attribute documentation correctly. If I missed something please let me know.<br></blockquote><br><blockquote type="cite">+Extensions for loop hint optimizations<br>+======================================<br>+<br>+The ``#pragma clang loop`` directive is used to specify hints for optimizing the<br>+subsequent for, while, do-while, or c++11 range-based for loop. The directive<br>+provides options for controlling vectorization, interleaving, and unrolling.<br></blockquote><br>This documentation describes syntax and the high-level effect of the<br>pragma, but it does not explain what are the semantic constraints on<br>the loop.  Users would want to know when it is valid to apply the<br>pragma, and the documentation does not explain that.<br><br>Dmitri<br><br>-- <br>main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br>(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>>*/<br></blockquote></div><br></div></div></body></html>