class BuildVectorSDNode

Declaration

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

Description

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

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

Inherits from: SDNode

Member Variables

Inherited from SDNode:

protected
public PersistentId

Method Overview

  • public BuildVectorSDNode()
  • public static bool classof(const llvm::SDNode * N)
  • public llvm::ConstantFPSDNode * getConstantFPSplatNode(const llvm::APInt & DemandedElts, llvm::BitVector * UndefElements = nullptr) const
  • public llvm::ConstantFPSDNode * getConstantFPSplatNode(llvm::BitVector * UndefElements = nullptr) const
  • public int32_t getConstantFPSplatPow2ToLog2Int(llvm::BitVector * UndefElements, uint32_t BitWidth) const
  • public bool getConstantRawBits(bool IsLittleEndian, unsigned int DstEltSizeInBits, SmallVectorImpl<llvm::APInt> & RawBitElements, llvm::BitVector & UndefElements) const
  • public llvm::ConstantSDNode * getConstantSplatNode(const llvm::APInt & DemandedElts, llvm::BitVector * UndefElements = nullptr) const
  • public llvm::ConstantSDNode * getConstantSplatNode(llvm::BitVector * UndefElements = nullptr) const
  • public bool getRepeatedSequence(const llvm::APInt & DemandedElts, SmallVectorImpl<llvm::SDValue> & Sequence, llvm::BitVector * UndefElements = nullptr) const
  • public bool getRepeatedSequence(SmallVectorImpl<llvm::SDValue> & Sequence, llvm::BitVector * UndefElements = nullptr) const
  • public llvm::SDValue getSplatValue(const llvm::APInt & DemandedElts, llvm::BitVector * UndefElements = nullptr) const
  • public llvm::SDValue getSplatValue(llvm::BitVector * UndefElements = nullptr) const
  • public bool isConstant() const
  • public Optional<std::pair<APInt, APInt>> isConstantSequence() const
  • public bool isConstantSplat(llvm::APInt & SplatValue, llvm::APInt & SplatUndef, unsigned int & SplatBitSize, bool & HasAnyUndefs, unsigned int MinSplatBits = 0, bool isBigEndian = false) const
  • public static void recastRawBits(bool IsLittleEndian, unsigned int DstEltSizeInBits, SmallVectorImpl<llvm::APInt> & DstBitElements, ArrayRef<llvm::APInt> SrcBitElements, llvm::BitVector & DstUndefElements, const llvm::BitVector & SrcUndefElements)

Inherited from SDNode:

Inherited from FoldingSetBase::Node:

Methods

BuildVectorSDNode()

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

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

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

Parameters

const llvm::SDNode* N

llvm::ConstantFPSDNode* getConstantFPSplatNode(
    const llvm::APInt& DemandedElts,
    llvm::BitVector* UndefElements =
        nullptr) const

Description

Returns the demanded splatted constant FP or null if this is not a constant FP splat. The DemandedElts mask indicates the elements that must be in the splat. If passed a non-null UndefElements bitvector, it will resize it to match the vector width and set the bits where elements are undef.

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

Parameters

const llvm::APInt& DemandedElts
llvm::BitVector* UndefElements = nullptr

llvm::ConstantFPSDNode* getConstantFPSplatNode(
    llvm::BitVector* UndefElements =
        nullptr) const

Description

Returns the splatted constant FP or null if this is not a constant FP splat. If passed a non-null UndefElements bitvector, it will resize it to match the vector width and set the bits where elements are undef.

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

Parameters

llvm::BitVector* UndefElements = nullptr

int32_t getConstantFPSplatPow2ToLog2Int(
    llvm::BitVector* UndefElements,
    uint32_t BitWidth) const

Description

If this is a constant FP splat and the splatted constant FP is an exact power or 2, return the log base 2 integer value. Otherwise, return -1. The BitWidth specifies the necessary bit precision.

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

Parameters

llvm::BitVector* UndefElements
uint32_t BitWidth

bool getConstantRawBits(
    bool IsLittleEndian,
    unsigned int DstEltSizeInBits,
    SmallVectorImpl<llvm::APInt>& RawBitElements,
    llvm::BitVector& UndefElements) const

Description

Extract the raw bit data from a build vector of Undef, Constant or ConstantFP node elements. Each raw bit element will be \p DstEltSizeInBits wide, undef elements are treated as zero, and entirely undefined elements are flagged in \p UndefElements.

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

Parameters

bool IsLittleEndian
unsigned int DstEltSizeInBits
SmallVectorImpl<llvm::APInt>& RawBitElements
llvm::BitVector& UndefElements

llvm::ConstantSDNode* getConstantSplatNode(
    const llvm::APInt& DemandedElts,
    llvm::BitVector* UndefElements =
        nullptr) const

Description

Returns the demanded splatted constant or null if this is not a constant splat. The DemandedElts mask indicates the elements that must be in the splat. If passed a non-null UndefElements bitvector, it will resize it to match the vector width and set the bits where elements are undef.

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

Parameters

const llvm::APInt& DemandedElts
llvm::BitVector* UndefElements = nullptr

llvm::ConstantSDNode* getConstantSplatNode(
    llvm::BitVector* UndefElements =
        nullptr) const

Description

Returns the splatted constant or null if this is not a constant splat. If passed a non-null UndefElements bitvector, it will resize it to match the vector width and set the bits where elements are undef.

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

Parameters

llvm::BitVector* UndefElements = nullptr

bool getRepeatedSequence(
    const llvm::APInt& DemandedElts,
    SmallVectorImpl<llvm::SDValue>& Sequence,
    llvm::BitVector* UndefElements =
        nullptr) const

Description

Find the shortest repeating sequence of values in the build vector. e.g. { u, X, u, X, u, u, X, u } -> { X } { X, Y, u, Y, u, u, X, u } -> { X, Y } Currently this must be a power-of-2 build vector. The DemandedElts mask indicates the elements that must be present, undemanded elements in Sequence may be null (SDValue()). If passed a non-null UndefElements bitvector, it will resize it to match the original vector width and set the bits where elements are undef. If result is false, Sequence will be empty.

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

Parameters

const llvm::APInt& DemandedElts
SmallVectorImpl<llvm::SDValue>& Sequence
llvm::BitVector* UndefElements = nullptr

bool getRepeatedSequence(
    SmallVectorImpl<llvm::SDValue>& Sequence,
    llvm::BitVector* UndefElements =
        nullptr) const

Description

Find the shortest repeating sequence of values in the build vector. e.g. { u, X, u, X, u, u, X, u } -> { X } { X, Y, u, Y, u, u, X, u } -> { X, Y } Currently this must be a power-of-2 build vector. If passed a non-null UndefElements bitvector, it will resize it to match the original vector width and set the bits where elements are undef. If result is false, Sequence will be empty.

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

Parameters

SmallVectorImpl<llvm::SDValue>& Sequence
llvm::BitVector* UndefElements = nullptr

llvm::SDValue getSplatValue(
    const llvm::APInt& DemandedElts,
    llvm::BitVector* UndefElements =
        nullptr) const

Description

Returns the demanded splatted value or a null value if this is not a splat. The DemandedElts mask indicates the elements that must be in the splat. If passed a non-null UndefElements bitvector, it will resize it to match the vector width and set the bits where elements are undef.

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

Parameters

const llvm::APInt& DemandedElts
llvm::BitVector* UndefElements = nullptr

llvm::SDValue getSplatValue(
    llvm::BitVector* UndefElements =
        nullptr) const

Description

Returns the splatted value or a null value if this is not a splat. If passed a non-null UndefElements bitvector, it will resize it to match the vector width and set the bits where elements are undef.

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

Parameters

llvm::BitVector* UndefElements = nullptr

bool isConstant() const

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

Optional<std::pair<APInt, APInt>>
isConstantSequence() const

Description

If this BuildVector is constant and represents the numerical series , a+n, a+2n, a+3n, ...> where a is integer and n is a non-zero integer, the value ,n> is returned.

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

bool isConstantSplat(
    llvm::APInt& SplatValue,
    llvm::APInt& SplatUndef,
    unsigned int& SplatBitSize,
    bool& HasAnyUndefs,
    unsigned int MinSplatBits = 0,
    bool isBigEndian = false) const

Description

Check if this is a constant splat, and if so, find the smallest element size that splats the vector. If MinSplatBits is nonzero, the element size must be at least that large. Note that the splat element may be the entire vector (i.e., a one element vector). Returns the splat element value in SplatValue. Any undefined bits in that value are zero, and the corresponding bits in the SplatUndef mask are set. The SplatBitSize value is set to the splat element size in bits. HasAnyUndefs is set to true if any bits in the vector are undefined. isBigEndian describes the endianness of the target.

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

Parameters

llvm::APInt& SplatValue
llvm::APInt& SplatUndef
unsigned int& SplatBitSize
bool& HasAnyUndefs
unsigned int MinSplatBits = 0
bool isBigEndian = false

static void recastRawBits(
    bool IsLittleEndian,
    unsigned int DstEltSizeInBits,
    SmallVectorImpl<llvm::APInt>& DstBitElements,
    ArrayRef<llvm::APInt> SrcBitElements,
    llvm::BitVector& DstUndefElements,
    const llvm::BitVector& SrcUndefElements)

Description

Recast bit data \p SrcBitElements to \p DstEltSizeInBits wide elements. Undef elements are treated as zero, and entirely undefined elements are flagged in \p DstUndefElements.

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

Parameters

bool IsLittleEndian
unsigned int DstEltSizeInBits
SmallVectorImpl<llvm::APInt>& DstBitElements
ArrayRef<llvm::APInt> SrcBitElements
llvm::BitVector& DstUndefElements
const llvm::BitVector& SrcUndefElements