Skip to content

[GSB] Always ensure that we wire up typealiases in protocol extensions. #14974

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

Closed
wants to merge 1 commit into from

Conversation

DougGregor
Copy link
Member

We were only wiring up typealiases in protocol extensions under some
circumstances, which meant that we could miss some equivalences between a
typealias in one protocol and an associated type in an inherited protocol,
which could manifest as a crash in IR generation.

Fixes SR-7097 / rdar://problem/38001269.

We were only wiring up typealiases in protocol extensions under some
circumstances, which meant that we could miss some equivalences between a
typealias in one protocol and an associated type in an inherited protocol,
which could manifest as a crash in IR generation.

Fixes SR-7097 / rdar://problem/38001269.
@DougGregor DougGregor requested a review from huonw March 5, 2018 06:54
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor requested a review from xedin March 5, 2018 06:55
@DougGregor
Copy link
Member Author

@swift-ci please smoke test compiler performance

@@ -3743,13 +3743,11 @@ ResolvedType GenericSignatureBuilder::maybeResolveEquivalenceClass(
if (!nestedPA)
return ResolvedType::forUnresolved(baseEquivClass);

if (resolutionKind != ArchetypeResolutionKind::AlreadyKnown) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused. As far as I can tell this change just means that updateNestedTypeForConformance now gets called with ArchetypeResolutionKind::AlreadyKnown in addition to the other two kinds, but, I can't see a way in which that call actually does anything.

https://github.com/apple/swift/blob/adfead025138474a5b4a6f3c1dee585c5654cc42/lib/AST/GenericSignatureBuilder.cpp#L2796-L2934

It seems like that function does three "interesting" things, but none of them happen with this kind:

What am I missing?

Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here...

Copy link
Member Author

Choose a reason for hiding this comment

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

You're both right and... somewhere I messed something up locally, because the test marked as fixed doesn't seem to be fixed. Very sorry :(

@swift-ci
Copy link
Contributor

swift-ci commented Mar 5, 2018

Build comment file:

Summary for master smoketest

No regressions above thresholds

Debug

debug brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 23,223,548 23,223,540 -8 -0.0%
time.swift-driver.wall 39.3s 39.2s -16.6ms -0.04%

debug detailed

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
name old new delta delta_pct
AST.NumImportedExternalDefinitions 44,325 44,325 0 0.0%
AST.NumLoadedModules 6,161 6,161 0 0.0%
AST.NumTotalClangImportedEntities 123,466 123,466 0 0.0%
AST.NumUsedConformances 2,816 2,816 0 0.0%
IRModule.NumIRBasicBlocks 67,316 67,316 0 0.0%
IRModule.NumIRFunctions 35,960 35,960 0 0.0%
IRModule.NumIRGlobals 35,332 35,332 0 0.0%
IRModule.NumIRInsts 732,937 732,937 0 0.0%
IRModule.NumIRValueSymbols 64,658 64,658 0 0.0%
LLVM.NumLLVMBytesOutput 23,223,548 23,223,540 -8 -0.0%
SILModule.NumSILGenFunctions 27,549 27,549 0 0.0%
SILModule.NumSILOptFunctions 31,631 31,631 0 0.0%
Sema.NumConformancesDeserialized 130,598 130,598 0 0.0%
Sema.NumConstraintScopes 416,611 416,611 0 0.0%
Sema.NumDeclsDeserialized 872,519 872,519 0 0.0%
Sema.NumDeclsValidated 29,522 29,522 0 0.0%
Sema.NumFunctionsTypechecked 26,107 26,107 0 0.0%
Sema.NumGenericSignatureBuilders 38,656 38,656 0 0.0%
Sema.NumLazyGenericEnvironments 163,947 163,947 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 17,255 17,255 0 0.0%
Sema.NumLazyIterableDeclContexts 149,976 149,976 0 0.0%
Sema.NumTypesDeserialized 917,350 917,350 0 0.0%
Sema.NumTypesValidated 108,166 108,166 0 0.0%

Release

release brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 27,721,024 27,721,016 -8 -0.0%
time.swift-driver.wall 69.1s 69.2s 26.3ms 0.04%

release detailed

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
name old new delta delta_pct
AST.NumImportedExternalDefinitions 6,977 6,977 0 0.0%
AST.NumLoadedModules 223 223 0 0.0%
AST.NumTotalClangImportedEntities 20,771 20,771 0 0.0%
AST.NumUsedConformances 2,818 2,818 0 0.0%
IRModule.NumIRBasicBlocks 63,693 63,693 0 0.0%
IRModule.NumIRFunctions 27,852 27,852 0 0.0%
IRModule.NumIRGlobals 29,179 29,179 0 0.0%
IRModule.NumIRInsts 557,514 557,514 0 0.0%
IRModule.NumIRValueSymbols 53,336 53,336 0 0.0%
LLVM.NumLLVMBytesOutput 27,721,024 27,721,016 -8 -0.0%
SILModule.NumSILGenFunctions 13,972 13,972 0 0.0%
SILModule.NumSILOptFunctions 20,753 20,753 0 0.0%
Sema.NumConformancesDeserialized 71,217 71,217 0 0.0%
Sema.NumConstraintScopes 397,535 397,535 0 0.0%
Sema.NumDeclsDeserialized 133,646 133,646 0 0.0%
Sema.NumDeclsValidated 19,193 19,193 0 0.0%
Sema.NumFunctionsTypechecked 7,393 7,393 0 0.0%
Sema.NumGenericSignatureBuilders 4,634 4,634 0 0.0%
Sema.NumLazyGenericEnvironments 20,629 20,629 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 2,513 2,513 0 0.0%
Sema.NumLazyIterableDeclContexts 13,013 13,013 0 0.0%
Sema.NumTypesDeserialized 157,277 157,277 0 0.0%
Sema.NumTypesValidated 29,559 29,559 0 0.0%

@DougGregor
Copy link
Member Author

This is the wrong way to go; the real fix is in #15002.

@DougGregor DougGregor closed this Mar 6, 2018
@DougGregor DougGregor deleted the gsb-typealias-always branch March 6, 2018 01:11
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.

4 participants