<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 18, 2014 at 11:29 PM, Owen Anderson <span dir="ltr"><<a href="mailto:resistor@mac.com" target="_blank">resistor@mac.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div><div>On Mar 18, 2014, at 10:22 PM, Chris Lattner <<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>> wrote:</div>
<br><blockquote type="cite"><div style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br>On Mar 18, 2014, at 4:51 PM, Eli Bendersky <<a href="mailto:eliben@google.com" target="_blank">eliben@google.com</a>> wrote:<br><br><blockquote type="cite">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></blockquote><br>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>
</div></blockquote></div><br></div><div>Chris,</div><div><br></div><div>The NoDuplicate was added by James Molloy in r170704 back in Dec 2012, after a review from you: <a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121210/159185.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121210/159185.html</a></div>
<div>AFAICT, Eli isn’t adding any new semantics here, just making it possible for intrinsics to be auto-marked as NoDuplicate.</div></blockquote></div><br>Also, this specific patch was reviewed on the list by both Justin Holewinski and Bill Wendling... but as Owen said, this patch is a total no-op semantically, noduplicate and its semantics were reviewed and established by the thread he cited.</div>
</div>