[PATCH] D104007: [BasicAA] Properly mark that coroutine suspension may modify parameters

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 13 11:53:24 PDT 2021


efriedma added a comment.

In D104007#2815732 <https://reviews.llvm.org/D104007#2815732>, @lxfind wrote:

> It seems that there is no stable contract to tell whether an argument is byval, and it depends on the target. 
> For example: https://godbolt.org/z/YcrYPbMdc
> So we won't be able to fix this just in CoroSplit pass. Either we change the front-end to force all byval arguments to have byval attribute (not sure if that's possible), or we may have to conservatively go with this patch.

I'm not sure what you mean. An LLVM IR argument either has the byval attribute, or it doesn't.  If it does, the allocation belongs to the callee.  If it doesn't, the pointer refers to an allocation constructed in the caller.  There isn't any other sense in which an argument can be "byval".

A given C++ function can have a bunch of variations in the LLVM IR signature, depending on the target, but that's not relevant here.  Once clang is finished emitting IR, the C++ type signature becomes irrelevant.


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