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

Chris Lattner clattner at apple.com
Tue Mar 18 22:22:36 PDT 2014


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




More information about the llvm-commits mailing list