[PATCH] D126715: [coro async] Add code to support dynamic aligment of over-aligned types in async frames
John McCall via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 2 10:18:53 PDT 2022
rjmccall added a comment.
In D126715#3548579 <https://reviews.llvm.org/D126715#3548579>, @jyknight wrote:
> This is rather memory-inefficient, and it's quite a shame that the ABI was defined such as not to pass-down a "context_alignment" field next to "context_size" in the async_function_pointer struct, so that the allocator can DTRT. Oh well...
Increasing the size of async function pointers and complicating the allocation logic are not free. The max alignment used by the ABI is 16 bytes, and the Swift frontend does not normally request alignments larger than that, and I wouldn't expect the places that *do* request it to typically need to persist values across an async suspension (vectorization, for example, generally loses a lot of its punch if you've got calls in the middle of your vectorized kernel), so we're talking about pretty rarified circumstances here; I think the trade-off made by the ABI is appropriate.
I would guess that whatever code pattern triggered this bug does not in fact need the value to persist a value across the suspension, and someone we're just failing to put it on the stack.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126715/new/
https://reviews.llvm.org/D126715
More information about the llvm-commits
mailing list