16 #ifndef LLVM_CODEGEN_MACHINEMEMOPERAND_H 17 #define LLVM_CODEGEN_MACHINEMEMOPERAND_H 30 class FoldingSetNodeID;
33 class MachineFunction;
34 class ModuleSlotTracker;
54 : V(v), Offset(offset), StackID(
ID) {
60 : V(v), Offset(offset), StackID(
ID) {
65 : V((
const Value *)nullptr), Offset(0), StackID(0),
72 : V(v), Offset(offset), StackID(
ID) {
75 AddrSpace = ValPtr->getType()->getPointerAddressSpace();
140 MOVolatile = 1u << 2,
142 MONonTemporal = 1u << 3,
144 MODereferenceable = 1u << 4,
146 MOInvariant = 1u << 5,
152 MOTargetFlag1 = 1u << 6,
153 MOTargetFlag2 = 1u << 7,
154 MOTargetFlag3 = 1u << 8,
161 struct MachineAtomicInfo {
166 unsigned Ordering : 4;
169 unsigned FailureOrdering : 4;
175 uint16_t BaseAlignLog2;
176 MachineAtomicInfo AtomicInfo;
189 const MDNode *Ranges =
nullptr,
258 bool isLoad()
const {
return FlagVals & MOLoad; }
259 bool isStore()
const {
return FlagVals & MOStore; }
318 return !(LHS == RHS);
bool isUnordered() const
Returns true if this memory operation doesn't have any ordering constraints other than normal aliasin...
A parsed version of the target data layout string in and methods for querying it. ...
#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.
unsigned getAddrSpace() const
Atomic ordering constants.
This class represents lattice values for constants.
AtomicOrdering getFailureOrdering() const
For cmpxchg atomic operations, return the atomic ordering requirements when store does not occur...
MachinePointerInfo(PointerUnion< const Value *, const PseudoSourceValue *> v, int64_t offset=0, uint8_t ID=0)
MachinePointerInfo(unsigned AddressSpace=0)
uint64_t getSize() const
Return the size in bytes of the memory reference.
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
Manage lifetime of a slot tracker for printing IR.
uint64_t getBaseAlignment() const
Return the minimum known alignment in bytes of the base address, without the offset.
void print(raw_ostream &OS) const
Support for operator<<.
bool isNull() const
Test if the pointer held in the union is null, regardless of which type it is.
unsigned getAddrSpace() const
Return the LLVM IR address space number that this pointer points into.
bool isAtomic() const
Returns true if this operation has an atomic ordering requirement of unordered or higher...
AAMDNodes getAAInfo() const
Return the AA tags for the memory reference.
static uint32_t getAlignment(const MCSectionCOFF &Sec)
A description of a memory reference used in the backend.
const void * getOpaqueValue() const
const HexagonInstrInfo * TII
bool isNonTemporal() const
const MDNode * getRanges() const
Return the range tag for the memory reference.
void setFlags(Flags f)
Bitwise OR the current flags with the given flags.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
friend bool operator!=(const MachineMemOperand &LHS, const MachineMemOperand &RHS)
AtomicOrdering
Atomic ordering for LLVM's memory model.
AtomicOrdering getOrdering() const
Return the atomic ordering requirements for this memory operation.
Type * getType() const
All values are typed, get the type of this value.
void * getOpaqueValue() const
TargetInstrInfo - Interface to description of machine instruction set.
const Value * getValue() const
Return the base address of the memory access.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
static MachinePointerInfo getUnknownStack(MachineFunction &MF)
Stack memory without other information.
This is an important class for using LLVM in a threaded context.
PointerUnion< const Value *, const PseudoSourceValue * > V
This is the IR pointer value for the access, or it is null if unknown.
MachinePointerInfo(const PseudoSourceValue *v, int64_t offset=0, uint8_t ID=0)
unsigned getAddressSpace() const
int64_t Offset
Offset - This is an offset from the base Value*.
const PseudoSourceValue * getPseudoValue() const
void setOffset(int64_t NewOffset)
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
T dyn_cast() const
Returns the current pointer if it is of the specified pointer type, otherwises returns null...
This class contains a discriminated union of information about pointers in memory operands...
uint64_t getAlignment() const
Return the minimum known alignment in bytes of the actual memory reference.
void setValue(const Value *NewSV)
Change the SourceValue for this MachineMemOperand.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
MachinePointerInfo(const Value *v, int64_t offset=0, uint8_t ID=0)
MachinePointerInfo getWithOffset(int64_t O) const
Special value supplied for machine level alias analysis.
Flags
Flags values. These may be or'd together.
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.
const MachinePointerInfo & getPointerInfo() const
Flags getFlags() const
Return the raw flags of the source value,.
bool isDereferenceable() 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.
T get() const
Returns the value of the specified pointer type.
void setValue(const PseudoSourceValue *NewSV)
static MachinePointerInfo getGOT(MachineFunction &MF)
Return a MachinePointerInfo record that refers to a GOT entry.
int64_t getOffset() const
For normal values, this is a byte offset added to the base address.
LLVM Value Representation.
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID for this memory operation.
Synchronized with respect to all concurrently executing threads.
bool isDereferenceable(unsigned Size, LLVMContext &C, const DataLayout &DL) const
Return true if memory region [V, V+Offset+Size) is known to be dereferenceable.
This class implements an extremely fast bulk output stream that can only output to a stream...
static MachinePointerInfo getStack(MachineFunction &MF, int64_t Offset, uint8_t ID=0)
Stack pointer relative access.
int is() const
Test if the Union currently holds the type matching T.
static bool isVolatile(Instruction *Inst)