[PATCH] D154007: Reland "Try to implement lambdas with inalloca parameters by forwarding without use of inallocas."

Amy Huang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 28 16:13:40 PDT 2023


akhuang added inline comments.


================
Comment at: clang/lib/CodeGen/CGCall.cpp:5103
 
-        if (Addr.getAlignment() < Align &&
+        if (CallInfo.isDelegateCall()) {
+          NeedCopy = false;
----------------
rnk wrote:
> akhuang wrote:
> > I think the problem is that it tries to do a copy here because the alignment of the forwarding function arg is larger than the alignment of the object that's being passed. I'm not sure how alignments are computed or if there are any other requirements for alignment. Is it ok to just ignore the new alignment? Do we need to change the code that computes the argument alignment?
> > 
> > (crbug.com/1457256#comment2 has an example repro)
> Yes, in general, structs with doubles and i64 members are passed misaligned on i686. This is true for all functions, not just lambdas. We should power down whatever alignment logic is causing the copy.
huh, ok, good to know. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154007



More information about the cfe-commits mailing list