[PATCH] D104007: [BasicAA] Properly mark that coroutine suspension may modify parameters
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 14 11:14:33 PDT 2021
efriedma added a comment.
I don't think you're characterizing the C++ issues correctly.
>From clang's perspective, what it needs to ensure is that every argument is stored in an allocation local to the callee (in other words, allocations corosplit can handle). "allocations corosplit can handle" should be either allocas, or arguments marked byval. These are pointers that don't exist in the caller, so corosplit can mess with the address in memory without worrying about code it can't see in the caller.
Between clang IR generation and corosplit, normal alias analysis should ensure we don't assume arguments allocated in the caller are live past the first coro.suspend. (This might involve ensuring clang doesn't attach certain attributes, like noalias, to the arguments.)
corosplit then takes the alloca/byval allocations, and rewrites them to refer to the coroutine frame.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104007/new/
https://reviews.llvm.org/D104007
More information about the llvm-commits
mailing list