[PATCH] D104007: [BasicAA] Properly mark that coroutine suspension may modify parameters
Xun Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 11 17:23:53 PDT 2021
lxfind added a comment.
In D104007#2814244 <https://reviews.llvm.org/D104007#2814244>, @efriedma wrote:
> In D104007#2813714 <https://reviews.llvm.org/D104007#2813714>, @efriedma wrote:
>
>>> Do you know if there is a stable contract in IR to tell whether an argument is in fact a callee-owned memory?
>>
>> Argument::hasPassPointeeByValueCopyAttr()
>
> Sorry, that's not right. The question you want to answer here is whether the pointer in the caller points to different memory from the pointer in the callee. The only attribute that causes that is byval, and it's very unlikely we'll ever add any others.
>
> inalloca/preallocated memory is part of the callee stack frame, at a low level. But it's actually allocated in the caller, so from an alias-analysis perspective, it doesn't count as a local allocation like byval would.
hmm sounds like hasPassPointeeByValueCopyAttr() is actually what I need. In CoroSplit, when deciding what to put on the coroutine frame, for arguments, I will need to decide whether it's enough to just put the pointer on the frame, or if I need to copy the content of the pointer (much like allocas) to the frame. Sounds like for inalloca and preallocated memory I still want to copy the content to the frame, not just the pointer.
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