Re: [Clang] Convergent Attribute

2016-05-17 Thread Ettore Speziale via cfe-commits
Hello, >>> CUDA? In any case, I don't see how the restriction helps users, and the >>> attribute at the IR level has a well-defined meaning regardless. If a user >>> were to have a use case, they'd simply find the restriction arbitrary and >>> frustrating. >> >> Yes, CUDA was already considere

Re: [Clang] Convergent Attribute

2016-05-11 Thread Ettore Speziale via cfe-commits
Hello, >> CUDA? In any case, I don't see how the restriction helps users, and the >> attribute at the IR level has a well-defined meaning regardless. If a user >> were to have a use case, they'd simply find the restriction arbitrary and >> frustrating. > > Yes, CUDA was already considered as w

RE: [Clang] Convergent Attribute

2016-05-10 Thread Anastasia Stulova via cfe-commits
then. ;) Anastasia -Original Message- From: Hal Finkel [mailto:hfin...@anl.gov] Sent: 10 May 2016 00:33 To: Anastasia Stulova Cc: nd; Clang Commits; Matt Arsenault; Ettore Speziale; Aaron Ballman Subject: Re: [Clang] Convergent Attribute - Original Message - > From: "An

Re: [Clang] Convergent Attribute

2016-05-09 Thread Hal Finkel via cfe-commits
- Original Message - > From: "Richard Smith via cfe-commits" > To: "Matt Arsenault" > Cc: "Clang Commits" > Sent: Monday, May 9, 2016 4:45:04 PM > Subject: Re: [Clang] Convergent Attribute > On Mon, May 9, 2016 at 2:43 PM, Richard Smit

Re: [Clang] Convergent Attribute

2016-05-09 Thread Hal Finkel via cfe-commits
- Original Message - > From: "Anastasia Stulova via cfe-commits" > To: "Matt Arsenault" , "Ettore Speziale" > , "Aaron Ballman" > > Cc: "nd" , "Clang Commits" > Sent: Monday, May 9, 2016 12:39:19 PM > Sub

Re: [Clang] Convergent Attribute

2016-05-09 Thread Richard Smith via cfe-commits
On Mon, May 9, 2016 at 2:43 PM, Richard Smith wrote: > On Sun, May 8, 2016 at 12:43 PM, Matt Arsenault via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> On May 6, 2016, at 18:12, Richard Smith via cfe-commits < >> cfe-commits@lists.llvm.org> wrote: >> >> On Fri, May 6, 2016 at 4:20 PM,

Re: [Clang] Convergent Attribute

2016-05-09 Thread Richard Smith via cfe-commits
On Sun, May 8, 2016 at 12:43 PM, Matt Arsenault via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On May 6, 2016, at 18:12, Richard Smith via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > > On Fri, May 6, 2016 at 4:20 PM, Matt Arsenault via cfe-commits < > cfe-commits@lists.llvm.org> w

Re: [Clang] Convergent Attribute

2016-05-09 Thread Matt Arsenault via cfe-commits
> On May 9, 2016, at 10:39, Anastasia Stulova via cfe-commits > wrote: > > Since it's not a part of any official spec we could of course make it > accepted with anything. > > Just out of curiosity what other programming models supported by Clang do you > think this attribute would be useful

Re: [Clang] Convergent Attribute

2016-05-09 Thread Ettore Speziale via cfe-commits
Hello, > On 05/06/2016 12:11 PM, Anastasia Stulova via cfe-commits wrote: >> I was just wondering whether it would make sense to restrict the usage of >> the attribute to OpenCL language i.e. to add "let LangOpts = [OpenCL];" in >> the attribute definition. > This seems to be a pointless arbitr

RE: [Clang] Convergent Attribute

2016-05-09 Thread Anastasia Stulova via cfe-commits
nault [mailto:matthew.arsena...@amd.com] Sent: 07 May 2016 00:37 To: Anastasia Stulova; Ettore Speziale; Aaron Ballman Cc: nd; Clang Commits Subject: Re: [Clang] Convergent Attribute On 05/06/2016 12:11 PM, Anastasia Stulova via cfe-commits wrote: > I was just wondering whether it would make sense to restrict the

Re: [Clang] Convergent Attribute

2016-05-08 Thread Matt Arsenault via cfe-commits
> On May 6, 2016, at 18:12, Richard Smith via cfe-commits > wrote: > > On Fri, May 6, 2016 at 4:20 PM, Matt Arsenault via cfe-commits > mailto:cfe-commits@lists.llvm.org>> wrote: > On 05/06/2016 02:42 PM, David Majnemer via cfe-commits wrote: > This example looks wrong to me. It doesn't seem m

Re: [Clang] Convergent Attribute

2016-05-06 Thread Richard Smith via cfe-commits
On Fri, May 6, 2016 at 4:20 PM, Matt Arsenault via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On 05/06/2016 02:42 PM, David Majnemer via cfe-commits wrote: > >> This example looks wrong to me. It doesn't seem meaningful for a function >> to be both readonly and convergent, because converge

Re: [Clang] Convergent Attribute

2016-05-06 Thread Matt Arsenault via cfe-commits
On 05/06/2016 12:11 PM, Anastasia Stulova via cfe-commits wrote: I was just wondering whether it would make sense to restrict the usage of the attribute to OpenCL language i.e. to add "let LangOpts = [OpenCL];" in the attribute definition. This seems to be a pointless arbitrary restriction to

Re: [Clang] Convergent Attribute

2016-05-06 Thread Matt Arsenault via cfe-commits
On 05/06/2016 02:42 PM, David Majnemer via cfe-commits wrote: This example looks wrong to me. It doesn't seem meaningful for a function to be both readonly and convergent, because convergent means the call has some side-effect visible to other threads and readonly means the call has no side-eff

Re: [Clang] Convergent Attribute

2016-05-06 Thread Matt Arsenault via cfe-commits
On 05/06/2016 02:53 PM, Richard Smith via cfe-commits wrote: It looks like we added the noduplicate attribute to clang to support OpenCL's barrier function. Did we get the semantics for it wrong for its intended use case? Yes. Noduplicate is essentially deprecated in favor of convergent. nodupl

Re: [Clang] Convergent Attribute

2016-05-06 Thread Richard Smith via cfe-commits
On Fri, May 6, 2016 at 2:42 PM, David Majnemer wrote: > On Fri, May 6, 2016 at 2:36 PM, Richard Smith via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> On Fri, May 6, 2016 at 1:56 PM, Ettore Speziale via cfe-commits < >> cfe-commits@lists.llvm.org> wrote: >> >>> Hello, >>> >>> > In the

Re: [Clang] Convergent Attribute

2016-05-06 Thread David Majnemer via cfe-commits
On Fri, May 6, 2016 at 2:36 PM, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On Fri, May 6, 2016 at 1:56 PM, Ettore Speziale via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Hello, >> >> > In the case of foo, there could be a problem. >> > If you do not mark it c

Re: [Clang] Convergent Attribute

2016-05-06 Thread Richard Smith via cfe-commits
On Fri, May 6, 2016 at 1:56 PM, Ettore Speziale via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Hello, > > > In the case of foo, there could be a problem. > > If you do not mark it convergent, the LLVM sink pass push the call to > foo to the then branch of the ternary operator, hence the pr

Re: [Clang] Convergent Attribute

2016-05-06 Thread Ettore Speziale via cfe-commits
Hello, > In the case of foo, there could be a problem. > If you do not mark it convergent, the LLVM sink pass push the call to foo to > the then branch of the ternary operator, hence the program has been > incorrectly optimized. > > Really? It looks like the problem is that you lied to the comp

Re: [Clang] Convergent Attribute

2016-05-06 Thread Richard Smith via cfe-commits
On Wed, May 4, 2016 at 5:47 PM, Ettore Speziale via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Hello, > > > I would appreciate a bit more background on this attribute's > > semantics. How would a user know when to add this attribute to their > > function definition? Are there other attribu

Re: [Clang] Convergent Attribute

2016-05-06 Thread David Majnemer via cfe-commits
nCL language i.e. to add "let LangOpts = [OpenCL];" in > the attribute definition. > > Thanks! > Anastasia > > -Original Message- > From: Ettore Speziale [mailto:speziale.ett...@gmail.com ] > Sent: 05 May 2016 01:48 > To: Aaron Ballman > Cc: Ettore

RE: [Clang] Convergent Attribute

2016-05-06 Thread Anastasia Stulova via cfe-commits
eziale.ett...@gmail.com] Sent: 05 May 2016 01:48 To: Aaron Ballman Cc: Ettore Speziale; Anastasia Stulova; Clang Commits Subject: Re: [Clang] Convergent Attribute Hello, > I would appreciate a bit more background on this attribute's > semantics. How would a user know when to add th

Re: [Clang] Convergent Attribute

2016-05-04 Thread Ettore Speziale via cfe-commits
Hello, > I would appreciate a bit more background on this attribute's > semantics. How would a user know when to add this attribute to their > function definition? Are there other attributes that cannot be used in > conjunction with this one? Should this apply to member functions? What > about Obj

Re: [Clang] Convergent Attribute

2016-05-04 Thread Aaron Ballman via cfe-commits
On Tue, May 3, 2016 at 12:18 PM, Ettore Speziale wrote: > Hello, > > the attached patch introduces the `convergent` attribute. > > It is meant to be lowered into the LLVM `convergent` attribute, to restrict > optimizations of attributed functions — e.g. you can attach convergent to > OpenCL’s ba