-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix two issues related with emission of differentiability witnesses #80983
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
base: main
Are you sure you want to change the base?
Conversation
@swift-ci please test |
Linux build seems to be broken due to unrelated issue:
Windows too:
|
@swift-ci please test |
1 similar comment
@swift-ci please test |
@swift-ci please test |
@swift-ci please test windows platform |
1 similar comment
@swift-ci please test windows platform |
I'm running into this one more often nowadays. Would be great if we could move this PR forward. Is there anything left to do to make the windows tests pass? |
@JaapWijnen windows was just broken on |
@swift-ci please test windows platform |
…lized. We can just re-create one with exactly same parameter and result indices as specialization only touches capture parameters (which are always non-wrt).
…are erased. This way we won't need to check if function is dead each time we canonicalize / emit code for differentiability witnesses later on.
…laration regardless whether derivative body is emitted or not. This handles the cases when the function itself if @inlinable, but the derivative is @usableFromInline, so its body it is not emitted in the module.
@swift-ci please test |
@swift-ci please test macos platform |
1 similar comment
@swift-ci please test macos platform |
I'd love to get this merged and perhaps we can still cherry pick this into 6.2? @clackary |
test/AutoDiff/compiler_crashers_fixed/issue-59135-usableFromInline-VJP.swift
Outdated
Show resolved
Hide resolved
Co-authored-by: Zachary 'Clack' Cole <[email protected]>
@eeckstein @jckarter Any objections on this PR? |
@swift-ci please test |
1 similar comment
@swift-ci please test |
@swift-ci please test windows platform |
@differentiable
attribute or from explicit@derivative(of:)
attribute on the derivative. In the latter case the derivative itself might not be emitted, while original function is (e.g. original function is@inlineable
, but derivative is@usableFromInline
). Previously both cases were handled only when function body was emitted. As a result we missed witness in the aforementioned case. Ensure the differentiability witness originating from@derivative(of:)
is emitted even if we're not going to emit body of the derivative.Fixes #59135