Skip to content

Start recovering from missing types in SIL deserialization #17564

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
merged 2 commits into from
Jun 28, 2018

Conversation

jrose-apple
Copy link
Contributor

@jrose-apple jrose-apple commented Jun 27, 2018

Now that @inlinable is a supported feature, we need to handle cases where a function is inlinable but it references some type that imports differently in different Swift versions. To start, handle the case where a SIL function's type is now invalid and therefore the entire function can't be imported. This doesn't open up anything interesting yet, but it's a start. This simple case is enough to fix problems when a SIL function is only referenced from a witness table and not actually used.

rdar://problem/40899824

Now that @inlinable is a supported feature, we need to handle cases
where a function is inlinable but it references some type that imports
differently in different Swift versions. To start, handle the case
where a SIL function's type is now invalid and therefore the entire
function can't be imported. This doesn't open up anything interesting
yet, but it's a start.

Part of rdar://problem/40899824
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test source compatibility

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test compiler performance

@swift-ci
Copy link
Contributor

Build comment file:

Summary for master smoketest

Unexpected test results, excluded stats for ReactiveCocoa

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 36,015,292 36,015,168 -124 -0.0%
time.swift-driver.wall 69.3s 69.6s 392.9ms 0.57%

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 82,886 82,886 0 0.0%
AST.NumLoadedModules 12,485 12,485 0 0.0%
AST.NumTotalClangImportedEntities 253,787 253,787 0 0.0%
AST.NumUsedConformances 8,754 8,754 0 0.0%
IRModule.NumIRBasicBlocks 127,546 127,546 0 0.0%
IRModule.NumIRFunctions 75,825 75,825 0 0.0%
IRModule.NumIRGlobals 69,290 69,290 0 0.0%
IRModule.NumIRInsts 1,426,237 1,426,237 0 0.0%
IRModule.NumIRValueSymbols 129,827 129,827 0 0.0%
LLVM.NumLLVMBytesOutput 36,015,292 36,015,168 -124 -0.0%
SILModule.NumSILGenFunctions 44,348 44,348 0 0.0%
SILModule.NumSILOptFunctions 47,339 47,339 0 0.0%
Sema.NumConformancesDeserialized 351,370 351,370 0 0.0%
Sema.NumConstraintScopes 893,629 893,629 0 0.0%
Sema.NumDeclsDeserialized 2,068,712 2,068,712 0 0.0%
Sema.NumDeclsValidated 188,816 188,816 0 0.0%
Sema.NumFunctionsTypechecked 47,175 47,175 0 0.0%
Sema.NumGenericSignatureBuilders 80,123 80,123 0 0.0%
Sema.NumLazyGenericEnvironments 415,196 415,196 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 37,995 37,995 0 0.0%
Sema.NumLazyIterableDeclContexts 330,717 330,717 0 0.0%
Sema.NumTypesDeserialized 2,285,893 2,285,893 0 0.0%
Sema.NumTypesValidated 160,444 160,444 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 26,641,268 26,641,268 0 0.0%
time.swift-driver.wall 140.3s 140.2s -30.2ms -0.02%

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 8,857 8,857 0 0.0%
AST.NumLoadedModules 408 408 0 0.0%
AST.NumTotalClangImportedEntities 25,770 25,770 0 0.0%
AST.NumUsedConformances 8,760 8,760 0 0.0%
IRModule.NumIRBasicBlocks 148,662 148,662 0 0.0%
IRModule.NumIRFunctions 56,687 56,687 0 0.0%
IRModule.NumIRGlobals 54,037 54,037 0 0.0%
IRModule.NumIRInsts 1,220,955 1,220,955 0 0.0%
IRModule.NumIRValueSymbols 101,467 101,467 0 0.0%
LLVM.NumLLVMBytesOutput 26,641,268 26,641,268 0 0.0%
SILModule.NumSILGenFunctions 22,181 22,181 0 0.0%
SILModule.NumSILOptFunctions 35,901 35,901 0 0.0%
Sema.NumConformancesDeserialized 86,021 86,021 0 0.0%
Sema.NumConstraintScopes 793,754 793,754 0 0.0%
Sema.NumDeclsDeserialized 205,103 205,103 0 0.0%
Sema.NumDeclsValidated 59,866 59,866 0 0.0%
Sema.NumFunctionsTypechecked 10,716 10,716 0 0.0%
Sema.NumGenericSignatureBuilders 9,751 9,751 0 0.0%
Sema.NumLazyGenericEnvironments 32,279 32,279 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 4,556 4,556 0 0.0%
Sema.NumLazyIterableDeclContexts 20,590 20,590 0 0.0%
Sema.NumTypesDeserialized 268,868 268,868 0 0.0%
Sema.NumTypesValidated 33,026 33,026 0 0.0%

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 2a89d5c

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 2a89d5c

@jrose-apple jrose-apple force-pushed the recovery-is-a-SILly-idea branch from 8714ee4 to 422a2fe Compare June 28, 2018 00:20
@jrose-apple
Copy link
Contributor Author

Full macOS tests

@swift-ci Please smoke test macOS

@jrose-apple jrose-apple force-pushed the recovery-is-a-SILly-idea branch from 422a2fe to 71efe36 Compare June 28, 2018 00:23
This is enough to let the test case in rdar://problem/40899824 pass,
and any callers of this function already need to be able to handle a
nullptr result. There's a lot more work to do in this area, but it's
nice to get the simple things working again.
@jrose-apple jrose-apple force-pushed the recovery-is-a-SILly-idea branch from 71efe36 to f1b347c Compare June 28, 2018 00:24
@swiftlang swiftlang deleted a comment from swift-ci Jun 28, 2018
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test Linux

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 71efe36d33e55e2078360bb2b6dc1ed7b102d500


import rdar40899824Helper

public protocol Proto: class {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the ": class" important for the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, probably not. That's just how the original Radar's test case went.

@jrose-apple jrose-apple merged commit 747e318 into swiftlang:master Jun 28, 2018
@jrose-apple jrose-apple deleted the recovery-is-a-SILly-idea branch June 28, 2018 16:34
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Jun 28, 2018
…ly-idea

Start recovering from missing types in SIL deserialization

rdar://problem/40899824
(cherry picked from commit 747e318)
Copy link

@shajrawi shajrawi left a comment

Choose a reason for hiding this comment

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

LGTM

jrose-apple added a commit that referenced this pull request Jun 28, 2018
…17591)

Start recovering from missing types in SIL deserialization

rdar://problem/40899824
(cherry picked from commit 747e318)
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