Skip to content
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

[SR-13670] Sema/SILGen: lower @derivative attribute directly to SIL differentiability witnesses #53952

Closed
dan-zheng opened this issue Oct 1, 2019 · 3 comments
Assignees

Comments

@dan-zheng
Copy link
Collaborator

Previous ID SR-13670
Radar None
Original Reporter @dan-zheng
Type Sub-task
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s
Labels Sub-task
Assignee @dan-zheng
Priority Medium

md5: e5ce47fd74f7fc29e2c2f821747e676e

Parent-Task:

  • SR-13659 Retroactive derivative registration

is blocked by:

  • SR-13669 Differentiation: revamp transform to directly canonicalize differentiability witnesses

relates to:

  • TF-1037 [AD] Crash for @differentiable + @derivative attributes with different derivative generic signatures
  • TF-1042 [AD] RemoveASTContext::{Differentiable,Derivative}Attrs

Issue Description:

Do not generate implicit @differentiable attributes during @derivative attribute type-checking. This was a hack and recently caused problems in ASTScopeLookup logic (TF-815).

Instead, directly lower @derivative attributes to SIL differentiability witnesses during SILGen.

@dan-zheng
Copy link
Collaborator Author

I investigated this as part of SIL differentiability witnesses (TF-866). Changing attribute type-checking to not generate implicit @differentiable attributes was fine.
It seems blocked by SILGen: it is important that SIL [differentiable] attributes are generated in SILFunctionBuilder::addFunctionAttributes, and it's not clear how to do this if we remove implicit @differentiable attributes. This will likely be blocked until SIL differentiability witnesses are done.

@dan-zheng
Copy link
Collaborator Author

WIP at https://github.com/dan-zheng/swift/commits/derivative-attr-silgen.
The change is straightforward but is blocked by TF-1024: changing the differentiation transform to directly canonicalize differentiability witnesses instead of SIL [differentiable] attributes.

@dan-zheng
Copy link
Collaborator Author

Done in #28621
@derivative attribute is SILGen'd directly to differentiability witnesses and no longer generates implicit @differentiable attribute.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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

No branches or pull requests

1 participant