[LLVMdev] [RFC] Stripping unusable intrinsics
Chris Bieneman
beanz at apple.com
Wed Dec 10 15:53:31 PST 2014
llvm-dev,
In my ongoing saga to improve LLVM for embedded use, we would like to support stripping out unused intrinsics based on the LLVM targets actually being built.
I’ve attached two patches.
The first is a new flag for tablegen to take a list of targets. If passed tablegen will only emit intrinsics that either have empty target prefixes, or target prefixes matching one of the targets in the list. If the flag is not passed the behavior is unchanged. This patch can land today (subject to review).
The second patch is a WIP, and adds support to the CMake build system for using the new tablegen flag, and for generating a new llvm/Config/llvm-targets.h header which contains defines for each target specified with LLVM_TARGETS_TO_BUILD.
This new header will allow us to #ifdef code using target-specific intrinsics outside the targets, thus allowing us to strip out all the unused intrinsics.
-Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake-build.diff
Type: application/octet-stream
Size: 1761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141210/d4d0f479/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tablegen.diff
Type: application/octet-stream
Size: 1524 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141210/d4d0f479/attachment-0001.obj>
More information about the llvm-dev
mailing list