Skip to content

Conversation

eeckstein
Copy link
Contributor

  • When constructing instructions which have substitution maps: initialize those with the canonical SubstitutionMap
  • Also initialize SILFunction::ForwardingSubMap with the canonical one

Non-canonical substitution maps may prevent generic specializations. This fixes a problem in Embedded Swift where an error is given because a function cannot be specialized, although it should.

#83895
rdar://159065157

@eeckstein eeckstein requested review from slavapestov, rjmccall, atrick, meg-gupta, nate-chandler and aidan-hall and removed request for ktoso and xymus August 29, 2025 18:05
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci apple silicon benchmark

* When constructing instructions which have substitution maps: initialize those with the canonical SubstitutionMap
* Also initialize SILFunction::ForwardingSubMap with the canonical one

Non-canonical substitution maps may prevent generic specializations.
This fixes a problem in Embedded Swift where an error is given because a function cannot be specialized, although it should.

swiftlang#83895
rdar://159065157
@eeckstein eeckstein force-pushed the canonical-substitution-maps branch from a30cdbb to 6df033b Compare August 29, 2025 20:31
@eeckstein
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@nate-chandler nate-chandler left a comment

Choose a reason for hiding this comment

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

LGTM

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test macos

@eeckstein eeckstein merged commit 50b5ecf into swiftlang:main Aug 30, 2025
4 of 5 checks passed
@eeckstein eeckstein deleted the canonical-substitution-maps branch August 30, 2025 18:30
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.

2 participants