<font size=2 face="sans-serif">Thank you both for the advice.<br>I'm going to try each of these ideas (including splitting the functions
that include PassRegistry.def, looking at the templates in PassManager.h
and looking at the large header files) and see what I get.<br>If any of those give me gains I'll post a patch.</font><br><br><font size=2 face="sans-serif">Thank you for the help!</font><br><font size=2 face="sans-serif">Stefan</font><br><br><br><br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">Chandler Carruth <chandlerc@gmail.com></font><br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">David Blaikie <dblaikie@gmail.com></font><br><font size=1 color=#5f5f5f face="sans-serif">Cc:
</font><font size=1 face="sans-serif">Stefan Pintilie <stefanp@ca.ibm.com>,
"llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org></font><br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">2019/09/04 07:51 PM</font><br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">[EXTERNAL] Re:
[llvm-dev] Memory Requirements For Compiling PassBuilder.cpp</font><br><hr noshade><br><br><br><font size=3>On Wed, Sep 4, 2019 at 2:17 PM David Blaikie via llvm-dev
<</font><a href="mailto:llvm-dev@lists.llvm.org"><font size=3 color=blue><u>llvm-dev@lists.llvm.org</u></font></a><font size=3>>
wrote:</font><br><font size=3>Probably the simple thing that might help would be to
split up the file a bit - especially the functions that include PassRegistry.def
as part of their implementation. I'm guessing the parse.*Pass functions
are the worst parts and having each of those in a separate file is probably
helpful.</font><br><br><font size=3>This may not help as much as you'd like. I suspect they're
all going to instantiate a similar set of templates, so you may end up
with N expensive files instead of 1.</font><br><br><font size=3>=/</font><br><font size=3> </font><br><font size=3><br>Other than that - actually changing the constructs to use less memory overall,
I'm not sure. </font><br><br><font size=3>Things that would likely help a lot here:</font><br><br><font size=3>1) Looking at the templates in PassManager.h that get
instantiated per-pass and have nested types or other constructs and refactoring
them so that they don't.</font><br><font size=3>2) Looking at some of the especially large headers and
refactoring them so that we don't need to include them. AliasAnalysis.h
and ScalarEvolution.h would be my first targets, but that's just based
on intuition, not profiling.</font><br><br><font size=3>I suspect there is a decent amount of improvement available
for both #1 and #2.</font><br><br><font size=3>The other thing that might help would be splitting apart
the parsing code from the fixed pipeline building code -- those actually
use somewhat different bits of pass management infrastructure and so we
might get a win from separating their compilation.</font><br><font size=3> </font><br><br><font size=3>On Tue, Sep 3, 2019 at 7:12 PM Stefan Pintilie via llvm-dev
<</font><a href="mailto:llvm-dev@lists.llvm.org" target="_blank"><font size=3 color=blue><u>llvm-dev@lists.llvm.org</u></font></a><font size=3>>
wrote:</font><br><font size=2 face="sans-serif">Hi Everyone,<br><br>Recently I have realised that compiling the file PassBuilder.cpp takes
a significant amount of memory. I have seen anywhere between 700 MB to
over 1GB depending on which build compiler is used. This memory consumption
recently caused a couple of build bots that run on a smaller machine to
run out of memory and fail to build.</font><font size=3><br></font><font size=2 face="sans-serif"><br>I have no intention of changing any of the functionality of this file but
I was wondering if anyone could suggest a way to reduce its complexity
(and hopefully memory consumption).<br>Any ideas of how I could try to go about this? Would it be possible to
refactor parts into another file perhaps?</font><font size=3><br></font><font size=2 face="sans-serif"><br>Thank you in advance,<br>Stefan</font><font size=3><br><br>_______________________________________________<br>LLVM Developers mailing list</font><font size=3 color=blue><u><br></u></font><a href="mailto:llvm-dev@lists.llvm.org" target="_blank"><font size=3 color=blue><u>llvm-dev@lists.llvm.org</u></font></a><font size=3 color=blue><u><br></u></font><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank"><font size=3 color=blue><u>https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</u></font></a><br><font size=3>_______________________________________________<br>LLVM Developers mailing list</font><font size=3 color=blue><u><br></u></font><a href="mailto:llvm-dev@lists.llvm.org" target="_blank"><font size=3 color=blue><u>llvm-dev@lists.llvm.org</u></font></a><font size=3 color=blue><u><br></u></font><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank"><font size=3 color=blue><u>https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</u></font></a><br><BR>