<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;"><br><div><div>On Mar 18, 2014, at 10:22 PM, Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>On Mar 18, 2014, at 4:51 PM, Eli Bendersky <<a href="mailto:eliben@google.com">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">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>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">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><div><br></div><div>—Owen</div></body></html>