Skip to content

[NameLookup] Add requests for module and AnyObject lookup #28395

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

Conversation

hamishknight
Copy link
Contributor

Add LookupInModuleRequest for module-level lookup, and AnyObjectLookupRequest for AnyObject lookup.

@hamishknight hamishknight requested a review from CodaFi November 21, 2019 01:11
@hamishknight hamishknight changed the base branch from swift-incremental-dependency-tracking to master November 21, 2019 01:20
@swiftlang swiftlang deleted a comment from swift-ci Nov 21, 2019
@swiftlang swiftlang deleted a comment from swift-ci Nov 21, 2019
@swiftlang swiftlang deleted a comment from swift-ci Nov 21, 2019
@swiftlang swiftlang deleted a comment from swift-ci Nov 21, 2019
@hamishknight hamishknight changed the base branch from master to swift-incremental-dependency-tracking November 21, 2019 03:18
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test compiler performance

@CodaFi
Copy link
Contributor

CodaFi commented Nov 21, 2019

@swift-ci please test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - f12de1ab2ba3244a475170769ee6e0d7ee443c86

@@ -15,6 +15,9 @@
//
//===----------------------------------------------------------------------===//

// Used to escape commas used within template arguments.
#define COMMA ,
Copy link
Contributor

Choose a reason for hiding this comment

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

Clever, but can we use a using declaration or a separate type to help out here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CodaFi Hmm, I guess for now we could just declare something using QualifiedLookupResult = SmallVector<ValueDecl *, 4>. It might make sense to eventually return LookupResult for both qualified and unqualified lookups though, what do you think?

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

@swift-ci
Copy link
Contributor

Summary for master full

Unexpected test results, excluded stats for RxCocoa, SwifterSwift, Base64CoderSwiftUI

Regressions found (see below)

Debug-batch

debug-batch brief

Regressed (1)
name old new delta delta_pct
time.swift-driver.wall 3042.2s 3096.2s 54.0s 1.77% ⛔
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 40,529,704,962,202 40,529,476,232,972 -228,729,230 -0.0%
LLVM.NumLLVMBytesOutput 1,783,408,588 1,783,416,508 7,920 0.0%

debug-batch detailed

Regressed (0)
name old new delta delta_pct
Improved (5)
name old new delta delta_pct
AST.NumLookupInModule 5,340,980 0 -5,340,980 -100.0% ✅
AST.NumLookupQualifiedInAnyObject 291 0 -291 -100.0% ✅
AST.NumSourceLinesPerSecond 4,555,450 4,492,838 -62,612 -1.37% ✅
Driver.NumDriverPipePolls 107,549 106,319 -1,230 -1.14% ✅
Driver.NumDriverPipeReads 99,203 97,878 -1,325 -1.34% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (197)
name old new delta delta_pct
AST.ImportSetCacheHit 1,626,017 1,625,820 -197 -0.01%
AST.ImportSetCacheMiss 592,888 592,890 2 0.0%
AST.ImportSetFoldHit 289,556 289,548 -8 -0.0%
AST.ImportSetFoldMiss 303,332 303,342 10 0.0%
AST.ModuleShadowCacheHit 1,951 1,951 0 0.0%
AST.ModuleShadowCacheMiss 1,512 1,512 0 0.0%
AST.ModuleVisibilityCacheHit 28,593 28,593 0 0.0%
AST.ModuleVisibilityCacheMiss 6,441 6,441 0 0.0%
AST.NumASTBytesAllocated 49,440,129,324 49,519,382,332 79,253,008 0.16%
AST.NumASTScopeLookups 3,413,025 3,413,043 18 0.0%
AST.NumBraceStmtASTScopeExpansions 612,040 612,040 0 0.0%
AST.NumBraceStmtASTScopes 612,040 612,040 0 0.0%
AST.NumDecls 138,608 138,608 0 0.0%
AST.NumDependencies 285,649 285,696 47 0.02%
AST.NumInfixOperators 53,324 53,324 0 0.0%
AST.NumIterableTypeBodyASTScopeExpansions 222,410 222,409 -1 -0.0%
AST.NumIterableTypeBodyASTScopes 271,252 271,272 20 0.01%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 266,034 266,034 0 0.0%
AST.NumLocalTypeDecls 250 250 0 0.0%
AST.NumLookupQualifiedInModule 2,353,062 2,348,410 -4,652 -0.2%
AST.NumLookupQualifiedInNominal 7,107,383 7,109,611 2,228 0.03%
AST.NumModuleLookupClassMember 7,167 7,167 0 0.0%
AST.NumModuleLookupValue 40,675,600 40,671,332 -4,268 -0.01%
AST.NumObjCMethods 24,210 24,210 0 0.0%
AST.NumPostfixOperators 49 49 0 0.0%
AST.NumPrecedenceGroups 25,489 25,489 0 0.0%
AST.NumPrefixOperators 99 99 0 0.0%
AST.NumReferencedDynamicNames 199 199 0 0.0%
AST.NumReferencedMemberNames 6,262,021 6,262,021 0 0.0%
AST.NumReferencedTopLevelNames 473,493 473,493 0 0.0%
AST.NumSourceBuffers 309,939 309,939 0 0.0%
AST.NumSourceLines 4,663,327 4,663,327 0 0.0%
AST.NumTotalClangImportedEntities 4,824,751 4,823,595 -1,156 -0.02%
Driver.ChildrenMaxRSS 226,522,558,464 227,338,285,056 815,726,592 0.36%
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 27,665 27,665 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.MaxMallocUsage 854,849,270,648 855,261,171,976 411,901,328 0.05%
Frontend.NumInstructionsExecuted 40,529,704,962,202 40,529,476,232,972 -228,729,230 -0.0%
Frontend.NumProcessFailures 0 0 0 0.0%
IRModule.NumIRAliases 195,441 195,441 0 0.0%
IRModule.NumIRBasicBlocks 6,782,789 6,782,789 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 3,333,154 3,333,154 0 0.0%
IRModule.NumIRGlobals 3,624,490 3,624,490 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 87,038,813 87,038,813 0 0.0%
IRModule.NumIRNamedMetaData 133,585 133,585 0 0.0%
IRModule.NumIRValueSymbols 6,306,499 6,306,499 0 0.0%
LLVM.NumLLVMBytesOutput 1,783,408,588 1,783,416,508 7,920 0.0%
Parse.NumFunctionsParsed 265,969 265,969 0 0.0%
Parse.NumIterableDeclContextParsed 586,070 586,072 2 0.0%
Parse.ParseAbstractFunctionBodyRequest 247,316 247,316 0 0.0%
Parse.ParseMembersRequest 459,060 459,062 2 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 1,695,666 1,695,666 0 0.0%
SILModule.NumSILGenGlobalVariables 52,820 52,820 0 0.0%
SILModule.NumSILGenVtables 18,505 18,505 0 0.0%
SILModule.NumSILGenWitnessTables 71,484 71,484 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 2,433,591 2,433,591 0 0.0%
SILModule.NumSILOptGlobalVariables 54,444 54,444 0 0.0%
SILModule.NumSILOptVtables 31,180 31,180 0 0.0%
SILModule.NumSILOptWitnessTables 156,521 156,521 0 0.0%
Sema.AbstractGenericSignatureRequest 30,201 30,201 0 0.0%
Sema.AccessLevelRequest 10,506,661 10,532,003 25,342 0.24%
Sema.AreAllStoredPropertiesDefaultInitableRequest 20,785 20,785 0 0.0%
Sema.AttachedFunctionBuilderRequest 3 3 0 0.0%
Sema.AttachedPropertyWrapperTypeRequest 537,014 537,014 0 0.0%
Sema.AttachedPropertyWrappersRequest 2,146,332 2,146,330 -2 -0.0%
Sema.ClassAncestryFlagsRequest 93,794 93,794 0 0.0%
Sema.CollectOverriddenDeclsRequest 6,194,025 6,206,687 12,662 0.2%
Sema.CompareDeclSpecializationRequest 456,037 455,875 -162 -0.04%
Sema.CursorInfoRequest 0 0 0 0.0%
Sema.CustomAttrNominalRequest 3 3 0 0.0%
Sema.DefaultAndMaxAccessLevelRequest 52,637 52,639 2 0.0%
Sema.DefaultArgumentExprRequest 36,691 36,691 0 0.0%
Sema.DefaultArgumentInitContextRequest 452 452 0 0.0%
Sema.DefaultDefinitionTypeRequest 7,620 7,620 0 0.0%
Sema.DefaultTypeRequest 458,277 458,277 0 0.0%
Sema.EmittedMembersRequest 25,617 25,617 0 0.0%
Sema.EnumRawTypeRequest 21,037 21,037 0 0.0%
Sema.EnumRawValuesRequest 10,654 10,654 0 0.0%
Sema.ExistentialConformsToSelfRequest 19,259 19,244 -15 -0.08%
Sema.ExistentialTypeSupportedRequest 15,672 15,672 0 0.0%
Sema.ExpandASTScopeRequest 6,281,110 6,281,116 6 0.0%
Sema.ExtendedNominalRequest 470,079 470,079 0 0.0%
Sema.ExtendedTypeRequest 73,761 73,761 0 0.0%
Sema.FunctionBuilderTypeRequest 3 3 0 0.0%
Sema.FunctionOperatorRequest 50,383 50,383 0 0.0%
Sema.GenericParamListRequest 8,537,227 8,552,000 14,773 0.17%
Sema.GenericSignatureRequest 2,634,917 2,634,848 -69 -0.0%
Sema.GetDestructorRequest 26,172 26,172 0 0.0%
Sema.HasCircularInheritanceRequest 22,286 22,286 0 0.0%
Sema.HasCircularInheritedProtocolsRequest 9,916 9,916 0 0.0%
Sema.HasCircularRawValueRequest 8,437 8,437 0 0.0%
Sema.HasDefaultInitRequest 50,736 50,736 0 0.0%
Sema.HasDynamicMemberLookupAttributeRequest 0 0 0 0.0%
Sema.HasMemberwiseInitRequest 18,948 18,948 0 0.0%
Sema.HasUserDefinedDesignatedInitRequest 50,746 50,746 0 0.0%
Sema.InferredGenericSignatureRequest 160,175 160,172 -3 -0.0%
Sema.InheritedDeclsReferencedRequest 4,940,315 4,944,489 4,174 0.08%
Sema.InheritedTypeRequest 269,739 269,611 -128 -0.05%
Sema.InheritsSuperclassInitializersRequest 25,931 25,931 0 0.0%
Sema.InitKindRequest 90,373 90,373 0 0.0%
Sema.InterfaceTypeRequest 12,564,001 12,577,170 13,169 0.1%
Sema.IsABICompatibleOverrideRequest 134,394 134,394 0 0.0%
Sema.IsAccessorTransparentRequest 305,685 305,685 0 0.0%
Sema.IsDeclApplicableRequest 0 0 0 0.0%
Sema.IsDynamicRequest 1,675,746 1,675,746 0 0.0%
Sema.IsFinalRequest 2,394,745 2,395,862 1,117 0.05%
Sema.IsGetterMutatingRequest 413,997 413,997 0 0.0%
Sema.IsImplicitlyUnwrappedOptionalRequest 2,364,895 2,363,902 -993 -0.04%
Sema.IsObjCRequest 1,485,442 1,485,796 354 0.02%
Sema.IsSetterMutatingRequest 337,052 337,052 0 0.0%
Sema.IsStaticRequest 2,995,323 2,995,566 243 0.01%
Sema.LazyStoragePropertyRequest 2,114 2,114 0 0.0%
Sema.LookupPrecedenceGroupRequest 173,735 173,735 0 0.0%
Sema.MangleLocalTypeDeclRequest 500 500 0 0.0%
Sema.NamedLazyMemberLoadFailureCount 17,551 17,556 5 0.03%
Sema.NamedLazyMemberLoadSuccessCount 27,384,585 27,382,157 -2,428 -0.01%
Sema.NamingPatternRequest 173,698 173,696 -2 -0.0%
Sema.NeedsNewVTableEntryRequest 653,268 653,268 0 0.0%
Sema.NominalTypeLookupDirectCount 33,777,761 33,788,819 11,058 0.03%
Sema.NumAccessorBodiesSynthesized 187,565 187,565 0 0.0%
Sema.NumAccessorsSynthesized 275,522 275,522 0 0.0%
Sema.NumConformancesDeserialized 7,908,690 7,920,348 11,658 0.15%
Sema.NumConstraintScopes 27,156,647 27,157,234 587 0.0%
Sema.NumConstraintsConsideredForEdgeContraction 86,398,116 86,398,250 134 0.0%
Sema.NumCyclicOneWayComponentsCollapsed 0 0 0 0.0%
Sema.NumDeclsDeserialized 60,891,340 60,960,178 68,838 0.11%
Sema.NumDeclsTypechecked 1,402,174 1,402,174 0 0.0%
Sema.NumFunctionsTypechecked 527,249 527,249 0 0.0%
Sema.NumGenericSignatureBuilders 1,157,035 1,157,732 697 0.06%
Sema.NumLazyIterableDeclContexts 7,301,876 7,305,877 4,001 0.05%
Sema.NumLazyRequirementSignatures 725,220 725,472 252 0.03%
Sema.NumLazyRequirementSignaturesLoaded 490,582 490,819 237 0.05%
Sema.NumLeafScopes 17,412,551 17,413,174 623 0.0%
Sema.NumTypesDeserialized 17,989,551 18,001,586 12,035 0.07%
Sema.NumTypesValidated 1,352,835 1,352,834 -1 -0.0%
Sema.NumUnloadedLazyIterableDeclContexts 4,443,164 4,442,047 -1,117 -0.03%
Sema.OpaqueReadOwnershipRequest 261,200 261,200 0 0.0%
Sema.OpaqueResultTypeRequest 0 0 0 0.0%
Sema.OperatorPrecedenceGroupRequest 747 747 0 0.0%
Sema.OverriddenDeclsRequest 2,214,762 2,214,457 -305 -0.01%
Sema.ParamSpecifierRequest 1,171,841 1,171,842 1 0.0%
Sema.PatternBindingEntryRequest 431,422 431,420 -2 -0.0%
Sema.PreCheckFunctionBuilderRequest 0 0 0 0.0%
Sema.PropertyWrapperBackingPropertyInfoRequest 532,059 532,059 0 0.0%
Sema.PropertyWrapperBackingPropertyTypeRequest 537,014 537,014 0 0.0%
Sema.PropertyWrapperMutabilityRequest 609,555 609,555 0 0.0%
Sema.PropertyWrapperTypeInfoRequest 1 1 0 0.0%
Sema.ProtocolRequiresClassRequest 58,158 58,024 -134 -0.23%
Sema.ProvideDefaultImplForRequest 6,194,025 6,206,687 12,662 0.2%
Sema.RangeInfoRequest 0 0 0 0.0%
Sema.RequirementRequest 105,801 105,802 1 0.0%
Sema.RequirementSignatureRequest 549,421 549,534 113 0.02%
Sema.RequiresOpaqueAccessorsRequest 1,290,496 1,290,496 0 0.0%
Sema.RequiresOpaqueModifyCoroutineRequest 251,174 251,174 0 0.0%
Sema.ResilienceExpansionRequest 1,673,689 1,673,689 0 0.0%
Sema.ResolveImplicitMemberRequest 2,930,211 2,931,364 1,153 0.04%
Sema.ResolveProtocolNameRequest 0 0 0 0.0%
Sema.ResultTypeRequest 623,365 623,363 -2 -0.0%
Sema.RootAndResultTypeOfKeypathDynamicMemberRequest 0 0 0 0.0%
Sema.RootTypeOfKeypathDynamicMemberRequest 0 0 0 0.0%
Sema.SelfAccessKindRequest 765,776 765,845 69 0.01%
Sema.SelfBoundsFromWhereClauseRequest 6,540,156 6,545,720 5,564 0.09%
Sema.SetterAccessLevelRequest 141,318 141,318 0 0.0%
Sema.StorageImplInfoRequest 1,376,802 1,376,802 0 0.0%
Sema.StoredPropertiesAndMissingMembersRequest 29,625 29,625 0 0.0%
Sema.StoredPropertiesRequest 288,501 288,501 0 0.0%
Sema.StructuralTypeRequest 2,028 2,028 0 0.0%
Sema.SuperclassDeclRequest 384,400 384,422 22 0.01%
Sema.SuperclassTypeRequest 48,364 48,364 0 0.0%
Sema.SynthesizeAccessorRequest 275,522 275,522 0 0.0%
Sema.SynthesizeDefaultInitRequest 4,743 4,743 0 0.0%
Sema.SynthesizeMemberwiseInitRequest 3,024 3,024 0 0.0%
Sema.TypeCheckFunctionBodyUntilRequest 527,249 527,249 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 28,288 28,290 2 0.01%
Sema.TypeRelationCheckRequest 0 0 0 0.0%
Sema.TypeWitnessRequest 7,842 7,842 0 0.0%
Sema.USRGenerationRequest 7,456,139 7,469,216 13,077 0.18%
Sema.UnderlyingTypeDeclsReferencedRequest 219,542 219,472 -70 -0.03%
Sema.UnderlyingTypeRequest 32,678 32,678 0 0.0%
Sema.UnqualifiedLookupRequest 3,569,720 3,569,738 18 0.0%
Sema.ValueWitnessRequest 62,259 62,259 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) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 49,634,497,647,641 49,641,895,577,338 7,397,929,697 0.01%
LLVM.NumLLVMBytesOutput 1,931,613,148 1,931,613,176 28 0.0%
time.swift-driver.wall 5515.0s 5533.4s 18.5s 0.34%

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) (18)
name old new delta delta_pct
AST.NumLoadedModules 29,851 29,851 0 0.0%
AST.NumTotalClangImportedEntities 1,207,954 1,207,954 0 0.0%
IRModule.NumIRBasicBlocks 5,472,320 5,472,320 0 0.0%
IRModule.NumIRFunctions 2,836,584 2,836,584 0 0.0%
IRModule.NumIRGlobals 3,150,300 3,150,300 0 0.0%
IRModule.NumIRInsts 53,158,052 53,158,052 0 0.0%
IRModule.NumIRValueSymbols 5,633,592 5,633,592 0 0.0%
LLVM.NumLLVMBytesOutput 1,931,613,148 1,931,613,176 28 0.0%
SILModule.NumSILGenFunctions 1,181,557 1,181,557 0 0.0%
SILModule.NumSILOptFunctions 1,730,977 1,730,977 0 0.0%
Sema.NumConformancesDeserialized 3,583,837 3,583,837 0 0.0%
Sema.NumConstraintScopes 26,617,400 26,617,400 0 0.0%
Sema.NumDeclsDeserialized 10,308,455 10,308,455 0 0.0%
Sema.NumFunctionsTypechecked 527,886 527,886 0 0.0%
Sema.NumGenericSignatureBuilders 277,999 277,999 0 0.0%
Sema.NumLazyIterableDeclContexts 1,308,043 1,308,043 0 0.0%
Sema.NumTypesDeserialized 5,175,146 5,175,146 0 0.0%
Sema.NumTypesValidated 817,852 817,852 0 0.0%

@hamishknight
Copy link
Contributor Author

Looks like source compat failures are for configurations which are XFAIL'ed on master.

We now have an equivalent counter for
LookupInModuleRequest.
We now have an equivalent counter for
AnyObjectLookupRequest.
@hamishknight
Copy link
Contributor Author

@swift-ci please smoke test

@hamishknight
Copy link
Contributor Author

Just noticed the compiler benchmark doesn't realize that a higher AST.NumSourceLinesPerSecond is better, so it thinks we have a speedup :D

@hamishknight hamishknight merged commit ddaf82d into swiftlang:swift-incremental-dependency-tracking Nov 22, 2019
@hamishknight hamishknight deleted the lookup-requests branch November 22, 2019 22:51
@hamishknight hamishknight restored the lookup-requests branch December 11, 2019 00:02
@hamishknight hamishknight deleted the lookup-requests branch December 11, 2019 15:15
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.

3 participants