[llvm] AlwaysInliner: Factor out some code in preparation for a future change. (PR #145614)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 25 02:12:28 PDT 2025


================
@@ -30,6 +30,44 @@ using namespace llvm;
 
 namespace {
 
+bool canInlineCallBase(CallBase *CB) {
+  return CB->hasFnAttr(Attribute::AlwaysInline) &&
+         !CB->getAttributes().hasFnAttr(Attribute::NoInline);
+}
+
+bool attemptInlineFunction(
----------------
fhahn wrote:

```suggestion
static bool attemptInlineFunction(
```
Could you also add a brief doc-comment?


https://github.com/llvm/llvm-project/pull/145614


More information about the llvm-commits mailing list