LLVM 22.0.0git
|
#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 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 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. | |
LLVM_ABI void | Profile (FoldingSetNodeID &ID) const |
void * | getRawPointer () const |
Return a raw pointer that uniquely identifies this attribute. | |
Static Public Attributes | |
static const unsigned | NumIntAttrKinds = LastIntAttr - FirstIntAttr + 1 |
static const unsigned | NumTypeAttrKinds = LastTypeAttr - FirstTypeAttr + 1 |
Definition at line 69 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 88 of file Attributes.h.
|
default |
Referenced by fromRawPointer(), and get().
Definition at line 785 of file Attributes.cpp.
References hasAttributeProperty().
Referenced by forceAttributes(), and llvm::ForceFunctionAttrsPass::run().
Definition at line 789 of file Attributes.cpp.
References hasAttributeProperty().
Definition at line 793 of file Attributes.cpp.
References hasAttributeProperty().
int Attribute::cmpKind | ( | Attribute | A | ) | const |
Used to sort attribute by kind.
Definition at line 739 of file Attributes.cpp.
References A, and llvm::AttributeImpl::cmp().
|
inlinestatic |
Get an attribute from a raw pointer created by getRawPointer.
Definition at line 340 of file Attributes.h.
References Attribute().
Referenced by llvm::unwrap().
|
static |
Definition at line 197 of file Attributes.cpp.
References llvm::LLVMContextImpl::Alloc, llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay >::Allocate(), assert(), Attribute(), llvm::LLVMContextImpl::AttrsSet, llvm::LLVMContextImpl::ConstantRangeListAttributes, Context, isConstantRangeListAttrKind(), llvm::ArrayRef< T >::size(), and llvm::ConstantRangeListAttributeImpl::totalSizeToAlloc().
|
static |
Definition at line 171 of file Attributes.cpp.
References assert(), Attribute(), llvm::LLVMContextImpl::AttrsSet, llvm::LLVMContextImpl::ConstantRangeAttributeAlloc, Context, llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), isConstantRangeAttrKind(), llvm::ConstantRange::isFullSet(), and llvm::APInt::Profile().
|
static |
Definition at line 149 of file Attributes.cpp.
References llvm::LLVMContextImpl::Alloc, assert(), Attribute(), llvm::LLVMContextImpl::AttrsSet, Context, and isTypeAttrKind().
|
static |
Return a uniquified Attribute object.
Definition at line 95 of file Attributes.cpp.
References llvm::LLVMContextImpl::Alloc, assert(), Attribute(), llvm::LLVMContextImpl::AttrsSet, Context, isEnumAttrKind(), and isIntAttrKind().
Referenced by llvm::AttrBuilder::addAttribute(), llvm::AttributeList::addAttributeAtIndex(), llvm::AttrBuilder::addConstantRangeAttr(), llvm::AttrBuilder::addConstantRangeListAttr(), llvm::AttrBuilder::addRawIntAttr(), llvm::memprof::CallStackTrie::addSingleAllocTypeAttribute(), llvm::AttrBuilder::addTypeAttr(), CreateGCStatepointCallCommon(), CreateGCStatepointInvokeCommon(), llvm::IRBuilderBase::CreatePreserveArrayAccessIndex(), llvm::IRBuilderBase::CreatePreserveStructAccessIndex(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), emitTPIDR2Save(), llvm::AttributeList::get(), llvm::Attributor::getAttrsFromAssumes(), llvm::IRAttribute< AK, BaseType, AAType >::getDeducedAttributes(), getWithAlignment(), getWithAllocKind(), getWithAllocSizeArgs(), getWithByRefType(), getWithByValType(), getWithCaptureInfo(), getWithDereferenceableBytes(), getWithDereferenceableOrNullBytes(), getWithInAllocaType(), getWithMemoryEffects(), getWithNewType(), getWithNoFPClass(), getWithPreallocatedType(), getWithStackAlignment(), getWithStructRetType(), getWithUWTableKind(), getWithVScaleRangeArgs(), llvm::Attributor::hasAttr(), llvm::inferAttribute(), inferInitializes(), insertCall(), llvm::AANoSync::isImpliedByIR(), llvm::AAWillReturn::isImpliedByIR(), llvm::AANoUndef::isImpliedByIR(), LLVMAddTargetDependentFunctionAttr(), LLVMCreateConstantRangeAttribute(), LLVMCreateEnumAttribute(), LLVMCreateStringAttribute(), LLVMCreateTypeAttribute(), processCallSite(), setAllocKind(), llvm::codegen::setFunctionAttributes(), llvm::setInlineRemark(), setParamElementType(), setParamReadNone(), setParamReadOnly(), setParamWriteOnly(), llvm::VFABI::setVectorVariantNames(), and upgradeSingleNVVMAnnotation().
|
static |
Definition at line 126 of file Attributes.cpp.
References llvm::LLVMContextImpl::Alloc, llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay >::Allocate(), Attribute(), llvm::LLVMContextImpl::AttrsSet, Context, llvm::StringRef::empty(), and llvm::StringAttributeImpl::totalSizeToAlloc().
MaybeAlign Attribute::getAlignment | ( | ) | const |
Returns the alignment field of an attribute as a byte alignment value.
Definition at line 435 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
Referenced by llvm::AttributeSet::intersectWith().
AllocFnKind Attribute::getAllocKind | ( | ) | const |
Definition at line 486 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
Referenced by getAsString().
Returns the argument numbers for the allocsize attribute.
Definition at line 462 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), 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 536 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::raw_ostream::flush(), llvm::Free, getAllocKind(), getAllocSizeArgs(), llvm::ConstantRange::getBitWidth(), getCaptureInfo(), getInitializes(), getKindAsEnum(), getKindAsString(), llvm::ConstantRange::getLower(), getMemoryEffects(), llvm::MemoryEffectsBase< LocationEnum >::getModRef(), getModRefStr(), getNameFromAttrKind(), getNoFPClass(), llvm::ConstantRange::getUpper(), getUWTableKind(), getValueAsConstantRange(), getValueAsInt(), llvm::AttributeImpl::getValueAsString(), getValueAsType(), getVScaleRangeMax(), getVScaleRangeMin(), hasAttribute(), llvm::InaccessibleMem, isEnumAttribute(), isStringAttribute(), isTypeAttribute(), llvm_unreachable, llvm::MemoryEffectsBase< LocationEnum >::locations(), Name, llvm::NoModRef, llvm::None, OS, llvm::Other, llvm::Type::print(), llvm::ConstantRangeList::print(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Realloc, llvm::StringRef::str(), llvm::Uninitialized, llvm::Unknown, and llvm::Zeroed.
|
static |
Definition at line 313 of file Attributes.cpp.
References llvm::StringSwitch< T, R >::Default(), and None.
Referenced by llvm::fillMapFromAssume(), forceAttributes(), llvm::getKnowledgeFromBundle(), llvm::hasAttributeInAssume(), LLVMGetEnumAttributeKindForName(), and llvm::ForceFunctionAttrsPass::run().
CaptureInfo Attribute::getCaptureInfo | ( | ) | const |
Returns information from captures attribute.
Definition at line 498 of file Attributes.cpp.
References assert(), llvm::CaptureInfo::createFromIntValue(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
Referenced by getAsString(), llvm::AttributeSet::intersectWith(), and llvm::AANoCapture::isImpliedByIR().
uint64_t Attribute::getDereferenceableBytes | ( | ) | const |
Returns the number of dereferenceable bytes from the dereferenceable attribute.
Definition at line 447 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), 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 454 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
ArrayRef< ConstantRange > Attribute::getInitializes | ( | ) | const |
Returns the value of the initializes attribute.
Definition at line 516 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsConstantRangeList(), 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 372 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getKindAsEnum(), hasKindAsEnum(), and None.
Referenced by llvm::AttrBuilder::addAttribute(), addIfNotExistent(), getAsString(), getWithNewType(), llvm::AttributeSet::intersectWith(), llvm::AANoCapture::isImpliedByIR(), 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 393 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getKindAsString(), and isStringAttribute().
Referenced by llvm::AttrBuilder::addAttribute(), addIfNotExistent(), getAsString(), and AttributeComparator::operator()().
MemoryEffects Attribute::getMemoryEffects | ( | ) | const |
Returns memory effects.
Definition at line 492 of file Attributes.cpp.
References assert(), llvm::MemoryEffectsBase< LocationEnum >::createFromIntValue(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
Referenced by addIfNotExistent(), getAsString(), and llvm::AttributeSet::intersectWith().
|
static |
Definition at line 322 of file Attributes.cpp.
References llvm_unreachable, and None.
Referenced by getAsString(), llvm::hasAttributeInAssume(), and printFunctionArgExts().
FPClassTest Attribute::getNoFPClass | ( | ) | const |
Return the FPClassTest for nofpclass.
Definition at line 504 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
Referenced by getAsString(), and llvm::AttributeSet::intersectWith().
const ConstantRange & Attribute::getRange | ( | ) | const |
Returns the value of the range attribute.
Definition at line 510 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsConstantRange(), and hasAttribute().
Referenced by AddReturnAttributes(), llvm::AttributeList::getParamRange(), llvm::AttrBuilder::getRange(), llvm::CallBase::getRange(), llvm::inferAttribute(), llvm::AttributeSet::intersectWith(), runImpl(), and llvm::AttributeFuncs::typeIncompatible().
|
inline |
Return a raw pointer that uniquely identifies this attribute.
Definition at line 335 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 441 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
UWTableKind Attribute::getUWTableKind | ( | ) | const |
Definition at line 480 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), 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 386 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsBool(), and isStringAttribute().
Referenced by llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), llvm::TargetLoweringBase::areJTsAllowed(), atomicIgnoresDenormalModeOrFPModeIsFTZ(), llvm::GCNTTIImpl::fpenvIEEEMode(), llvm::FastISel::lowerCall(), 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 414 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsConstantRange(), 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 420 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsConstantRangeList(), 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 379 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), 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 400 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsString(), and isStringAttribute().
Referenced by addIfNotExistent(), adjustCallerStackProbeSize(), adjustMinLegalVectorWidth(), llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), collectMetadataInfo(), llvm::GCNTargetMachine::createMachineScheduler(), llvm::TargetOptions::DisableFramePointerElim(), llvm::SystemZELFFrameLowering::emitPrologue(), llvm::TargetOptions::FramePointerIsReserved(), llvm::getAllocationFamily(), getDeoptLowering(), llvm::AMDGPUTargetMachine::getFeatureString(), llvm::AMDGPUTargetMachine::getGPUName(), getGridValue(), llvm::RISCVMachineFunctionInfo::getInterruptStackKind(), llvm::X86TargetLowering::getStackProbeSymbolName(), llvm::getStringFnAttrAsInt(), llvm::SystemZTargetMachine::getSubtargetImpl(), 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::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::XtensaTargetMachine::getSubtargetImpl(), llvm::VFABI::getVectorVariantNames(), llvm::PPCTargetLowering::hasInlineStackProbe(), llvm::RISCVTargetLowering::hasInlineStackProbe(), llvm::SystemZTargetLowering::hasInlineStackProbe(), llvm::X86TargetLowering::hasInlineStackProbe(), isThumbFunction(), llvm::CallLowering::lowerCall(), llvm::RISCVTargetLowering::LowerFormalArguments(), llvm::RISCVTargetLowering::LowerReturn(), llvm::GCNSubtarget::overridePostRASchedPolicy(), llvm::parseStatepointDirectivesFromAttrs(), llvm::OpenMPIRBuilder::readThreadBoundsForKernel(), and llvm::AttributeFuncs::updateMinLegalVectorWidthAttr().
Type * Attribute::getValueAsType | ( | ) | const |
Return the attribute's value as a Type.
This requires the attribute to be a type attribute.
Definition at line 407 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsType(), and isTypeAttribute().
Referenced by getAsString().
std::optional< unsigned > Attribute::getVScaleRangeMax | ( | ) | const |
Returns the maximum value for the vscale_range attribute or std::nullopt when unknown.
Definition at line 474 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), hasAttribute(), and unpackVScaleRangeArgs().
Referenced by getAsString(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::getVScaleRange(), 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 468 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), 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 234 of file Attributes.cpp.
References A, assert(), Context, get(), and llvm::Value::MaximumAlignment.
Referenced by adjustByValArgAlignment(), llvm::MatrixBuilder::CreateColumnMajorLoad(), llvm::MatrixBuilder::CreateColumnMajorStore(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemMove(), llvm::IRBuilderBase::CreateMaskedCompressStore(), llvm::IRBuilderBase::CreateMaskedExpandLoad(), createNVVMInternalAddrspaceWrap(), llvm::IRBuilderBase::CreateThreadLocalAddress(), llvm::VPInterleaveEVLRecipe::execute(), llvm::VPWidenLoadEVLRecipe::execute(), llvm::VPWidenStoreEVLRecipe::execute(), llvm::ARMTTIImpl::instCombineIntrinsic(), LLVMSetInstrParamAlignment(), LLVMSetParamAlignment(), lowerKernelArguments(), llvm::MemIntrinsicBase< Derived >::setDestAlignment(), llvm::MemTransferBase< BaseCL >::setSourceAlignment(), and llvm::InstCombinerImpl::visitCallInst().
|
static |
Definition at line 303 of file Attributes.cpp.
|
static |
Definition at line 296 of file Attributes.cpp.
References assert(), Context, get(), and packAllocSizeArgs().
Referenced by doPromotion(), and setAllocSize().
|
static |
Definition at line 264 of file Attributes.cpp.
|
static |
Definition at line 256 of file Attributes.cpp.
|
static |
Definition at line 291 of file Attributes.cpp.
References Context, get(), and llvm::CaptureInfo::toIntValue().
Referenced by addArgumentAttrs(), llvm::AANoCapture::isImpliedByIR(), and setDoesNotCapture().
|
static |
Definition at line 244 of file Attributes.cpp.
References assert(), Context, and get().
Referenced by annotateDereferenceableBytes(), and lowerKernelArguments().
|
static |
Definition at line 250 of file Attributes.cpp.
|
static |
Definition at line 272 of file Attributes.cpp.
|
static |
Definition at line 281 of file Attributes.cpp.
References Context, get(), and llvm::MemoryEffectsBase< LocationEnum >::toIntValue().
Referenced by fixupFPReturnAndCall(), 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 186 of file Attributes.h.
References assert(), Context, get(), getKindAsEnum(), and isTypeAttribute().
Referenced by llvm::AttributeList::replaceAttributeTypeAtIndex().
|
static |
Definition at line 286 of file Attributes.cpp.
|
static |
Definition at line 268 of file Attributes.cpp.
|
static |
Definition at line 239 of file Attributes.cpp.
References A, assert(), Context, and get().
Referenced by upgradeSingleNVVMAnnotation().
|
static |
Definition at line 260 of file Attributes.cpp.
|
static |
Definition at line 276 of file Attributes.cpp.
|
static |
Definition at line 307 of file Attributes.cpp.
References Context, get(), and packVScaleRangeArgs().
Return true if the attribute is present.
Definition at line 426 of file Attributes.cpp.
References llvm::AttributeImpl::hasAttribute(), and None.
Referenced by getAlignment(), getAllocKind(), getAllocSizeArgs(), getAsString(), getCaptureInfo(), 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 430 of file Attributes.cpp.
References llvm::AttributeImpl::hasAttribute(), and 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 233 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 731 of file Attributes.cpp.
References assert(), llvm::CallingConv::C, isValid(), and llvm::AttributeImpl::Profile().
Definition at line 808 of file Attributes.cpp.
References hasIntersectProperty().
Referenced by llvm::AttributeSet::intersectWith().
Definition at line 811 of file Attributes.cpp.
References hasIntersectProperty().
Referenced by llvm::AttributeSet::intersectWith().
Definition at line 817 of file Attributes.cpp.
References hasIntersectProperty().
Referenced by llvm::AttributeSet::intersectWith().
Definition at line 814 of file Attributes.cpp.
References hasIntersectProperty().
Referenced by llvm::AttributeSet::intersectWith().
bool Attribute::isConstantRangeAttribute | ( | ) | const |
Return true if the attribute is a ConstantRange attribute.
Definition at line 364 of file Attributes.cpp.
References llvm::AttributeImpl::isConstantRangeAttribute().
Referenced by addIfNotExistent(), and getValueAsConstantRange().
Definition at line 110 of file Attributes.h.
Referenced by get().
bool Attribute::isConstantRangeListAttribute | ( | ) | const |
Return true if the attribute is a ConstantRangeList attribute.
Definition at line 368 of file Attributes.cpp.
References llvm::AttributeImpl::isConstantRangeListAttribute().
Referenced by getValueAsConstantRangeList().
Definition at line 113 of file Attributes.h.
Referenced by get().
bool Attribute::isEnumAttribute | ( | ) | const |
Return true if the attribute is an Attribute::AttrKind type.
Definition at line 348 of file Attributes.cpp.
References llvm::AttributeImpl::isEnumAttribute().
Referenced by addIfNotExistent(), and getAsString().
Definition at line 101 of file Attributes.h.
Referenced by clampReturnedValueStates(), get(), llvm::IRAttribute< AK, BaseType, AAType >::hasTrivialInitializer(), llvm::AttributeSet::intersectWith(), and llvm::AttributeImpl::Profile().
Return true if the provided string matches the IR name of an attribute.
example: "noalias" return true but not "NoAlias"
Definition at line 336 of file Attributes.cpp.
References llvm::StringSwitch< T, R >::Default(), and Name.
Referenced by llvm::hasAttributeInAssume().
bool Attribute::isIntAttribute | ( | ) | const |
Return true if the attribute is an integer attribute.
Definition at line 352 of file Attributes.cpp.
References llvm::AttributeImpl::isIntAttribute().
Referenced by addIfNotExistent(), getValueAsInt(), and isEqualOrWorse().
Definition at line 104 of file Attributes.h.
Referenced by get(), llvm::AttrBuilder::getRawIntAttr(), llvm::hasAttributeInAssume(), llvm::IntAttributeImpl::IntAttributeImpl(), llvm::AttributeSet::intersectWith(), and llvm::AttributeImpl::Profile().
bool Attribute::isStringAttribute | ( | ) | const |
Return true if the attribute is a string (target-dependent) attribute.
Definition at line 356 of file Attributes.cpp.
References llvm::AttributeImpl::isStringAttribute().
Referenced by llvm::AttrBuilder::addAttribute(), addIfNotExistent(), llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), getAsString(), getKindAsString(), getValueAsBool(), getValueAsString(), hasAttribute(), hasKindAsEnum(), AttributeComparator::operator()(), and llvm::parseStatepointDirectivesFromAttrs().
bool Attribute::isTypeAttribute | ( | ) | const |
Return true if the attribute is a type attribute.
Definition at line 360 of file Attributes.cpp.
References llvm::AttributeImpl::isTypeAttribute().
Referenced by getAsString(), getValueAsType(), and getWithNewType().
Definition at line 107 of file Attributes.h.
Referenced by addRawAttributeValue(), get(), and llvm::AttrBuilder::getTypeAttr().
|
inline |
Return true if the attribute is any kind of attribute.
Definition at line 223 of file Attributes.h.
Referenced by AddParamAndFnBasicAttributes(), AddReturnAttributes(), adjustCallerStackProbeSize(), adjustMinLegalVectorWidth(), collectMetadataInfo(), llvm::AttrBuilder::contains(), llvm::GCNTargetMachine::createMachineScheduler(), llvm::TargetOptions::DisableFramePointerElim(), llvm::GCNTTIImpl::fpenvIEEEMode(), llvm::TargetOptions::FramePointerIsReserved(), llvm::getAllocationFamily(), getAllocFnKind(), llvm::AMDGPUTargetMachine::getFeatureString(), llvm::CallBase::getFnAttr(), llvm::AMDGPUTargetMachine::getGPUName(), getParameterABIAttributes(), llvm::AttrBuilder::getRange(), llvm::CallBase::getRange(), llvm::getStringFnAttrAsInt(), llvm::SystemZTargetMachine::getSubtargetImpl(), 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::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::XtensaTargetMachine::getSubtargetImpl(), llvm::getVScaleRange(), hasParentContext(), llvm::inferAttribute(), llvm::AttributeSet::intersectWith(), isThumbFunction(), llvm::SPIRVCallLowering::lowerCall(), llvm::SPIRVCallLowering::lowerReturn(), llvm::GCNSubtarget::overridePostRASchedPolicy(), runImpl(), tryToMoveFreeBeforeNullTest(), llvm::AttributeFuncs::typeIncompatible(), and llvm::AttributeFuncs::updateMinLegalVectorWidthAttr().
Definition at line 324 of file Attributes.h.
References A.
Less-than operator. Useful for sorting the attributes list.
Definition at line 749 of file Attributes.cpp.
References A.
void Attribute::Profile | ( | FoldingSetNodeID & | ID | ) | const |
Definition at line 756 of file Attributes.cpp.
Definition at line 98 of file Attributes.h.
Definition at line 99 of file Attributes.h.