This is an archive of the discontinued LLVM Phabricator instance.

llvm.coro.id.async lowering: Parameterize how-to restore the current's continutation context and restart the pipeline after splitting
ClosedPublic

Authored by aschwaighofer on Nov 4 2020, 12:05 PM.

Details

Summary

The llvm.coro.suspend.async intrinsic takes a function pointer as its
argument that describes how-to restore the current continuation's
context from the context argument of the continuation function. Before
we assumed that the current context can be restored by loading from the
context arguments first pointer field (first_arg->caller_context).

This allows for defining suspension points that reuse the current
context for example.

Also:

llvm.coro.id.async lowering: Add llvm.coro.preprare.async intrinsic

Blocks inlining until after the async coroutine was split.

rdar://70097093

Diff Detail

Event Timeline

aschwaighofer created this revision.Nov 4 2020, 12:05 PM
aschwaighofer requested review of this revision.Nov 4 2020, 12:05 PM

Fix Lint errors

Change the async function pointer's context size position

struct async_function_pointer {
  uint32_t relative_function_pointer_to_async_impl;
  uint32_t context_size;
}

And make the position of the async context argument configurable. The
position is specified by the llvm.coro.id.async intrinsic.

Fix a comment to reflect that the async context argument position is now parameterizable

One more lint clang-tidy fix.

Retry with clang-format. test/Other/new-pass-manager.ll passes locally

No change. Retrigger tests.

Both clang/test/CodeGen/lto-newpm-pipeline.c and test/Other/new-pass-manager.ll have been passing locally.

Hmm, those failures also occur on other PRs. I guess we don't keep this bot clean.

https://reviews.llvm.org/D90839

This revision was not accepted when it landed; it landed in state Needs Review.Nov 6 2020, 6:23 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.