|
LLVM
4.0.0
|
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 | |
| StringRef | getName (ID id) |
| Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx". More... | |
| std::string | getName (ID id, ArrayRef< Type * > Tys) |
| Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx". More... | |
| FunctionType * | getType (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... | |
| Function * | getDeclaration (Module *M, ID id, ArrayRef< Type * > Tys=None) |
| Create or insert an LLVM Function declaration for an intrinsic, and return it. More... | |
| int | lookupLLVMIntrinsicByName (ArrayRef< const char * > NameTable, StringRef Name) |
| Looks up Name in NameTable via binary search. More... | |
| ID | getIntrinsicForGCCBuiltin (const char *Prefix, StringRef BuiltinName) |
| Map a GCC builtin name to an intrinsic ID. More... | |
| ID | getIntrinsicForMSBuiltin (const char *Prefix, StringRef 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... | |
| bool | matchIntrinsicType (Type *Ty, ArrayRef< IITDescriptor > &Infos, SmallVectorImpl< Type * > &ArgTys) |
| Match the specified type (which comes from an intrinsic argument or return value) with the type constraints specified by the .td file. More... | |
| bool | matchIntrinsicVarArg (bool isVarArg, ArrayRef< IITDescriptor > &Infos) |
| Verify if the intrinsic has variable arguments. More... | |
| llvm::Optional< Function * > | remangleIntrinsicFunction (Function *F) |
This namespace contains an enum with a value for every intrinsic/builtin function known by LLVM.
The enum values are returned by Function::getIntrinsicID().
| enum llvm::Intrinsic::ID : unsigned |
| Enumerator | |
|---|---|
| not_intrinsic | |
| num_intrinsics | |
Definition at line 37 of file Intrinsics.h.
| AttributeSet llvm::Intrinsic::getAttributes | ( | LLVMContext & | C, |
| ID | id | ||
| ) |
Return the attributes for an intrinsic.
Referenced by llvm::attributesPermitTailCall(), llvm::FunctionComparator::cmpOperations(), llvm::AttributeSet::getAllocSizeArgs(), llvm::AttributeSet::getAsString(), llvm::AttributeSet::getAttribute(), llvm::InvokeInst::getAttribute(), llvm::AMDGPUIntrinsicInfo::getDeclaration(), llvm::AttributeSet::getDereferenceableBytes(), llvm::AttributeSet::getDereferenceableOrNullBytes(), llvm::AttributeSet::getFnAttributes(), llvm::AttributeSet::getParamAlignment(), llvm::AttributeSet::getParamAttributes(), llvm::AttributeSet::getRetAttributes(), llvm::AttributeSet::getStackAlignment(), llvm::AttributeSet::hasAttribute(), llvm::AttributeSet::hasAttributes(), llvm::Argument::hasNonNullAttr(), haveSameSpecialState(), LLVMGetAttributeCountAtIndex(), LLVMGetAttributesAtIndex(), and llvm::UpgradeIntrinsicFunction().
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 949 of file Function.cpp.
References llvm::Module::getContext(), getName(), llvm::Module::getOrInsertFunction(), and getType().
Referenced by callIntrinsic(), llvm::changeToUnreachable(), CombineUAddWithOverflow(), llvm::IRBuilderBase::CreateAssumption(), createCoroSave(), llvm::IRBuilderBase::CreateGCRelocate(), CreateGCRelocates(), llvm::IRBuilderBase::CreateGCResult(), CreateGCStatepointCallCommon(), CreateGCStatepointInvokeCommon(), llvm::IRBuilder< TargetFolder >::CreateInvariantGroupBarrier(), llvm::IRBuilderBase::CreateInvariantStart(), llvm::IRBuilderBase::CreateLifetimeEnd(), llvm::IRBuilderBase::CreateLifetimeStart(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilderBase::CreateMemSet(), createPopcntIntrinsic(), CreatePrologue(), llvm::AArch64TargetLowering::emitAtomicCmpXchgNoStoreLLBalance(), llvm::ARMTargetLowering::emitAtomicCmpXchgNoStoreLLBalance(), llvm::HexagonTargetLowering::emitLoadLinked(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::HexagonTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), llvm::SCEVExpander::generateOverflowCheck(), generateUnsignedDivisionCode(), llvm::AArch64TargetLowering::getIRStackGuard(), llvm::AArch64TargetLowering::getSafeStackPointerLocation(), getScalarIntrinsicDeclaration(), getStackGuard(), INITIALIZE_PASS(), llvm::InlineFunction(), llvm::DIBuilder::insertDbgValueIntrinsic(), llvm::DIBuilder::insertDeclare(), lowerGuardIntrinsic(), llvm::AArch64TargetLowering::lowerInterleavedLoad(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::IntrinsicLowering::LowerToByteSwap(), llvm::ARMTargetLowering::makeDMB(), llvm::coro::LowererBase::makeSubFnCall(), optimizeUnaryDoubleFP(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), llvm::recognizeBSwapOrBitReverseIdiom(), remangleIntrinsicFunction(), simplifyX86extrq(), simplifyX86insertq(), llvm::UpgradeIntrinsicCall(), UpgradeIntrinsicFunction1(), UpgradeSSE41Function(), UpgradeX86IntrinsicsWith8BitMask(), UpgradeX86MaskedShift(), llvm::InstCombiner::visitAllocSite(), llvm::InstCombiner::visitCallInst(), and llvm::InstCombiner::visitFPTrunc().
Map a GCC builtin name to an intrinsic ID.
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 784 of file Function.cpp.
References DecodeIITType(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::ArrayRef< T >::size().
Referenced by getType(), and remangleIntrinsicFunction().
| StringRef llvm::Intrinsic::getName | ( | ID | id | ) |
Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
Note, this version is for intrinsics with no overloads. Use the other version of getName if overloads are required.
Definition at line 555 of file Function.cpp.
References assert(), IntrinsicNameTable, isOverloaded(), and num_intrinsics.
Referenced by llvm::SDNode::getOperationName(), lowerGuardIntrinsic(), llvm::MIPrinter::print(), remangleIntrinsicFunction(), llvm::ScalarEvolution::ScalarEvolution(), and UpgradeIntrinsicFunction1().
Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
Note, this version of getName supports overloads, but is less efficient than the StringRef version of this function. If no overloads are requried, it is safe to use this version, but better to use the StringRef version.
Definition at line 562 of file Function.cpp.
References assert(), getMangledTypeStr(), IntrinsicNameTable, and num_intrinsics.
| FunctionType * llvm::Intrinsic::getType | ( | LLVMContext & | Context, |
| ID | id, | ||
| ArrayRef< Type * > | Tys = None |
||
| ) |
Return the function type for an intrinsic.
Definition at line 905 of file Function.cpp.
References llvm::SmallVectorTemplateCommon< T >::back(), DecodeFixedType(), llvm::SmallVectorBase::empty(), llvm::ArrayRef< T >::empty(), llvm::FunctionType::get(), getIntrinsicInfoTableEntries(), llvm::Type::isVoidTy(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::pop_back(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by allSameType(), cloneConstantExprWithNewAddressSpace(), llvm::ConstantExprKeyType::create(), llvm::ScalarEvolution::getAddExpr(), llvm::ScalarEvolution::getAddRecExpr(), llvm::lto::InputFile::Symbol::getCommonSize(), getDeclaration(), llvm::CastInst::getDestTy(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getIntrinsicInstrCost(), llvm::ScalarEvolution::getMulExpr(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), getRuntimeMDForKernel(), llvm::ScalarEvolution::getSMaxExpr(), llvm::ScalarEvolution::getUMaxExpr(), llvm::ConstantExpr::getWithOperands(), llvm::DbgVariable::isArtificial(), llvm::object::Elf_Sym_Impl< ELFT >::isCommon(), llvm::HexagonMCInstrInfo::isCompound(), llvm::DbgVariable::isObjectPointer(), llvm::HexagonMCInstrInfo::isVector(), LLVMTypeOf(), PerformHeapAllocSRoA(), llvm::object::Elf_Sym_Impl< ELFT >::setBinding(), llvm::PHINode::setIncomingValue(), llvm::object::Elf_Rel_Impl< ELFType< TargetEndianness, false >, false >::setSymbol(), llvm::object::Elf_Rel_Impl< ELFType< TargetEndianness, true >, false >::setSymbol(), SimplifyGEPInst(), and llvm::InstCombiner::visitLandingPadInst().
| 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 932 of file Function.cpp.
Referenced by llvm::CallGraphNode::addCalledFunction(), buildCGN(), and DeleteBasicBlock().
| bool llvm::Intrinsic::isOverloaded | ( | ID | id | ) |
Returns true if the intrinsic can be overloaded.
Definition at line 926 of file Function.cpp.
Referenced by getName(), and llvm::Function::lookupIntrinsicID().
| int llvm::Intrinsic::lookupLLVMIntrinsicByName | ( | ArrayRef< const char * > | NameTable, |
| StringRef | Name | ||
| ) |
Looks up Name in NameTable via binary search.
NameTable must be sorted and all entries must start with "llvm.". If NameTable contains an exact match for Name or a prefix of Name followed by a dot, its index in NameTable is returned. Otherwise, -1 is returned.
Definition at line 50 of file IntrinsicInst.cpp.
References assert(), llvm::ArrayRef< T >::begin(), llvm::StringRef::data(), llvm::ArrayRef< T >::end(), llvm::StringRef::find(), High, llvm::StringRef::npos, llvm::StringRef::size(), and llvm::StringRef::startswith().
Referenced by isCoroutineIntrinsicName(), llvm::Function::lookupIntrinsicID(), and llvm::AMDGPUIntrinsicInfo::lookupName().
| bool llvm::Intrinsic::matchIntrinsicType | ( | Type * | Ty, |
| ArrayRef< IITDescriptor > & | Infos, | ||
| SmallVectorImpl< Type * > & | ArgTys | ||
| ) |
Match the specified type (which comes from an intrinsic argument or return value) with the type constraints specified by the .td file.
If the given type is an overloaded type it is pushed to the ArgTys vector.
Returns false if the given type matches with the constraints, true otherwise.
Definition at line 967 of file Function.cpp.
References llvm::Intrinsic::IITDescriptor::AK_Any, llvm::Intrinsic::IITDescriptor::AK_AnyFloat, llvm::Intrinsic::IITDescriptor::AK_AnyInteger, llvm::Intrinsic::IITDescriptor::AK_AnyPointer, llvm::Intrinsic::IITDescriptor::AK_AnyVector, llvm::Intrinsic::IITDescriptor::Argument, assert(), D, llvm::Intrinsic::IITDescriptor::Double, llvm::dyn_cast(), llvm::ArrayRef< T >::empty(), llvm::Intrinsic::IITDescriptor::ExtendArgument, llvm::Intrinsic::IITDescriptor::Float, llvm::ArrayRef< T >::front(), llvm::IntegerType::get(), llvm::PointerType::getAddressSpace(), llvm::StructType::getElementType(), llvm::SequentialType::getElementType(), llvm::PointerType::getElementType(), llvm::VectorType::getExtendedElementVectorType(), llvm::VectorType::getHalfElementsVectorType(), llvm::StructType::getNumElements(), llvm::SequentialType::getNumElements(), llvm::VectorType::getTruncatedElementVectorType(), llvm::Type::getVectorElementType(), llvm::Type::getVectorNumElements(), llvm::Intrinsic::IITDescriptor::Half, llvm::Intrinsic::IITDescriptor::HalfVecArgument, i, llvm::Intrinsic::IITDescriptor::Integer, llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), llvm::Type::isFPOrFPVectorTy(), llvm::Type::isHalfTy(), llvm::Type::isIntegerTy(), llvm::Type::isIntOrIntVectorTy(), llvm::Type::isMetadataTy(), llvm::Type::isTokenTy(), llvm::Type::isVoidTy(), llvm::Type::isX86_MMXTy(), llvm_unreachable, llvm::Intrinsic::IITDescriptor::Metadata, llvm::Intrinsic::IITDescriptor::MMX, llvm::Intrinsic::IITDescriptor::Pointer, llvm::Intrinsic::IITDescriptor::PtrToArgument, llvm::Intrinsic::IITDescriptor::PtrToElt, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Intrinsic::IITDescriptor::SameVecWidthArgument, llvm::SmallVectorTemplateCommon< T >::size(), llvm::ArrayRef< T >::slice(), llvm::ARM_MB::ST, llvm::Intrinsic::IITDescriptor::Struct, llvm::Intrinsic::IITDescriptor::Token, llvm::Intrinsic::IITDescriptor::TruncArgument, llvm::Intrinsic::IITDescriptor::VarArg, llvm::Intrinsic::IITDescriptor::VecOfPtrsToElt, llvm::Intrinsic::IITDescriptor::Vector, and llvm::Intrinsic::IITDescriptor::Void.
Referenced by remangleIntrinsicFunction().
Verify if the intrinsic has variable arguments.
This method is intended to be called after all the fixed arguments have been matched first.
This method returns true on error.
Definition at line 1116 of file Function.cpp.
References D, llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::front(), llvm::Intrinsic::IITDescriptor::Kind, llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::slice().
Referenced by remangleIntrinsicFunction().
Definition at line 1135 of file Function.cpp.
References assert(), llvm::Function::getCallingConv(), getDeclaration(), llvm::Function::getFunctionType(), llvm::Function::getIntrinsicID(), getIntrinsicInfoTableEntries(), getName(), llvm::Value::getName(), llvm::GlobalValue::getParent(), llvm::FunctionType::getReturnType(), llvm::FunctionType::isVarArg(), matchIntrinsicType(), matchIntrinsicVarArg(), llvm::None, llvm::FunctionType::params(), and llvm::Function::setCallingConv().
1.8.6