Skip to content

Cherry pick some fixes to qualification branch #22819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Feb 22, 2019

rdar://problem/48218483

We no longer store the 'transparent' bit in the ApplyInst, so there's
no need to recreate them.
This utility is generally a horrible idea but even worse the
callers were not doing anything to ensure the required
invariants actually held.

Add a new canReplaceLoadSequence() method and chek it in the
right places.
The basic theory here is as follows:

- The resilience expansion never changes the lowered type, only the
  SIL type category (object or address). This means that function
  types always pass resilient values indirectly regardless of
  expansion, etc.

- The getTypeLowering() methods all take an optional 'forExpansion'
  parameter. Soon, these will become non-optional and I'll audit all
  call sites to pass the right expansion; for convenience, the
  entry points on SILFunction will pass the right expansion.

Places I need to revisit and pass the right expansion in are marked
as 'FIXME: Expansion'.

For now, this just fixes a SILCombiner bug. After some more plumbing
this will enable SILGen to produce better code.

Progress on <rdar://problem/24057844>,
<https://bugs.swift.org/browse/SR-261>.
Apparently you can use a swift_name attribute in Clang to import types
as members of Swift types. If the Swift type is not public, we would
still try to serialize the witness thunks, which tripped SIL verifier
checks since the witnesses themselves were not serialized.

Note that the fix here is to just delete the special case of an
imported conformance; the regular "type is public and protocol is
public" condition suffices here.

Fixes <rdar://problem/48218483>.
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 411a2e0

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 411a2e0

@AnnaZaks
Copy link
Contributor

This also contains a cherry-pick for a fix to Swift 5.0: 48226583 / #22737

If the conforming type is generic, we have to treat the conformance as
resilient if it is defined outside of the current module.

This is because it can resiliently change from being non-dependent
to dependent.
@slavapestov slavapestov force-pushed the cherry-pick-5.1-branch branch from 411a2e0 to 4611412 Compare February 22, 2019 23:47
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 411a2e0

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 411a2e0

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 4611412

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4611412

… an apply has nothrow on the actual function_ref.

Previously, we based it off of whether or not the original apply had a nothrow
bit. This is incorrect in the case where we added an error result to a function
without an error result. In such a case, we need to /not/ put on the nothrow
bit. This commit generalizes this idea slightly by assuming that if we are asked
to perform this transformation we should just match what the underlying
function_ref (i.e. setting nothrow if the underlying function type has an error
result and not setting nothrow if the underlying function type does not have an
error result).

rdar://47828439
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 77cba37d583e190d977e0f58a0e501702964f42b

Turns out the tags are shuffled around by XORing with a
per-process hash, and we have to deobfuscate the tag
before checking if its an extended tag.

There's no test for this; just running the existing tests
several times in a row is sufficient to trigger the problem.
@slavapestov slavapestov force-pushed the cherry-pick-5.1-branch branch from 77cba37 to 8b01751 Compare February 26, 2019 05:29
@aschwaighofer
Copy link
Contributor

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 77cba37d583e190d977e0f58a0e501702964f42b

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 77cba37d583e190d977e0f58a0e501702964f42b

@slavapestov slavapestov merged commit c94688b into swiftlang:swift-5.1-branch Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants