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

[NFC] Update coroutine intrinsics documentation and few remaining tests to opaque pointers #65698

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

asl
Copy link
Collaborator

@asl asl commented Sep 7, 2023

No description provided.

@asl asl requested a review from nikic September 7, 2023 23:29
@asl asl requested a review from a team as a code owner September 7, 2023 23:29
@github-actions github-actions bot added the coroutines C++20 coroutines label Sep 7, 2023
@asl
Copy link
Collaborator Author

asl commented Sep 7, 2023

I kept few no-op ptr->ptr bitcasts in order not to rename unnamed values

Copy link
Member

@ChuanqiXu9 ChuanqiXu9 left a comment

Choose a reason for hiding this comment

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

LGTM.

@asl asl requested a review from a team as a code owner September 8, 2023 16:26
@asl asl merged commit 1a0cbb9 into llvm:main Sep 8, 2023
2 checks passed
@asl asl deleted the coro-doc-opaque-ptr branch September 8, 2023 19:32
asl added a commit to asl/llvm-project that referenced this pull request Feb 5, 2024
asl added a commit to asl/llvm-project that referenced this pull request Mar 22, 2024
rxwei pushed a commit to apple/llvm-project that referenced this pull request Mar 27, 2024
* Update coroutine intrinsics documentation and few remaining tests to opaque pointers (llvm#65698)

* Extend `retcon.once` coroutines lowering to optionally produce a normal result (llvm#66333)

One of the main user of these kind of coroutines is swift. There yield-once (`retcon.once`) coroutines are used to temporary "expose" pointers to internal fields of various objects creating borrow scopes.

However, in some cases it might be useful also to allow these coroutines to produce a normal result, but there is no convenient way to represent this (as compared to switched-resume kind of coroutines where C++ `co_return` is transformed to a member / callback call on promise object).

The extension is simple: we allow continuation function to have a non-void result and accept optional extra arguments via a special `llvm.coro.end.result` intrinsic that would essentially forward them as normal results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coroutines C++20 coroutines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants