Re: [RFC] __atomic_compare_exchange* optimizations (PR middle-end/66867, alternative)

2016-06-30 Thread H.J. Lu
On Fri, Jun 24, 2016 at 6:35 AM, Jakub Jelinek wrote: > On Thu, Jun 23, 2016 at 05:23:21PM +0200, Jakub Jelinek wrote: >> Thinking about this again, there could be another option - keep >> __atomic_compare_exchange_N in the IL, but under certain conditions (similar >> to what the patch uses in fol

Re: [RFC] __atomic_compare_exchange* optimizations (PR middle-end/66867, alternative)

2016-06-28 Thread Richard Biener
On Fri, 24 Jun 2016, Jakub Jelinek wrote: > On Thu, Jun 23, 2016 at 05:23:21PM +0200, Jakub Jelinek wrote: > > Thinking about this again, there could be another option - keep > > __atomic_compare_exchange_N in the IL, but under certain conditions (similar > > to what the patch uses in fold_builtin

Re: [RFC] __atomic_compare_exchange* optimizations (PR middle-end/66867)

2016-06-28 Thread Richard Biener
On Thu, 23 Jun 2016, Jakub Jelinek wrote: > Hi! > > This PR is about 2 issues with the *atomic_compare_exchange* APIs, which > didn't exist with __sync_*_compare_and_swap: > 1) the APIs make the expected argument addressable, although it is very >common it is an automatic variable that is add

[RFC] __atomic_compare_exchange* optimizations (PR middle-end/66867, alternative)

2016-06-24 Thread Jakub Jelinek
On Thu, Jun 23, 2016 at 05:23:21PM +0200, Jakub Jelinek wrote: > Thinking about this again, there could be another option - keep > __atomic_compare_exchange_N in the IL, but under certain conditions (similar > to what the patch uses in fold_builtin_atomic_compare_exchange) for these > builtins igno

[RFC] __atomic_compare_exchange* optimizations (PR middle-end/66867)

2016-06-23 Thread Jakub Jelinek
Hi! This PR is about 2 issues with the *atomic_compare_exchange* APIs, which didn't exist with __sync_*_compare_and_swap: 1) the APIs make the expected argument addressable, although it is very common it is an automatic variable that is addressable only because of these APIs 2) for the fear