16 #ifndef LLVM_CODEGEN_MACHINEMEMOPERAND_H
17 #define LLVM_CODEGEN_MACHINEMEMOPERAND_H
26 #include "llvm/Support/DataTypes.h"
30 class FoldingSetNodeID;
33 class MachineFunction;
34 class ModuleSlotTracker;
121 struct MachineAtomicInfo {
123 unsigned SynchScope : 1;
126 unsigned Ordering : 4;
129 unsigned FailureOrdering : 4;
132 MachinePointerInfo PtrInfo;
135 uint16_t BaseAlignLog2;
136 MachineAtomicInfo AtomicInfo;
138 const MDNode *Ranges;
147 unsigned base_alignment,
148 const AAMDNodes &AAInfo = AAMDNodes(),
149 const MDNode *Ranges =
nullptr,
248 void setOffset(int64_t NewOffset) { PtrInfo.Offset = NewOffset; }
275 return !(LHS == RHS);
#define LLVM_MARK_AS_BITMASK_ENUM(LargestValue)
LLVM_MARK_AS_BITMASK_ENUM lets you opt in an individual enum type so you can perform bitwise operatio...
static MachinePointerInfo getJumpTable(MachineFunction &MF)
Return a MachinePointerInfo record that refers to a jump table entry.
Flags getFlags() const
Return the raw flags of the source value,.
Atomic ordering constants.
Manage lifetime of a slot tracker for printing IR.
const MachinePointerInfo & getPointerInfo() const
AtomicOrdering getOrdering() const
Return the atomic ordering requirements for this memory operation.
A description of a memory reference used in the backend.
MachinePointerInfo(const PseudoSourceValue *v, int64_t offset=0)
void setFlags(Flags f)
Bitwise OR the current flags with the given flags.
MachinePointerInfo getWithOffset(int64_t O) const
The memory access is dereferenceable (i.e., doesn't trap).
friend bool operator!=(const MachineMemOperand &LHS, const MachineMemOperand &RHS)
AtomicOrdering
Atomic ordering for LLVM's memory model.
uint64_t getAlignment() const
Return the minimum known alignment in bytes of the actual memory reference.
static MachinePointerInfo getStack(MachineFunction &MF, int64_t Offset)
Stack pointer relative access.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
The memory access is volatile.
AAMDNodes getAAInfo() const
Return the AA tags for the memory reference.
SynchronizationScope getSynchScope() const
Return the synchronization scope for this memory operation.
PointerUnion< const Value *, const PseudoSourceValue * > V
This is the IR pointer value for the access, or it is null if unknown.
int64_t Offset
Offset - This is an offset from the base Value*.
void Profile(FoldingSetNodeID &ID) const
Profile - Gather unique data for the object.
void setOffset(int64_t NewOffset)
The memory access is non-temporal.
const PseudoSourceValue * getPseudoValue() const
This class contains a discriminated union of information about pointers in memory operands...
bool isNull() const
Test if the pointer held in the union is null, regardless of which type it is.
void refineAlignment(const MachineMemOperand *MMO)
Update this MachineMemOperand to reflect the alignment of MMO, if it has a greater alignment...
The memory access writes data.
const void * getOpaqueValue() const
void setValue(const Value *NewSV)
Change the SourceValue for this MachineMemOperand.
bool isDereferenceable() const
T get() const
Returns the value of the specified pointer type.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
unsigned getAddrSpace() const
Return the LLVM IR address space number that this pointer points into.
const Value * getValue() const
Return the base address of the memory access.
Special value supplied for machine level alias analysis.
Flags
Flags values. These may be or'd together.
void print(raw_ostream &OS) const
Support for operator<<.
bool isNonTemporal() const
The memory access reads data.
friend bool operator==(const MachineMemOperand &LHS, const MachineMemOperand &RHS)
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
bool isUnordered() const
Returns true if this memory operation doesn't have any ordering constraints other than normal aliasin...
bool isAtomic() const
Returns true if this operation has an atomic ordering requirement of unordered or higher...
The memory access always returns the same value (or traps).
unsigned getAddrSpace() const
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
static MachinePointerInfo getConstantPool(MachineFunction &MF)
Return a MachinePointerInfo record that refers to the constant pool.
void setValue(const PseudoSourceValue *NewSV)
MachineMemOperand(MachinePointerInfo PtrInfo, Flags flags, uint64_t s, unsigned base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SynchronizationScope SynchScope=CrossThread, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
Construct a MachineMemOperand object with the specified PtrInfo, flags, size, and base alignment...
MachinePointerInfo(const Value *v=nullptr, int64_t offset=0)
static MachinePointerInfo getGOT(MachineFunction &MF)
Return a MachinePointerInfo record that refers to a GOT entry.
const MDNode * getRanges() const
Return the range tag for the memory reference.
LLVM Value Representation.
int64_t getOffset() const
For normal values, this is a byte offset added to the base address.
uint64_t getSize() const
Return the size in bytes of the memory reference.
This class implements an extremely fast bulk output stream that can only output to a stream...
AtomicOrdering getFailureOrdering() const
For cmpxchg atomic operations, return the atomic ordering requirements when store does not occur...
int is() const
Test if the Union currently holds the type matching T.
uint64_t getBaseAlignment() const
Return the minimum known alignment in bytes of the base address, without the offset.