[CoroElide] Remove fallback for frame layout determination
authorNikita Popov <npopov@redhat.com>
Fri, 4 Mar 2022 12:07:58 +0000 (13:07 +0100)
committerNikita Popov <npopov@redhat.com>
Mon, 7 Mar 2022 10:23:02 +0000 (11:23 +0100)
commit1bd33691cb1d10fb118ddf7f9fb305b112f67cbe
tree754e9a9c89d311ffe3cd7b6c77e84c5fbf11f510
parent2d26f163f60ea4a466584a2347ccc09fc1595c76
[CoroElide] Remove fallback for frame layout determination

Only determine the frame layout based on dereferenceable and align
attributes, and remove the type-based fallback, which is incompatible
with opaque pointers. The dereferenceable attribute is required,
while the align attribute uses default alignment of 1 (commonly,
align 1 attributes do not get placed, relying on default alignment).

The CoroSplit pass producing the resume function adds the necessary
attributes in https://github.com/llvm/llvm-project/blob/7daed359111f6d151fef447f520f85ef1dabedf6/llvm/lib/Transforms/Coroutines/CoroSplit.cpp#L840,
and their presence is checked in coro-debug.ll at least.

Differential Revision: https://reviews.llvm.org/D120988
llvm/lib/Transforms/Coroutines/CoroElide.cpp
llvm/test/Transforms/Coroutines/coro-elide-musttail.ll
llvm/test/Transforms/Coroutines/coro-elide-stat.ll
llvm/test/Transforms/Coroutines/coro-elide.ll
llvm/test/Transforms/Coroutines/coro-heap-elide.ll