LLVM 18.0.0git
Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::ConstantSDNode Class Reference

#include "llvm/CodeGen/SelectionDAGNodes.h"

Inheritance diagram for llvm::ConstantSDNode:
Inheritance graph

Public Member Functions

const ConstantIntgetConstantIntValue () const
const APIntgetAPIntValue () const
uint64_t getZExtValue () const
int64_t getSExtValue () const
uint64_t getLimitedValue (uint64_t Limit=UINT64_MAX)
MaybeAlign getMaybeAlignValue () const
Align getAlignValue () const
bool isOne () const
bool isZero () const
bool isAllOnes () const
bool isMaxSignedValue () const
bool isMinSignedValue () const
bool isOpaque () 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.
const APIntgetConstantOperandAPInt (unsigned Num) const
 Helper method returns the APInt of a ConstantSDNode operand.
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)


class SelectionDAG

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 = ilist_iterator< OptionsT, false, false >
using const_self_iterator = ilist_iterator< OptionsT, false, true >
using reverse_self_iterator = ilist_iterator< OptionsT, true, false >
using const_reverse_self_iterator = ilist_iterator< OptionsT, true, true >
- 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)
- Protected Attributes inherited from llvm::SDNode
union {
   char   RawSDNodeBits [sizeof(uint16_t)]
   SDNodeBitfields   SDNodeBits
   ConstantSDNodeBitfields   ConstantSDNodeBits
   MemSDNodeBitfields   MemSDNodeBits
   LSBaseSDNodeBitfields   LSBaseSDNodeBits
   LoadSDNodeBitfields   LoadSDNodeBits
   StoreSDNodeBitfields   StoreSDNodeBits

Detailed Description

Definition at line 1598 of file SelectionDAGNodes.h.

Member Function Documentation

◆ classof()

static bool llvm::ConstantSDNode::classof ( const SDNode N)

Definition at line 1629 of file SelectionDAGNodes.h.

References llvm::ISD::Constant, N, and llvm::ISD::TargetConstant.

◆ getAlignValue()

Align llvm::ConstantSDNode::getAlignValue ( ) const

Definition at line 1619 of file SelectionDAGNodes.h.

◆ getAPIntValue()

const APInt & llvm::ConstantSDNode::getAPIntValue ( ) const

◆ getConstantIntValue()

const ConstantInt * llvm::ConstantSDNode::getConstantIntValue ( ) const

Definition at line 1611 of file SelectionDAGNodes.h.

◆ getLimitedValue()

uint64_t llvm::ConstantSDNode::getLimitedValue ( uint64_t  Limit = UINT64_MAX)

Definition at line 1615 of file SelectionDAGNodes.h.

◆ getMaybeAlignValue()

MaybeAlign llvm::ConstantSDNode::getMaybeAlignValue ( ) const

Definition at line 1618 of file SelectionDAGNodes.h.

◆ getSExtValue()

int64_t llvm::ConstantSDNode::getSExtValue ( ) const

◆ getZExtValue()

uint64_t llvm::ConstantSDNode::getZExtValue ( ) const

Definition at line 1613 of file SelectionDAGNodes.h.

Referenced by AddCombineBUILD_VECTORToVPADDL(), AddCombineTo64bitMLAL(), llvm::SIInstrInfo::areLoadsFromSameBasePtr(), checkBoolTestSetCCCombine(), CombineANDShift(), combineBVOfVecSExt(), combineShiftToMULH(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::BPFSelectionDAGInfo::EmitTargetCodeForMemcpy(), llvm::HexagonSelectionDAGInfo::EmitTargetCodeForMemcpy(), llvm::X86SelectionDAGInfo::EmitTargetCodeForMemset(), Expand64BitShift(), getAArch64Cmp(), getExtendTypeForNode(), llvm::SelectionDAG::getMemcpy(), llvm::SelectionDAG::getMemmove(), llvm::SelectionDAG::getMemset(), llvm::SelectionDAG::getNode(), getPermuteMask(), getPointerConstIncrement(), isAllConstantBuildVector(), isBSwapHWordElement(), isExtendOrShiftOperand(), isValidImmForSVEVecImmAddrMode(), LowerAndToBT(), LowerATOMIC_FENCE(), performANDCombine(), PerformANDCombine(), PerformBFICombine(), performCMovFPCombine(), PerformMVEVLDCombine(), performORCombine(), PerformORCombineToBFI(), performSELECTCombine(), PerformShiftCombine(), performSHLCombine(), performSRACombine(), performSRLCombine(), replaceSplatVectorStore(), SDValueToConstBool(), llvm::LoongArchDAGToDAGISel::SelectInlineAsmMemoryOperand(), shouldGenerateInlineTPLoop(), tryCombineCRC32(), tryCombineToBSL(), tryLowerToSLI(), and llvm::RISCVDAGToDAGISel::tryShrinkShlLogicImm().

◆ isAllOnes()

bool llvm::ConstantSDNode::isAllOnes ( ) const

◆ isMaxSignedValue()

bool llvm::ConstantSDNode::isMaxSignedValue ( ) const

Definition at line 1624 of file SelectionDAGNodes.h.

◆ isMinSignedValue()

bool llvm::ConstantSDNode::isMinSignedValue ( ) const

Definition at line 1625 of file SelectionDAGNodes.h.

◆ isOne()

bool llvm::ConstantSDNode::isOne ( ) const

◆ isOpaque()

bool llvm::ConstantSDNode::isOpaque ( ) const

◆ isZero()

bool llvm::ConstantSDNode::isZero ( ) const

Friends And Related Function Documentation

◆ SelectionDAG

friend class SelectionDAG

Definition at line 1599 of file SelectionDAGNodes.h.

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