LLVM  15.0.0git
Classes | Functions
llvm::GISelAddressing Namespace Reference

Classes

struct  BaseIndexOffset
 Helper struct to store a base, index and offset that forms an address. More...
 

Functions

BaseIndexOffset getPointerInfo (Register Ptr, MachineRegisterInfo &MRI)
 Returns a BaseIndexOffset which describes the pointer in Ptr. More...
 
bool aliasIsKnownForLoadStore (const MachineInstr &MI1, const MachineInstr &MI2, bool &IsAlias, MachineRegisterInfo &MRI)
 Compute whether or not a memory access at MI1 aliases with an access at MI2. More...
 
bool instMayAlias (const MachineInstr &MI, const MachineInstr &Other, MachineRegisterInfo &MRI, AliasAnalysis *AA)
 Returns true if the instruction MI may alias Other. More...
 

Function Documentation

◆ aliasIsKnownForLoadStore()

bool llvm::GISelAddressing::aliasIsKnownForLoadStore ( const MachineInstr MI1,
const MachineInstr MI2,
bool &  IsAlias,
MachineRegisterInfo MRI 
)

Compute whether or not a memory access at MI1 aliases with an access at MI2.

Returns
true if either alias/no-alias is known. Sets IsAlias accordingly.

Definition at line 103 of file LoadStoreOpt.cpp.

References llvm::GISelAddressing::BaseIndexOffset::BaseReg, llvm::getDefIgnoringCopies(), getPointerInfo(), llvm::MachineFrameInfo::isFixedObjectIndex(), llvm::Register::isValid(), MRI, llvm::GISelAddressing::BaseIndexOffset::Offset, and llvm::MemoryLocation::UnknownSize.

Referenced by instMayAlias().

◆ getPointerInfo()

BaseIndexOffset llvm::GISelAddressing::getPointerInfo ( Register  Ptr,
MachineRegisterInfo MRI 
)

◆ instMayAlias()

bool llvm::GISelAddressing::instMayAlias ( const MachineInstr MI,
const MachineInstr Other,
MachineRegisterInfo MRI,
AliasAnalysis AA 
)

Returns true if the instruction MI may alias Other.

This function uses multiple strategies to detect aliasing, whereas aliasIsKnownForLoadStore just looks at the addresses of load/stores and is tries to reason about base/index/offsets.

Definition at line 188 of file LoadStoreOpt.cpp.

References aliasIsKnownForLoadStore(), llvm::MemoryLocation::getSizeOrUnknown(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::IsVolatile, llvm::AArch64CC::LS, llvm::MIPatternMatch::m_GPtrAdd(), llvm::MIPatternMatch::m_ICst(), llvm::MIPatternMatch::m_Reg(), MI, llvm::MIPatternMatch::mi_match(), llvm::min(), MRI, Other, and llvm::MemoryLocation::UnknownSize.