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

Jan Voung jvoung at google.com
Fri Sep 9 11:22:56 PDT 2011


Attached is one more patch for dragonegg to go with these other patches.
It simply generates a Make error when there is a mismatch between the
dragonegg target and the backend targets enabled in llvm, by asking
llvm-config.
It also possible to go without this patch and simply have compile errors
when the intrinsics referenced by dragonegg aren't actually defined by llvm
(since it's been pruned out), but the error would be more mysterious.

Otherwise, the previously attached llvm and clang patches should still apply
(checked at rev 139374).

Thanks!

On Thu, Sep 1, 2011 at 1:42 PM, Jan Voung <jvoung at google.com> wrote:

> 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/20110909/e5a3f900/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: intrinsic_include_dragonegg.patch
Type: text/x-patch
Size: 779 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110909/e5a3f900/attachment.bin>


More information about the llvm-commits mailing list