[PATCH] D129904: [Inline] Introduce function attribute to control maximum stack size of inlined functions

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 14:15:56 PDT 2022


wolfgangp created this revision.
wolfgangp added reviewers: aeubanks, mtrofin, davidxl.
Herald added subscribers: ChuanqiXu, haicheng, hiraditya.
Herald added a project: All.
wolfgangp requested review of this revision.
Herald added a project: LLVM.

In D128454 <https://reviews.llvm.org/D128454> a backend option was introduced to control the maximum stack size of inlined functions (-mllvm -inline-max-stacksize=<N>).

It seems advantageous to implement this functionality via a function attribute in order to make it work smoothly for LTO, while retaining the ability to override the value on the command line.

Note that the attribute pertains to the caller and not the callee, i.e. if function foo() has the attribute, it means "don't inline any function with a stacksize larger than the given value".

If this is OK, I'll follow up with a clang patch that sets the attribute based on a command line option.


https://reviews.llvm.org/D129904

Files:
  llvm/lib/Analysis/InlineCost.cpp
  llvm/test/Transforms/Inline/inline-stacksize.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129904.445120.patch
Type: text/x-patch
Size: 3129 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220715/0be34b5a/attachment.bin>


More information about the llvm-commits mailing list