Skip to content

Conversation

@meg-gupta
Copy link
Contributor

The invariant is checking if the "cached" isUniquelyReferenced result is still valid. The compiler can insert copies for lifetime adjustment during optimizations between the time isUniquelyReferenced is first "cached" to the invariant, such copies don't escape and don't really matter for COW. In such cases, this invariant will fire.

This PR turns off this invariant.

rdar://100530373

The invariant is checking if the "cached" isUniquelyReferenced result is still valid. The compiler can insert copies for lifetime adjustment during optimizations between the time isUniquelyReferenced is first "cached" to the invariant, such copies don't escape and don't really matter for COW. In such cases, this invariant will fire. This PR turns off this invariant. rdar://100530373
@meg-gupta meg-gupta requested a review from eeckstein October 28, 2022 17:03
@meg-gupta
Copy link
Contributor Author

I don't have a unit test for this. This was firing in a few sodlib tests in our repository on certain Linux configurations.

@meg-gupta
Copy link
Contributor Author

@swift-ci smoke test

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically LGTM.
But this should also be removed in ContiguousArray and in Array/ContiguousArray::_reserveCapacityImpl

@meg-gupta
Copy link
Contributor Author

I am going to close this PR and address the underlying reason here - #61826

@meg-gupta meg-gupta closed this Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants