================
@@ -241,14 +241,18 @@ void CSPreInliner::processFunction(const FunctionId Name) 
{
   ProfiledCandidateQueue CQueue;
   getInlineCandidates(CQueue, FSamples);
 
+  // Candidates left out because the size budget is spent.
+  SmallVector<ProfiledInlineCandidate> OverBudget;
   while (!CQueue.empty()) {
-    // Inlines always_inline callees regardless of the budget.
-    if (FuncFinalSize >= SizeLimit &&
-        !CQueue.top().CalleeSamples->getContext().hasAttribute(
-            ContextAlwaysInline))
-      break;
     ProfiledInlineCandidate Candidate = CQueue.top();
     CQueue.pop();
+    // Inlines always_inline callees regardless of the budget.
----------------
kunalspathak wrote:

This is the part I am not sure about. We are basically inlining cold calls as 
well if they are marked `always_inline`. Sometimes, there can be lot of library 
functions that are all marked as `always_inline` but are cold. Don't think we 
should inline them, specially ignoring the size budget? Perhaps we can inline 
them only as long as it doesn't cross the size budget?

https://github.com/llvm/llvm-project/pull/234094
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to