From f5890e4e4317c1bb9a25f29a44ab009604f09e4b Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Sat, 23 Jun 2018 02:02:38 +0000 Subject: [IR] Split Intrinsics.inc into enums and implementations Implements PR34259 Intrinsics.h is a very popular header. Most LLVM TUs care about things like dbg_value, but they don't care how they are implemented. After I split these out, IntrinsicImpl.inc is 1.7 MB, so this saves each LLVM TU from scanning 1.7 MB of source that gets pre-processed away. It also means we can modify intrinsic properties without triggering a full rebuild, but that's probably less of a win. I think the next best thing to do would be to split out the target intrinsics into their own header. Very, very few TUs care about target-specific intrinsics. It's very hard to split up the target independent intrinsics like llvm.expect, assume, and dbg.value, though. llvm-svn: 335407 --- llvm/lib/IR/Function.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'llvm/lib/IR/Function.cpp') diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index 4c7b6b7..db37089 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -487,13 +487,13 @@ void Function::copyAttributesFrom(const Function *Src) { static const char * const IntrinsicNameTable[] = { "not_intrinsic", #define GET_INTRINSIC_NAME_TABLE -#include "llvm/IR/Intrinsics.inc" +#include "llvm/IR/IntrinsicImpl.inc" #undef GET_INTRINSIC_NAME_TABLE }; /// Table of per-target intrinsic name tables. #define GET_INTRINSIC_TARGET_DATA -#include "llvm/IR/Intrinsics.inc" +#include "llvm/IR/IntrinsicImpl.inc" #undef GET_INTRINSIC_TARGET_DATA /// Find the segment of \c IntrinsicNameTable for intrinsics with the same @@ -840,7 +840,7 @@ static void DecodeIITType(unsigned &NextElt, ArrayRef Infos, } #define GET_INTRINSIC_GENERATOR_GLOBAL -#include "llvm/IR/Intrinsics.inc" +#include "llvm/IR/IntrinsicImpl.inc" #undef GET_INTRINSIC_GENERATOR_GLOBAL void Intrinsic::getIntrinsicInfoTableEntries(ID id, @@ -977,7 +977,7 @@ FunctionType *Intrinsic::getType(LLVMContext &Context, bool Intrinsic::isOverloaded(ID id) { #define GET_INTRINSIC_OVERLOAD_TABLE -#include "llvm/IR/Intrinsics.inc" +#include "llvm/IR/IntrinsicImpl.inc" #undef GET_INTRINSIC_OVERLOAD_TABLE } @@ -995,7 +995,7 @@ bool Intrinsic::isLeaf(ID id) { /// This defines the "Intrinsic::getAttributes(ID id)" method. #define GET_INTRINSIC_ATTRIBUTES -#include "llvm/IR/Intrinsics.inc" +#include "llvm/IR/IntrinsicImpl.inc" #undef GET_INTRINSIC_ATTRIBUTES Function *Intrinsic::getDeclaration(Module *M, ID id, ArrayRef Tys) { @@ -1008,12 +1008,12 @@ Function *Intrinsic::getDeclaration(Module *M, ID id, ArrayRef Tys) { // This defines the "Intrinsic::getIntrinsicForGCCBuiltin()" method. #define GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN -#include "llvm/IR/Intrinsics.inc" +#include "llvm/IR/IntrinsicImpl.inc" #undef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN // This defines the "Intrinsic::getIntrinsicForMSBuiltin()" method. #define GET_LLVM_INTRINSIC_FOR_MS_BUILTIN -#include "llvm/IR/Intrinsics.inc" +#include "llvm/IR/IntrinsicImpl.inc" #undef GET_LLVM_INTRINSIC_FOR_MS_BUILTIN bool Intrinsic::matchIntrinsicType(Type *Ty, ArrayRef &Infos, -- cgit v1.1