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

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 10:01:28 PDT 2022


mtrofin accepted this revision.
mtrofin added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Analysis/InlineCost.cpp:157
+  if (Attr.isValid()) {
+    int AttrValue;
+    if (!Attr.getValueAsString().getAsInteger(10, AttrValue))
----------------
Nit: can you please initialize `AttrValue` at declaration - just less chances of odd bug chases later.


================
Comment at: llvm/lib/Analysis/InlineCost.cpp:2713
+    if (Optional<int> AttrMaxStackSize =
+            getStringFnAttrAsInt(Caller, "inline-max-stacksize"))
+      FinalStackSizeThreshold = *AttrMaxStackSize;
----------------
nit: make `inline-max-stacksize` a constant so, later, there's less chance of people copying around the free string.


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

https://reviews.llvm.org/D129904



More information about the llvm-commits mailing list