15 #ifndef LLVM_CODEGEN_MACHINEMEMOPERAND_H 16 #define LLVM_CODEGEN_MACHINEMEMOPERAND_H 27 class FoldingSetNodeID;
30 class MachineFunction;
31 class ModuleSlotTracker;
51 : V(v), Offset(offset), StackID(
ID) {
57 : V(v), Offset(offset), StackID(
ID) {
62 : V((
const Value *)nullptr), Offset(0), StackID(0),
69 : V(v), Offset(offset), StackID(
ID) {
72 AddrSpace = ValPtr->getType()->getPointerAddressSpace();
137 MOVolatile = 1u << 2,
139 MONonTemporal = 1u << 3,
141 MODereferenceable = 1u << 4,
143 MOInvariant = 1u << 5,
149 MOTargetFlag1 = 1u << 6,
150 MOTargetFlag2 = 1u << 7,
151 MOTargetFlag3 = 1u << 8,
158 struct MachineAtomicInfo {
163 unsigned Ordering : 4;
166 unsigned FailureOrdering : 4;
173 MachineAtomicInfo AtomicInfo;
186 const MDNode *Ranges =
nullptr,
258 bool isLoad()
const {
return FlagVals & MOLoad; }
259 bool isStore()
const {
return FlagVals & MOStore; }
316 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.
T get() const
Returns the value of the specified pointer type.
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.
T dyn_cast() const
Returns the current pointer if it is of the specified pointer type, otherwises returns null...
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.
bool isNull() const
Test if the pointer held in the union is null, regardless of which type it is.
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.
uint64_t getSizeInBits() const
Return the size in bits of the memory reference.
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)
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.
Synchronized with respect to all concurrently executing threads.
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
int is() const
Test if the Union currently holds the type matching T.
static MachinePointerInfo getConstantPool(MachineFunction &MF)
Return a MachinePointerInfo record that refers to the constant pool.
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.
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.
static bool isVolatile(Instruction *Inst)
void * getOpaqueValue() const