Re: [swift-dev] isUniquelyReferenced issues

2016-04-01 Thread John McCall via swift-dev
> On Apr 1, 2016, at 4:10 PM, Andrew Trick via swift-dev > wrote: >> On Apr 1, 2016, at 8:43 AM, Joe Groff via swift-dev >> wrote: >> >> >>> On Mar 31, 2016, at 11:49 PM, Patrick Pijnappel >>> wrote: >>> >>> The modified version doesn't seem to change any of the results (on -O or >>> -Ono

Re: [swift-dev] isUniquelyReferenced issues

2016-04-01 Thread Andrew Trick via swift-dev
> On Apr 1, 2016, at 8:43 AM, Joe Groff via swift-dev > wrote: > > >> On Mar 31, 2016, at 11:49 PM, Patrick Pijnappel >> wrote: >> >> The modified version doesn't seem to change any of the results (on -O or >> -Onone). Note that the problem is that it's not uniquely referenced inside >> b

Re: [swift-dev] isUniquelyReferenced issues

2016-04-01 Thread Joe Groff via swift-dev
> On Mar 31, 2016, at 11:49 PM, Patrick Pijnappel > wrote: > > The modified version doesn't seem to change any of the results (on -O or > -Onone). Note that the problem is that it's not uniquely referenced inside > bar where it actually should be – that would mean that ownership is currently

Re: [swift-dev] isUniquelyReferenced issues

2016-04-01 Thread Patrick Pijnappel via swift-dev
Ok I checked, in the version from my original email we have: callq _swift_retain movq %rbx, %rdi callq __TF4main3barFVS_3FooT_ movq %rbx, %rdi callq _swift_release Which makes foo obviously non-uniquely referenced inside bar, preventing COW optimization. So it seems the optimizer somehow doe

Re: [swift-dev] isUniquelyReferenced issues

2016-03-31 Thread Patrick Pijnappel via swift-dev
The modified version doesn't seem to change any of the results (on -O or -Onone). Note that the problem is that it's *not* uniquely referenced inside bar where it actually should be – that would mean that ownership is currently not directly transferred right? On Fri, Apr 1, 2016 at 10:27 AM, Joe G

Re: [swift-dev] isUniquelyReferenced issues

2016-03-31 Thread Joe Groff via swift-dev
> On Mar 31, 2016, at 4:21 PM, Joe Groff via swift-dev > wrote: > >> >> On Mar 31, 2016, at 3:58 PM, Patrick Pijnappel via swift-dev >> wrote: >> >> In trying to implement a COW type, but I'm running into problems with >> isUniqueReferenced breaking in even fairly simple cases. For example

Re: [swift-dev] isUniquelyReferenced issues

2016-03-31 Thread Joe Groff via swift-dev
> On Mar 31, 2016, at 3:58 PM, Patrick Pijnappel via swift-dev > wrote: > > In trying to implement a COW type, but I'm running into problems with > isUniqueReferenced breaking in even fairly simple cases. For example (with > -O) the code below prints "bar: false", commenting out the print in

[swift-dev] isUniquelyReferenced issues

2016-03-31 Thread Patrick Pijnappel via swift-dev
In trying to implement a COW type, but I'm running into problems with isUniqueReferenced breaking in even fairly simple cases. For example (with -O) the code below prints "bar: false", commenting out the print in test() makes it print "bar: true", and removing the var parameter var foo: Foo and usi