[llvm-dev] debug build busts memory

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 26 10:27:18 PST 2019

Hi Bagel,

On Tue, 26 Nov 2019 at 18:15, Bagel via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Is there a way to just build "llc"?

"make llc" should do the trick (though ninja tends to be even faster).

> Any ideas to speed things up?

As you can imagine, this is an issue lots of people hit. Knobs you can
twist to make things better:

1. Use lld, for example with the LLVM_ENABLE_LLD CMake option
(assuming it's installed).
2. Lower the LLVM_PARALLEL_LINK_JOBS CMake option to something your
system can support.
3. The LLVM_USE_SPLIT_DWARF essentially leaves the DWARF info in the
.o files and avoids linking it properly until it's used. This speeds
up linking, at the cost of slower gdb/lldb load, and you need a quite
new version of lldb to debug at all.
4. You can skip building unnecessary targets with
LLVM_TARGETS_TO_BUILD, though that's more significant as a
compile-time saver than link-memory.
5. Even more-so for LLVM_OPTIMIZED_TABLEGEN.
6. There's some option to build .so files instead of .a, which saves
linker memory. But it slows down test runs significantly and is also
annoying for debug so I don't think people tend to use it these days.

I tend to run with the first three on Linux.



More information about the llvm-dev mailing list