-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Allow normal function results of @yield_once coroutines #69843
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
Tagging @rxwei @BradLarson |
414f7ee
to
848f223
Compare
@rjmccall @hborla @slavapestov @xedin Note that we cannot run the tests as we need to have the corresponding LLVM change in Let me know how this is usually resolved in swift repo. |
What's the corresponding LLVM branch this should be tested against? I think you can do cross-PR testing, for example:
|
Ah, ok. Let me try this! Thanks. |
Please test with swiftlang/llvm-project#7797 |
848f223
to
06ba7b3
Compare
Please test with swiftlang/llvm-project#7797 |
9153998
to
650b0bb
Compare
Please test with swiftlang/llvm-project#7797 |
@rxwei @rjmccall @hborla @slavapestov @xedin |
Hey @asl, apologies for the delay, many folks have been out of office the last few weeks. I'm not the right person to review this change (and I suspect Pavel isn't either; we were only automatically tagged because of the minor change in AST/Types.h). @rjmccall or @jckarter are probably the right reviewers, and they are both OOO this week. |
Thanks! Yeah, waiting mostly for @rjmccall – we discussed this during the last US LLVM Dev Meeting. |
CC: @nate-chandler and @atrick |
c037b2d
to
2ea10a6
Compare
Please test with swiftlang/llvm-project#7797 |
Please test with swiftlang/llvm-project#7797 |
@rjmccall ping |
Please test with swiftlang/llvm-project#7797 |
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.
I'm not sure I get the LLVM IR pattern that we're emitting here. There's a coro.end.results
instruction that may or may not be tied to the coro.end
with the token? What do we do to register the direct results on the unwind path?
Please test with swiftlang/llvm-project#7797 |
Please test with swiftlang/llvm-project#7797 |
@rjmccall Friendly weekly ping. Thanks! |
Please test with swiftlang/llvm-project#7797 |
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.
Alright, let's move forward here.
Thanks a lot! Much appreciated |
Please test with swiftlang/llvm-project#7797 |
Please test with swiftlang/llvm-project#7797 |
…)" This reverts commit aa5b505.
This adds SIL-level support and LLVM codegen for normal results of a coroutine.
The main user of this will be autodiff as VJP of a coroutine must be a coroutine itself (in order to produce the yielded result) and return a pullback closure as a normal result.
The LLVM IR codegen depends on the following patch from LLVM mainline: swiftlang/llvm-project@51d5d7b (that is already a part of apple/llvm-project/next)
For now only direct results are supported, but this seems to be enough for autodiff purposes.