[PATCH] D81765: Don't inline dynamic allocas that simplify to huge static allocas.
JF Bastien via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 23 11:48:36 PDT 2020
jfb added a comment.
In D81765#2090952 <https://reviews.llvm.org/D81765#2090952>, @jfb wrote:
> One thing I'd like to make sure we don't break:
>
> __attribute__((always_inline))
> char *stack_allocate(size_t size) {
> if (size < threshold)
> return alloca(size);
> return malloc(size);
> }
>
>
> This should always inline. Is it still the case? It turns out that we have Important Code which relies on this...
Can you check this?
================
Comment at: llvm/include/llvm/Analysis/InlineCost.h:54
+/// static allocas above this amount in bytes.
+const uint64_t MaxSimplifiedDynamicAllocaToMove = 65536;
} // namespace InlineConstants
----------------
mtrofin wrote:
> I think MaxSimplifiedDynamicAllocaToMove should be part of InlineParams, since it's a threshold.
It probably needs to be a per-target thing, since we want different values for userspace and kernel.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81765/new/
https://reviews.llvm.org/D81765
More information about the llvm-commits
mailing list