[PATCH] Adding support for NoDuplicate function attribute in CLang

Joey Gouly joey.gouly at arm.com
Wed Nov 20 04:42:14 PST 2013


LGTM!

 

From: cfe-commits-bounces at cs.uiuc.edu
[mailto:cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Marcello Maggioni
Sent: 16 November 2013 15:42
To: cfe-commits at cs.uiuc.edu
Subject: Re: [PATCH] Adding support for NoDuplicate function attribute in
CLang

 

New patch that merges the two separate patches together and also adds the
NoDuplicate attribute to the ConstructAttributeList functions in CGCall.cpp

Cheers,
Marcello

On 15/11/13 10:49, Marcello Maggioni 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. 

I splitted the patch in two files. The "_code" file contains the part that
adds the functionality to Clang and the "_tests" part contains the added
tests. 

Tell me if it is interesting to add this to mainline. If there is a need for
corrections I'll be happy to make them. 

Cheers, 
Marcello 






_______________________________________________
cfe-commits mailing list
cfe-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131120/7bae724b/attachment.html>


More information about the cfe-commits mailing list