LLVM  3.7.0
Classes | Enumerations | Functions
llvm::Intrinsic Namespace Reference

This namespace contains an enum with a value for every intrinsic/builtin function known by LLVM. More...

Classes

struct  IITDescriptor
 This is a type descriptor which explains the type requirements of an intrinsic. More...
 

Enumerations

enum  ID : unsigned { not_intrinsic = 0, num_intrinsics }
 

Functions

std::string getName (ID id, ArrayRef< Type * > Tys=None)
 Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx". More...
 
FunctionTypegetType (LLVMContext &Context, ID id, ArrayRef< Type * > Tys=None)
 Return the function type for an intrinsic. More...
 
bool isOverloaded (ID id)
 Returns true if the intrinsic can be overloaded. More...
 
bool isLeaf (ID id)
 Returns true if the intrinsic is a leaf, i.e. More...
 
AttributeSet getAttributes (LLVMContext &C, ID id)
 Return the attributes for an intrinsic. More...
 
FunctiongetDeclaration (Module *M, ID id, ArrayRef< Type * > Tys=None)
 Create or insert an LLVM Function declaration for an intrinsic, and return it. More...
 
ID getIntrinsicForGCCBuiltin (const char *Prefix, const char *BuiltinName)
 Map a GCC builtin name to an intrinsic ID. More...
 
ID getIntrinsicForMSBuiltin (const char *Prefix, const char *BuiltinName)
 Map a MS builtin name to an intrinsic ID. More...
 
void getIntrinsicInfoTableEntries (ID id, SmallVectorImpl< IITDescriptor > &T)
 Return the IIT table descriptor for the specified intrinsic into an array of IITDescriptors. More...
 

Detailed Description

This namespace contains an enum with a value for every intrinsic/builtin function known by LLVM.

The enum values are returned by Function::getIntrinsicID().

Enumeration Type Documentation

Enumerator
not_intrinsic 
num_intrinsics 

Definition at line 35 of file Intrinsics.h.

Function Documentation

AttributeSet llvm::Intrinsic::getAttributes ( LLVMContext &  C,
ID  id 
)
Function * llvm::Intrinsic::getDeclaration ( Module M,
ID  id,
ArrayRef< Type * >  Tys = None 
)

Create or insert an LLVM Function declaration for an intrinsic, and return it.

The Tys parameter is for intrinsics with overloaded types (e.g., those using iAny, fAny, vAny, or iPTRAny). For a declaration of an overloaded intrinsic, Tys must provide exactly one type for each overloaded type in the intrinsic.

Definition at line 866 of file Function.cpp.

References llvm::Module::getContext(), getName(), llvm::Module::getOrInsertFunction(), and getType().

Referenced by callIntrinsic(), changeToUnreachable(), CombineUAddWithOverflow(), llvm::IRBuilderBase::CreateAssumption(), llvm::IRBuilderBase::CreateGCRelocate(), CreateGCRelocates(), llvm::IRBuilderBase::CreateGCResult(), llvm::IRBuilderBase::CreateGCStatepointCall(), llvm::IRBuilderBase::CreateGCStatepointInvoke(), llvm::IRBuilderBase::CreateLifetimeEnd(), llvm::IRBuilderBase::CreateLifetimeStart(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilderBase::CreateMemSet(), CreatePrologue(), createStubLandingPad(), llvm::HexagonTargetLowering::emitLoadLinked(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::HexagonTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), generateUnsignedDivisionCode(), INITIALIZE_PASS(), llvm::InlineFunction(), llvm::DIBuilder::insertDbgValueIntrinsic(), llvm::DIBuilder::insertDeclare(), llvm::AArch64TargetLowering::lowerInterleavedLoad(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::IntrinsicLowering::LowerToByteSwap(), llvm::ARMTargetLowering::makeDMB(), ProcessUGT_ADDCST_ADD(), ProcessUMulZExtIdiom(), llvm::UpgradeIntrinsicCall(), UpgradeIntrinsicFunction1(), UpgradeSSE41Function(), UpgradeX86IntrinsicsWith8BitMask(), llvm::InstCombiner::visitAllocSite(), llvm::InstCombiner::visitCallInst(), and llvm::InstCombiner::visitFPTrunc().

ID llvm::Intrinsic::getIntrinsicForGCCBuiltin ( const char *  Prefix,
const char *  BuiltinName 
)

Map a GCC builtin name to an intrinsic ID.

Referenced by llvm::AMDGPUIntrinsicInfo::lookupName().

ID llvm::Intrinsic::getIntrinsicForMSBuiltin ( const char *  Prefix,
const char *  BuiltinName 
)

Map a MS builtin name to an intrinsic ID.

void llvm::Intrinsic::getIntrinsicInfoTableEntries ( ID  id,
SmallVectorImpl< IITDescriptor > &  T 
)

Return the IIT table descriptor for the specified intrinsic into an array of IITDescriptors.

Definition at line 710 of file Function.cpp.

References DecodeIITType(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::ArrayRef< T >::size().

Referenced by getType().

std::string llvm::Intrinsic::getName ( ID  id,
ArrayRef< Type * >  Tys = None 
)

Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".

Definition at line 500 of file Function.cpp.

References llvm::ArrayRef< T >::empty(), getMangledTypeStr(), num_intrinsics, and llvm::ArrayRef< T >::size().

Referenced by llvm::SDNode::getOperationName(), and UpgradeIntrinsicFunction1().

FunctionType * llvm::Intrinsic::getType ( LLVMContext Context,
ID  id,
ArrayRef< Type * >  Tys = None 
)
bool llvm::Intrinsic::isLeaf ( ID  id)

Returns true if the intrinsic is a leaf, i.e.

it does not make any calls itself. Most intrinsics are leafs, the exceptions being the patchpoint and statepoint intrinsics. These call (or invoke) their "target" argument.

Definition at line 849 of file Function.cpp.

Referenced by llvm::CallGraphNode::addCalledFunction(), and isGCLeafFunction().

bool llvm::Intrinsic::isOverloaded ( ID  id)

Returns true if the intrinsic can be overloaded.

Definition at line 843 of file Function.cpp.