[PATCH] Adding support for NoDuplicate function attribute in CLang

Aaron Ballman aaron at aaronballman.com
Wed Nov 20 12:11:14 PST 2013


On Wed, Nov 20, 2013 at 2:25 PM, Marcello Maggioni
<marcello at codeplay.com> wrote:
> Sorry, I missed the mail.
>
> Hmm, well, ideally if the call through the pointer is duplicated ,and the
> function call shouldn't be duplicated (like in some implementations of
> "barrier()" in OpenCL) the result might be wrong (in the case of a barrier
> the result is a dead-lock).
> Of course, OpenCL itself doesn't have this problem because it doesn't have
> function pointers ...

Which brings me to my round-about question -- should this be exposed
as an OpenCL-only attribute in the same way we do with CUDA
attributes? Eg) only expose a GNU spelling for it, and check in Sema
whether lang options are for OpenCL and warn if not compiling for
OpenCL.

It sounds like this is intended for OpenCL users and it will have
little utility to non-OpenCL users (feel free to correct me if I'm
wrong on this account).

~Aaron



More information about the cfe-commits mailing list