In generating the code for symmetric transfer, a temporary object is created to store the returned handle from await_suspend() call of the awaiter. Previously this temp won't be cleaned up until very later, which ends up causing this temp to be spilled to the heap. However, we know that this temp will no longer be needed after we obtained the address. We can clean it up right after the call to address member.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Not sure how to add a test case for this though. We don't seem to explicitly test AST output.
Comment Actions
hmm @rjmccall, I don't think there is a stable way to test this. The code generated for symmetric transfer is way too complicated to stably pattern match one less item in the frame.
Comment Actions
I don't know that much about the code-generation here, but when cleanups escape into a surrounding scope, you can usually test that the cleanup is emitted before some call tied to a later statement in that scope. You don't have to test for every last instruction in the function.