|
LLVM
10.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... | |
Typedefs | |
| typedef unsigned | ID |
Enumerations | |
| enum | IndependentIntrinsics : unsigned { not_intrinsic = 0 } |
| enum | MatchIntrinsicTypesResult { MatchIntrinsicTypes_Match = 0, MatchIntrinsicTypes_NoMatchRet = 1, MatchIntrinsicTypes_NoMatchArg = 2 } |
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... | |
| AttributeList | 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... | |
| MatchIntrinsicTypesResult | matchIntrinsicSignature (FunctionType *FTy, ArrayRef< IITDescriptor > &Infos, SmallVectorImpl< Type *> &ArgTys) |
| Match the specified function type 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().
| typedef unsigned llvm::Intrinsic::ID |
Definition at line 39 of file TargetTransformInfo.h.
| Enumerator | |
|---|---|
| not_intrinsic | |
Definition at line 40 of file Intrinsics.h.
| Enumerator | |
|---|---|
| MatchIntrinsicTypes_Match | |
| MatchIntrinsicTypes_NoMatchRet | |
| MatchIntrinsicTypes_NoMatchArg | |
Definition at line 174 of file Intrinsics.h.
| AttributeList llvm::Intrinsic::getAttributes | ( | LLVMContext & | C, |
| ID | id | ||
| ) |
Return the attributes for an intrinsic.
Referenced by llvm::AttributeList::addAllocSizeParamAttr(), llvm::Function::addAttribute(), llvm::CallBase::addAttribute(), llvm::Function::addAttributes(), llvm::AttributeList::addAttributes(), llvm::Function::addDereferenceableAttr(), llvm::CallBase::addDereferenceableAttr(), llvm::Function::addDereferenceableOrNullAttr(), llvm::CallBase::addDereferenceableOrNullAttr(), llvm::Function::addDereferenceableOrNullParamAttr(), llvm::Function::addDereferenceableParamAttr(), llvm::Function::addParamAttr(), llvm::CallBase::addParamAttr(), llvm::Function::addParamAttrs(), llvm::attributesPermitTailCall(), computeAddrSpace(), llvm::AttributeList::dump(), llvm::AttributeList::getAllocSizeArgs(), llvm::AttributeList::getAsString(), llvm::AttributeList::getAttribute(), llvm::CallBase::getAttribute(), llvm::CallSiteBase< Function, BasicBlock, Value, User, Use, Instruction, CallInst, InvokeInst, CallBrInst, User::op_iterator >::getAttributes(), llvm::AttributeList::getDereferenceableBytes(), llvm::AttributeList::getDereferenceableOrNullBytes(), llvm::AttributeList::getFnAttributes(), llvm::AttributeList::getParamAlignment(), llvm::CallBase::getParamAttr(), llvm::Function::getParamAttribute(), llvm::AttributeList::getParamAttributes(), llvm::AttributeList::getParamByValType(), llvm::AttributeList::getRetAlignment(), llvm::AttributeList::getRetAttributes(), llvm::AttributeList::getStackAlignment(), llvm::SITargetLowering::getTgtMemIntrinsic(), llvm::Function::hasAttribute(), llvm::AttributeList::hasAttribute(), llvm::AttributeList::hasAttributes(), llvm::Function::hasParamAttribute(), haveSameSpecialState(), LLVMGetAttributeCountAtIndex(), LLVMGetAttributesAtIndex(), llvm::IRAttributeManifest::manifestAttrs(), llvm::Function::removeAttribute(), llvm::CallBase::removeAttribute(), llvm::Function::removeAttributes(), llvm::Function::removeFnAttr(), llvm::Function::removeParamAttr(), llvm::CallBase::removeParamAttr(), llvm::Function::removeParamAttrs(), 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 1112 of file Function.cpp.
References llvm::FunctionCallee::getCallee(), llvm::Module::getContext(), llvm::Value::getName(), llvm::Module::getOrInsertFunction(), and llvm::Value::getType().
Referenced by addAssumeNonNull(), addBoundsChecking(), AddCalls(), AreSequentialAccesses(), callIntrinsic(), CanGenerateTest(), canonicalizeSaturatedAdd(), llvm::changeToUnreachable(), Cleanup(), llvm::createAArch64StackTaggingPass(), llvm::IRBuilderBase::CreateBinaryIntrinsic(), createCoroSave(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemCpy(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemMove(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemSet(), llvm::IRBuilderBase::CreateFAddReduce(), createFFSIntrinsic(), llvm::IRBuilderBase::CreateFMulReduce(), llvm::IRBuilderBase::CreateGCRelocate(), CreateGCRelocates(), llvm::IRBuilderBase::CreateGCResult(), CreateGCStatepointCallCommon(), CreateGCStatepointInvokeCommon(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateInvariantStart(), llvm::IRBuilder< TargetFolder >::CreateLaunderInvariantGroup(), llvm::IRBuilderBase::CreateLifetimeEnd(), llvm::IRBuilderBase::CreateLifetimeStart(), llvm::IRBuilderBase::CreateMaskedStore(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilderBase::CreateMemSet(), createPopcntIntrinsic(), createPowWithIntegerExponent(), llvm::IRBuilder< TargetFolder >::CreatePreserveArrayAccessIndex(), llvm::IRBuilder< TargetFolder >::CreatePreserveStructAccessIndex(), llvm::IRBuilder< TargetFolder >::CreatePreserveUnionAccessIndex(), CreatePrologue(), llvm::IRBuilder< TargetFolder >::CreateStripInvariantGroup(), llvm::IRBuilderBase::CreateUnaryIntrinsic(), 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::PPCTargetLowering::emitTrailingFence(), eraseDeadBBsAndChildren(), explicifyGuards(), findStackProtectorIntrinsic(), foldCttzCtlz(), foldGuardedRotateToFunnelShift(), foldShiftIntoShiftInAnotherHandOfAndInICmp(), foldToUnsignedSaturatedAdd(), foldVecTruncToExtElt(), generateUnsignedDivisionCode(), llvm::objcarc::ARCRuntimeEntryPoints::get(), llvm::IRPosition::getAttrs(), GetCtorAndDtorPriority(), getDeclareIntrin(), getIntrinsicForMaskedAtomicRMWBinOp(), getIntToFPVal(), getPointerOperands(), getReductionIntrinsic(), getScalarIntrinsicDeclaration(), getSqrtCall(), getStackGuard(), getSuccState(), hasUndefContents(), INITIALIZE_PASS(), llvm::InlineFunction(), insertCall(), insertLifetimeMarkersSurroundingCall(), insertSinCosCall(), insertValues(), instrumentOneFunc(), isAtomic(), isCallPromotable(), isIndirectBrTarget(), isZeroLengthArray(), LLVMGetIntrinsicDeclaration(), lowerGuardIntrinsic(), llvm::AArch64TargetLowering::lowerInterleavedLoad(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), lowerLocalAllocas(), LowerRotate(), llvm::IntrinsicLowering::LowerToByteSwap(), llvm::ARMTargetLowering::makeDMB(), llvm::coro::LowererBase::makeSubFnCall(), MarkBlocksLiveIn(), matchRotate(), optimizeBinaryDoubleFP(), optimizeDoubleFP(), postDominates(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), promotedOpIsNUW(), llvm::recognizeBSwapOrBitReverseIdiom(), remangleIntrinsicFunction(), replaceUnaryCall(), RetagMask(), llvm::GCNTTIImpl::rewriteIntrinsicWithAddressSpace(), llvm::LoopDataPrefetchPass::run(), shouldKeepFDivF32(), ShrinkDemandedConstant(), SimplifyBSwap(), SimplifyNVVMIntrinsic(), llvm::DISubprogram::toSPFlags(), tryToRecognizePopCount(), TypeSizeToSizeIndex(), unifyReturnBlockSet(), llvm::UpgradeARCRuntime(), upgradeAVX512MaskToSelect(), UpgradeIntrinsicFunction1(), UpgradePTESTIntrinsic(), UpgradeX86AddSubSatIntrinsics(), upgradeX86ConcatShift(), UpgradeX86IntrinsicFunction(), UpgradeX86IntrinsicsWith8BitMask(), UpgradeX86MaskedShift(), upgradeX86Rotate(), UpgradeX86VPERMT2Intrinsics(), UseTlsOffset(), llvm::InstCombiner::visitAllocSite(), llvm::InstCombiner::visitBitCast(), and llvm::InstCombiner::visitCallInst().
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 932 of file Function.cpp.
References DecodeIITType(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::ArrayRef< T >::size().
Referenced by llvm::Intrinsic::IITDescriptor::get(), getParentPad(), getType(), remangleIntrinsicFunction(), and ShrinkDemandedConstant().
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 659 of file Function.cpp.
References assert(), and isOverloaded().
Referenced by AddCalls(), containsProfilingIntrinsics(), explicifyGuards(), llvm::lto::LTO::getMaxTasks(), llvm::SDNode::getOperationName(), getParentPad(), isDirectCall(), isEmptyFunction(), llvm::SelectionDAGISel::isOrEquivalentToAdd(), LLVMIntrinsicCopyOverloadedName(), LLVMIntrinsicGetName(), lowerGuardIntrinsic(), lowerWidenableCondition(), llvm::MachineOperand::print(), remangleIntrinsicFunction(), llvm::JumpThreadingPass::runImpl(), llvm::ScalarEvolution::ScalarEvolution(), splitGlobals(), truncateIVUse(), unswitchBestCondition(), 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 666 of file Function.cpp.
References assert(), and getMangledTypeStr().
| FunctionType * llvm::Intrinsic::getType | ( | LLVMContext & | Context, |
| ID | id, | ||
| ArrayRef< Type *> | Tys = None |
||
| ) |
Return the function type for an intrinsic.
Definition at line 1068 of file Function.cpp.
References llvm::SmallVectorTemplateCommon< T >::back(), DecodeFixedType(), llvm::SmallVectorBase::empty(), llvm::ArrayRef< T >::empty(), llvm::FunctionType::get(), getIntrinsicInfoTableEntries(), llvm::SmallVectorTemplateBase< T >::pop_back(), and llvm::SmallVectorTemplateBase< T >::push_back().
Referenced by llvm::CastInst::getDestTy(), llvm::Function::getParamByValType(), llvm::CallSiteBase< Function, BasicBlock, Value, User, Use, Instruction, CallInst, InvokeInst, CallBrInst, User::op_iterator >::isReturnNonNull(), LLVMIntrinsicGetType(), and llvm::CallBase::setCalledFunction().
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 1095 of file Function.cpp.
Referenced by llvm::CallGraphNode::addCalledFunction(), and DeleteBasicBlock().
Returns true if the intrinsic can be overloaded.
Definition at line 1089 of file Function.cpp.
Referenced by getName(), LLVMIntrinsicIsOverloaded(), 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 59 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(), and llvm::Function::lookupIntrinsicID().
| Intrinsic::MatchIntrinsicTypesResult llvm::Intrinsic::matchIntrinsicSignature | ( | FunctionType * | FTy, |
| ArrayRef< IITDescriptor > & | Infos, | ||
| SmallVectorImpl< Type *> & | ArgTys | ||
| ) |
Match the specified function type 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 1363 of file Function.cpp.
References Check(), E, llvm::FunctionType::getReturnType(), I, matchIntrinsicType(), MatchIntrinsicTypes_Match, MatchIntrinsicTypes_NoMatchArg, MatchIntrinsicTypes_NoMatchRet, and llvm::FunctionType::params().
Referenced by getParentPad(), remangleIntrinsicFunction(), and ShrinkDemandedConstant().
| bool llvm::Intrinsic::matchIntrinsicVarArg | ( | bool | isVarArg, |
| ArrayRef< IITDescriptor > & | Infos | ||
| ) |
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 1389 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 getParentPad(), and remangleIntrinsicFunction().
Definition at line 1408 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::isVarArg(), matchIntrinsicSignature(), matchIntrinsicVarArg(), Name, llvm::None, and llvm::Function::setCallingConv().
Referenced by getArrayElements(), and UpgradeIntrinsicFunction1().
1.8.13