large llc footprint

We have a large bitcode file produced from a tool. It's about 23 meg.

When we compile this with llc, the footprint is 4-7 gig depending on which target.

On a desktop this is not such a problem but it is on mobile devices.

The suspect is that the flow graph for the entire program is built and kept for the duration, even if no optimization needing it all is in progress.

This would make us think that if we wrote a tool to split the bitcode up into separate files that we could work around this.

Maybe there are other possible solutions.

Any thoughts or experience from others on this problem would be greatly appreciated.

TIA,

Reed

We have a large bitcode file produced from a tool. It's about 23 meg.

When we compile this with llc, the footprint is 4-7 gig depending on
which target.

On a desktop this is not such a problem but it is on mobile devices.

The suspect is that the flow graph for the entire program is built and
kept for the duration, even if no optimization needing it all is in
progress.

This would make us think that if we wrote a tool to split the bitcode up
into separate files that we could work around this.

We already have the infrastructure for such a tool, if necessary; take
a look at llvm-extract.

Maybe there are other possible solutions.

Any thoughts or experience from others on this problem would be greatly
appreciated.

If you could figure out where the memory is going, that would be
useful information; it sounds like llc is using more space than it
should need.

-Eli

Ok. Thanks.

I will put some instrumentation into LLVM to help with memory usage tracking and take a look at llvm-extract.

Reed

You can use things like -time-passes etc to at least get a time estimate of where the time is going. Also, any optimization or code generation flags you're using would be more than helpful. Do you have debug info in there? More details would get you better advice :slight_smile:

-eric