[LLVMdev] [RFC] Stripping unusable intrinsics

Pete Cooper peter_cooper at apple.com
Wed Dec 10 16:06:57 PST 2014


> On Dec 10, 2014, at 4:02 PM, Reid Kleckner <rnk at google.com> wrote:
> 
> How much code is there that looks at target specific intrinsics from generic IR passes? Can we move this code into something like TargetTransformInfo?
InstCombineCalls does some of this.  Ideally we’d move this to something like InstCombineCalls_X86, etc.  That or at the very least a method for each target which is #ifdef’ed .

There’s also code in SelectionDAGBuilder for lowering some target specific intrinsics.

Thanks,
Pete
> 
> On Wed, Dec 10, 2014 at 3:53 PM, Chris Bieneman <beanz at apple.com <mailto:beanz at apple.com>> wrote:
> 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
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>         http://llvm.cs.uiuc.edu <http://llvm.cs.uiuc.edu/>
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141210/5eaab245/attachment.html>


More information about the llvm-dev mailing list