-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AutoDiff upstream] Add derivative function SILDeclRefs. #30564
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
`@differentiable` attribute on protocol requirements and non-final class members will produce derivative function entries in witness tables and vtables. This patch adds an optional derivative function configuration (`AutoDiffDerivativeFunctionIdentifier`) to `SILDeclRef` to represent these derivative function entries. Derivative function configurations consist of: - A derivative function kind (JVP or VJP). - Differentiability parameter indices. Resolves TF-1209. Enables TF-1212: upstream derivative function entries in witness tables/vtables.
@slavapestov: would you like to review this patch, as a SIL code owner? |
@swift-ci Please smoke test |
CanGenericSignature derivativeCanGenSig; | ||
if (derivativeGenericSignature) | ||
derivativeCanGenSig = derivativeGenericSignature->getCanonicalSignature(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified after #29105:
CanGenericSignature derivativeCanGenSig; | |
if (derivativeGenericSignature) | |
derivativeCanGenSig = derivativeGenericSignature->getCanonicalSignature(); | |
auto derivativeCanGenSig = derivativeGenericSignature.getCanonicalSignature(); |
I'll land this in a follow-up.
@swift-ci Please smoke test macOS platform |
Both macOS and Linux CI failed mysteriously. Retriggering. |
@swift-ci Please smoke test Linux |
@swift-ci Please test |
SwiftPM tests on Linux seem to have flaked again (for the fourth time): :0: error: module file '/home/buildnode/jenkins/workspace/swift-PR-Linux-smoke-test/branch-master/tmp_swiftpm/ModuleCache/34DIH411VVHZV/CDispatch-E28X8IBKETOX.pcm' is out of date and needs to be rebuilt: signature mismatch 10:31:25 :0: note: imported by module 'CoreFoundation' in '/home/buildnode/jenkins/workspace/swift-PR-Linux-smoke-test/branch-master/tmp_swiftpm/ModuleCache/34DIH411VVHZV/CoreFoundation-1HECCF3FGVFVS.pcm' 10:31:25 :0: error: missing required modules: 'CDispatch', '_SwiftDispatchOverlayShims' 10:31:25 /home/buildnode/jenkins/workspace/swift-PR-Linux-smoke-test/branch-master/swiftpm/Tests/PackageLoadingTests/PDLoadingTests.swift:50: error: PackageDescription4_2LoadingTests.testBasics : failed - 10:31:25 Test Case 'PackageDescription4_2LoadingTests.testBasics' failed (0.778 seconds) 10:31:25 Test Suite 'PackageDescription4_2LoadingTests' failed at 2020-03-22 17:31:06.456 10:31:25 Executed 1 test, with 1 failure (0 unexpected) in 0.778 (0.778) seconds 10:31:25 Test Suite 'Selected tests' failed at 2020-03-22 17:31:06.456 10:31:25 Executed 1 test, with 1 failure (0 unexpected) in 0.778 (0.778) seconds |
Merging to unblock progress. Happy to address feedback later! |
Run `clang-format` on changes in swiftlang#30564.
Run `clang-format` on changes in #30564.
@differentiable
attribute on protocol requirements and non-final class memberswill produce derivative function entries in witness tables and vtables.
This patch adds an optional derivative function configuration
(
AutoDiffDerivativeFunctionIdentifier
) toSILDeclRef
to represent thesederivative function entries.
Derivative function configurations consist of:
Resolves TF-1209.
Enables TF-1212: upstream derivative function entries in witness tables/vtables.
Derivative function
SILDeclRef
examples: