[llvm-commits] PATCH: pruning llvm w/ config flags --enable-target-oses=os1, os2 similar to --enable-target=arch1, arch2.

Jan Voung jvoung at google.com
Mon Aug 29 16:58:36 PDT 2011


Ping.

- Is this approach acceptable?
  - I guess it is hard to test if this has any effect / depends on the
compiler.
- Is trimming the size of the llvm binaries (via config flags) useful to
others?
  - Other examples:
    - make "include/llvm/Intrinsics.td" not #include intrinsincs for targets
that were not enabled through "--enable-target"
    - config flags to avoid building unused register allocators, other
passes


On Wed, Aug 24, 2011 at 1:12 PM, Jan Voung <jvoung at google.com> wrote:

> Hi all,
>
> Attached is a patch that can help prune the size of the llvm binaries
> (e.g., llc, lli) a bit. This is done by adding configure flags
> --enable-target-oses=os1,os2 and --enable-target-envs=env1,env2 similar to
> --enable-target=arch1,arch2. These flags generate pre-processor defines
> that are then checked within the Triple module to force certain code paths
> to be considered dead (if llvm is built with an LTO-enabled-compiler).
>
> The if-defs could be spread further to give the same benefit for non-LTO
> compilers, but that isn't done.
>
> Concretely, if you build LLVM w/ clang -O4 and --enable-target-oses=Linux,
> there is about a 170 KB savings (prunes most of the MC COFF support, plus
> some branches in various places). If --enable-target-envs=gnu is also
> specified then most of MC MachO code is also pruned:
>
> llc built with lto, x86+arm arches, all oses, all environments: 12757900
> llc built with lto, x86+arm arches, only Linux, all environments: 12584978
> llc built with lto, x86+arm arches, only Linux, only gnu environment:
> 12528216
>
> Is this worth adding?
>
> Again, patch is attached, or you can view the patch online:
> http://codereview.chromium.org/7730004/
>
> Thanks!
> - Jan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110829/197b096e/attachment.html>


More information about the llvm-commits mailing list