Represents one node in the SelectionDAG.

Synopsis

Declared in <llvm/CodeGen/SelectionDAGNodes.h>

class SDNode
    : public FoldingSetNode
    , public ilist_node<SDNode>

Base Classes

Name

Description

FoldingSetNode

Convenience alias for the base node type stored in a folding set.

ilist_node<SDNode>

An intrusive list node.

Types

Name

Description

use_iterator

This class provides iterator support for SDUse operands that use a specific SDNode.

user_iterator

value_op_iterator

Iterator for directly iterating over the operand SDValue's.

Type Aliases

Member Functions

Name

Description

Profile

Gather unique data for the node.

addUse

This method should only be used by the SDUse class.

bitcastToAPInt

dropFlags

dump

Dump this node, for debugging.

dump

Dump this node, for debugging. The given SelectionDAG allows target‐specific nodes to be printed in human‐readable form.

dumpr

Dump (recursively) this node and its use‐def subgraph.

dumpr

Dump (recursively) this node and its use‐def subgraph. The given SelectionDAG allows target‐specific nodes to be printed in human‐readable form.

dumprFull

printrFull to dbgs(). The given SelectionDAG allows target‐specific nodes to be printed in human‐readable form. Unlike dumpr, this will print the whole DAG, including children that appear multiple times.

dumprWithDepth

printrWithDepth to dbgs(). The given SelectionDAG allows target‐specific nodes to be printed in human‐readable form. Unlike dumpr, this will print children that appear multiple times wherever they are used.

getAsAPIntVal

Helper method returns the APInt value of a ConstantSDNode.

getAsZExtVal

Helper method returns the zero‐extended integer value of a ConstantSDNode.

getCFIType

getCombinerWorklistIndex

Get worklist index for DAGCombiner

getConstantOperandAPInt

Helper method returns the APInt of a ConstantSDNode operand.

getConstantOperandVal

Helper method returns the integer value of a ConstantSDNode operand.

getDebugLoc

Return the source location info.

getFlags

getGluedNode

If this node has a glue operand, return the node to which the glue operand points. Otherwise return NULL.

getGluedUser

If this node has a glue value with a user, return the user (there is at most one). Otherwise return NULL.

getHasDebugValue

getIROrder

Return the node ordering.

getMachineOpcode

This may only be called if isMachineOpcode returns true. It returns the MachineInstr opcode value that the node's opcode corresponds to.

getNodeId

Return the unique node id.

getNumOperands

Return the number of values used by this operation.

getNumValues

Return the number of values defined/returned by this operator.

getOpcode

Return the SelectionDAG opcode value for this node. For pre‐isel nodes (those for which isMachineOpcode returns false), these are the opcode values in the ISD and <target>ISD namespaces. For post‐isel opcodes, see getMachineOpcode.

getOperand

getOperationName

Return the opcode of this operation for printing.

getSchedulerWorklistVisited

Get visited state for ScheduleDAGSDNodes::BuildSchedUnits.

getSimpleValueType

Return the type of a specified result as a simple type.

getVTList

getValueSizeInBits

Returns MVT::getSizeInBits(getValueType(ResNo)).

getValueType

Return the type of a specified result.

hasAnyUseOfValue

Return true if there are any use of the indicated value. This method ignores uses of other values defined by this operation.

hasNUsesOfValue

Return true if there are exactly NUSES uses of the indicated value. This method ignores uses of other values defined by this operation.

hasOneUse

Return true if there is exactly one use of this node.

hasPoisonGeneratingFlags

hasPredecessor

Return true if N is a predecessor of this node. N is either an operand of this node, or can be reached by recursively traversing up the operands. NOTE: This is an expensive method. Use it carefully.

intersectFlagsWith

Clear any flags in this node that aren't also set in Flags. If Flags is not in a defined state then this has no effect.

isAnyAdd

Returns true if the node type is ADD or PTRADD.

isAssert

Test if this node is an assert operation.

isDivergent

isMachineOpcode

Test if this node has a post‐isel opcode, directly corresponding to a MachineInstr opcode.

isMemIntrinsic

Test if this node is a memory intrinsic (with valid pointer information).

isOnlyUserOf

Return true if this node is the only use of N.

isOperandOf

Return true if this node is an operand of N.

isPredecessorOf

Return true if this node is a predecessor of N. NOTE: Implemented on top of hasPredecessor and every bit as expensive. Use carefully.

isStrictFPOpcode

Test if this node is a strict floating point pseudo‐op.

isTargetOpcode

Test if this node has a target‐specific opcode (in the <target>ISD namespace).

isUndef

Returns true if the node type is UNDEF or POISON.

isVPOpcode

Test if this node is a vector predication operation.

op_begin

op_end

op_values

ops

print

print_details

print_types

printr

printrFull

Print a SelectionDAG node and all children down to the leaves. The given SelectionDAG allows target‐specific nodes to be printed in human‐readable form. Unlike printr, this will print the whole DAG, including children that appear multiple times.

printrWithDepth

Print a SelectionDAG node and children up to depth "depth." The given SelectionDAG allows target‐specific nodes to be printed in human‐readable form. Unlike printr, this will print children that appear multiple times wherever they are used.

setCFIType

setCombinerWorklistIndex

Set worklist index for DAGCombiner

setDebugLoc

Set source location info. Try to avoid this, putting it in the constructor is preferable.

setFlags

setHasDebugValue

setIROrder

Set the node ordering.

setNodeId

Set unique node id.

setSchedulerWorklistVisited

Set visited state for ScheduleDAGSDNodes::BuildSchedUnits.

use_begin

Provide iteration support to walk over all uses of an SDNode.

use_empty

Return true if there are no uses of this node.

use_size

Return the number of uses of this node. This method takes time proportional to the number of uses.

user_begin

Provide iteration support to walk over all users of an SDNode.

users

users

uses

uses

value_begin

value_end

values

Static Member Functions

Name

Description

areOnlyUsersOf

Return true if all the users of N are contained in Nodes. NOTE: Requires at least one match, but doesn't require them all.

getIndexedModeName

getMaxNumOperands

Return the maximum number of operands that a SDNode can hold.

hasPredecessorHelper

Returns true if N is a predecessor of any node in Worklist. This helper keeps Visited and Worklist sets externally to allow unions searches to be performed in parallel, caching of results across queries and incremental addition to Worklist. Stops early if N is found but will resume. Remember to clear Visited and Worklists if DAG changes. MaxSteps gives a maximum number of nodes to visit before giving up. The TopologicalPrune flag signals that positive NodeIds are topologically ordered (Operands have strictly smaller node id) and search can be pruned leveraging this.

use_end

user_end

Data Members

Name

Description

CombinerWorklistIndex [variant member]

Index in worklist of DAGCombiner, or negative if the node is not in the worklist. ‐1 = not in worklist; ‐2 = not in worklist, but has already been combined at least once.

ConstantSDNodeBits [variant member]

LSBaseSDNodeBits [variant member]

LoadSDNodeBits [variant member]

MemSDNodeBits [variant member]

PersistentId

Unique and persistent id per SDNode in the DAG. Used for debug printing. We do not place that under #if LLVM_ENABLE_ABI_BREAKING_CHECKS intentionally because it adds unneeded complexity without noticeable benefits (see discussion with thakis in D120714). Currently, there are two padding bytes after this field.

RawSDNodeBits [variant member]

SDNodeBits [variant member]

SchedulerWorklistVisited [variant member]

Visited state in ScheduleDAGSDNodes::BuildSchedUnits.

StoreSDNodeBits [variant member]

Protected Types

Protected Enums

Protected Member Functions

Name

Description

SDNode [constructor]

Create an SDNode.

DropOperands

Release the operands and set this node to have zero operands.

Protected Static Member Functions

Friends

Name

Description

llvm::HandleSDNode

This class is used to form a handle around another node that is persistent and is updated across invocations of replaceAllUsesWith on its operand. This node should be directly created by end‐users and not added to the AllNodes list.

llvm::SelectionDAG

This is used to represent a portion of an LLVM function in a low‐level Data Dependence DAG representation suitable for instruction selection. This DAG is constructed as the first step of instruction selection in order to allow implementation of machine specific optimizations and code simplifications.

Non-Member Functions

Name

Description

ISD::allOperandsUndef

Return true if the node has at least one operand and all operands of the specified node are ISD::UNDEF.

ISD::isBuildVectorAllOnes

Return true if the specified node is a BUILD_VECTOR where all of the elements are ~0 or undef.

ISD::isBuildVectorAllZeros

Return true if the specified node is a BUILD_VECTOR where all of the elements are 0 or undef.

ISD::isBuildVectorOfConstantFPSDNodes

Return true if the specified node is a BUILD_VECTOR node of all ConstantFPSDNode or undef.

ISD::isBuildVectorOfConstantSDNodes

Return true if the specified node is a BUILD_VECTOR node of all ConstantSDNode or undef.

ISD::isConstantSplatVector

If N is a BUILD_VECTOR or SPLAT_VECTOR node whose elements are all the same constant or undefined, return true and return the constant value in SplatValue.

ISD::isConstantSplatVectorAllOnes

Return true if the specified node is a BUILD_VECTOR or SPLAT_VECTOR where all of the elements are ~0 or undef. If BuildVectorOnly is set to true, it only checks BUILD_VECTOR.

ISD::isConstantSplatVectorAllZeros

Return true if the specified node is a BUILD_VECTOR or SPLAT_VECTOR where all of the elements are 0 or undef. If BuildVectorOnly is set to true, it only checks BUILD_VECTOR.

ISD::isEXTLoad

Returns true if the specified node is a EXTLOAD.

ISD::isFreezeUndef

Return true if the specified node is FREEZE(UNDEF).

ISD::isNON_EXTLoad

Returns true if the specified node is a non‐extending load.

ISD::isNormalLoad

Returns true if the specified node is a non‐extending and unindexed load.

ISD::isNormalMaskedLoad

Returns true if the specified node is a non‐extending and unindexed masked load.

ISD::isNormalMaskedStore

Returns true if the specified node is a non‐extending and unindexed masked store.

ISD::isNormalStore

Returns true if the specified node is a non‐truncating and unindexed store.

ISD::isSEXTLoad

Returns true if the specified node is a SEXTLOAD.

ISD::isUNINDEXEDLoad

Returns true if the specified node is an unindexed load.

ISD::isUNINDEXEDStore

Returns true if the specified node is an unindexed store.

ISD::isVectorShrinkable

Returns true if the specified node is a vector where all elements can be truncated to the specified element size without a loss in meaning.

ISD::isZEXTLoad

Returns true if the specified node is a ZEXTLOAD.

Derived Classes

Name

Description

AddrSpaceCastSDNode

AssertAlignSDNode

An SDNode that records if a register contains a value that is guaranteed to be aligned accordingly.

BasicBlockSDNode

BlockAddressSDNode

BuildVectorSDNode

A "pseudo‐class" with methods for operating on BUILD_VECTORs.

CondCodeSDNode

ConstantFPSDNode

ConstantPoolSDNode

ConstantSDNode

DeactivationSymbolSDNode

ExternalSymbolSDNode

FrameIndexSDNode

GlobalAddressSDNode

HandleSDNode

This class is used to form a handle around another node that is persistent and is updated across invocations of replaceAllUsesWith on its operand. This node should be directly created by end‐users and not added to the AllNodes list.

JumpTableSDNode

LabelSDNode

LifetimeSDNode

This SDNode is used for LIFETIME_START/LIFETIME_END values.

MCSymbolSDNode

MDNodeSDNode

MachineSDNode

An SDNode that represents everything that will be needed to construct a MachineInstr. These nodes are created during the instruction selection proper phase.

MemSDNode

This is an abstract virtual class for memory operations.

PseudoProbeSDNode

This SDNode is used for PSEUDO_PROBE values, which are the function guid and the index of the basic block being probed. A pseudo probe serves as a place holder and will be removed at the end of compilation. It does not have any operand because we do not want the instruction selection to deal with any.

RegisterMaskSDNode

RegisterSDNode

ShuffleVectorSDNode

This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction. It combines elements from two input vectors into a new input vector, with the selection and ordering of elements determined by an array of integers, referred to as the shuffle mask. For input vectors of width N, mask indices of 0..N‐1 refer to elements from the LHS input, and indices from N to 2N‐1 the RHS. An index of ‐1 is treated as undef, such that the code generator may put any value in the corresponding element of the result.

SrcValueSDNode

An SDNode that holds an arbitrary LLVM IR Value. This is used when the SelectionDAG needs to make a simple reference to something in the LLVM IR representation.

TargetIndexSDNode

Completely target‐dependent object reference.

VTSDNode

This class is used to represent EVT's, which are used to parameterize some operations.

Created with MrDocs