class SDNode

Declaration

class SDNode : public Node { /* full declaration omitted */ };

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:499

Inherits from: FoldingSetBase::Node

Member Variables

protected anonymous struct / union
public uint16_t PersistentId
Unique and persistent id per SDNode in the DAG. Used for debug printing.

Method Overview

Inherited from FoldingSetBase::Node:

Methods

void DropOperands()

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1106

void Profile(llvm::FoldingSetNodeID& ID) const

Description

Gather unique data for the node.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1081

Parameters

llvm::FoldingSetNodeID& ID

SDNode(unsigned int Opc,
       unsigned int Order,
       llvm::DebugLoc dl,
       llvm::SDVTList VTs)

Description

Create an SDNode. SDNodes are created without any operands, and never own the operand storage. To add operands, see SelectionDAG::createOperands.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1096

Parameters

unsigned int Opc
unsigned int Order
llvm::DebugLoc dl
llvm::SDVTList VTs

void addUse(llvm::SDUse& U)

Description

This method should only be used by the SDUse class.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1084

Parameters

llvm::SDUse& U

static bool areOnlyUsersOf(
    ArrayRef<const llvm::SDNode*> Nodes,
    const llvm::SDNode* N)

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:922

Parameters

ArrayRef<const llvm::SDNode*> Nodes
const llvm::SDNode* N

void dump(const llvm::SelectionDAG* G) const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1059

Parameters

const llvm::SelectionDAG* G

void dump() const

Description

Dump this node, for debugging.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1051

void dumpr(const llvm::SelectionDAG* G) const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1064

Parameters

const llvm::SelectionDAG* G

void dumpr() const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1054

void dumprFull(
    const llvm::SelectionDAG* G = nullptr) const

Description

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.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1070

Parameters

const llvm::SelectionDAG* G = nullptr

void dumprWithDepth(
    const llvm::SelectionDAG* G = nullptr,
    unsigned int depth = 100) const

Description

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.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1077

Parameters

const llvm::SelectionDAG* G = nullptr
unsigned int depth = 100

inline const llvm::APInt& getConstantOperandAPInt(
    unsigned int Num) const

Description

Helper method returns the APInt of a ConstantSDNode operand.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:936

Parameters

unsigned int Num

inline uint64_t getConstantOperandVal(
    unsigned int Num) const

Description

Helper method returns the integer value of a ConstantSDNode operand.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:933

Parameters

unsigned int Num

const llvm::DebugLoc& getDebugLoc() const

Description

Return the source location info.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:753

const llvm::SDNodeFlags getFlags() const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:989

llvm::SDNode* getGluedNode() const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:973

llvm::SDNode* getGluedUser() const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:982

bool getHasDebugValue() const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:723

unsigned int getIROrder() const

Description

Return the node ordering.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:747

static const char* getIndexedModeName(
    ISD::MemIndexedMode AM)

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1027

Parameters

ISD::MemIndexedMode AM

unsigned int getMachineOpcode() const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:718

static constexpr size_t getMaxNumOperands()

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:928

int getNodeId() const

Description

Return the unique node id.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:741

unsigned int getNumOperands() const

Description

Return the number of values used by this operation.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:925

unsigned int getNumValues() const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:998

unsigned int getOpcode() const

Description

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.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:663

const llvm::SDValue& getOperand(
    unsigned int Num) const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:938

Parameters

unsigned int Num

std::string getOperationName(
    const llvm::SelectionDAG* G = nullptr) const

Description

Return the opcode of this operation for printing.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1026

Parameters

const llvm::SelectionDAG* G = nullptr

static llvm::SDVTList getSDVTList(llvm::EVT VT)

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1087

Parameters

llvm::EVT VT

llvm::MVT getSimpleValueType(
    unsigned int ResNo) const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1007

Parameters

unsigned int ResNo

llvm::SDVTList getVTList() const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:966

llvm::TypeSize getValueSizeInBits(
    unsigned int ResNo) const

Description

Returns MVT::getSizeInBits(getValueType(ResNo)). If the value type is a scalable vector type, the scalable property will be set and the runtime size will be a positive integer multiple of the base size.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1016

Parameters

unsigned int ResNo

llvm::EVT getValueType(unsigned int ResNo) const

Description

Return the type of a specified result.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1001

Parameters

unsigned int ResNo

bool hasAnyUseOfValue(unsigned int Value) const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:836

Parameters

unsigned int Value

bool hasNUsesOfValue(unsigned int NUses,
                     unsigned int Value) const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:832

Parameters

unsigned int NUses
unsigned int Value

bool hasOneUse() const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:732

bool hasPredecessor(const llvm::SDNode* N) const

Description

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.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:855

Parameters

const llvm::SDNode* N

static bool hasPredecessorHelper(
    const llvm::SDNode* N,
    SmallPtrSetImpl<const llvm::SDNode*>& Visited,
    SmallVectorImpl<const llvm::SDNode*>&
        Worklist,
    unsigned int MaxSteps = 0,
    bool TopologicalPrune = false)

Description

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.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:866

Parameters

const llvm::SDNode* N
SmallPtrSetImpl<const llvm::SDNode*>& Visited
SmallVectorImpl<const llvm::SDNode*>& Worklist
unsigned int MaxSteps = 0
bool TopologicalPrune = false

void intersectFlagsWith(
    const llvm::SDNodeFlags Flags)

Description

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.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:995

Parameters

const llvm::SDNodeFlags Flags

bool isDivergent() const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:726

bool isFast()

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:991

bool isMachineOpcode() const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:713

bool isMemIntrinsic() const

Description

Test if this node is a memory intrinsic (with valid pointer information). INTRINSIC_W_CHAIN and INTRINSIC_VOID nodes are sometimes created for non-memory intrinsics (with chains) that are not really instances of MemSDNode. For such nodes, we need some extra state to determine the proper classof relationship.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:693

bool isOnlyUserOf(const llvm::SDNode* N) const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:839

Parameters

const llvm::SDNode* N

bool isOperandOf(const llvm::SDNode* N) const

Description

Return true if this node is an operand of N.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:842

Parameters

const llvm::SDNode* N

bool isPredecessorOf(const llvm::SDNode* N) const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:847

Parameters

const llvm::SDNode* N

bool isStrictFPOpcode()

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:700

bool isTargetMemoryOpcode() const

Description

Test if this node has a target-specific memory-referencing opcode (in the < target > ISD namespace and greater than FIRST_TARGET_MEMORY_OPCODE).

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:681

bool isTargetOpcode() const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:667

bool isTargetStrictFPOpcode() const

Description

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). Note that all target memory opcode are currently automatically considered to possibly raise FP exceptions as well.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:674

bool isUndef() const

Description

Return true if the type of the node type undefined.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:686

llvm::SDNode::op_iterator op_begin() const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:945

llvm::SDNode::op_iterator op_end() const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:946

iterator_range<llvm::SDNode::value_op_iterator>
op_values() const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:961

ArrayRef<llvm::SDUse> ops() const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:947

void print(
    llvm::raw_ostream& OS,
    const llvm::SelectionDAG* G = nullptr) const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1030

Parameters

llvm::raw_ostream& OS
const llvm::SelectionDAG* G = nullptr

void print_details(
    llvm::raw_ostream& OS,
    const llvm::SelectionDAG* G) const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1029

Parameters

llvm::raw_ostream& OS
const llvm::SelectionDAG* G

void print_types(
    llvm::raw_ostream& OS,
    const llvm::SelectionDAG* G) const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1028

Parameters

llvm::raw_ostream& OS
const llvm::SelectionDAG* G

void printr(
    llvm::raw_ostream& OS,
    const llvm::SelectionDAG* G = nullptr) const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1031

Parameters

llvm::raw_ostream& OS
const llvm::SelectionDAG* G = nullptr

void printrFull(
    llvm::raw_ostream& O,
    const llvm::SelectionDAG* G = nullptr) const

Description

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.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1039

Parameters

llvm::raw_ostream& O
const llvm::SelectionDAG* G = nullptr

void printrWithDepth(
    llvm::raw_ostream& O,
    const llvm::SelectionDAG* G = nullptr,
    unsigned int depth = 100) const

Description

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.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1047

Parameters

llvm::raw_ostream& O
const llvm::SelectionDAG* G = nullptr
unsigned int depth = 100

void setDebugLoc(llvm::DebugLoc dl)

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:757

Parameters

llvm::DebugLoc dl

void setFlags(llvm::SDNodeFlags NewFlags)

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:990

Parameters

llvm::SDNodeFlags NewFlags

void setHasDebugValue(bool b)

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:724

Parameters

bool b

void setIROrder(unsigned int Order)

Description

Set the node ordering.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:750

Parameters

unsigned int Order

void setNodeId(int Id)

Description

Set unique node id.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:744

Parameters

int Id

llvm::SDNode::use_iterator use_begin() const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:817

bool use_empty() const

Description

Return true if there are no uses of this node.

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:729

static llvm::SDNode::use_iterator use_end()

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:821

size_t use_size() const

Description

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

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:738

inline iterator_range<llvm::SDNode::use_iterator>
uses()

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:823

inline iterator_range<llvm::SDNode::use_iterator>
uses() const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:826

llvm::SDNode::value_iterator value_begin() const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1022

llvm::SDNode::value_iterator value_end() const

Declared at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1023