LLVM 19.0.0git
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
llvm::MemSDNode Class Reference

This is an abstract virtual class for memory operations. More...

#include "llvm/CodeGen/SelectionDAGNodes.h"

Inheritance diagram for llvm::MemSDNode:
Inheritance graph
[legend]

Public Member Functions

 MemSDNode (unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT memvt, MachineMemOperand *MMO)
 
bool readMem () const
 
bool writeMem () const
 
Align getOriginalAlign () const
 Returns alignment and volatility of the memory access.
 
Align getAlign () const
 
unsigned getRawSubclassData () const
 Return the SubclassData value, without HasDebugValue.
 
bool isVolatile () const
 
bool isNonTemporal () const
 
bool isDereferenceable () const
 
bool isInvariant () const
 
int64_t getSrcValueOffset () const
 
AAMDNodes getAAInfo () const
 Returns the AA info that describes the dereference.
 
const MDNodegetRanges () const
 Returns the Ranges that describes the dereference.
 
SyncScope::ID getSyncScopeID () const
 Returns the synchronization scope ID for this memory operation.
 
AtomicOrdering getSuccessOrdering () const
 Return the atomic ordering requirements for this memory operation.
 
AtomicOrdering getMergedOrdering () const
 Return a single atomic ordering that is at least as strong as both the success and failure orderings for an atomic operation.
 
bool isAtomic () const
 Return true if the memory operation ordering is Unordered or higher.
 
bool isUnordered () const
 Returns true if the memory operation doesn't imply any ordering constraints on surrounding memory operations beyond the normal memory aliasing rules.
 
bool isSimple () const
 Returns true if the memory operation is neither atomic or volatile.
 
EVT getMemoryVT () const
 Return the type of the in-memory value.
 
MachineMemOperandgetMemOperand () const
 Return a MachineMemOperand object describing the memory reference performed by operation.
 
const MachinePointerInfogetPointerInfo () const
 
unsigned getAddressSpace () const
 Return the address space for the associated pointer.
 
void refineAlignment (const MachineMemOperand *NewMMO)
 Update this MemSDNode's MachineMemOperand information to reflect the alignment of NewMMO, if it has a greater alignment.
 
const SDValuegetChain () const
 
const SDValuegetBasePtr () const
 
- Public Member Functions inherited from llvm::SDNode
unsigned getOpcode () const
 Return the SelectionDAG opcode value for this node.
 
bool isTargetOpcode () const
 Test if this node has a target-specific opcode (in the <target>ISD namespace).
 
bool isTargetStrictFPOpcode () const
 Test if this node has a target-specific opcode that may raise FP exceptions (in the <target>ISD namespace and greater than FIRST_TARGET_STRICTFP_OPCODE).
 
bool isTargetMemoryOpcode () const
 Test if this node has a target-specific memory-referencing opcode (in the <target>ISD namespace and greater than FIRST_TARGET_MEMORY_OPCODE).
 
bool isUndef () const
 Return true if the type of the node type undefined.
 
bool isMemIntrinsic () const
 Test if this node is a memory intrinsic (with valid pointer information).
 
bool isStrictFPOpcode ()
 Test if this node is a strict floating point pseudo-op.
 
bool isVPOpcode () const
 Test if this node is a vector predication operation.
 
bool isMachineOpcode () const
 Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode.
 
unsigned getMachineOpcode () const
 This may only be called if isMachineOpcode returns true.
 
bool getHasDebugValue () const
 
void setHasDebugValue (bool b)
 
bool isDivergent () const
 
bool use_empty () const
 Return true if there are no uses of this node.
 
bool hasOneUse () const
 Return true if there is exactly one use of this node.
 
size_t use_size () const
 Return the number of uses of this node.
 
int getNodeId () const
 Return the unique node id.
 
void setNodeId (int Id)
 Set unique node id.
 
unsigned getIROrder () const
 Return the node ordering.
 
void setIROrder (unsigned Order)
 Set the node ordering.
 
const DebugLocgetDebugLoc () const
 Return the source location info.
 
void setDebugLoc (DebugLoc dl)
 Set source location info.
 
use_iterator use_begin () const
 Provide iteration support to walk over all uses of an SDNode.
 
iterator_range< use_iteratoruses ()
 
iterator_range< use_iteratoruses () const
 
bool hasNUsesOfValue (unsigned NUses, unsigned Value) const
 Return true if there are exactly NUSES uses of the indicated value.
 
bool hasAnyUseOfValue (unsigned Value) const
 Return true if there are any use of the indicated value.
 
bool isOnlyUserOf (const SDNode *N) const
 Return true if this node is the only use of N.
 
bool isOperandOf (const SDNode *N) const
 Return true if this node is an operand of N.
 
bool isPredecessorOf (const SDNode *N) const
 Return true if this node is a predecessor of N.
 
bool hasPredecessor (const SDNode *N) const
 Return true if N is a predecessor of this node.
 
unsigned getNumOperands () const
 Return the number of values used by this operation.
 
uint64_t getConstantOperandVal (unsigned Num) const
 Helper method returns the integer value of a ConstantSDNode operand.
 
uint64_t getAsZExtVal () const
 Helper method returns the zero-extended integer value of a ConstantSDNode.
 
const APIntgetConstantOperandAPInt (unsigned Num) const
 Helper method returns the APInt of a ConstantSDNode operand.
 
const APIntgetAsAPIntVal () const
 Helper method returns the APInt value of a ConstantSDNode.
 
const SDValuegetOperand (unsigned Num) const
 
op_iterator op_begin () const
 
op_iterator op_end () const
 
ArrayRef< SDUseops () const
 
iterator_range< value_op_iteratorop_values () const
 
SDVTList getVTList () const
 
SDNodegetGluedNode () const
 If this node has a glue operand, return the node to which the glue operand points.
 
SDNodegetGluedUser () const
 If this node has a glue value with a user, return the user (there is at most one).
 
SDNodeFlags getFlags () const
 
void setFlags (SDNodeFlags NewFlags)
 
void intersectFlagsWith (const SDNodeFlags Flags)
 Clear any flags in this node that aren't also set in Flags.
 
void setCFIType (uint32_t Type)
 
uint32_t getCFIType () const
 
unsigned getNumValues () const
 Return the number of values defined/returned by this operator.
 
EVT getValueType (unsigned ResNo) const
 Return the type of a specified result.
 
MVT getSimpleValueType (unsigned ResNo) const
 Return the type of a specified result as a simple type.
 
TypeSize getValueSizeInBits (unsigned ResNo) const
 Returns MVT::getSizeInBits(getValueType(ResNo)).
 
value_iterator value_begin () const
 
value_iterator value_end () const
 
iterator_range< value_iteratorvalues () const
 
std::string getOperationName (const SelectionDAG *G=nullptr) const
 Return the opcode of this operation for printing.
 
void print_types (raw_ostream &OS, const SelectionDAG *G) const
 
void print_details (raw_ostream &OS, const SelectionDAG *G) const
 
void print (raw_ostream &OS, const SelectionDAG *G=nullptr) const
 
void printr (raw_ostream &OS, const SelectionDAG *G=nullptr) const
 
void printrFull (raw_ostream &O, const SelectionDAG *G=nullptr) const
 Print a SelectionDAG node and all children down to the leaves.
 
void printrWithDepth (raw_ostream &O, const SelectionDAG *G=nullptr, unsigned depth=100) const
 Print a SelectionDAG node and children up to depth "depth." The given SelectionDAG allows target-specific nodes to be printed in human-readable form.
 
void dump () const
 Dump this node, for debugging.
 
void dumpr () const
 Dump (recursively) this node and its use-def subgraph.
 
void dump (const SelectionDAG *G) const
 Dump this node, for debugging.
 
void dumpr (const SelectionDAG *G) const
 Dump (recursively) this node and its use-def subgraph.
 
void dumprFull (const SelectionDAG *G=nullptr) const
 printrFull to dbgs().
 
void dumprWithDepth (const SelectionDAG *G=nullptr, unsigned depth=100) const
 printrWithDepth to dbgs().
 
void Profile (FoldingSetNodeID &ID) const
 Gather unique data for the node.
 
void addUse (SDUse &U)
 This method should only be used by the SDUse class.
 
- Public Member Functions inherited from llvm::FoldingSetBase::Node
 Node ()=default
 
void * getNextInBucket () const
 
void SetNextInBucket (void *N)
 
- Public Member Functions inherited from llvm::ilist_node_impl< OptionsT >
self_iterator getIterator ()
 
const_self_iterator getIterator () const
 
reverse_self_iterator getReverseIterator ()
 
const_reverse_self_iterator getReverseIterator () const
 
bool isSentinel () const
 Check whether this is the sentinel node.
 

Static Public Member Functions

static bool classof (const SDNode *N)
 
- Static Public Member Functions inherited from llvm::SDNode
static use_iterator use_end ()
 
static bool hasPredecessorHelper (const SDNode *N, SmallPtrSetImpl< const SDNode * > &Visited, SmallVectorImpl< const SDNode * > &Worklist, unsigned int MaxSteps=0, bool TopologicalPrune=false)
 Returns true if N is a predecessor of any node in Worklist.
 
static bool areOnlyUsersOf (ArrayRef< const SDNode * > Nodes, const SDNode *N)
 Return true if all the users of N are contained in Nodes.
 
static constexpr size_t getMaxNumOperands ()
 Return the maximum number of operands that a SDNode can hold.
 
static const chargetIndexedModeName (ISD::MemIndexedMode AM)
 

Protected Attributes

MachineMemOperandMMO
 Memory reference information.
 
- Protected Attributes inherited from llvm::SDNode
union {
   char   RawSDNodeBits [sizeof(uint16_t)]
 
   SDNodeBitfields   SDNodeBits
 
   ConstantSDNodeBitfields   ConstantSDNodeBits
 
   MemSDNodeBitfields   MemSDNodeBits
 
   LSBaseSDNodeBitfields   LSBaseSDNodeBits
 
   LoadSDNodeBitfields   LoadSDNodeBits
 
   StoreSDNodeBitfields   StoreSDNodeBits
 
}; 
 

Additional Inherited Members

- Public Types inherited from llvm::SDNode
using op_iterator = SDUse *
 
using value_iterator = const EVT *
 
- Public Attributes inherited from llvm::SDNode
uint16_t PersistentId = 0xffff
 Unique and persistent id per SDNode in the DAG.
 
- Protected Types inherited from llvm::SDNode
enum  { NumSDNodeBits = 3 }
 
enum  { NumMemSDNodeBits = NumSDNodeBits + 4 }
 
enum  { NumLSBaseSDNodeBits = NumMemSDNodeBits + 3 }
 
- Protected Types inherited from llvm::ilist_node_impl< OptionsT >
using self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, false >::type
 
using const_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, true >::type
 
using reverse_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, false >::type
 
using const_reverse_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, true >::type
 
- Protected Member Functions inherited from llvm::SDNode
 SDNode (unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs)
 Create an SDNode.
 
void DropOperands ()
 Release the operands and set this node to have zero operands.
 
- Protected Member Functions inherited from llvm::ilist_node_impl< OptionsT >
 ilist_node_impl ()=default
 
- Static Protected Member Functions inherited from llvm::SDNode
static SDVTList getSDVTList (EVT VT)
 

Detailed Description

This is an abstract virtual class for memory operations.

Definition at line 1297 of file SelectionDAGNodes.h.

Constructor & Destructor Documentation

◆ MemSDNode()

MemSDNode::MemSDNode ( unsigned  Opc,
unsigned  Order,
const DebugLoc dl,
SDVTList  VTs,
EVT  memvt,
MachineMemOperand MMO 
)

Member Function Documentation

◆ classof()

static bool llvm::MemSDNode::classof ( const SDNode N)
inlinestatic

◆ getAAInfo()

AAMDNodes llvm::MemSDNode::getAAInfo ( ) const
inline

◆ getAddressSpace()

unsigned llvm::MemSDNode::getAddressSpace ( ) const
inline

◆ getAlign()

Align llvm::MemSDNode::getAlign ( ) const
inline

◆ getBasePtr()

const SDValue & llvm::MemSDNode::getBasePtr ( ) const
inline

◆ getChain()

const SDValue & llvm::MemSDNode::getChain ( ) const
inline

Definition at line 1400 of file SelectionDAGNodes.h.

References llvm::SDNode::getOperand().

Referenced by combineBVOfConsecutiveLoads(), combineLoad(), combineMaskedStore(), combineMOVDQ2Q(), combineSIntToFP(), combineStore(), combineTargetShuffle(), EltsFromConsecutiveLoads(), llvm::PPCTargetLowering::expandVSXLoadForLE(), llvm::PPCTargetLowering::expandVSXStoreForLE(), getBROADCAST_LOAD(), isFusableLoadOpStorePattern(), LowerF128Load(), LowerF128Store(), lowerFP_TO_SINT_STORE(), LowerLoad(), llvm::HexagonTargetLowering::LowerLoad(), lowerLoadF128(), lowerLoadI1(), lowerShuffleAsBroadcast(), LowerStore(), LowerSTORE(), llvm::HexagonTargetLowering::LowerStore(), lowerStoreF128(), lowerStoreI1(), lowerUnalignedIntStore(), llvm::HexagonTargetLowering::LowerUnalignedLoad(), AMDGPUDAGToDAGISel::matchLoadD16FromBuildVector(), narrowExtractedVectorLoad(), narrowLoadToVZLoad(), PerformExtractFpToIntStores(), performFPExtendCombine(), performIntToFpCombine(), llvm::AMDGPUTargetLowering::performLoadCombine(), performMaskedGatherScatterCombine(), performMSTORECombine(), PerformSplittingMVETruncToNarrowingStores(), PerformSplittingToNarrowingStores(), llvm::AMDGPUTargetLowering::performStoreCombine(), PerformSTORECombine(), PerformTruncatingStoreCombine(), performUnpackCombine(), PerformVMOVrhCombine(), reduceMaskedStoreToScalarStore(), llvm::RISCVTargetLowering::ReplaceNodeResults(), llvm::SparcTargetLowering::ReplaceNodeResults(), ShrinkLoadReplaceStoreWithStore(), llvm::TargetLowering::SimplifySetCC(), splitStores(), splitStoreSplat(), TryDistrubutionADDVecReduce(), llvm::RISCVDAGToDAGISel::tryIndexedLoad(), tryMemPairCombine(), tryToFoldExtOfExtload(), tryToFoldExtOfLoad(), and tryToFoldExtOfMaskedLoad().

◆ getMemOperand()

MachineMemOperand * llvm::MemSDNode::getMemOperand ( ) const
inline

Return a MachineMemOperand object describing the memory reference performed by operation.

Definition at line 1381 of file SelectionDAGNodes.h.

References MMO.

Referenced by AddNodeIDCustom(), combineAndLoadToBZHI(), combineLoad(), combineMaskedStore(), combineMOVDQ2Q(), combineStore(), combineTargetShuffle(), CombineVLDDUP(), createStoreLR(), EltsFromConsecutiveLoads(), llvm::PPCTargetLowering::expandVSXLoadForLE(), llvm::PPCTargetLowering::expandVSXStoreForLE(), getAVX2GatherNode(), getBROADCAST_LOAD(), getGatherNode(), getScatterNode(), llvm::SITargetLowering::isMemOpHasNoClobberedMemOperand(), llvm::SITargetLowering::isMemOpUniform(), lowerAtomicArith(), lowerFP_TO_SINT_STORE(), LowerINTRINSIC_W_CHAIN(), LowerLoad(), llvm::HexagonTargetLowering::LowerLoad(), lowerShuffleAsBroadcast(), LowerStore(), LowerSTORE(), llvm::HexagonTargetLowering::LowerStore(), llvm::HexagonTargetLowering::LowerUnalignedLoad(), AMDGPUDAGToDAGISel::matchLoadD16FromBuildVector(), narrowExtractedVectorLoad(), narrowLoadToVZLoad(), PerformExtractFpToIntStores(), performFPExtendCombine(), performIntToFpCombine(), llvm::AMDGPUTargetLowering::performLoadCombine(), performMaskedGatherScatterCombine(), performMSTORECombine(), PerformMVEVLDCombine(), performNEONPostLDSTCombine(), performPostLD1Combine(), PerformSplittingMVETruncToNarrowingStores(), PerformSplittingToNarrowingStores(), llvm::AMDGPUTargetLowering::performStoreCombine(), PerformSTORECombine(), PerformTruncatingStoreCombine(), performUnpackCombine(), PerformVMOVrhCombine(), reduceMaskedStoreToScalarStore(), ReplaceINTRINSIC_W_CHAIN(), llvm::RISCVTargetLowering::ReplaceNodeResults(), llvm::SparcTargetLowering::ReplaceNodeResults(), llvm::AMDGPUTargetLowering::shouldReduceLoadWidth(), ShrinkLoadReplaceStoreWithStore(), splitStores(), splitStoreSplat(), TryCombineBaseUpdate(), tryMemPairCombine(), tryToFoldExtOfExtload(), tryToFoldExtOfLoad(), and tryToFoldExtOfMaskedLoad().

◆ getMemoryVT()

EVT llvm::MemSDNode::getMemoryVT ( ) const
inline

Return the type of the in-memory value.

Definition at line 1377 of file SelectionDAGNodes.h.

Referenced by AddNodeIDCustom(), allUsesTruncate(), checkValueWidth(), combineLoad(), combineMaskedStore(), combineStore(), combineTargetShuffle(), CombineVLDDUP(), createStoreLR(), getAVX2GatherNode(), getGatherNode(), getParamsForOneTrueMaskedElt(), llvm::HexagonTargetLowering::getPostIndexedAddressParts(), getScatterNode(), isValidSplatLoad(), LowerINTRINSIC_W_CHAIN(), LowerLoad(), LowerLOAD(), llvm::HexagonTargetLowering::LowerLoad(), llvm::VETargetLowering::lowerLOAD(), lowerLoadI1(), LowerSTORE(), llvm::HexagonTargetLowering::LowerStore(), llvm::MipsTargetLowering::lowerSTORE(), llvm::VETargetLowering::lowerSTORE(), lowerStoreI1(), llvm::HexagonTargetLowering::LowerUnalignedLoad(), AMDGPUDAGToDAGISel::matchLoadD16FromBuildVector(), PerformANDCombine(), llvm::AMDGPUTargetLowering::performLoadCombine(), performMaskedGatherScatterCombine(), performMemPairCombine(), performMSTORECombine(), performNEONPostLDSTCombine(), performPostLD1Combine(), llvm::AMDGPUTargetLowering::performStoreCombine(), PerformTruncatingStoreCombine(), performUnpackCombine(), ReplaceINTRINSIC_W_CHAIN(), llvm::RISCVTargetLowering::ReplaceNodeResults(), llvm::SparcTargetLowering::ReplaceNodeResults(), llvm::AArch64TargetLowering::shouldReduceLoadWidth(), llvm::TargetLowering::SimplifySetCC(), llvm::RISCVDAGToDAGISel::tryIndexedLoad(), tryMemPairCombine(), tryToFoldExtendSelectLoad(), tryToFoldExtOfExtload(), and tryToFoldExtOfMaskedLoad().

◆ getMergedOrdering()

AtomicOrdering llvm::MemSDNode::getMergedOrdering ( ) const
inline

Return a single atomic ordering that is at least as strong as both the success and failure orderings for an atomic operation.

(For operations other than cmpxchg, this is equivalent to getSuccessOrdering().)

Definition at line 1363 of file SelectionDAGNodes.h.

References llvm::MachineMemOperand::getMergedOrdering(), and MMO.

◆ getOriginalAlign()

Align llvm::MemSDNode::getOriginalAlign ( ) const
inline

◆ getPointerInfo()

const MachinePointerInfo & llvm::MemSDNode::getPointerInfo ( ) const
inline

◆ getRanges()

const MDNode * llvm::MemSDNode::getRanges ( ) const
inline

Returns the Ranges that describes the dereference.

Definition at line 1348 of file SelectionDAGNodes.h.

References llvm::MachineMemOperand::getRanges(), and MMO.

Referenced by llvm::HexagonTargetLowering::LowerLoad().

◆ getRawSubclassData()

unsigned llvm::MemSDNode::getRawSubclassData ( ) const
inline

Return the SubclassData value, without HasDebugValue.

This contains an encoding of the volatile flag, as well as bits used by subclasses. This function should only be used to compute a FoldingSetNodeID value. The HasDebugValue bit is masked out because CSE map needs to match nodes with debug info with nodes without debug info. Same is about isDivergent bit.

Definition at line 1323 of file SelectionDAGNodes.h.

References llvm::Data, llvm::SDNode::RawSDNodeBits, and llvm::SDNode::SDNodeBits.

Referenced by AddNodeIDCustom().

◆ getSrcValueOffset()

int64_t llvm::MemSDNode::getSrcValueOffset ( ) const
inline

Definition at line 1342 of file SelectionDAGNodes.h.

References llvm::MachineMemOperand::getOffset(), and MMO.

◆ getSuccessOrdering()

AtomicOrdering llvm::MemSDNode::getSuccessOrdering ( ) const
inline

Return the atomic ordering requirements for this memory operation.

For cmpxchg atomic operations, return the atomic ordering requirements when store occurs.

Definition at line 1356 of file SelectionDAGNodes.h.

References llvm::MachineMemOperand::getSuccessOrdering(), and MMO.

Referenced by lowerAtomicArith().

◆ getSyncScopeID()

SyncScope::ID llvm::MemSDNode::getSyncScopeID ( ) const
inline

Returns the synchronization scope ID for this memory operation.

Definition at line 1351 of file SelectionDAGNodes.h.

References llvm::MachineMemOperand::getSyncScopeID(), and MMO.

Referenced by lowerAtomicArith().

◆ isAtomic()

bool llvm::MemSDNode::isAtomic ( ) const
inline

Return true if the memory operation ordering is Unordered or higher.

Definition at line 1366 of file SelectionDAGNodes.h.

References llvm::MachineMemOperand::isAtomic(), and MMO.

Referenced by isSimple().

◆ isDereferenceable()

bool llvm::MemSDNode::isDereferenceable ( ) const
inline

Definition at line 1338 of file SelectionDAGNodes.h.

References llvm::SDNode::MemSDNodeBits.

◆ isInvariant()

bool llvm::MemSDNode::isInvariant ( ) const
inline

◆ isNonTemporal()

bool llvm::MemSDNode::isNonTemporal ( ) const
inline

◆ isSimple()

bool llvm::MemSDNode::isSimple ( ) const
inline

◆ isUnordered()

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

Returns true if the memory operation doesn't imply any ordering constraints on surrounding memory operations beyond the normal memory aliasing rules.

Definition at line 1371 of file SelectionDAGNodes.h.

References llvm::MachineMemOperand::isUnordered(), and MMO.

◆ isVolatile()

bool llvm::MemSDNode::isVolatile ( ) const
inline

◆ readMem()

bool llvm::MemSDNode::readMem ( ) const
inline

Definition at line 1310 of file SelectionDAGNodes.h.

References llvm::MachineMemOperand::isLoad(), and MMO.

Referenced by getBROADCAST_LOAD().

◆ refineAlignment()

void llvm::MemSDNode::refineAlignment ( const MachineMemOperand NewMMO)
inline

Update this MemSDNode's MachineMemOperand information to reflect the alignment of NewMMO, 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 1396 of file SelectionDAGNodes.h.

References MMO, and llvm::MachineMemOperand::refineAlignment().

◆ writeMem()

bool llvm::MemSDNode::writeMem ( ) const
inline

Definition at line 1311 of file SelectionDAGNodes.h.

References llvm::MachineMemOperand::isStore(), and MMO.

Member Data Documentation

◆ MMO

MachineMemOperand* llvm::MemSDNode::MMO
protected

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