[PATCH] D132275: [clang] Create alloca to pass into static lambda

2023-06-08 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. > The first argument in the call is an undef but the argument type is also > marked as noundef, so this is unreachable It looks like your code was getting miscompiled? If I'm understanding correctly, without this patch, we assume the lambda body is unreachable, and s

[PATCH] D132275: [clang] Create alloca to pass into static lambda

2023-06-08 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. Ok here's some of my findings. So there's a step in the attributor where it replaces some instructions with `unreachable`. One step is: *** IR Dump Before AttributorPass on [module] *** ; Function Attrs: inlinehint minsize nounwind optsize define linkonce_odr d

[PATCH] D132275: [clang] Create alloca to pass into static lambda

2023-06-05 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. > EmitLambdaDelegatingInvokeBody emit an always_inline hint To clarify, I mean on the call instruction, not on either function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132275/new/ https://reviews.llvm.org/D132275 _

[PATCH] D132275: [clang] Create alloca to pass into static lambda

2023-06-05 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. Possibly the alloca doesn't get eliminated, or doesn't get eliminated early enough for attributor to kick in. Not sure what context would make that significant, off the top of my head. Is the lambda in question defined in an inline function (linkonce_odr)? Maybe we

[PATCH] D132275: [clang] Create alloca to pass into static lambda

2023-06-02 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added subscribers: jdoerfert, leonardchan. leonardchan added a comment. Hi. For an embedded device, prior to this patch, we used to be able to see a significant savings of 28kB when we enabled the attributor. But with this patch, we don't see these savings anymore when enabling the a

[PATCH] D132275: [clang] Create alloca to pass into static lambda

2022-08-23 Thread Vitaly Buka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb5a9adf1f533: [clang] Create alloca to pass into static lambda (authored by vitalybuka). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132275/new/ https://r

[PATCH] D132275: [clang] Create alloca to pass into static lambda

2022-08-23 Thread Eli Friedman via Phabricator via cfe-commits
efriedma accepted this revision. efriedma added a comment. This revision is now accepted and ready to land. LGTM (We might want to consider messing with the rules for calling lambdas that don't capture anything, since there's no way to actually access it from the lambda body. But it's unlikely

[PATCH] D132275: [clang] Create alloca to pass into static lambda

2022-08-22 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 454629. vitalybuka added a comment. new line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132275/new/ https://reviews.llvm.org/D132275 Files: clang/lib/CodeGen/CGClass.cpp clang/test/CodeGenCXX/lambda-

[PATCH] D132275: [clang] Create alloca to pass into static lambda

2022-08-22 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 454628. vitalybuka added a comment. created alloca instead of changing attributes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132275/new/ https://reviews.llvm.org/D132275 Files: clang/lib/CodeGen/CGClas