[PATCH] D101980: [RFC] [Coroutines] Put the contents of byval argument to the frame

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 11 21:58:14 PDT 2021


ChuanqiXu added a comment.

In D101980#2752775 <https://reviews.llvm.org/D101980#2752775>, @rjmccall wrote:

> That are semantically passed by value but "physically" passed as a pointer to a temporary? Yes, absolutely, depending on the target. Example: https://godbolt.org/z/oK1Yadjvq
>
> (I assume you meant "fine".) That's true, no. It is *uncommon* for a type to have a copy/move operation that isn't semantically equivalent to memcpy without also having a non-trivial destructor, but it's absolutely possible, both formally and in practice. Practical examples include relative pointers or structs containing a field signed with address-diversified pointer authentication.

Many thanks to the sharing! Really appreciate it.

> Well, inalloca is a problem, because we actually only ever use inalloca when there's an argument type with a non-trivial copy/move/destroy operation. If you'd like to land a short-term fix just for byref, I think that might be okay while we figure out on llvm-dev what to do in general.

Does it mean `byval` there? I would like to land a short-term fix for `byval` since the other approaches would take a long time.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101980/new/

https://reviews.llvm.org/D101980



More information about the llvm-commits mailing list