[PATCH] D22603: [coroutines] Part 1 of N: Documentation

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 20:00:53 PDT 2016


dberris added a comment.

Some questions (not really blockers but I think is worth addressing somewhere):

- Are the coroutines guaranteed to "leak" if they are never run to full completion?
- Is there a way to explicitly "clone" the state of a coroutine so that it can be restored to a previous state? The use case is for running the same suspended coroutine in different threads, perhaps because there's some non-determinism involved.
- Will the escape analysis figure out whether there are resources that need cleaning up once execution has flowed through resume points? Say for example, there's a local variable in the preamble that never gets touched again in the resume points -- will the analysis be able to see that there aren't references anymore in the resume points? i.e. is it possible to do just in lowering, or do you need to teach some of the other optimisations about what the final layout would be for coroutines to be able to make these kinds of optimisations?

I don't know if these should be documented here or somewhere else (and if they're been asked before then apologies for being late to the party).


https://reviews.llvm.org/D22603





More information about the llvm-commits mailing list