On Wed, Nov 20, 2013 at 1:22 PM, Aaron Ballman <aa...@aaronballman.com>wrote:

> On Fri, Nov 15, 2013 at 5:49 AM, Marcello Maggioni
> <marce...@codeplay.com> wrote:
> > Hi all,
> >
> > I made a patch that adds the capability of defining the NoDuplicate
> > attribute for a function using both the GNU and CXX11 attribute syntaxes
> > like in:
> >
> > __attribute__((noduplicate))
> > [[noduplicate]]
> >
> > I also added tests to test out the new addition.
> > The NoDuplicate attribute is useful to avoid the application of compiler
> > optimizations like Loop Unswitching to code containing function calls
> that
> > implement functionality like barriers in OpenCL. These functions could
> fail
> > if such an optimization is applied on the code that calls them.
>
> How is this different from the optnone attribute that was recently
> added? The attribute name here doesn't really convey much meaning
> based on this description, so perhaps there is a better name for it?
>

Note that in the OpenCL use case, the name precisely describes the intent:
you can
move barrier calls around, inline them, etc, if you can show that the
semantics of
OpenCL code is the same but (on some particular architectures) you aren't
allowed to
duplicate a given barrier call (due to implementation restrictions) even if
otherwise
the semantics was ok. This relates to the LLVM function attribute named
noduplicate
(as visible in the patch, obviously)

-- 
cheers, dave tweed__________________________
high-performance computing and machine vision expert: david.tw...@gmail.com
"while having code so boring anyone can maintain it, use Python." --
attempted insult seen on slashdot
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to