[PATCH] D98481: [Inliner] Do not inline mutual-recursive functions to avoid exponential size growth.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 15 23:56:26 PDT 2021


davidxl added a comment.

Without guarding the caller size, this (over topdown inlining) can also potentially happen without recursion.

This patch seems too aggressive. One possible way to handle it is to restrict inlining to a node N in non trivial SCC when node N has >1 fan-out (edges) to other nodes in the same SCC -- the large fan-out is the reason for the excessive growth.



================
Comment at: llvm/lib/Transforms/IPO/Inliner.cpp:809
+      auto CalleeSCC = CG.lookupSCC(*CG.lookup(Callee));
       if (CG.lookupSCC(*CG.lookup(Callee)) == C &&
           UR.InlinedInternalEdges.count({&N, C})) {
----------------
if (CalleeSCC == C) &&


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98481



More information about the llvm-commits mailing list