[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-14 Thread Amy Huang via Phabricator via cfe-commits
akhuang added a comment. In D136998#3926368 , @efriedma wrote: > In D136998#3926321 , @rnk wrote: > >> In D136998#3906874 , @efriedma >> wrote: >> >>> Should we try to us

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-14 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. In D136998#3926321 , @rnk wrote: > In D136998#3906874 , @efriedma > wrote: > >> Should we try to use this codepath for variadic lambdas as well? > > Yes! > >> Do we want to try to unify

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-14 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. In D136998#3906874 , @efriedma wrote: > Should we try to use this codepath for variadic lambdas as well? Yes! > Do we want to try to unify our cloning code? > CodeGenFunction::GenerateVarArgsThunk has code doing something similar.

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-14 Thread Amy Huang via Phabricator via cfe-commits
akhuang updated this revision to Diff 475269. akhuang added a comment. Fix calling convention of cloned function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136998/new/ https://reviews.llvm.org/D136998 Files: clang/lib/CodeGen/CGClass.cpp c

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-11 Thread Amy Huang via Phabricator via cfe-commits
akhuang added a comment. In D136998#3906881 , @efriedma wrote: > Might also be worth considering if we can avoid cloning here. It should be > possible to emit the lambda body into a separate function with a calling > convention of your choice, and make

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-11 Thread Amy Huang via Phabricator via cfe-commits
akhuang updated this revision to Diff 474889. akhuang marked an inline comment as done. akhuang added a comment. Move cloning code into a function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136998/new/ https://reviews.llvm.org/D136998 Files:

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-03 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. Might also be worth considering if we can avoid cloning here. It should be possible to emit the lambda body into a separate function with a calling convention of your choice, and make both the call operator and the static invoker call it. Repository: rG LLVM Githu

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-03 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. Should we try to use this codepath for variadic lambdas as well? Do we want to try to unify our cloning code? CodeGenFunction::GenerateVarArgsThunk has code doing something similar. (It's at least worth comparing to see if you're doing something significantly differ

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-03 Thread Amy Huang via Phabricator via cfe-commits
akhuang added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:3590-3593 + getTarget().getCXXABI().isMicrosoft() && + llvm::any_of(cast(FD)->parameters(), [&](ParmVarDecl *P) { +return isInAllocaArgument(getCXXABI(), P->getType()); +

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-03 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a subscriber: efriedma. rnk added a comment. +@efriedma, can you review this as a Clang CodeGen owner, according to the recently updated CodeOwners.rst file? https://github.com/llvm/llvm-project/blob/main/clang/CodeOwners.rst#clang-llvm-ir-generation Comment at: clan

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-03 Thread Amy Huang via Phabricator via cfe-commits
akhuang updated this revision to Diff 473082. akhuang added a comment. moved some stuff around Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136998/new/ https://reviews.llvm.org/D136998 Files: clang/lib/CodeGen/CGClass.cpp clang/lib/CodeGen/Co

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-03 Thread Amy Huang via Phabricator via cfe-commits
akhuang added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:3590-3593 + getTarget().getCXXABI().isMicrosoft() && + llvm::any_of(cast(FD)->parameters(), [&](ParmVarDecl *P) { +return isInAllocaArgument(getCXXABI(), P->getType()); +

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-02 Thread Amy Huang via Phabricator via cfe-commits
akhuang added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:3590-3593 + getTarget().getCXXABI().isMicrosoft() && + llvm::any_of(cast(FD)->parameters(), [&](ParmVarDecl *P) { +return isInAllocaArgument(getCXXABI(), P->getType()); +

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-02 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:3590-3593 + getTarget().getCXXABI().isMicrosoft() && + llvm::any_of(cast(FD)->parameters(), [&](ParmVarDecl *P) { +return isInAllocaArgument(getCXXABI(), P->getType()); +

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-02 Thread Amy Huang via Phabricator via cfe-commits
akhuang added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:3590-3593 + getTarget().getCXXABI().isMicrosoft() && + llvm::any_of(cast(FD)->parameters(), [&](ParmVarDecl *P) { +return isInAllocaArgument(getCXXABI(), P->getType()); +

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-02 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: clang/lib/CodeGen/CGClass.cpp:3064 +if (I.getName().equals("this")) { + VMap[&I] = llvm::PoisonValue::get(I.getType()); +} else { Let's use getNullValue instead, just to avoid any complications for msan or ubsa

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-02 Thread Amy Huang via Phabricator via cfe-commits
akhuang updated this revision to Diff 472761. akhuang added a comment. update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136998/new/ https://reviews.llvm.org/D136998 Files: clang/lib/CodeGen/CGClass.cpp clang/lib/CodeGen/CodeGenFunction.h

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-01 Thread Amy Huang via Phabricator via cfe-commits
akhuang updated this revision to Diff 472450. akhuang added a comment. update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136998/new/ https://reviews.llvm.org/D136998 Files: clang/lib/CodeGen/CGClass.cpp clang/lib/CodeGen/CodeGenFunction.h

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-11-01 Thread Amy Huang via Phabricator via cfe-commits
akhuang updated this revision to Diff 472447. akhuang added a comment. update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136998/new/ https://reviews.llvm.org/D136998 Files: clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGClass.cpp clang/

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-10-29 Thread Nuno Lopes via Phabricator via cfe-commits
nlopes added inline comments. Comment at: clang/lib/CodeGen/CGClass.cpp:3080 + if (I.getName().equals("this")) { +VMap[&I] = llvm::UndefValue::get(I.getType()); + } Please use PoisonValue instead whenever possible, as we are trying to remove un

[PATCH] D136998: Try to implement lambdas with inalloca parameters by inlining the call operator function.

2022-10-28 Thread Amy Huang via Phabricator via cfe-commits
akhuang created this revision. Herald added a subscriber: nlopes. Herald added a project: All. akhuang requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D136998 Files: clang/l