<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 18, 2014 at 10:22 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><br>
On Mar 18, 2014, at 4:51 PM, Eli Bendersky <<a href="mailto:eliben@google.com">eliben@google.com</a>> wrote:<br>
<br>
> Author: eliben<br>
> Date: Tue Mar 18 18:51:07 2014<br>
> New Revision: 204200<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=204200&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=204200&view=rev</a><br>
> Log:<br>
> Expose "noduplicate" attribute as a property for intrinsics.<br>
><br>
> The "noduplicate" function attribute exists to prevent certain optimizations<br>
> from duplicating calls to the function. This is important on platforms where<br>
> certain function call duplications are unsafe (for example execution barriers<br>
> for CUDA and OpenCL).<br>
><br>
> This patch makes it possible to specify intrinsics as "noduplicate" and<br>
> translates that to the appropriate function attribute.<br>
<br>
</div>Hi Eli,<br>
<br>
Was this discussed somewhere?  I missed the discussion on this, and this has non-obvious ramifications.  Is it enough to teach code metrics that this isn't a duplicatable instruction, or does CUDA rely on stronger "no reorder" and "no merge" guarantees?  How do you expect to implement these guarantees without scattering special cases throughout the optimizer?<br>

</blockquote><div><br></div><div>I think Owen and Chandler covered most of the background; just for completeness, the original discussion of the patch earlier this week is in <a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140317/209081.html">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140317/209081.html</a> - the email introducing the patch has a little bit more detail than the commit message. Perhaps I could have incorporated it into the commit message to make it clearer.</div>

<div><br></div><div>Eli</div><div> </div></div></div></div>