Skip to content

Prepare for finalizeDecl() removal #26160

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

An assortment of somewhat random refactorings.

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor Author

@swift-ci Please test compiler performance

@swift-ci
Copy link
Contributor

Summary for master full

Unexpected test results, excluded stats for Tagged, RswiftCore, ProcedureKit, RxCocoa, Deferred, Wordy, SwifterSwift

Regressions found (see below)

Debug-batch

debug-batch brief

Regressed (0)
name old new delta delta_pct
Improved (2)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 27,686,491,780,316 27,004,732,772,354 -681,759,007,962 -2.46% ✅
time.swift-driver.wall 2597.5s 2556.6s -41.0s -1.58% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (1)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 1,133,624,418 1,133,632,798 8,380 0.0%

debug-batch detailed

Regressed (1)
name old new delta delta_pct
AST.NumSourceLinesPerSecond 2,366,633 2,454,616 87,983 3.72% ⛔
Improved (15)
name old new delta delta_pct
AST.NumASTBytesAllocated 41,324,833,435 39,963,936,138 -1,360,897,297 -3.29% ✅
Frontend.MaxMallocUsage 795,977,084,744 787,596,599,016 -8,380,485,728 -1.05% ✅
Frontend.NumInstructionsExecuted 27,686,491,780,316 27,004,732,772,354 -681,759,007,962 -2.46% ✅
Sema.AccessLevelRequest 7,160,448 6,657,735 -502,713 -7.02% ✅
Sema.ExtendedNominalRequest 3,301,482 3,262,192 -39,290 -1.19% ✅
Sema.InheritedDeclsReferencedRequest 3,765,111 3,718,947 -46,164 -1.23% ✅
Sema.IsFinalRequest 2,831,023 2,788,394 -42,629 -1.51% ✅
Sema.NumConformancesDeserialized 5,940,381 5,755,576 -184,805 -3.11% ✅
Sema.NumDeclsDeserialized 45,272,850 43,989,374 -1,283,476 -2.83% ✅
Sema.NumGenericSignatureBuilders 929,942 916,828 -13,114 -1.41% ✅
Sema.NumLazyGenericEnvironments 8,268,566 8,012,222 -256,344 -3.1% ✅
Sema.NumTypesDeserialized 13,642,087 13,394,032 -248,055 -1.82% ✅
Sema.OverriddenDeclsRequest 1,517,954 1,470,402 -47,552 -3.13% ✅
Sema.SelfBoundsFromWhereClauseRequest 4,870,253 4,793,984 -76,269 -1.57% ✅
Sema.USRGenerationRequest 4,916,246 4,572,814 -343,432 -6.99% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (102)
name old new delta delta_pct
AST.NumDecls 89,927 89,927 0 0.0%
AST.NumDependencies 209,410 209,412 2 0.0%
AST.NumInfixOperators 34,314 34,314 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 253,269 253,269 0 0.0%
AST.NumLocalTypeDecls 123 123 0 0.0%
AST.NumObjCMethods 13,727 13,727 0 0.0%
AST.NumPostfixOperators 18 18 0 0.0%
AST.NumPrecedenceGroups 16,733 16,733 0 0.0%
AST.NumPrefixOperators 60 60 0 0.0%
AST.NumReferencedDynamicNames 109 109 0 0.0%
AST.NumReferencedMemberNames 3,991,966 3,991,966 0 0.0%
AST.NumReferencedTopLevelNames 308,437 308,437 0 0.0%
AST.NumSourceBuffers 381,380 381,380 0 0.0%
AST.NumSourceLines 3,046,712 3,046,712 0 0.0%
AST.NumStoredPropertiesQueries 9,100,298 9,095,203 -5,095 -0.06%
AST.NumTotalClangImportedEntities 4,146,152 4,124,983 -21,169 -0.51%
Driver.ChildrenMaxRSS 131,215,130,624 130,604,437,504 -610,693,120 -0.47%
Driver.DriverDepCascadingDynamic 0 0 0 0.0%
Driver.DriverDepCascadingExternal 0 0 0 0.0%
Driver.DriverDepCascadingMember 0 0 0 0.0%
Driver.DriverDepCascadingNominal 0 0 0 0.0%
Driver.DriverDepCascadingTopLevel 0 0 0 0.0%
Driver.DriverDepDynamic 0 0 0 0.0%
Driver.DriverDepExternal 0 0 0 0.0%
Driver.DriverDepMember 0 0 0 0.0%
Driver.DriverDepNominal 0 0 0 0.0%
Driver.DriverDepTopLevel 0 0 0 0.0%
Driver.NumDriverJobsRun 18,258 18,258 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumDriverPipePolls 100,190 99,764 -426 -0.43%
Driver.NumDriverPipeReads 100,416 100,627 211 0.21%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.NumProcessFailures 0 0 0 0.0%
IRModule.NumIRAliases 118,830 118,830 0 0.0%
IRModule.NumIRBasicBlocks 4,526,126 4,526,126 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 2,089,746 2,089,746 0 0.0%
IRModule.NumIRGlobals 2,190,129 2,190,129 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 60,036,928 60,036,928 0 0.0%
IRModule.NumIRNamedMetaData 88,675 88,675 0 0.0%
IRModule.NumIRValueSymbols 3,823,155 3,823,155 0 0.0%
LLVM.NumLLVMBytesOutput 1,133,624,418 1,133,632,798 8,380 0.0%
Parse.NumFunctionsParsed 167,377 167,377 0 0.0%
Parse.NumIterableDeclContextParsed 1,137,180 1,137,180 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 1,059,948 1,059,948 0 0.0%
SILModule.NumSILGenGlobalVariables 36,144 36,144 0 0.0%
SILModule.NumSILGenVtables 12,239 12,239 0 0.0%
SILModule.NumSILGenWitnessTables 45,226 45,226 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 1,507,833 1,507,833 0 0.0%
SILModule.NumSILOptGlobalVariables 36,998 36,998 0 0.0%
SILModule.NumSILOptVtables 20,265 20,265 0 0.0%
SILModule.NumSILOptWitnessTables 99,223 99,223 0 0.0%
Sema.AttachedFunctionBuilderRequest 0 0 0 0.0%
Sema.AttachedPropertyWrapperTypeRequest 318,305 318,305 0 0.0%
Sema.AttachedPropertyWrappersRequest 1,330,091 1,316,812 -13,279 -1.0%
Sema.CustomAttrNominalRequest 0 0 0 0.0%
Sema.DefaultAndMaxAccessLevelRequest 57,309 57,299 -10 -0.02%
Sema.DefaultDefinitionTypeRequest 5,351 5,351 0 0.0%
Sema.DefaultTypeRequest 320,016 320,016 0 0.0%
Sema.EnumRawTypeRequest 17,174 17,174 0 0.0%
Sema.FunctionBuilderTypeRequest 0 0 0 0.0%
Sema.InheritedTypeRequest 228,405 228,294 -111 -0.05%
Sema.IsDynamicRequest 1,061,084 1,061,084 0 0.0%
Sema.IsGetterMutatingRequest 389,217 389,217 0 0.0%
Sema.IsObjCRequest 1,103,064 1,097,052 -6,012 -0.55%
Sema.IsSetterMutatingRequest 273,166 273,166 0 0.0%
Sema.LazyStoragePropertyRequest 2,420 2,420 0 0.0%
Sema.MangleLocalTypeDeclRequest 246 246 0 0.0%
Sema.NamedLazyMemberLoadFailureCount 21,126 21,147 21 0.1%
Sema.NamedLazyMemberLoadSuccessCount 19,154,882 19,147,176 -7,706 -0.04%
Sema.NominalTypeLookupDirectCount 24,107,775 23,911,341 -196,434 -0.81%
Sema.NumConstraintScopes 17,803,794 17,781,730 -22,064 -0.12%
Sema.NumConstraintsConsideredForEdgeContraction 53,045,447 53,042,709 -2,738 -0.01%
Sema.NumDeclsFinalized 1,317,807 1,317,807 0 0.0%
Sema.NumDeclsTypechecked 870,226 870,226 0 0.0%
Sema.NumDeclsValidated 1,974,037 1,992,770 18,733 0.95%
Sema.NumFunctionsTypechecked 313,511 313,511 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 212,082 211,827 -255 -0.12%
Sema.NumLazyIterableDeclContexts 5,977,537 5,927,920 -49,617 -0.83%
Sema.NumLazyRequirementSignatures 643,812 641,923 -1,889 -0.29%
Sema.NumLazyRequirementSignaturesLoaded 411,869 410,353 -1,516 -0.37%
Sema.NumLeafScopes 11,453,566 11,434,351 -19,215 -0.17%
Sema.NumTypesValidated 1,703,654 1,703,603 -51 -0.0%
Sema.NumUnloadedLazyIterableDeclContexts 3,938,111 3,969,076 30,965 0.79%
Sema.OpaqueReadOwnershipRequest 408,748 410,026 1,278 0.31%
Sema.PropertyWrapperBackingPropertyInfoRequest 316,218 316,218 0 0.0%
Sema.PropertyWrapperBackingPropertyTypeRequest 318,305 318,305 0 0.0%
Sema.PropertyWrapperTypeInfoRequest 0 0 0 0.0%
Sema.RequirementRequest 62,879 62,870 -9 -0.01%
Sema.RequirementSignatureRequest 479,148 477,553 -1,595 -0.33%
Sema.SelfAccessKindRequest 4,140,302 4,141,809 1,507 0.04%
Sema.SetterAccessLevelRequest 90,384 90,384 0 0.0%
Sema.StructuralTypeRequest 0 0 0 0.0%
Sema.SuperclassDeclRequest 324,784 323,057 -1,727 -0.53%
Sema.SuperclassTypeRequest 39,318 39,318 0 0.0%
Sema.TypeCheckFunctionBodyUntilRequest 313,511 313,511 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 30,287 30,277 -10 -0.03%
Sema.UnderlyingTypeDeclsReferencedRequest 169,306 167,650 -1,656 -0.98%

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) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 30,164,373,982,391 30,161,048,306,893 -3,325,675,498 -0.01%
LLVM.NumLLVMBytesOutput 972,402,526 972,401,050 -1,476 -0.0%
time.swift-driver.wall 5093.6s 5098.3s 4.7s 0.09%

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) (21)
name old new delta delta_pct
AST.NumLoadedModules 17,186 17,186 0 0.0%
AST.NumTotalClangImportedEntities 743,528 743,528 0 0.0%
IRModule.NumIRBasicBlocks 3,852,707 3,852,707 0 0.0%
IRModule.NumIRFunctions 1,767,989 1,767,989 0 0.0%
IRModule.NumIRGlobals 1,936,842 1,936,842 0 0.0%
IRModule.NumIRInsts 35,554,850 35,554,850 0 0.0%
IRModule.NumIRValueSymbols 3,444,408 3,444,408 0 0.0%
LLVM.NumLLVMBytesOutput 972,402,526 972,401,050 -1,476 -0.0%
SILModule.NumSILGenFunctions 733,995 733,995 0 0.0%
SILModule.NumSILOptFunctions 981,694 981,694 0 0.0%
Sema.NumConformancesDeserialized 2,237,917 2,237,917 0 0.0%
Sema.NumConstraintScopes 17,493,106 17,493,106 0 0.0%
Sema.NumDeclsDeserialized 6,011,831 6,011,831 0 0.0%
Sema.NumDeclsValidated 1,157,908 1,157,908 0 0.0%
Sema.NumFunctionsTypechecked 318,791 318,791 0 0.0%
Sema.NumGenericSignatureBuilders 178,091 178,091 0 0.0%
Sema.NumLazyGenericEnvironments 1,170,458 1,170,485 27 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 21,540 21,540 0 0.0%
Sema.NumLazyIterableDeclContexts 742,755 742,755 0 0.0%
Sema.NumTypesDeserialized 3,094,727 3,094,727 0 0.0%
Sema.NumTypesValidated 725,323 725,323 0 0.0%

// FIXME: Once accessor synthesis and getInterfaceType() itself are
// request-ified this goes away.
if (!fn->hasValidSignature()) {
S.M->getASTContext().getLazyResolver()->resolveDeclSignature(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you assert that the accessor is synthesized in this case? We definitely do not want any explicitly-written accessors to be skipped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem. However do keep in mind this whole 'if' check will go away at some point.

// If we didn't report an error, but we encountered a property that
// hadn't been type-checked, queue the type for delayed checking.
if (RequireDelayedChecking) {
TC.DelayedCircularityChecks.push_back(OriginalDecl);
Copy link
Member

Choose a reason for hiding this comment

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

w00t!

The idea here is to split up the logic into three parts:

- computation of the final ImplInfo for lazy, property wrappers
  and @NSManaged

- deciding if we should add accessors or not

- actually adding the accessors
Since validateDecl() never calls back into typeCheckDecl(), I think
it's safe to call validateDecl() from circularity checking.
@slavapestov slavapestov force-pushed the prepare-for-finalize-decl-removal branch from 463dcab to a347dce Compare July 16, 2019 18:32
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 62a37d7 into swiftlang:master Jul 16, 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.

4 participants