LLVM 22.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 | onlyAccessesErrnoMem () const |
Whether this function only (at most) accesses errno 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 | errnoMemOnly (ModRefInfo MR=ModRefInfo::ModRef) |
Create MemoryEffectsBase that can only access errno memory. | |
static MemoryEffectsBase | otherMemOnly (ModRefInfo MR=ModRefInfo::ModRef) |
Create MemoryEffectsBase that can only access other memory. | |
static MemoryEffectsBase | inaccessibleOrArgMemOnly (ModRefInfo MR=ModRefInfo::ModRef) |
Create MemoryEffectsBase that can only access inaccessible or argument memory. | |
static MemoryEffectsBase | argumentOrErrnoMemOnly (ModRefInfo ArgMR=ModRefInfo::ModRef, ModRefInfo ErrnoMR=ModRefInfo::ModRef) |
Create MemoryEffectsBase that can only access argument or errno 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 109 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::locations().
|
inlinestatic |
Create MemoryEffectsBase that can only access argument memory.
Definition at line 135 of file ModRef.h.
Referenced by addLocAccess(), checkFunctionMemoryAccess(), llvm::CallBase::setOnlyAccessesArgMemory(), setOnlyAccessesArgMemory(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().
|
inlinestatic |
Create MemoryEffectsBase that can only access argument or errno memory.
Definition at line 167 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::none().
Referenced by setOnlyWritesArgMemOrErrnoMem().
|
inlinestatic |
Create MemoryEffectsBase from an encoded integer value (used by memory attribute).
Definition at line 177 of file ModRef.h.
Referenced by llvm::Attribute::getMemoryEffects().
|
inline |
Whether this function may access argument memory.
Definition at line 229 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::getModRef(), and llvm::isModOrRefSet().
|
inline |
Whether this function accesses no memory.
Definition at line 215 of file ModRef.h.
Referenced by llvm::canSinkOrHoistInst(), checkFunctionMemoryAccess(), llvm::CallBase::doesNotAccessMemory(), llvm::AAResults::doesNotAccessMemory(), getFunctionControl(), llvm::SITargetLowering::getTgtMemIntrinsic(), llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesArgPointees(), llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesErrnoMem(), llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleMem(), and llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleOrArgMem().
|
inlinestatic |
Create MemoryEffectsBase that can only access errno memory.
Definition at line 146 of file ModRef.h.
Referenced by setOnlyWritesErrnoMemory().
|
inline |
Get ModRefInfo for any location.
Definition at line 207 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 188 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 200 of file ModRef.h.
References llvm::NoModRef.
Referenced by checkFunctionMemoryAccess(), llvm::BasicAAResult::getModRefInfo(), llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesArgPointees(), llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesErrnoMem(), llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleMem(), and llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleOrArgMem().
|
inlinestatic |
Create MemoryEffectsBase that can only access inaccessible memory.
Definition at line 141 of file ModRef.h.
Referenced by checkFunctionMemoryAccess(), decodeLLVMAttributesForBitcode(), llvm::CallBase::getMemoryEffects(), llvm::BasicAAResult::getMemoryEffects(), llvm::CallBase::setOnlyAccessesInaccessibleMemory(), setOnlyAccessesInaccessibleMemory(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().
|
inlinestatic |
Create MemoryEffectsBase that can only access inaccessible or argument memory.
Definition at line 158 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::none().
Referenced by decodeLLVMAttributesForBitcode(), llvm::CallBase::setOnlyAccessesInaccessibleMemOrArgMem(), setOnlyAccessesInaccessibleMemOrArgMem(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().
|
inlinestatic |
Returns iterator over all supported location kinds.
Definition at line 98 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 120 of file ModRef.h.
References llvm::NoModRef.
Referenced by addMemoryAttrs(), llvm::MemoryEffectsBase< LocationEnum >::argumentOrErrnoMemOnly(), checkFunctionMemoryAccess(), decodeLLVMAttributesForBitcode(), fixupFPReturnAndCall(), llvm::TypeBasedAAResult::getMemoryEffects(), llvm::NVPTXAAResult::getMemoryEffects(), llvm::objcarc::ObjCARCAAResult::getMemoryEffects(), llvm::MemoryEffectsBase< LocationEnum >::inaccessibleOrArgMemOnly(), llvm::CallBase::setDoesNotAccessMemory(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().
|
inline |
Whether this function only (at most) accesses argument memory.
Definition at line 224 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::doesNotAccessMemory(), and llvm::MemoryEffectsBase< LocationEnum >::getWithoutLoc().
Referenced by AddAliasScopeMetadata(), llvm::objcarc::CanAlterRefCount(), llvm::MemoryLocation::getForDest(), and llvm::CallBase::onlyAccessesArgMemory().
|
inline |
Whether this function only (at most) accesses errno memory.
Definition at line 239 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::doesNotAccessMemory(), and llvm::MemoryEffectsBase< LocationEnum >::getWithoutLoc().
|
inline |
Whether this function only (at most) accesses inaccessible memory.
Definition at line 234 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::doesNotAccessMemory(), and llvm::MemoryEffectsBase< LocationEnum >::getWithoutLoc().
Referenced by AddAliasScopeMetadata(), and llvm::CallBase::onlyAccessesInaccessibleMemory().
|
inline |
Whether this function only (at most) accesses argument and inaccessible memory.
Definition at line 245 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::doesNotAccessMemory(), and llvm::MemoryEffectsBase< LocationEnum >::getWithoutLoc().
Referenced by llvm::CallBase::onlyAccessesInaccessibleMemOrArgMem().
|
inline |
Whether this function only (at most) reads memory.
Definition at line 218 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::CallBase::onlyReadsMemory(), llvm::AAResults::onlyReadsMemory(), and llvm::VPWidenIntrinsicRecipe::VPWidenIntrinsicRecipe().
|
inline |
Whether this function only (at most) writes memory.
Definition at line 221 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::getModRef(), and llvm::isRefSet().
Referenced by llvm::canSinkOrHoistInst(), llvm::SITargetLowering::getTgtMemIntrinsic(), llvm::CallBase::onlyWritesMemory(), and llvm::VPWidenIntrinsicRecipe::VPWidenIntrinsicRecipe().
|
inline |
Check whether this is different from other MemoryEffectsBase.
Definition at line 288 of file ModRef.h.
References llvm::MemoryEffectsBase< LocationEnum >::operator==(), and llvm::Other.
|
inline |
Intersect with other MemoryEffectsBase.
Definition at line 252 of file ModRef.h.
References llvm::Other.
|
inline |
Intersect (in-place) with other MemoryEffectsBase.
Definition at line 257 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 285 of file ModRef.h.
References llvm::Other.
Referenced by llvm::MemoryEffectsBase< LocationEnum >::operator!=().
|
inline |
Union with other MemoryEffectsBase.
Definition at line 263 of file ModRef.h.
References llvm::Other.
|
inline |
Union (in-place) with other MemoryEffectsBase.
Definition at line 268 of file ModRef.h.
References llvm::Other.
|
inlinestatic |
Create MemoryEffectsBase that can only access other memory.
|
inlinestatic |
Create MemoryEffectsBase that can read any memory.
Definition at line 125 of file ModRef.h.
References llvm::Ref.
Referenced by decodeLLVMAttributesForBitcode(), llvm::CallBase::getMemoryEffects(), llvm::BasicAAResult::getMemoryEffects(), llvm::AMDGPULibFunc::getOrInsertFunction(), llvm::CallBase::setOnlyReadsMemory(), setOnlyReadsMemory(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().
|
inline |
Convert MemoryEffectsBase into an encoded integer value (used by memory attribute).
Definition at line 183 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 115 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::NVPTXAAResult::getMemoryEffects(), llvm::GlobalsAAResult::getMemoryEffects(), llvm::AANoSync::isImpliedByIR(), llvm::AAWillReturn::isImpliedByMustprogressAndReadonly(), and runIPSCCP().
|
inlinestatic |
Create MemoryEffectsBase that can write any memory.
Definition at line 130 of file ModRef.h.
References llvm::Mod.
Referenced by decodeLLVMAttributesForBitcode(), llvm::MemoryLocation::getForDest(), llvm::CallBase::getMemoryEffects(), llvm::BasicAAResult::getMemoryEffects(), llvm::CallBase::setOnlyWritesMemory(), setOnlyWritesMemory(), upgradeMemoryAttr(), and upgradeOldMemoryAttribute().