[PATCH] D115545: [Inline] Attempt to delete any discardable if unused functions

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 15 15:52:23 PST 2021


aeubanks added a comment.

In D115545#3192006 <https://reviews.llvm.org/D115545#3192006>, @nikic wrote:

> In D115545#3190357 <https://reviews.llvm.org/D115545#3190357>, @aeubanks wrote:
>
>> this causes compile time regressions due to calling LazyCallGraph::removeDeadFunction() more, seeing if that can be optimized
>
> That seems surprising, what's so expensive about that method?

Weird, I remeasured and it didn't show up as significant anymore.

Now `filterDeadComdatFunctions()` is extremely expensive, which makes sense since we're iterating over every function/global in the module on every inliner run on an SCC. Not sure there's a good way around this unless we start keeping track of comdat users within the comdat.
Shame since this saves a lot of memory of template heavy code: https://llvm-compile-time-tracker.com/compare.php?from=d66323c1ef28104ccf7d72e05954fc1241845a33&to=c0a6e811b81deee725a2eaf37662d7181e11e704&stat=max-rss. Which I actually don't really understand. I would have thought that we're already clearing function analyses due to the recently added eager invalidation flag, and I wouldn't think that the IR itself takes up that much memory compared to analyses, but maybe I'm wrong.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115545



More information about the llvm-commits mailing list