[llvm] [Inliner] Put inline history into IR as !inline_history metadata (PR #190092)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 09:15:07 PDT 2026


================
@@ -367,9 +349,19 @@ PreservedAnalyses InlinerPass::run(LazyCallGraph::SCC &InitialC,
           &FAM.getResult<BlockFrequencyAnalysis>(*(CB->getCaller())),
           &FAM.getResult<BlockFrequencyAnalysis>(Callee));
 
+      // For compile time reasons we try to only track inline history for the
+      // calls where it may actually prevent inlining, which is inlining through
+      // an SCC. This can happen if the callee is in a non-trivial SCC/RefSCC,
+      // or if an inlined call site was an indirect call, which can be
+      // devirtualized to call any target. The indirect call case is handled
+      // within InlineFunction.
----------------
nikic wrote:

Why is the second case (devirtualized call) not handled by being in a non-trivial RefSCC? I thought RefSCC exists to handle things like that.

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


More information about the llvm-commits mailing list