<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 30, 2014 at 9:52 AM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class=""><br><div class="gmail_quote">On Thu, Jun 26, 2014 at 9:49 AM, Mark Heffernan <span dir="ltr"><<a href="mailto:meheff@google.com" target="_blank">meheff@google.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From a previous review Richard Smith (cc'd) had a strong opinion about placing the loop pragmas inside of the clang namespace ("#pragma clang loop...").  Clearly this is incompatible with "#pragma unroll ...".  Richard, any thoughts on this?</blockquote>

</div><br></div>I can't speak for Richard, but my take on it would be this:</div><div class="gmail_extra"><br></div><div class="gmail_extra">For an invented syntax, it should go under the clang namespace.</div><div class="gmail_extra">

<br></div><div class="gmail_extra">For a syntax designed to be compatible with some other system (Intel, IBM, or CUDA) we should match their syntax exactly, as otherwise there is no point in "compatibility".</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">I'm personally very comfortable with Clang supporting a relatively diverse set of syntaxes for specifying this behavior in order to increase compatibility with other compilers that we would otherwise already be compatible with (IBM and Intel seem likely) or which there are specs that we should follow (CUDA). I would probably allow the CUDA-compatible syntax only in CUDA mode (and similarly other compatible syntaxes if there is a comparable narrow area where the compatibility matters), but it doesn't seem to be a deal breaker either way.</div>

</div>
</blockquote></div><br></div><div class="gmail_extra">I basically agree with all of this. In CUDA mode we should obviously support the CUDA syntax. For compatibility with icc and xlc we should support the form with parens. I don't see any particularly good reason to prohibit the CUDA form outside of CUDA mode.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">One question: you list the unroll count as 'n'. Must that be a constant integer? The clang pragma intends to allow an arbitrary integer constant expression there. That might be a good reason for us to introduce our own syntax for it, if we're providing a slightly more general form.</div>
</div>