<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 20, 2013 at 1:22 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">On Fri, Nov 15, 2013 at 5:49 AM, Marcello Maggioni<br>
<<a href="mailto:marcello@codeplay.com">marcello@codeplay.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I made a patch that adds the capability of defining the NoDuplicate<br>
> attribute for a function using both the GNU and CXX11 attribute syntaxes<br>
> like in:<br>
><br>
> __attribute__((noduplicate))<br>
> [[noduplicate]]<br>
><br>
> I also added tests to test out the new addition.<br>
> The NoDuplicate attribute is useful to avoid the application of compiler<br>
> optimizations like Loop Unswitching to code containing function calls that<br>
> implement functionality like barriers in OpenCL. These functions could fail<br>
> if such an optimization is applied on the code that calls them.<br>
<br>
</div>How is this different from the optnone attribute that was recently<br>
added? The attribute name here doesn't really convey much meaning<br>
based on this description, so perhaps there is a better name for it?<br>
</blockquote><div><br>Note that in the OpenCL use case, the name precisely describes the intent: you can<br>move barrier calls around, inline them, etc, if you can show that the semantics of<br>OpenCL code is the same but (on some particular architectures) you aren't allowed to<br>
duplicate a given barrier call (due to implementation restrictions) even if otherwise<br></div><div>the semantics was ok. This relates to the LLVM function attribute named noduplicate<br>(as visible in the patch, obviously)<br>
</div><br></div>-- <br><div>cheers, dave tweed__________________________</div><div>high-performance computing and machine vision expert: <a href="mailto:david.tweed@gmail.com" target="_blank">david.tweed@gmail.com</a></div>
<div>"while having code so boring anyone can maintain it, use Python." -- attempted insult seen on slashdot</div><div> </div>
</div></div>