reducing llc's memory consumption

We are processing some fairly large, e.g. 10s of MB, bitcode files with llc,
which result in peak memory use of several GBs.
We would like to ameliorate this somewhat.
On one end of the spectrum we could look into reducing the size of common
data structures and local space optimization.
On the other end we could try to switch the MCAssembler from a model
where it processes the entire Module at once, to something more like
a function at a time.
Does the list have any suggestions what we should look into.
Important considerations are:

  • anticipated reduction in memory use
  • likelihood of succeeding
  • upstreamability

Cheers,
Robert

We are processing some fairly large, e.g. 10s of MB, bitcode files with llc,
which result in peak memory use of several GBs.
We would like to ameliorate this somewhat.
On one end of the spectrum we could look into reducing the size of common
data structures and local space optimization.
On the other end we could try to switch the MCAssembler from a model
where it processes the entire Module at once, to something more like
a function at a time.

The assembler has no concept of functions, only labels. As expressions may span arbitrary regions in the assembly and require later fixups, the assembler needs to consider the whole of the output. Consider, for example, X86 branch relaxation.

-Jim