[PATCH] D110784: Manually create unique_ptr in various pass adaptors

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 4 12:30:46 PDT 2021


aeubanks added a comment.

In D110784#3040750 <https://reviews.llvm.org/D110784#3040750>, @dblaikie wrote:

> In D110784#3040749 <https://reviews.llvm.org/D110784#3040749>, @aeubanks wrote:
>
>> In D110784#3040708 <https://reviews.llvm.org/D110784#3040708>, @dblaikie wrote:
>>
>>> "83M -> 73M" is peak RAM usage during compilation, I guess?
>>>
>>> Is that worth the code changes? I think there's value in make_unique making it easier to read code/check for memory leaks, etc. (makes explicit new stand out more/get extra scrutiny when reading code)
>>
>> That's compile time, specifically the "instructions" stat in `perf stat` (I should have specified more clearly in the description).
>> PassBuilder.cpp is by far the longest file to compile (if you only build X86). With many cores/distributed build farms, it's the bottleneck. So yeah I think it's worth it.
>
> Ah, sorry, didn't catch the "instructions" on the line wrap there. I see.
>
> What about splitting up the file in some way(s)?

We can't get around (at least with the current design) tons of instantiations of these because for each entry in PassRegistry.def we instantiate at least one of these adaptors, sometimes multiple ones. Splitting these up into multiple files doesn't make sense logically from a code organization point of view, since they're all about parsing a pass pipeline and a lot of the code is very similar between module/cgscc/function/loop passes.

I have tried splitting things out before with no real impact, although I can look again.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110784



More information about the llvm-commits mailing list