|
LLVM 24.0.0git
|
Functions, function parameters, and return types can have attributes to indicate how they should be treated by optimizations and code generation. More...
#include "llvm/IR/Attributes.h"
Public Types | |
| enum | AttrKind { None , EndAttrKinds , EmptyKey , TombstoneKey } |
| This enumeration lists the attributes that can be associated with parameters, function results, or the function itself. More... | |
Public Member Functions | |
| Attribute ()=default | |
| Attribute | getWithNewType (LLVMContext &Context, Type *ReplacementTy) |
For a typed attribute, return the equivalent attribute with the type changed to ReplacementTy. | |
| LLVM_ABI bool | isEnumAttribute () const |
| Return true if the attribute is an Attribute::AttrKind type. | |
| LLVM_ABI bool | isIntAttribute () const |
| Return true if the attribute is an integer attribute. | |
| LLVM_ABI bool | isStringAttribute () const |
| Return true if the attribute is a string (target-dependent) attribute. | |
| LLVM_ABI bool | isTypeAttribute () const |
| Return true if the attribute is a type attribute. | |
| LLVM_ABI bool | isConstantRangeAttribute () const |
| Return true if the attribute is a ConstantRange attribute. | |
| LLVM_ABI bool | isConstantRangeListAttribute () const |
| Return true if the attribute is a ConstantRangeList attribute. | |
| bool | isValid () const |
| Return true if the attribute is any kind of attribute. | |
| LLVM_ABI bool | hasAttribute (AttrKind Val) const |
| Return true if the attribute is present. | |
| LLVM_ABI bool | hasAttribute (StringRef Val) const |
| Return true if the target-dependent attribute is present. | |
| bool | hasKindAsEnum () const |
| Returns true if the attribute's kind can be represented as an enum (Enum, Integer, Type, ConstantRange, or ConstantRangeList attribute). | |
| LLVM_ABI Attribute::AttrKind | getKindAsEnum () const |
| Return the attribute's kind as an enum (Attribute::AttrKind). | |
| LLVM_ABI uint64_t | getValueAsInt () const |
| Return the attribute's value as an integer. | |
| LLVM_ABI bool | getValueAsBool () const |
| Return the attribute's value as a boolean. | |
| LLVM_ABI StringRef | getKindAsString () const |
| Return the attribute's kind as a string. | |
| LLVM_ABI StringRef | getValueAsString () const |
| Return the attribute's value as a string. | |
| LLVM_ABI Type * | getValueAsType () const |
| Return the attribute's value as a Type. | |
| LLVM_ABI const ConstantRange & | getValueAsConstantRange () const |
| Return the attribute's value as a ConstantRange. | |
| LLVM_ABI ArrayRef< ConstantRange > | getValueAsConstantRangeList () const |
| Return the attribute's value as a ConstantRange array. | |
| LLVM_ABI MaybeAlign | getAlignment () const |
| Returns the alignment field of an attribute as a byte alignment value. | |
| LLVM_ABI MaybeAlign | getStackAlignment () const |
| Returns the stack alignment field of an attribute as a byte alignment value. | |
| LLVM_ABI uint64_t | getDereferenceableBytes () const |
| Returns the number of dereferenceable bytes from the dereferenceable attribute. | |
| LLVM_ABI DeadOnReturnInfo | getDeadOnReturnInfo () const |
| Returns the number of dead_on_return bytes from the dead_on_return attribute, or std::nullopt if all memory reachable through the pointer is marked dead on return. | |
| LLVM_ABI uint64_t | getDereferenceableOrNullBytes () const |
| Returns the number of dereferenceable_or_null bytes from the dereferenceable_or_null attribute. | |
| LLVM_ABI std::pair< unsigned, std::optional< unsigned > > | getAllocSizeArgs () const |
| Returns the argument numbers for the allocsize attribute. | |
| LLVM_ABI unsigned | getVScaleRangeMin () const |
| Returns the minimum value for the vscale_range attribute. | |
| LLVM_ABI std::optional< unsigned > | getVScaleRangeMax () const |
| Returns the maximum value for the vscale_range attribute or std::nullopt when unknown. | |
| LLVM_ABI UWTableKind | getUWTableKind () const |
| LLVM_ABI AllocFnKind | getAllocKind () const |
| LLVM_ABI MemoryEffects | getMemoryEffects () const |
| Returns memory effects. | |
| LLVM_ABI struct DenormalFPEnv | getDenormalFPEnv () const |
| Returns denormal_fpenv. | |
| LLVM_ABI CaptureInfo | getCaptureInfo () const |
| Returns information from captures attribute. | |
| LLVM_ABI FPClassTest | getNoFPClass () const |
| Return the FPClassTest for nofpclass. | |
| LLVM_ABI const ConstantRange & | getRange () const |
| Returns the value of the range attribute. | |
| LLVM_ABI ArrayRef< ConstantRange > | getInitializes () const |
| Returns the value of the initializes attribute. | |
| LLVM_ABI std::string | getAsString (bool InAttrGrp=false) const |
| The Attribute is converted to a string of equivalent mnemonic. | |
| LLVM_ABI bool | hasParentContext (LLVMContext &C) const |
| Return true if this attribute belongs to the LLVMContext. | |
| bool | operator== (Attribute A) const |
| Equality and non-equality operators. | |
| bool | operator!= (Attribute A) const |
| LLVM_ABI int | cmpKind (Attribute A) const |
| Used to sort attribute by kind. | |
| LLVM_ABI bool | operator< (Attribute A) const |
| Less-than operator. Useful for sorting the attributes list. | |
| void * | getRawPointer () const |
| Return a raw pointer that uniquely identifies this attribute. | |
Static Public Attributes | |
| static const unsigned | NumEnumAttrKinds = LastEnumAttr - FirstEnumAttr + 1 |
| static const unsigned | NumIntAttrKinds = LastIntAttr - FirstIntAttr + 1 |
| static const unsigned | NumTypeAttrKinds = LastTypeAttr - FirstTypeAttr + 1 |
Functions, function parameters, and return types can have attributes to indicate how they should be treated by optimizations and code generation.
This class represents one of those attributes. It's light-weight and should be passed around by-value.
Definition at line 106 of file Attributes.h.
This enumeration lists the attributes that can be associated with parameters, function results, or the function itself.
Note: The ‘uwtable’ attribute is about the ABI or the user mandating an / entry in the unwind table. The ‘nounwind’ attribute is about an exception passing by the function.
In a theoretical system that uses tables for profiling and SjLj for exceptions, they would be fully independent. In a normal system that uses tables for both, the semantics are:
nil = Needs an entry because an exception might pass by. nounwind = No need for an entry uwtable = Needs an entry because the ABI says so and because an exception might pass by. uwtable + nounwind = Needs an entry because the ABI says so.
| Enumerator | |
|---|---|
| None | No attributes have been set. |
| EndAttrKinds | Sentinel value useful for loops. |
| EmptyKey | |
| TombstoneKey | |
Definition at line 125 of file Attributes.h.
|
default |
Definition at line 823 of file Attributes.cpp.
References FnAttr, and hasAttributeProperty().
Referenced by forceAttributes(), and llvm::ForceFunctionAttrsPass::run().
Definition at line 827 of file Attributes.cpp.
References hasAttributeProperty(), and ParamAttr.
Definition at line 831 of file Attributes.cpp.
References hasAttributeProperty(), and RetAttr.
| int Attribute::cmpKind | ( | Attribute | A | ) | const |
|
inlinestatic |
Get an attribute from a raw pointer created by getRawPointer.
Definition at line 385 of file Attributes.h.
References Attribute().
Referenced by llvm::unwrap().
|
static |
Definition at line 184 of file Attributes.cpp.
References llvm::FoldingSetNodeID::AddInteger(), assert(), Attribute(), isConstantRangeListAttrKind(), llvm::ArrayRef< T >::size(), and llvm::ConstantRangeListAttributeImpl::totalSizeToAlloc().
|
static |
Definition at line 158 of file Attributes.cpp.
References llvm::FoldingSetNodeID::AddInteger(), assert(), Attribute(), llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), isConstantRangeAttrKind(), llvm::ConstantRange::isFullSet(), and llvm::APInt::Profile().
|
static |
Definition at line 141 of file Attributes.cpp.
References assert(), Attribute(), and isTypeAttrKind().
|
static |
Return a uniquified Attribute object.
Definition at line 95 of file Attributes.cpp.
References assert(), Attribute(), get(), isEnumAttrKind(), and isIntAttrKind().
Referenced by llvm::memprof::addAmbiguousAttribute(), addAssumptionsImpl(), llvm::memprof::CallStackTrie::addSingleAllocTypeAttribute(), convertToIRTypeAndAttr(), CreateGCStatepointCallCommon(), CreateGCStatepointInvokeCommon(), llvm::instrumentor::IRTCallDescription::createLLVMCall(), llvm::IRBuilderBase::CreatePreserveArrayAccessIndex(), llvm::IRBuilderBase::CreatePreserveStructAccessIndex(), llvm::IRBuilderBase::CreateStructuredAlloca(), llvm::IRBuilderBase::CreateStructuredGEP(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), get(), llvm::Attributor::getAttrsFromAssumes(), llvm::IRAttribute< AK, BaseType, AAType >::getDeducedAttributes(), getWithAlignment(), getWithAllocKind(), getWithAllocSizeArgs(), getWithByRefType(), getWithByValType(), getWithCaptureInfo(), getWithDeadOnReturnInfo(), getWithDereferenceableBytes(), getWithDereferenceableOrNullBytes(), getWithInAllocaType(), getWithMemoryEffects(), getWithNewType(), getWithNoFPClass(), getWithPreallocatedType(), getWithStackAlignment(), getWithStructRetType(), getWithUWTableKind(), getWithVScaleRangeArgs(), llvm::Attributor::hasAttr(), llvm::inferAttribute(), inferInitializes(), insertCall(), llvm::AANoSync::isImpliedByIR(), llvm::AANoUndef::isImpliedByIR(), llvm::AAWillReturn::isImpliedByIR(), LLVMAddTargetDependentFunctionAttr(), LLVMCreateConstantRangeAttribute(), LLVMCreateDenormalFPEnvAttribute(), LLVMCreateEnumAttribute(), LLVMCreateStringAttribute(), LLVMCreateTypeAttribute(), LLVMDIBuilderGetOrCreateArray(), LLVMDIBuilderGetOrCreateTypeArray(), processCallSite(), llvm::InlinerPass::run(), setAllocKind(), llvm::codegen::setFunctionAttributes(), llvm::setInlineRemark(), setParamElementType(), setParamReadNone(), setParamReadOnly(), setParamWriteOnly(), llvm::VFABI::setVectorVariantNames(), and upgradeSingleNVVMAnnotation().
|
static |
Definition at line 123 of file Attributes.cpp.
References Attribute(), and llvm::StringAttributeImpl::totalSizeToAlloc().
| MaybeAlign Attribute::getAlignment | ( | ) | const |
Returns the alignment field of an attribute as a byte alignment value.
Definition at line 419 of file Attributes.cpp.
References assert(), and hasAttribute().
Referenced by llvm::AttributeSet::intersectWith().
| AllocFnKind Attribute::getAllocKind | ( | ) | const |
Definition at line 477 of file Attributes.cpp.
References assert(), and hasAttribute().
Referenced by getAsString().
Returns the argument numbers for the allocsize attribute.
Definition at line 453 of file Attributes.cpp.
References assert(), hasAttribute(), and unpackAllocSizeArgs().
Referenced by getAllocationSize(), and getAsString().
| std::string Attribute::getAsString | ( | bool | InAttrGrp = false | ) | const |
The Attribute is converted to a string of equivalent mnemonic.
This is, presumably, for writing out the mnemonics for the assembly writer.
Definition at line 531 of file Attributes.cpp.
References llvm::Aligned, llvm::Alloc, llvm::ArgMem, assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::Default, llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::ErrnoMem, llvm::First, llvm::Free, getAllocKind(), getAllocSizeArgs(), llvm::ConstantRange::getBitWidth(), getCaptureInfo(), getDenormalFPEnv(), getInitializes(), getKindAsEnum(), getKindAsString(), llvm::ConstantRange::getLower(), getMemoryEffects(), llvm::MemoryEffectsBase< LocationEnum >::getModRef(), getModRefStr(), getNameFromAttrKind(), getNoFPClass(), llvm::ConstantRange::getUpper(), getUWTableKind(), getValueAsConstantRange(), getValueAsInt(), getValueAsType(), getVScaleRangeMax(), getVScaleRangeMin(), hasAttribute(), llvm::InaccessibleMem, isEnumAttribute(), isStringAttribute(), llvm::MemoryEffectsBase< LocationEnum >::isTargetMemLoc(), llvm::MemoryEffectsBase< LocationEnum >::isTargetMemLocSameForAll(), isTypeAttribute(), llvm::join(), llvm_unreachable, llvm::MemoryEffectsBase< IRMemLocation >::locations(), llvm::NoModRef, llvm::None, llvm::Other, llvm::ConstantRangeList::print(), llvm::DenormalFPEnv::print(), llvm::Type::print(), llvm::printEscapedString(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Realloc, llvm::StringRef::str(), llvm::TargetMem0, llvm::TargetMem1, llvm::Uninitialized, llvm::Unknown, and llvm::Zeroed.
Referenced by LLVMGetAsString().
|
static |
Definition at line 305 of file Attributes.cpp.
References llvm::StringSwitch< T, R >::Default(), and None.
Referenced by llvm::fillMapFromAssume(), forceAttributes(), llvm::getKnowledgeFromBundle(), LLVMGetEnumAttributeKindForName(), and llvm::ForceFunctionAttrsPass::run().
| CaptureInfo Attribute::getCaptureInfo | ( | ) | const |
Returns information from captures attribute.
Definition at line 489 of file Attributes.cpp.
References assert(), llvm::CaptureInfo::createFromIntValue(), and hasAttribute().
Referenced by getAsString(), llvm::AttributeSet::intersectWith(), and llvm::AANoCapture::isImpliedByIR().
| DeadOnReturnInfo Attribute::getDeadOnReturnInfo | ( | ) | const |
Returns the number of dead_on_return bytes from the dead_on_return attribute, or std::nullopt if all memory reachable through the pointer is marked dead on return.
Definition at line 438 of file Attributes.cpp.
References assert(), llvm::DeadOnReturnInfo::createFromIntValue(), and hasAttribute().
| DenormalFPEnv Attribute::getDenormalFPEnv | ( | ) | const |
Returns denormal_fpenv.
Definition at line 495 of file Attributes.cpp.
References llvm::DenormalFPEnv::createFromIntValue().
Referenced by getAsString().
| uint64_t Attribute::getDereferenceableBytes | ( | ) | const |
Returns the number of dereferenceable bytes from the dereferenceable attribute.
Definition at line 431 of file Attributes.cpp.
References assert(), and hasAttribute().
Referenced by tryToMoveFreeBeforeNullTest().
| uint64_t Attribute::getDereferenceableOrNullBytes | ( | ) | const |
Returns the number of dereferenceable_or_null bytes from the dereferenceable_or_null attribute.
Definition at line 445 of file Attributes.cpp.
References assert(), and hasAttribute().
| ArrayRef< ConstantRange > Attribute::getInitializes | ( | ) | const |
Returns the value of the initializes attribute.
Definition at line 511 of file Attributes.cpp.
References assert(), and hasAttribute().
Referenced by getAsString().
| Attribute::AttrKind Attribute::getKindAsEnum | ( | ) | const |
Return the attribute's kind as an enum (Attribute::AttrKind).
This requires the attribute be representable as an enum (see: hasKindAsEnum).
Definition at line 356 of file Attributes.cpp.
References assert(), hasKindAsEnum(), and None.
Referenced by getAsString(), getAttrToAdd(), getWithNewType(), llvm::AttributeSet::intersectWith(), llvm::AANoCapture::isImpliedByIR(), LLVMGetEnumAttributeKind(), AttributeComparator::operator()(), and AttributeComparator::operator()().
| StringRef Attribute::getKindAsString | ( | ) | const |
Return the attribute's kind as a string.
This requires the attribute to be a string attribute.
Definition at line 377 of file Attributes.cpp.
References assert(), and isStringAttribute().
Referenced by getAsString(), LLVMGetStringAttributeKind(), AttributeComparator::operator()(), AttributeComparator::operator()(), and llvm::RISCVTTIImpl::shouldCopyAttributeWhenOutliningFrom().
| MemoryEffects Attribute::getMemoryEffects | ( | ) | const |
Returns memory effects.
Definition at line 483 of file Attributes.cpp.
References assert(), llvm::MemoryEffectsBase< IRMemLocation >::createFromIntValue(), and hasAttribute().
Referenced by getAsString(), getAttrToAdd(), and llvm::AttributeSet::intersectWith().
|
static |
Definition at line 314 of file Attributes.cpp.
References llvm_unreachable, and None.
Referenced by getAsString(), and printFunctionArgExts().
| FPClassTest Attribute::getNoFPClass | ( | ) | const |
Return the FPClassTest for nofpclass.
Definition at line 499 of file Attributes.cpp.
References assert(), and hasAttribute().
Referenced by AddReturnAttributes(), getAsString(), and llvm::AttributeSet::intersectWith().
| const ConstantRange & Attribute::getRange | ( | ) | const |
Returns the value of the range attribute.
Definition at line 505 of file Attributes.cpp.
References assert(), and hasAttribute().
Referenced by addNoUndefAttrs(), AddReturnAttributes(), llvm::CallBase::getRange(), llvm::inferAttribute(), llvm::AttributeSet::intersectWith(), runImpl(), and llvm::typeIncompatible().
|
inline |
Return a raw pointer that uniquely identifies this attribute.
Definition at line 380 of file Attributes.h.
Referenced by llvm::wrap().
| MaybeAlign Attribute::getStackAlignment | ( | ) | const |
Returns the stack alignment field of an attribute as a byte alignment value.
Definition at line 425 of file Attributes.cpp.
References assert(), and hasAttribute().
| UWTableKind Attribute::getUWTableKind | ( | ) | const |
Definition at line 471 of file Attributes.cpp.
References assert(), and hasAttribute().
Referenced by getAsString().
| bool Attribute::getValueAsBool | ( | ) | const |
Return the attribute's value as a boolean.
This requires that the attribute be a string attribute.
Definition at line 370 of file Attributes.cpp.
References assert(), and isStringAttribute().
Referenced by llvm::AMDGPUMachineFunctionInfo::AMDGPUMachineFunctionInfo(), llvm::TargetLoweringBase::areJTsAllowed(), llvm::GCNTTIImpl::fpenvIEEEMode(), and simplifySwitchLookup().
| const ConstantRange & Attribute::getValueAsConstantRange | ( | ) | const |
Return the attribute's value as a ConstantRange.
This requires the attribute to be a ConstantRange attribute.
Definition at line 398 of file Attributes.cpp.
References assert(), and isConstantRangeAttribute().
Referenced by getAsString().
| ArrayRef< ConstantRange > Attribute::getValueAsConstantRangeList | ( | ) | const |
Return the attribute's value as a ConstantRange array.
This requires the attribute to be a ConstantRangeList attribute.
Definition at line 404 of file Attributes.cpp.
References assert(), and isConstantRangeListAttribute().
| uint64_t Attribute::getValueAsInt | ( | ) | const |
Return the attribute's value as an integer.
This requires that the attribute be an integer attribute.
Definition at line 363 of file Attributes.cpp.
References assert(), and isIntAttribute().
Referenced by getAllocFnKind(), getAsString(), llvm::AttributeSet::intersectWith(), and isEqualOrWorse().
| StringRef Attribute::getValueAsString | ( | ) | const |
Return the attribute's value as a string.
This requires the attribute to be a string attribute.
Definition at line 384 of file Attributes.cpp.
References assert(), and isStringAttribute().
Referenced by llvm::AArch64FunctionInfo::AArch64FunctionInfo(), llvm::memprof::addAmbiguousAttribute(), adjustCallerStackProbeSize(), adjustMinLegalVectorWidth(), collectMetadataInfo(), llvm::WebAssemblyAsmPrinter::emitGlobalVariable(), llvm::SystemZELFFrameLowering::emitPrologue(), expandPtrauthForEmuPAC(), llvm::getAllocationFamily(), llvm::AMDGPUTargetMachine::getFeatureString(), getFramePointerPolicy(), llvm::AMDGPUTargetMachine::getGPUName(), llvm::RISCVMachineFunctionInfo::getInterruptStackKind(), llvm::AMDGPU::getSchedStrategy(), llvm::X86TargetLowering::getStackProbeSymbolName(), llvm::getStringFnAttrAsInt(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::CSKYTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::LoongArchTargetMachine::getSubtargetImpl(), llvm::M68kTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::SparcTargetMachine::getSubtargetImpl(), llvm::SystemZTargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::XtensaTargetMachine::getSubtargetImpl(), llvm::VFABI::getVectorVariantNames(), hasEHTargetFeatureAttr(), llvm::HexagonTargetLowering::hasInlineStackProbe(), llvm::LoongArchTargetLowering::hasInlineStackProbe(), llvm::PPCTargetLowering::hasInlineStackProbe(), llvm::RISCVTargetLowering::hasInlineStackProbe(), llvm::SystemZTargetLowering::hasInlineStackProbe(), llvm::X86TargetLowering::hasInlineStackProbe(), isThumbFunction(), LLVMGetStringAttributeValue(), llvm::RISCVTargetLowering::LowerFormalArguments(), llvm::RISCVTargetLowering::LowerReturn(), optimizeModularFormat(), llvm::GCNSubtarget::overridePostRASchedPolicy(), llvm::parseStatepointDirectivesFromAttrs(), llvm::memprof::removeAnyExistingAmbiguousAttribute(), llvm::updateMinLegalVectorWidthAttr(), useNoopPostScheduler(), and verifyAMDGPUReqdWorkGroupSize().
| Type * Attribute::getValueAsType | ( | ) | const |
Return the attribute's value as a Type.
This requires the attribute to be a type attribute.
Definition at line 391 of file Attributes.cpp.
References assert(), and isTypeAttribute().
Referenced by llvm::StructuredAllocaInst::getAllocationType(), getAsString(), and llvm::StructuredGEPInst::getBaseType().
| std::optional< unsigned > Attribute::getVScaleRangeMax | ( | ) | const |
Returns the maximum value for the vscale_range attribute or std::nullopt when unknown.
Definition at line 465 of file Attributes.cpp.
References assert(), hasAttribute(), and unpackVScaleRangeArgs().
Referenced by getAsString(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::getVScaleRange(), simplifyBinaryIntrinsic(), llvm::InstCombinerImpl::visitSExt(), llvm::InstCombinerImpl::visitTrunc(), and llvm::InstCombinerImpl::visitZExt().
| unsigned Attribute::getVScaleRangeMin | ( | ) | const |
Returns the minimum value for the vscale_range attribute.
Definition at line 459 of file Attributes.cpp.
References assert(), hasAttribute(), and unpackVScaleRangeArgs().
Referenced by getAsString(), llvm::RISCVTargetMachine::getSubtargetImpl(), and llvm::getVScaleRange().
|
static |
Return a uniquified Attribute object that has the specific alignment set.
Definition at line 221 of file Attributes.cpp.
References A(), assert(), get(), and llvm::Value::MaximumAlignment.
Referenced by llvm::MatrixBuilder::CreateColumnMajorLoad(), llvm::MatrixBuilder::CreateColumnMajorStore(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemMove(), llvm::IRBuilderBase::CreateMaskedCompressStore(), llvm::IRBuilderBase::CreateMaskedExpandLoad(), llvm::IRBuilderBase::CreateMaskedGather(), llvm::IRBuilderBase::CreateMaskedLoad(), llvm::IRBuilderBase::CreateMaskedScatter(), llvm::IRBuilderBase::CreateMaskedStore(), llvm::OpenMPIRBuilder::createOMPAllocShared(), llvm::IRBuilderBase::CreateThreadLocalAddress(), llvm::VPInterleaveEVLRecipe::execute(), llvm::VPWidenLoadEVLRecipe::execute(), llvm::VPWidenMemIntrinsicRecipe::execute(), llvm::VPWidenStoreEVLRecipe::execute(), llvm::ARMTTIImpl::instCombineIntrinsic(), LLVMSetInstrParamAlignment(), LLVMSetParamAlignment(), lowerKernelArguments(), setByValParamABIAlign(), llvm::MemIntrinsicBase< Derived >::setDestAlignment(), llvm::MemIntrinsicBase< Derived >::setDestAlignment(), llvm::MemTransferBase< BaseCL >::setSourceAlignment(), llvm::MemTransferBase< BaseCL >::setSourceAlignment(), tryToImproveAlign(), and llvm::InstCombinerImpl::visitCallInst().
|
static |
Definition at line 295 of file Attributes.cpp.
References get().
|
static |
Definition at line 288 of file Attributes.cpp.
References assert(), get(), and packAllocSizeArgs().
Referenced by doPromotion(), and setAllocSize().
|
static |
Definition at line 251 of file Attributes.cpp.
References get().
|
static |
Definition at line 243 of file Attributes.cpp.
References get().
|
static |
Definition at line 283 of file Attributes.cpp.
References get(), and llvm::CaptureInfo::toIntValue().
Referenced by addArgumentAttrs(), llvm::AANoCapture::isImpliedByIR(), and setDoesNotCapture().
|
static |
Definition at line 278 of file Attributes.cpp.
References get(), and llvm::DeadOnReturnInfo::toIntValue().
|
static |
Definition at line 231 of file Attributes.cpp.
References assert(), and get().
Referenced by annotateDereferenceableBytes(), llvm::GCNTTIImpl::instCombineIntrinsic(), and lowerKernelArguments().
|
static |
Definition at line 237 of file Attributes.cpp.
|
static |
Definition at line 259 of file Attributes.cpp.
References get().
|
static |
Definition at line 268 of file Attributes.cpp.
References get(), and llvm::MemoryEffectsBase< LocationEnum >::toIntValue().
Referenced by fixupFPReturnAndCall(), getAttrToAdd(), llvm::AMDGPULibFunc::getOrInsertFunction(), runIPSCCP(), and llvm::CallBase::setMemoryEffects().
|
inline |
For a typed attribute, return the equivalent attribute with the type changed to ReplacementTy.
Definition at line 229 of file Attributes.h.
References assert(), get(), getKindAsEnum(), and isTypeAttribute().
|
static |
Definition at line 273 of file Attributes.cpp.
References get().
Referenced by addArgumentAttrsFromCallsites(), addNoFPClassAttrsTopDown(), and llvm::RTLIB::RuntimeLibcallsInfo::getFunctionTy().
|
static |
Definition at line 255 of file Attributes.cpp.
References get().
|
static |
Definition at line 226 of file Attributes.cpp.
References A(), assert(), and get().
Referenced by promoteParamAlign(), and upgradeSingleNVVMAnnotation().
|
static |
Definition at line 247 of file Attributes.cpp.
References get().
|
static |
Definition at line 263 of file Attributes.cpp.
References get(), and uint64_t.
Referenced by llvm::Function::setUWTableKind().
|
static |
Definition at line 299 of file Attributes.cpp.
References get(), and packVScaleRangeArgs().
Return true if the attribute is present.
Definition at line 410 of file Attributes.cpp.
References None.
Referenced by getAlignment(), getAllocKind(), getAllocSizeArgs(), getAsString(), getCaptureInfo(), getDeadOnReturnInfo(), getDereferenceableBytes(), getDereferenceableOrNullBytes(), getInitializes(), getMemoryEffects(), getNoFPClass(), getRange(), getStackAlignment(), getUWTableKind(), getVScaleRangeMax(), getVScaleRangeMin(), and llvm::isStatepointDirectiveAttr().
Return true if the target-dependent attribute is present.
Definition at line 414 of file Attributes.cpp.
References isStringAttribute().
|
inline |
Returns true if the attribute's kind can be represented as an enum (Enum, Integer, Type, ConstantRange, or ConstantRangeList attribute).
Definition at line 272 of file Attributes.h.
References isStringAttribute().
Referenced by getKindAsEnum(), and llvm::AttributeSet::intersectWith().
| bool Attribute::hasParentContext | ( | LLVMContext & | C | ) | const |
Return true if this attribute belongs to the LLVMContext.
Definition at line 758 of file Attributes.cpp.
References assert(), llvm::LLVMContextImpl::AttrsSet, C(), llvm::LLVMContextImpl::EnumAttrs, llvm::LLVMContextImpl::IntAttrs, isValid(), llvm::LLVMContextImpl::StringAttrs, and llvm::LLVMContextImpl::TypeAttrs.
Definition at line 850 of file Attributes.cpp.
References hasIntersectProperty(), and IntersectPreserve.
Referenced by llvm::AttributeSet::intersectWith().
Definition at line 853 of file Attributes.cpp.
References hasIntersectProperty(), and IntersectAnd.
Referenced by llvm::AttributeSet::intersectWith().
Definition at line 859 of file Attributes.cpp.
References hasIntersectProperty(), and IntersectCustom.
Referenced by llvm::AttributeSet::intersectWith().
Definition at line 856 of file Attributes.cpp.
References hasIntersectProperty(), and IntersectMin.
Referenced by llvm::AttributeSet::intersectWith().
Whether this is an ABI attribute (for returns or arguments).
Definition at line 835 of file Attributes.cpp.
References ABIAttr, and hasAttributeProperty().
| bool Attribute::isConstantRangeAttribute | ( | ) | const |
Return true if the attribute is a ConstantRange attribute.
Definition at line 348 of file Attributes.cpp.
Referenced by getAttrToAdd(), and getValueAsConstantRange().
Definition at line 148 of file Attributes.h.
Referenced by get().
| bool Attribute::isConstantRangeListAttribute | ( | ) | const |
Return true if the attribute is a ConstantRangeList attribute.
Definition at line 352 of file Attributes.cpp.
Referenced by getValueAsConstantRangeList().
Definition at line 151 of file Attributes.h.
Referenced by get().
| bool Attribute::isEnumAttribute | ( | ) | const |
Return true if the attribute is an Attribute::AttrKind type.
Definition at line 332 of file Attributes.cpp.
Referenced by getAsString(), and getAttrToAdd().
Definition at line 139 of file Attributes.h.
Referenced by clampReturnedValueStates(), get(), llvm::IRAttribute< AK, BaseType, AAType >::hasTrivialInitializer(), and llvm::AttributeSet::intersectWith().
| bool Attribute::isIntAttribute | ( | ) | const |
Return true if the attribute is an integer attribute.
Definition at line 336 of file Attributes.cpp.
Referenced by getAttrToAdd(), getValueAsInt(), and isEqualOrWorse().
Definition at line 142 of file Attributes.h.
Referenced by get(), llvm::IntAttributeImpl::IntAttributeImpl(), and llvm::AttributeSet::intersectWith().
| bool Attribute::isStringAttribute | ( | ) | const |
Return true if the attribute is a string (target-dependent) attribute.
Definition at line 340 of file Attributes.cpp.
Referenced by getAsString(), getAttrToAdd(), getKindAsString(), getValueAsBool(), getValueAsString(), hasAttribute(), hasKindAsEnum(), LLVMIsStringAttribute(), llvm::Attributor::manifestAttrs(), AttributeComparator::operator()(), AttributeComparator::operator()(), AttributeComparator::operator()(), llvm::parseStatepointDirectivesFromAttrs(), llvm::RISCVTTIImpl::shouldCopyAttributeWhenOutliningFrom(), and verifyAMDGPUReqdWorkGroupSize().
| bool Attribute::isTypeAttribute | ( | ) | const |
Return true if the attribute is a type attribute.
Definition at line 344 of file Attributes.cpp.
Referenced by getAsString(), getValueAsType(), getWithNewType(), and LLVMIsTypeAttribute().
Definition at line 145 of file Attributes.h.
Referenced by addRawAttributeValue(), and get().
|
inline |
Return true if the attribute is any kind of attribute.
Definition at line 262 of file Attributes.h.
Referenced by llvm::AArch64FunctionInfo::AArch64FunctionInfo(), addMBBNames(), addNoUndefAttrs(), AddParamAndFnBasicAttributes(), AddReturnAttributes(), adjustCallerStackProbeSize(), adjustMinLegalVectorWidth(), collectMetadataInfo(), expandPtrauthForEmuPAC(), llvm::GCNTTIImpl::fpenvIEEEMode(), llvm::getAllocationFamily(), getAllocFnKind(), getAttrToAdd(), llvm::AMDGPUTargetMachine::getFeatureString(), llvm::CallBase::getFnAttr(), getFramePointerPolicy(), llvm::AMDGPUTargetMachine::getGPUName(), getParameterABIAttributes(), llvm::CallBase::getRange(), llvm::AMDGPU::getSchedStrategy(), llvm::getStringFnAttrAsInt(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::CSKYTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::LoongArchTargetMachine::getSubtargetImpl(), llvm::M68kTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::SparcTargetMachine::getSubtargetImpl(), llvm::SystemZTargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::XtensaTargetMachine::getSubtargetImpl(), llvm::getVScaleRange(), hasEHTargetFeatureAttr(), hasParentContext(), llvm::inferAttribute(), llvm::AttributeSet::intersectWith(), isThumbFunction(), llvm::SPIRVCallLowering::lowerCall(), llvm::SPIRVCallLowering::lowerReturn(), llvm::GCNSubtarget::overridePostRASchedPolicy(), runImpl(), simplifyBinaryIntrinsic(), tryToMoveFreeBeforeNullTest(), llvm::typeIncompatible(), llvm::updateMinLegalVectorWidthAttr(), useNoopPostScheduler(), and verifyAMDGPUReqdWorkGroupSize().
Definition at line 371 of file Attributes.h.
References A().
Less-than operator. Useful for sorting the attributes list.
Definition at line 790 of file Attributes.cpp.
References A().
Definition at line 135 of file Attributes.h.
Definition at line 136 of file Attributes.h.
Definition at line 137 of file Attributes.h.