[llvm] r204200 - Expose "noduplicate" attribute as a property for intrinsics.

Chandler Carruth chandlerc at google.com
Tue Mar 18 23:40:46 PDT 2014


On Tue, Mar 18, 2014 at 11:29 PM, Owen Anderson <resistor at mac.com> wrote:

> On Mar 18, 2014, at 10:22 PM, Chris Lattner <clattner at apple.com> wrote:
>
>
> On Mar 18, 2014, at 4:51 PM, Eli Bendersky <eliben at google.com> wrote:
>
> Author: eliben
> Date: Tue Mar 18 18:51:07 2014
> New Revision: 204200
>
> URL: http://llvm.org/viewvc/llvm-project?rev=204200&view=rev
> Log:
> Expose "noduplicate" attribute as a property for intrinsics.
>
> The "noduplicate" function attribute exists to prevent certain
> optimizations
> from duplicating calls to the function. This is important on platforms
> where
> certain function call duplications are unsafe (for example execution
> barriers
> for CUDA and OpenCL).
>
> This patch makes it possible to specify intrinsics as "noduplicate" and
> translates that to the appropriate function attribute.
>
>
> Hi Eli,
>
> 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?
>
>
> Chris,
>
> The NoDuplicate was added by James Molloy in r170704 back in Dec 2012,
> after a review from you:
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121210/159185.html
> AFAICT, Eli isn’t adding any new semantics here, just making it possible
> for intrinsics to be auto-marked as NoDuplicate.
>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140318/e88fed66/attachment.html>


More information about the llvm-commits mailing list