LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
llvm::MachineMemOperand Class Reference

#include <MachineMemOperand.h>

Public Types

enum  MemOperandFlags {
  MOLoad = 1, MOStore = 2, MOVolatile = 4, MONonTemporal = 8,
  MOInvariant = 16, MOTargetStartBit = 5, MOTargetNumBits = 3, MOMaxBits = 8
}
 Flags values. These may be or'd together. More...
 

Public Member Functions

 MachineMemOperand (MachinePointerInfo PtrInfo, unsigned flags, uint64_t s, unsigned base_alignment, const MDNode *TBAAInfo=0, const MDNode *Ranges=0)
 
const MachinePointerInfogetPointerInfo () const
 
const ValuegetValue () const
 
unsigned int getFlags () const
 getFlags - Return the raw flags of the source value, More...
 
void setFlags (unsigned f)
 Bitwise OR the current flags with the given flags. More...
 
int64_t getOffset () const
 
uint64_t getSize () const
 getSize - Return the size in bytes of the memory reference. More...
 
uint64_t getAlignment () const
 
uint64_t getBaseAlignment () const
 
const MDNodegetTBAAInfo () const
 getTBAAInfo - Return the TBAA tag for the memory reference. More...
 
const MDNodegetRanges () const
 getRanges - Return the range tag for the memory reference. More...
 
bool isLoad () const
 
bool isStore () const
 
bool isVolatile () const
 
bool isNonTemporal () const
 
bool isInvariant () const
 
bool isUnordered () const
 
void refineAlignment (const MachineMemOperand *MMO)
 
void setValue (const Value *NewSV)
 
void setOffset (int64_t NewOffset)
 
void Profile (FoldingSetNodeID &ID) const
 

Detailed Description

MachineMemOperand - A description of a memory reference used in the backend. Instead of holding a StoreInst or LoadInst, this class holds the address Value of the reference along with a byte size and offset. This allows it to describe lowered loads and stores. Also, the special PseudoSourceValue objects can be used to represent loads and stores to memory locations that aren't explicit in the regular LLVM IR.

Definition at line 82 of file MachineMemOperand.h.

Member Enumeration Documentation

Flags values. These may be or'd together.

Enumerator
MOLoad 

The memory access reads data.

MOStore 

The memory access writes data.

MOVolatile 

The memory access is volatile.

MONonTemporal 

The memory access is non-temporal.

MOInvariant 

The memory access is invariant.

MOTargetStartBit 
MOTargetNumBits 
MOMaxBits 

Definition at line 91 of file MachineMemOperand.h.

Constructor & Destructor Documentation

MachineMemOperand::MachineMemOperand ( MachinePointerInfo  PtrInfo,
unsigned  flags,
uint64_t  s,
unsigned  base_alignment,
const MDNode TBAAInfo = 0,
const MDNode Ranges = 0 
)

MachineMemOperand - Construct an MachineMemOperand object with the specified PtrInfo, flags, size, and base alignment.

Definition at line 420 of file MachineInstr.cpp.

Member Function Documentation

uint64_t MachineMemOperand::getAlignment ( ) const

getAlignment - Return the minimum known alignment in bytes of the actual memory reference.

Definition at line 460 of file MachineInstr.cpp.

Referenced by llvm::MemSDNode::getAlignment(), isMemoryOp(), llvm::X86InstrInfo::loadRegFromAddr(), and llvm::X86InstrInfo::storeRegToAddr().

uint64_t llvm::MachineMemOperand::getBaseAlignment ( ) const
inline

getBaseAlignment - Return the minimum known alignment in bytes of the base address, without the offset.

Definition at line 146 of file MachineMemOperand.h.

References MOMaxBits.

Referenced by llvm::MachineFunction::getMachineMemOperand(), and llvm::MemSDNode::getOriginalAlignment().

unsigned int llvm::MachineMemOperand::getFlags ( ) const
inline

getFlags - Return the raw flags of the source value,

See Also
MemOperandFlags.

Definition at line 127 of file MachineMemOperand.h.

References MOMaxBits.

Referenced by llvm::MachineFunction::getMachineMemOperand(), and llvm::PPCTargetLowering::PerformDAGCombine().

int64_t llvm::MachineMemOperand::getOffset ( ) const
inline

getOffset - For normal values, this is a byte offset added to the base address. For PseudoSourceValue::FPRel values, this is the FrameIndex number.

Definition at line 135 of file MachineMemOperand.h.

References llvm::MachinePointerInfo::Offset.

Referenced by llvm::PPCHazardRecognizer970::EmitInstruction(), llvm::PPCHazardRecognizer970::getHazardType(), llvm::MachineFunction::getMachineMemOperand(), llvm::MemSDNode::getSrcValueOffset(), and MIsNeedChainEdge().

const MachinePointerInfo& llvm::MachineMemOperand::getPointerInfo ( ) const
inline
const MDNode* llvm::MachineMemOperand::getRanges ( ) const
inline

getRanges - Return the range tag for the memory reference.

Definition at line 152 of file MachineMemOperand.h.

Referenced by llvm::MemSDNode::getRanges().

uint64_t llvm::MachineMemOperand::getSize ( ) const
inline
const MDNode* llvm::MachineMemOperand::getTBAAInfo ( ) const
inline

getTBAAInfo - Return the TBAA tag for the memory reference.

Definition at line 149 of file MachineMemOperand.h.

Referenced by llvm::MemSDNode::getTBAAInfo(), and MIsNeedChainEdge().

const Value* llvm::MachineMemOperand::getValue ( ) const
inline

getValue - Return the base address of the memory access. This may either be a normal LLVM IR Value, or one of the special values used in CodeGen. Special values are those obtained via PseudoSourceValue::getFixedStack(int), PseudoSourceValue::getStack, and other PseudoSourceValue member functions which return objects which stand for frame/stack pointer relative references and other special references which are not representable in the high-level IR.

Definition at line 124 of file MachineMemOperand.h.

References llvm::MachinePointerInfo::V.

Referenced by llvm::PPCHazardRecognizer970::EmitInstruction(), llvm::PPCHazardRecognizer970::getHazardType(), llvm::MachineFunction::getMachineMemOperand(), llvm::MemSDNode::getSrcValue(), MIsNeedChainEdge(), llvm::AMDGPUTargetLowering::SplitVectorLoad(), and llvm::AMDGPUTargetLowering::SplitVectorStore().

bool llvm::MachineMemOperand::isInvariant ( ) const
inline
bool llvm::MachineMemOperand::isLoad ( ) const
inline

Definition at line 154 of file MachineMemOperand.h.

References MOLoad.

Referenced by llvm::MemSDNode::readMem().

bool llvm::MachineMemOperand::isNonTemporal ( ) const
inline
bool llvm::MachineMemOperand::isStore ( ) const
inline

Definition at line 155 of file MachineMemOperand.h.

References MOStore.

Referenced by llvm::MemSDNode::writeMem().

bool llvm::MachineMemOperand::isUnordered ( ) const
inline

isUnordered - Returns true if this memory operation doesn't have any ordering constraints other than normal aliasing. Volatile and atomic memory operations can't be reordered.

Currently, we don't model the difference between volatile and atomic operations. They should retain their ordering relative to all memory operations.

Definition at line 167 of file MachineMemOperand.h.

References isVolatile().

bool llvm::MachineMemOperand::isVolatile ( ) const
inline
void MachineMemOperand::Profile ( FoldingSetNodeID ID) const

Profile - Gather unique data for the object.

Definition at line 435 of file MachineInstr.cpp.

void MachineMemOperand::refineAlignment ( const MachineMemOperand MMO)

refineAlignment - Update this MachineMemOperand to reflect the alignment of MMO, if it has a greater alignment. This must only be used when the new alignment applies to all users of this MachineMemOperand.

Definition at line 442 of file MachineInstr.cpp.

Referenced by llvm::MemSDNode::refineAlignment().

void llvm::MachineMemOperand::setFlags ( unsigned  f)
inline

Bitwise OR the current flags with the given flags.

Definition at line 130 of file MachineMemOperand.h.

References MOMaxBits.

void llvm::MachineMemOperand::setOffset ( int64_t  NewOffset)
inline

Definition at line 178 of file MachineMemOperand.h.

References llvm::MachinePointerInfo::Offset.

void llvm::MachineMemOperand::setValue ( const Value NewSV)
inline

setValue - Change the SourceValue for this MachineMemOperand. This should only be used when an object is being relocated and all references to it are being updated.

Definition at line 177 of file MachineMemOperand.h.

References llvm::MachinePointerInfo::V.


The documentation for this class was generated from the following files: