[llvm-commits] [llvm] [PATCH] pruning llvm -- only include intrinsics for targets S, given --enable-targets=S

Jan Voung jvoung at google.com
Thu Sep 1 13:42:59 PDT 2011


Hi all,

Here is a set of patches (one llvm, one clang) that could trim the size of
the llvm backends. This is one changes Intrinsics.td to only include
Intrinsics for the targets that were enabled via --enable-targets=X,Y,Z.
This is about ~100KB savings if you only enable X86 (haven't measured
others, but it should be greater for targets with fewer intrinsics).

"size llc" w/ only x86
BEFORE:
text data bss dec hex filename
11328502 502632 36976 11868110 b517ce Release+Asserts/bin/llc

AFTER:
text data bss dec hex filename
11232165 499080 36976 11768221 b3919d Release+Asserts/bin/llc

NOTE:* *this affects the "opt" tool and other bitcode tools that may depend
on Intrinsics.td having all intrinsics available.

I'm not sure how to properly get "svn mv"'ed stuff to show up in the
attached files, but they show up in the online views:
http://codereview.chromium.org/7792066/
http://codereview.chromium.org/7824006/

Other detail:

(a) This is done by adding an "include_if" directive to TableGen (vs trying
to do a full-fledged #if def / #else / #endif).

(b) Add CPP defines to handle inline code the depends on these intrinsics
(e.g., in InstCombine). See second attached patch for clang side changes. I
haven't looked into llvm-gcc or dragon egg dependencies on LLVM's
Intrinsics.td, so it may take some more work to land.

(c) move tests that are target dependent into target-specific directories.
Previously tests would assume that "opt" understood target specific
intrinsics.

TEST= build llvm w/ --enable-targets=all, --enable-targets=x86,
--enable-targets=arm, run "make check" in each case. They pass, except for
JIT and generic tests w/ --enable-target=arm since my host machine is x86.
Are there other tests, I should try?

As noted above, there might be more work needed for dragon egg and llvm-gcc,
but is the overall approach okay? Thanks!

- Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110901/41e7dd23/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: intrinsic_include.patch2
Type: application/octet-stream
Size: 60924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110901/41e7dd23/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: intrinsic_include_clang.patch
Type: text/x-patch
Size: 3427 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110901/41e7dd23/attachment.bin>


More information about the llvm-commits mailing list