[PATCH] D104184: [Coroutine] Properly deal with byval and noalias parameters
Chuanqi Xu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 14 20:45:59 PDT 2021
ChuanqiXu added a comment.
The overall patch looks good to me.
================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:1141-1142
+ Type *FieldType = S.first->getType();
+ // For byval arguments, we need to store the pointed value in the frame,
+ // not just the pointer itself.
+ if (const Argument *A = dyn_cast<Argument>(S.first))
----------------
>not just the pointer itself.
'instead of the pointer itself' since we wouldn't store the pointer anymore, right?
================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:1605
+ Builder.CreateLoad(Def->getType()->getPointerElementType(), Def);
+ Builder.CreateStore(Value, G);
+ } else {
----------------
lxfind wrote:
> efriedma wrote:
> > Use memcpy to copy large values; load+store results in very inefficient code.
> Good to know. We actually use load+store for all the frame rewrites. We can look at changing all of that in a separate patch.
> Use memcpy to copy large values; load+store results in very inefficient code.
Would the successive pass convert load+store to memcpy?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104184/new/
https://reviews.llvm.org/D104184
More information about the llvm-commits
mailing list