LLVM API Documentation

Public Types | Public Member Functions
llvm::MachineMemOperand Class Reference

#include <MachineMemOperand.h>

List of all members.

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 AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
const MachinePointerInfogetPointerInfo () const
const ValuegetValue () const
const PseudoSourceValuegetPseudoValue () const
const void * getOpaqueValue () const
unsigned int getFlags () const
 getFlags - Return the raw flags of the source value,
void setFlags (unsigned f)
 Bitwise OR the current flags with the given flags.
int64_t getOffset () const
unsigned getAddrSpace () const
uint64_t getSize () const
 getSize - Return the size in bytes of the memory reference.
uint64_t getAlignment () const
uint64_t getBaseAlignment () const
AAMDNodes getAAInfo () const
 getAAInfo - Return the AA tags for the memory reference.
const MDNodegetRanges () const
 getRanges - Return the range tag for the memory reference.
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 setValue (const PseudoSourceValue *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 91 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 100 of file MachineMemOperand.h.


Constructor & Destructor Documentation

MachineMemOperand::MachineMemOperand ( MachinePointerInfo  PtrInfo,
unsigned  flags,
uint64_t  s,
unsigned  base_alignment,
const AAMDNodes AAInfo = AAMDNodes(),
const MDNode Ranges = nullptr 
)

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

Definition at line 432 of file MachineInstr.cpp.


Member Function Documentation

getAAInfo - Return the AA tags for the memory reference.

Definition at line 167 of file MachineMemOperand.h.

Referenced by MIsNeedChainEdge().

Definition at line 153 of file MachineMemOperand.h.

References llvm::MachinePointerInfo::getAddrSpace().

uint64_t MachineMemOperand::getAlignment ( ) const

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

Definition at line 473 of file MachineInstr.cpp.

Referenced by isMemoryOp().

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 164 of file MachineMemOperand.h.

References MOMaxBits.

Referenced by llvm::MachineFunction::getMachineMemOperand().

getFlags - Return the raw flags of the source value,

See also:
MemOperandFlags.

Definition at line 143 of file MachineMemOperand.h.

References MOMaxBits.

Referenced by llvm::MachineFunction::getMachineMemOperand().

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 151 of file MachineMemOperand.h.

References llvm::MachinePointerInfo::Offset.

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

getRanges - Return the range tag for the memory reference.

Definition at line 170 of file MachineMemOperand.h.

uint64_t llvm::MachineMemOperand::getSize ( ) 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 134 of file MachineMemOperand.h.

References llvm::PointerUnion< PT1, PT2 >::dyn_cast(), and llvm::MachinePointerInfo::V.

Referenced by llvm::PPCHazardRecognizer970::EmitInstruction(), getCodeAddrSpace(), llvm::PPCHazardRecognizer970::getHazardType(), llvm::MachineFunction::getMachineMemOperand(), MIsNeedChainEdge(), llvm::AMDGPUTargetLowering::ScalarizeVectorLoad(), llvm::AMDGPUTargetLowering::ScalarizeVectorStore(), llvm::AMDGPUTargetLowering::SplitVectorLoad(), and llvm::AMDGPUTargetLowering::SplitVectorStore().

Definition at line 172 of file MachineMemOperand.h.

References MOLoad.

Definition at line 173 of file MachineMemOperand.h.

References MOStore.

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 185 of file MachineMemOperand.h.

References isVolatile().

Profile - Gather unique data for the object.

Definition at line 448 of file MachineInstr.cpp.

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 455 of file MachineInstr.cpp.

Bitwise OR the current flags with the given flags.

Definition at line 146 of file MachineMemOperand.h.

References MOMaxBits.

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

Definition at line 197 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 195 of file MachineMemOperand.h.

References llvm::MachinePointerInfo::V.

Definition at line 196 of file MachineMemOperand.h.

References llvm::MachinePointerInfo::V.


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