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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 16 03:30:47 PST 2021


nikic added a comment.

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

> In D115545#3196100 <https://reviews.llvm.org/D115545#3196100>, @aeubanks wrote:
>
>> 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.
>
> Keeping track of users makes sense to me, and doesn't seem overly complicated. I've put up a prototype at D115864 <https://reviews.llvm.org/D115864>.

Though testing that patch with this one the compile-time impact seems to be about the same, so either I did something wrong or the problem isn't with the comdat scan.


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