LLVM 20.0.0git
|
#include "llvm/Support/ModRef.h"
Public Types | |
using | Location = LocationEnum |
Public Member Functions | |
MemoryEffectsBase (Location Loc, ModRefInfo MR) | |
Create MemoryEffectsBase that can access only the given location with the given ModRefInfo. | |
MemoryEffectsBase (ModRefInfo MR) | |
Create MemoryEffectsBase that can access any location with the given ModRefInfo. | |
uint32_t | toIntValue () const |
Convert MemoryEffectsBase into an encoded integer value (used by memory attribute). | |
ModRefInfo | getModRef (Location Loc) const |
Get ModRefInfo for the given Location. | |
MemoryEffectsBase | getWithModRef (Location Loc, ModRefInfo MR) const |
Get new MemoryEffectsBase with modified ModRefInfo for Loc. | |
MemoryEffectsBase | getWithoutLoc (Location Loc) const |
Get new MemoryEffectsBase with NoModRef on the given Loc. | |
ModRefInfo | getModRef () const |
Get ModRefInfo for any location. | |
bool | doesNotAccessMemory () const |
Whether this function accesses no memory. | |
bool | onlyReadsMemory () const |
Whether this function only (at most) reads memory. | |
bool | onlyWritesMemory () const |
Whether this function only (at most) writes memory. | |
bool | onlyAccessesArgPointees () const |
Whether this function only (at most) accesses argument memory. | |
bool | doesAccessArgPointees () const |
Whether this function may access argument memory. | |
bool | onlyAccessesInaccessibleMem () const |
Whether this function only (at most) accesses inaccessible memory. | |
bool | onlyAccessesInaccessibleOrArgMem () const |
Whether this function only (at most) accesses argument and inaccessible memory. | |
MemoryEffectsBase | operator& (MemoryEffectsBase Other) const |
Intersect with other MemoryEffectsBase. | |
MemoryEffectsBase & | operator&= (MemoryEffectsBase Other) |
Intersect (in-place) with other MemoryEffectsBase. | |
MemoryEffectsBase | operator| (MemoryEffectsBase Other) const |
Union with other MemoryEffectsBase. | |
MemoryEffectsBase & | operator|= (MemoryEffectsBase Other) |
Union (in-place) with other MemoryEffectsBase. | |
MemoryEffectsBase | operator- (MemoryEffectsBase Other) const |
Subtract other MemoryEffectsBase. | |
MemoryEffectsBase & | operator-= (MemoryEffectsBase Other) |
Subtract (in-place) with other MemoryEffectsBase. | |
bool | operator== (MemoryEffectsBase Other) const |
Check whether this is the same as other MemoryEffectsBase. | |
bool | operator!= (MemoryEffectsBase Other) const |
Check whether this is different from other MemoryEffectsBase. | |
Static Public Member Functions | |
static auto | locations () |
Returns iterator over all supported location kinds. | |
static MemoryEffectsBase | unknown () |
Create MemoryEffectsBase that can read and write any memory. | |
static MemoryEffectsBase | none () |
Create MemoryEffectsBase that cannot read or write any memory. | |
static MemoryEffectsBase | readOnly () |
Create MemoryEffectsBase that can read any memory. | |
static MemoryEffectsBase | writeOnly () |
Create MemoryEffectsBase that can write any memory. | |
static MemoryEffectsBase | argMemOnly (ModRefInfo MR=ModRefInfo::ModRef) |
Create MemoryEffectsBase that can only access argument memory. | |
static MemoryEffectsBase | inaccessibleMemOnly (ModRefInfo MR=ModRefInfo::ModRef) |
Create MemoryEffectsBase that can only access inaccessible memory. | |
static MemoryEffectsBase | inaccessibleOrArgMemOnly (ModRefInfo MR=ModRefInfo::ModRef) |
Create MemoryEffectsBase that can only access inaccessible or argument memory. | |
static MemoryEffectsBase | createFromIntValue (uint32_t Data) |
Create MemoryEffectsBase from an encoded integer value (used by memory attribute). | |
using llvm::MemoryEffectsBase< LocationEnum >::Location = LocationEnum |
|
inline |
Create MemoryEffectsBase that can access only the given location with the given ModRefInfo.
|
inlineexplicit |
Create MemoryEffectsBase that can access any location with the given ModRefInfo.
Definition at line 106 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::locations().
|
inlinestatic |
Create MemoryEffectsBase that can only access argument memory.
Definition at line 132 of file ModRef.h.
Referenced by addLocAccess(), checkFunctionMemoryAccess(), llvm::Function::setOnlyAccessesArgMemory(), llvm::CallBase::setOnlyAccessesArgMemory(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().
|
inlinestatic |
Create MemoryEffectsBase from an encoded integer value (used by memory attribute).
Definition at line 154 of file ModRef.h.
Referenced by llvm::Attribute::getMemoryEffects().
|
inline |
Whether this function may access argument memory.
Definition at line 206 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::getModRef(), and llvm::isModOrRefSet().
|
inline |
Whether this function accesses no memory.
Definition at line 192 of file ModRef.h.
Referenced by llvm::canSinkOrHoistInst(), checkFunctionMemoryAccess(), llvm::Function::doesNotAccessMemory(), llvm::CallBase::doesNotAccessMemory(), llvm::AAResults::doesNotAccessMemory(), getFunctionControl(), llvm::SITargetLowering::getTgtMemIntrinsic(), llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesArgPointees(), llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleMem(), and llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleOrArgMem().
|
inline |
Get ModRefInfo for any location.
Definition at line 184 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::getModRef(), llvm::MemoryEffectsBase< LocationEnum >::locations(), and llvm::NoModRef.
Referenced by llvm::MemoryEffectsBase< LocationEnum >::doesAccessArgPointees(), llvm::MemoryEffectsBase< LocationEnum >::getModRef(), llvm::MemoryEffectsBase< LocationEnum >::onlyReadsMemory(), and llvm::MemoryEffectsBase< LocationEnum >::onlyWritesMemory().
|
inline |
Get ModRefInfo for the given Location.
Definition at line 165 of file ModRef.h.
Referenced by llvm::AliasSetTracker::add(), addMemoryAttrs(), checkFunctionMemoryAccess(), determinePointerAccessAttrs(), llvm::Attribute::getAsString(), llvm::AAResults::getModRefInfo(), llvm::operator<<(), and runIPSCCP().
|
inline |
Get new MemoryEffectsBase with modified ModRefInfo for Loc.
|
inline |
Get new MemoryEffectsBase with NoModRef on the given Loc.
Definition at line 177 of file ModRef.h.
References llvm::NoModRef.
Referenced by checkFunctionMemoryAccess(), llvm::AAResults::getModRefInfo(), llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesArgPointees(), llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleMem(), and llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleOrArgMem().
|
inlinestatic |
Create MemoryEffectsBase that can only access inaccessible memory.
Definition at line 138 of file ModRef.h.
Referenced by checkFunctionMemoryAccess(), decodeLLVMAttributesForBitcode(), llvm::BasicAAResult::getMemoryEffects(), llvm::Function::setOnlyAccessesInaccessibleMemory(), llvm::CallBase::setOnlyAccessesInaccessibleMemory(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().
|
inlinestatic |
Create MemoryEffectsBase that can only access inaccessible or argument memory.
Definition at line 145 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::none().
Referenced by decodeLLVMAttributesForBitcode(), llvm::Function::setOnlyAccessesInaccessibleMemOrArgMem(), llvm::CallBase::setOnlyAccessesInaccessibleMemOrArgMem(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().
|
inlinestatic |
Returns iterator over all supported location kinds.
Definition at line 95 of file ModRef.h.
References llvm::enum_seq_inclusive(), and llvm::force_iteration_on_noniterable_enum.
Referenced by llvm::Attribute::getAsString(), llvm::MemoryEffectsBase< LocationEnum >::getModRef(), llvm::MemoryEffectsBase< LocationEnum >::MemoryEffectsBase(), and llvm::operator<<().
|
inlinestatic |
Create MemoryEffectsBase that cannot read or write any memory.
Definition at line 117 of file ModRef.h.
References llvm::NoModRef.
Referenced by addMemoryAttrs(), checkFunctionMemoryAccess(), decodeLLVMAttributesForBitcode(), fixupFPReturnAndCall(), llvm::TypeBasedAAResult::getMemoryEffects(), llvm::objcarc::ObjCARCAAResult::getMemoryEffects(), llvm::MemoryEffectsBase< LocationEnum >::inaccessibleOrArgMemOnly(), llvm::Function::setDoesNotAccessMemory(), llvm::CallBase::setDoesNotAccessMemory(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().
|
inline |
Whether this function only (at most) accesses argument memory.
Definition at line 201 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::doesNotAccessMemory(), and llvm::MemoryEffectsBase< LocationEnum >::getWithoutLoc().
Referenced by AddAliasScopeMetadata(), llvm::objcarc::CanAlterRefCount(), llvm::canSinkOrHoistInst(), llvm::Function::onlyAccessesArgMemory(), and llvm::CallBase::onlyAccessesArgMemory().
|
inline |
Whether this function only (at most) accesses inaccessible memory.
Definition at line 211 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::doesNotAccessMemory(), and llvm::MemoryEffectsBase< LocationEnum >::getWithoutLoc().
Referenced by AddAliasScopeMetadata(), llvm::Function::onlyAccessesInaccessibleMemory(), and llvm::CallBase::onlyAccessesInaccessibleMemory().
|
inline |
Whether this function only (at most) accesses argument and inaccessible memory.
Definition at line 217 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::doesNotAccessMemory(), and llvm::MemoryEffectsBase< LocationEnum >::getWithoutLoc().
Referenced by llvm::Function::onlyAccessesInaccessibleMemOrArgMem(), and llvm::CallBase::onlyAccessesInaccessibleMemOrArgMem().
|
inline |
Whether this function only (at most) reads memory.
Definition at line 195 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::getModRef(), and llvm::isModSet().
Referenced by llvm::objcarc::CanAlterRefCount(), llvm::canSinkOrHoistInst(), getFunctionControl(), llvm::SITargetLowering::getTgtMemIntrinsic(), llvm::AANoSync::isImpliedByIR(), llvm::AAWillReturn::isImpliedByMustprogressAndReadonly(), llvm::Function::onlyReadsMemory(), llvm::CallBase::onlyReadsMemory(), and llvm::AAResults::onlyReadsMemory().
|
inline |
Whether this function only (at most) writes memory.
Definition at line 198 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::getModRef(), and llvm::isRefSet().
Referenced by llvm::SITargetLowering::getTgtMemIntrinsic(), llvm::Function::onlyWritesMemory(), and llvm::CallBase::onlyWritesMemory().
|
inline |
Check whether this is different from other MemoryEffectsBase.
Definition at line 260 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::operator==(), and llvm::Other.
|
inline |
Intersect with other MemoryEffectsBase.
Definition at line 224 of file ModRef.h.
References llvm::Other.
|
inline |
Intersect (in-place) with other MemoryEffectsBase.
Definition at line 229 of file ModRef.h.
References llvm::Other.
|
inline |
|
inline |
Subtract (in-place) with other MemoryEffectsBase.
|
inline |
Check whether this is the same as other MemoryEffectsBase.
Definition at line 257 of file ModRef.h.
References llvm::Other.
Referenced by llvm::MemoryEffectsBase< LocationEnum >::operator!=().
|
inline |
Union with other MemoryEffectsBase.
Definition at line 235 of file ModRef.h.
References llvm::Other.
|
inline |
Union (in-place) with other MemoryEffectsBase.
Definition at line 240 of file ModRef.h.
References llvm::Other.
|
inlinestatic |
Create MemoryEffectsBase that can read any memory.
Definition at line 122 of file ModRef.h.
References llvm::Ref.
Referenced by decodeLLVMAttributesForBitcode(), llvm::CallBase::getMemoryEffects(), llvm::BasicAAResult::getMemoryEffects(), llvm::AMDGPULibFunc::getOrInsertFunction(), llvm::Function::setOnlyReadsMemory(), llvm::CallBase::setOnlyReadsMemory(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().
|
inline |
Convert MemoryEffectsBase into an encoded integer value (used by memory attribute).
Definition at line 160 of file ModRef.h.
Referenced by llvm::AttrBuilder::addMemoryAttr(), and llvm::Attribute::getWithMemoryEffects().
|
inlinestatic |
Create MemoryEffectsBase that can read and write any memory.
Definition at line 112 of file ModRef.h.
References llvm::ModRef.
Referenced by addMemoryAttrs(), decodeLLVMAttributesForBitcode(), llvm::AttributeSet::getMemoryEffects(), llvm::AttributeSetNode::getMemoryEffects(), llvm::AAResults::getMemoryEffects(), llvm::AAResultBase::getMemoryEffects(), llvm::TypeBasedAAResult::getMemoryEffects(), llvm::GlobalsAAResult::getMemoryEffects(), llvm::AANoSync::isImpliedByIR(), llvm::AAWillReturn::isImpliedByMustprogressAndReadonly(), and runIPSCCP().
|
inlinestatic |
Create MemoryEffectsBase that can write any memory.
Definition at line 127 of file ModRef.h.
References llvm::Mod.
Referenced by decodeLLVMAttributesForBitcode(), llvm::CallBase::getMemoryEffects(), llvm::BasicAAResult::getMemoryEffects(), llvm::Function::setOnlyWritesMemory(), llvm::CallBase::setOnlyWritesMemory(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().