-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SIL] Teach *ApplyInst to traffic in SubstitutionMap. #16400
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
[SIL] Teach *ApplyInst to traffic in SubstitutionMap. #16400
Conversation
be1c07c
to
2e07c7b
Compare
I've (again) hit a steady state where things build with this change, so let's see how it performs. |
@swift-ci please test |
@swift-ci please test source compatibility |
@swift-ci please smoke test compiler performance |
@swift-ci please benchmark |
Build failed |
@swift-ci please test compiler performance |
Build comment file:Optimized (O)Regression (1)
Improvement (1)
No Changes (425)
Unoptimized (Onone)Regression (5)
Improvement (10)
No Changes (412)
Hardware Overview
|
Build comment file:Summary for master fullUnexpected test results, excluded stats for ProcedureKit, StencilSwiftKit, ObjectMapper, Core Regressions found (see below) Debug-batchdebug-batch briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
debug-batch detailedRegressed (2)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (71)
Releaserelease briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
release detailedRegressed (0)
Improved (1)
Unchanged (delta < 1.0% or delta < 100.0ms) (22)
|
Push SubstitutionMaps through most of SILGen and the SIL optimizers that involve the various *ApplyInsts.
…ters. SubstitutionMap::lookupSubstitution() assumed that any type parameter it was given would already be canonical, and fail (return a null Type) when given a type parameter that was equivalent to another type parameter but is not itself canonical. Canonicalize, recursive, and record the replacement type appropriately.
Introduce an operation to check that a given substitution map is non-empty (i.e., corresponds to a generic signature) and that the generic signature has type parameters that aren’t bound to concrete types. This is the appropriate predicate for SIL-and-later to determine whether there will be any substitutions.
…nMap. SIL printing and parsing was based on printing substitution lists. Change that to instead print/parse based on the replacement types in substitution maps, which fits more closely with the rest of the system. This commit is papering over an issue where the substitution maps generated for the “apply” of a partial specialization use an ever-so-slightly different generic signature than partial specialization itself. The TODO in the SIL printer for covers that case.
3c02380
to
c009650
Compare
@swift-ci please test |
Push SubstitutionMaps through most of SILGen, the SIL optimizers, and much of IRGen
that involve the various *ApplyInsts. Overall this eliminates ~100 more explicit uses of
SubstitutionList
, and plumbs substitution maps through most of the infrastructure.