class ShuffleVectorInst
Declaration
class ShuffleVectorInst : public Instruction { /* full declaration omitted */ };
Declared at: llvm/include/llvm/IR/Instructions.h:1983
Inherits from: Instruction
Member Variables
Inherited from Value:
- protected SubclassOptionalData
- protected NumUserOperands
- protected IsUsedByMD
- protected HasName
- protected HasHungOffUses
- protected HasDescriptor
- public static MaxAlignmentExponent = 29
- public static MaximumAlignment = 1U << MaxAlignmentExponent
Method Overview
- public ShuffleVectorInst(llvm::Value * V1, llvm::Value * V2, llvm::Value * Mask, const llvm::Twine & NameStr = "", llvm::Instruction * InsertBefor = nullptr)
- public ShuffleVectorInst(llvm::Value * V1, llvm::Value * V2, llvm::Value * Mask, const llvm::Twine & NameStr, llvm::BasicBlock * InsertAtEnd)
- public bool changesLength() const
- public static bool classof(const llvm::Value * V)
- public static bool classof(const llvm::Instruction * I)
- protected llvm::ShuffleVectorInst * cloneImpl() const
- public void commute()
- public static void commuteShuffleMask(MutableArrayRef<int> Mask, unsigned int InVecNumElts)
- public llvm::Constant * getMask() const
- public static int getMaskValue(const llvm::Constant * Mask, unsigned int Elt)
- public int getMaskValue(unsigned int Elt) const
- public void getShuffleMask(SmallVectorImpl<int> & Result) const
- public SmallVector<int, 16> getShuffleMask() const
- public static void getShuffleMask(const llvm::Constant * Mask, SmallVectorImpl<int> & Result)
- public llvm::VectorType * getType() const
- public bool increasesLength() const
- public bool isConcat() const
- public static bool isExtractSubvectorMask(ArrayRef<int> Mask, int NumSrcElts, int & Index)
- public static bool isExtractSubvectorMask(const llvm::Constant * Mask, int NumSrcElts, int & Index)
- public bool isExtractSubvectorMask(int & Index) const
- public bool isIdentity() const
- public static bool isIdentityMask(const llvm::Constant * Mask)
- public static bool isIdentityMask(ArrayRef<int> Mask)
- public bool isIdentityWithExtract() const
- public bool isIdentityWithPadding() const
- public bool isReverse() const
- public static bool isReverseMask(ArrayRef<int> Mask)
- public static bool isReverseMask(const llvm::Constant * Mask)
- public bool isSelect() const
- public static bool isSelectMask(ArrayRef<int> Mask)
- public static bool isSelectMask(const llvm::Constant * Mask)
- public bool isSingleSource() const
- public static bool isSingleSourceMask(ArrayRef<int> Mask)
- public static bool isSingleSourceMask(const llvm::Constant * Mask)
- public bool isTranspose() const
- public static bool isTransposeMask(ArrayRef<int> Mask)
- public static bool isTransposeMask(const llvm::Constant * Mask)
- public static bool isValidOperands(const llvm::Value * V1, const llvm::Value * V2, const llvm::Value * Mask)
- public bool isZeroEltSplat() const
- public static bool isZeroEltSplatMask(const llvm::Constant * Mask)
- public static bool isZeroEltSplatMask(ArrayRef<int> Mask)
Inherited from Instruction:
- public andIRFlags
- public applyMergedLocation
- public classof
- public clone
- public copyFastMathFlags
- public copyFastMathFlags
- public copyIRFlags
- public copyMetadata
- public dropPoisonGeneratingFlags
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public eraseFromParent
- public extractProfMetadata
- public extractProfTotalWeight
- public getAAMetadata
- public getAllMetadata
- public getAllMetadataOtherThanDebugLoc
- public getDebugLoc
- public getFastMathFlags
- public getFunction
- public getFunction
- public getMetadata
- public getMetadata
- public getModule
- public getModule
- public getNextNonDebugInstruction
- public getNextNonDebugInstruction
- public getNumSuccessors
- public getOpcode
- public getOpcodeName
- public getOpcodeName
- public getParent
- public getParent
- public getPrevNonDebugInstruction
- public getPrevNonDebugInstruction
- protected getSubclassDataFromInstruction
- public getSuccessor
- public hasAllowContract
- public hasAllowReassoc
- public hasAllowReciprocal
- public hasApproxFunc
- public hasAtomicLoad
- public hasAtomicStore
- public hasMetadata
- public hasMetadata
- public hasMetadata
- public hasMetadataOtherThanDebugLoc
- public hasNoInfs
- public hasNoNaNs
- public hasNoSignedWrap
- public hasNoSignedZeros
- public hasNoUnsignedWrap
- public insertAfter
- public insertBefore
- public isArithmeticShift
- public isAssociative
- public isAssociative
- public isAtomic
- public isBinaryOp
- public isBinaryOp
- public isBitwiseLogicOp
- public isBitwiseLogicOp
- public isCast
- public isCast
- public isCommutative
- public isCommutative
- public isEHPad
- public isExact
- public isExceptionalTerminator
- public isExceptionalTerminator
- public isFast
- public isFenceLike
- public isFuncletPad
- public isFuncletPad
- public isIdempotent
- public isIdempotent
- public isIdenticalTo
- public isIdenticalToWhenDefined
- public isIndirectTerminator
- public isIndirectTerminator
- public isIntDivRem
- public isIntDivRem
- public isLifetimeStartOrEnd
- public isLogicalShift
- public isNilpotent
- public isNilpotent
- public isSafeToRemove
- public isSameOperationAs
- public isShift
- public isShift
- public isTerminator
- public isTerminator
- public isUnaryOp
- public isUnaryOp
- public isUsedOutsideOfBlock
- public mayHaveSideEffects
- public mayReadFromMemory
- public mayReadOrWriteMemory
- public mayThrow
- public mayWriteToMemory
- public moveAfter
- public moveBefore
- public moveBefore
- public removeFromParent
- public replaceSuccessorWith
- public setAAMetadata
- public setDebugLoc
- public setFast
- public setFastMathFlags
- public setHasAllowReassoc
- public setHasAllowReciprocal
- public setHasApproxFunc
- public setHasNoInfs
- public setHasNoNaNs
- public setHasNoSignedWrap
- public setHasNoSignedZeros
- public setHasNoUnsignedWrap
- protected setInstructionSubclassData
- public setIsExact
- public setMetadata
- public setMetadata
- public setProfWeight
- public setSuccessor
- public swapProfMetadata
- public user_back
- public user_back
Inherited from User:
- protected Op
- protected Op
- protected OpFrom
- protected allocHungoffUses
- public classof
- public dropAllReferences
- public getDescriptor
- public getDescriptor
- public getNumOperands
- public getOperand
- public getOperandList
- public getOperandList
- public getOperandUse
- public getOperandUse
- protected growHungoffUses
- public op_begin
- public op_begin
- public op_end
- public op_end
- public operand_values
- public operand_values
- public operands
- public operands
- public replaceUsesOfWith
- public setGlobalVariableNumOperands
- public setNumHungOffUseOperands
- public setOperand
- public value_op_begin
- public value_op_begin
- public value_op_end
- public value_op_end
Inherited from Value:
- public DoPHITranslation
- public DoPHITranslation
- public addUse
- public assertModuleIsMaterialized
- public assertModuleIsMaterializedImpl
- public clearSubclassOptionalData
- public deleteValue
- public dump
- public getContext
- public getName
- public getNumUses
- public getPointerAlignment
- public getPointerDereferenceableBytes
- public getRawSubclassOptionalData
- protected getSubclassDataFromValue
- public getType
- public getValueID
- public getValueName
- public hasNUses
- public hasNUsesOrMore
- public hasName
- public hasOneUse
- public hasSameSubclassOptionalData
- public hasValueHandle
- public isSwiftError
- public isUsedByMetadata
- public isUsedInBasicBlock
- public materialized_use_begin
- public materialized_use_begin
- public materialized_use_empty
- public materialized_user_begin
- public materialized_user_begin
- public materialized_users
- public materialized_users
- public materialized_uses
- public materialized_uses
- public mutateType
- public print
- public print
- public printAsOperand
- public printAsOperand
- public replaceAllUsesWith
- public replaceNonMetadataUsesWith
- public replaceUsesOutsideBlock
- public replaceUsesWithIf
- public reverseUseList
- public setName
- public setValueName
- protected setValueSubclassData
- public sortUseList
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsOffsets
- public stripInBoundsOffsets
- public stripPointerCasts
- public stripPointerCasts
- public stripPointerCastsAndAliases
- public stripPointerCastsAndAliases
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsSameRepresentation
- public stripPointerCastsSameRepresentation
- public takeName
- public use_begin
- public use_begin
- public use_empty
- public use_end
- public use_end
- public user_back
- public user_back
- public user_begin
- public user_begin
- public user_empty
- public user_end
- public user_end
- public users
- public users
- public uses
- public uses
Methods
¶ShuffleVectorInst(
llvm::Value* V1,
llvm::Value* V2,
llvm::Value* Mask,
const llvm::Twine& NameStr = "",
llvm::Instruction* InsertBefor = nullptr)
ShuffleVectorInst(
llvm::Value* V1,
llvm::Value* V2,
llvm::Value* Mask,
const llvm::Twine& NameStr = "",
llvm::Instruction* InsertBefor = nullptr)
Declared at: llvm/include/llvm/IR/Instructions.h:1991
Parameters
- llvm::Value* V1
- llvm::Value* V2
- llvm::Value* Mask
- const llvm::Twine& NameStr = ""
- llvm::Instruction* InsertBefor = nullptr
¶ShuffleVectorInst(llvm::Value* V1,
llvm::Value* V2,
llvm::Value* Mask,
const llvm::Twine& NameStr,
llvm::BasicBlock* InsertAtEnd)
ShuffleVectorInst(llvm::Value* V1,
llvm::Value* V2,
llvm::Value* Mask,
const llvm::Twine& NameStr,
llvm::BasicBlock* InsertAtEnd)
Declared at: llvm/include/llvm/IR/Instructions.h:1994
Parameters
- llvm::Value* V1
- llvm::Value* V2
- llvm::Value* Mask
- const llvm::Twine& NameStr
- llvm::BasicBlock* InsertAtEnd
¶bool changesLength() const
bool changesLength() const
Description
Return true if this shuffle returns a vector with a different number of elements than its source vectors. Examples: shufflevector < 4 x n> A, < 4 x n> B, < 1,2,3> shufflevector < 4 x n> A, < 4 x n> B, < 1,2,3,4,5>
Declared at: llvm/include/llvm/IR/Instructions.h:2055
¶static bool classof(const llvm::Value* V)
static bool classof(const llvm::Value* V)
Declared at: llvm/include/llvm/IR/Instructions.h:2279
Parameters
- const llvm::Value* V
¶static bool classof(const llvm::Instruction* I)
static bool classof(const llvm::Instruction* I)
Declared at: llvm/include/llvm/IR/Instructions.h:2276
Parameters
- const llvm::Instruction* I
¶llvm::ShuffleVectorInst* cloneImpl() const
llvm::ShuffleVectorInst* cloneImpl() const
Declared at: llvm/include/llvm/IR/Instructions.h:1988
¶void commute()
void commute()
Description
Swap the first 2 operands and adjust the mask to preserve the semantics of the instruction.
Declared at: llvm/include/llvm/IR/Instructions.h:2004
¶static void commuteShuffleMask(
MutableArrayRef<int> Mask,
unsigned int InVecNumElts)
static void commuteShuffleMask(
MutableArrayRef<int> Mask,
unsigned int InVecNumElts)
Description
Change values in a shuffle permute mask assuming the two vector operands of length InVecNumElts have swapped position.
Declared at: llvm/include/llvm/IR/Instructions.h:2264
Parameters
- MutableArrayRef<int> Mask
- unsigned int InVecNumElts
¶llvm::Constant* getMask() const
llvm::Constant* getMask() const
Declared at: llvm/include/llvm/IR/Instructions.h:2020
¶static int getMaskValue(
const llvm::Constant* Mask,
unsigned int Elt)
static int getMaskValue(
const llvm::Constant* Mask,
unsigned int Elt)
Description
Return the shuffle mask value for the specified element of the mask. Return -1 if the element is undef.
Declared at: llvm/include/llvm/IR/Instructions.h:2026
Parameters
- const llvm::Constant* Mask
- unsigned int Elt
¶int getMaskValue(unsigned int Elt) const
int getMaskValue(unsigned int Elt) const
Description
Return the shuffle mask value of this instruction for the given element index. Return -1 if the element is undef.
Declared at: llvm/include/llvm/IR/Instructions.h:2030
Parameters
- unsigned int Elt
¶void getShuffleMask(
SmallVectorImpl<int>& Result) const
void getShuffleMask(
SmallVectorImpl<int>& Result) const
Description
Return the mask for this instruction as a vector of integers. Undefined elements of the mask are returned as -1.
Declared at: llvm/include/llvm/IR/Instructions.h:2041
Parameters
- SmallVectorImpl<int>& Result
¶SmallVector<int, 16> getShuffleMask() const
SmallVector<int, 16> getShuffleMask() const
Declared at: llvm/include/llvm/IR/Instructions.h:2045
¶static void getShuffleMask(
const llvm::Constant* Mask,
SmallVectorImpl<int>& Result)
static void getShuffleMask(
const llvm::Constant* Mask,
SmallVectorImpl<int>& Result)
Description
Convert the input shuffle mask operand to a vector of integers. Undefined elements of the mask are returned as -1.
Declared at: llvm/include/llvm/IR/Instructions.h:2036
Parameters
- const llvm::Constant* Mask
- SmallVectorImpl<int>& Result
¶llvm::VectorType* getType() const
llvm::VectorType* getType() const
Description
Overload to return most specific vector type.
Declared at: llvm/include/llvm/IR/Instructions.h:2013
¶bool increasesLength() const
bool increasesLength() const
Description
Return true if this shuffle returns a vector with a greater number of elements than its source vectors. Example: shufflevector < 2 x n> A, < 2 x n> B, < 1,2,3>
Declared at: llvm/include/llvm/IR/Instructions.h:2064
¶bool isConcat() const
bool isConcat() const
Description
Return true if this shuffle concatenates its 2 source vectors. This returns false if either input is undefined. In that case, the shuffle is is better classified as an identity with padding operation.
Declared at: llvm/include/llvm/IR/Instructions.h:2122
¶static bool isExtractSubvectorMask(
ArrayRef<int> Mask,
int NumSrcElts,
int& Index)
static bool isExtractSubvectorMask(
ArrayRef<int> Mask,
int NumSrcElts,
int& Index)
Description
Return true if this shuffle mask is an extract subvector mask. A valid extract subvector mask returns a smaller vector from a single source operand. The base extraction index is returned as well.
Declared at: llvm/include/llvm/IR/Instructions.h:2246
Parameters
- ArrayRef<int> Mask
- int NumSrcElts
- int& Index
¶static bool isExtractSubvectorMask(
const llvm::Constant* Mask,
int NumSrcElts,
int& Index)
static bool isExtractSubvectorMask(
const llvm::Constant* Mask,
int NumSrcElts,
int& Index)
Declared at: llvm/include/llvm/IR/Instructions.h:2248
Parameters
- const llvm::Constant* Mask
- int NumSrcElts
- int& Index
¶bool isExtractSubvectorMask(int& Index) const
bool isExtractSubvectorMask(int& Index) const
Description
Return true if this shuffle mask is an extract subvector mask.
Declared at: llvm/include/llvm/IR/Instructions.h:2257
Parameters
- int& Index
¶bool isIdentity() const
bool isIdentity() const
Description
Return true if this shuffle chooses elements from exactly one source vector without lane crossings and does not change the number of elements from its input vectors. Example: shufflevector < 4 x n> A, < 4 x n> B, < 4,undef,6,undef>
Declared at: llvm/include/llvm/IR/Instructions.h:2107
¶static bool isIdentityMask(
const llvm::Constant* Mask)
static bool isIdentityMask(
const llvm::Constant* Mask)
Declared at: llvm/include/llvm/IR/Instructions.h:2096
Parameters
- const llvm::Constant* Mask
¶static bool isIdentityMask(ArrayRef<int> Mask)
static bool isIdentityMask(ArrayRef<int> Mask)
Description
Return true if this shuffle mask chooses elements from exactly one source vector without lane crossings. A shuffle using this mask is not necessarily a no-op because it may change the number of elements from its input vectors or it may provide demanded bits knowledge via undef lanes. Example: <undef ,undef,2,3>
Declared at: llvm/include/llvm/IR/Instructions.h:2095
Parameters
- ArrayRef<int> Mask
¶bool isIdentityWithExtract() const
bool isIdentityWithExtract() const
Description
Return true if this shuffle extracts the first N elements of exactly one source vector.
Declared at: llvm/include/llvm/IR/Instructions.h:2117
¶bool isIdentityWithPadding() const
bool isIdentityWithPadding() const
Description
Return true if this shuffle lengthens exactly one source vector with undefs in the high elements.
Declared at: llvm/include/llvm/IR/Instructions.h:2113
¶bool isReverse() const
bool isReverse() const
Description
Return true if this shuffle swaps the order of elements from exactly one source vector. Example: shufflevector < 4 x n> A, < 4 x n> B, < 3,undef,1,undef> TODO: Optionally allow length-changing shuffles.
Declared at: llvm/include/llvm/IR/Instructions.h:2168
¶static bool isReverseMask(ArrayRef<int> Mask)
static bool isReverseMask(ArrayRef<int> Mask)
Description
Return true if this shuffle mask swaps the order of elements from exactly one source vector. Example: < 7,6,undef,4> This assumes that vector operands are the same length as the mask.
Declared at: llvm/include/llvm/IR/Instructions.h:2156
Parameters
- ArrayRef<int> Mask
¶static bool isReverseMask(
const llvm::Constant* Mask)
static bool isReverseMask(
const llvm::Constant* Mask)
Declared at: llvm/include/llvm/IR/Instructions.h:2157
Parameters
- const llvm::Constant* Mask
¶bool isSelect() const
bool isSelect() const
Description
Return true if this shuffle chooses elements from its source vectors without lane crossings and all operands have the same number of elements. In other words, this shuffle is equivalent to a vector select with a constant condition operand. Example: shufflevector < 4 x n> A, < 4 x n> B, <undef ,1,6,3> This returns false if the mask does not choose from both input vectors. In that case, the shuffle is better classified as an identity shuffle. TODO: Optionally allow length-changing shuffles.
Declared at: llvm/include/llvm/IR/Instructions.h:2148
¶static bool isSelectMask(ArrayRef<int> Mask)
static bool isSelectMask(ArrayRef<int> Mask)
Description
Return true if this shuffle mask chooses elements from its source vectors without lane crossings. A shuffle using this mask would be equivalent to a vector select with a constant condition operand. Example: < 4,1,6,undef> This returns false if the mask does not choose from both input vectors. In that case, the shuffle is better classified as an identity shuffle. This assumes that vector operands are the same length as the mask (a length-changing shuffle can never be equivalent to a vector select).
Declared at: llvm/include/llvm/IR/Instructions.h:2132
Parameters
- ArrayRef<int> Mask
¶static bool isSelectMask(
const llvm::Constant* Mask)
static bool isSelectMask(
const llvm::Constant* Mask)
Declared at: llvm/include/llvm/IR/Instructions.h:2133
Parameters
- const llvm::Constant* Mask
¶bool isSingleSource() const
bool isSingleSource() const
Description
Return true if this shuffle chooses elements from exactly one source vector without changing the length of that vector. Example: shufflevector < 4 x n> A, < 4 x n> B, < 3,0,undef,3> TODO: Optionally allow length-changing shuffles.
Declared at: llvm/include/llvm/IR/Instructions.h:2086
¶static bool isSingleSourceMask(ArrayRef<int> Mask)
static bool isSingleSourceMask(ArrayRef<int> Mask)
Description
Return true if this shuffle mask chooses elements from exactly one source vector. Example: < 7,5,undef,7> This assumes that vector operands are the same length as the mask.
Declared at: llvm/include/llvm/IR/Instructions.h:2074
Parameters
- ArrayRef<int> Mask
¶static bool isSingleSourceMask(
const llvm::Constant* Mask)
static bool isSingleSourceMask(
const llvm::Constant* Mask)
Declared at: llvm/include/llvm/IR/Instructions.h:2075
Parameters
- const llvm::Constant* Mask
¶bool isTranspose() const
bool isTranspose() const
Description
Return true if this shuffle transposes the elements of its inputs without changing the length of the vectors. This operation may also be known as a merge or interleave. See the description for isTransposeMask() for the exact specification. Example: shufflevector < 4 x n> A, < 4 x n> B, < 0,4,2,6>
Declared at: llvm/include/llvm/IR/Instructions.h:2239
¶static bool isTransposeMask(ArrayRef<int> Mask)
static bool isTransposeMask(ArrayRef<int> Mask)
Description
Return true if this shuffle mask is a transpose mask. Transpose vector masks transpose a 2xn matrix. They read corresponding even- or odd-numbered vector elements from two n-dimensional source vectors and write each result into consecutive elements of an n-dimensional destination vector. Two shuffles are necessary to complete the transpose, one for the even elements and another for the odd elements. This description closely follows how the TRN1 and TRN2 AArch64 instructions operate. For example, a simple 2x2 matrix can be transposed with: ; Original matrix m0 = < a, b > m1 = < c, d > ; Transposed matrix t0 = < a, c > = shufflevector m0, m1, < 0, 2 > t1 = < b, d > = shufflevector m0, m1, < 1, 3 > For matrices having greater than n columns, the resulting nx2 transposed matrix is stored in two result vectors such that one vector contains interleaved elements from all the even-numbered rows and the other vector contains interleaved elements from all the odd-numbered rows. For example, a 2x4 matrix can be transposed with: ; Original matrix m0 = < a, b, c, d > m1 = < e, f, g, h > ; Transposed matrix t0 = < a, e, c, g > = shufflevector m0, m1 < 0, 4, 2, 6 > t1 = < b, f, d, h > = shufflevector m0, m1 < 1, 5, 3, 7 >
Declared at: llvm/include/llvm/IR/Instructions.h:2226
Parameters
- ArrayRef<int> Mask
¶static bool isTransposeMask(
const llvm::Constant* Mask)
static bool isTransposeMask(
const llvm::Constant* Mask)
Declared at: llvm/include/llvm/IR/Instructions.h:2227
Parameters
- const llvm::Constant* Mask
¶static bool isValidOperands(
const llvm::Value* V1,
const llvm::Value* V2,
const llvm::Value* Mask)
static bool isValidOperands(
const llvm::Value* V1,
const llvm::Value* V2,
const llvm::Value* Mask)
Description
Return true if a shufflevector instruction can be formed with the specified operands.
Declared at: llvm/include/llvm/IR/Instructions.h:2008
Parameters
- const llvm::Value* V1
- const llvm::Value* V2
- const llvm::Value* Mask
¶bool isZeroEltSplat() const
bool isZeroEltSplat() const
Description
Return true if all elements of this shuffle are the same value as the first element of exactly one source vector without changing the length of that vector. Example: shufflevector < 4 x n> A, < 4 x n> B, <undef ,0,undef,0> TODO: Optionally allow length-changing shuffles. TODO: Optionally allow splats from other elements.
Declared at: llvm/include/llvm/IR/Instructions.h:2190
¶static bool isZeroEltSplatMask(
const llvm::Constant* Mask)
static bool isZeroEltSplatMask(
const llvm::Constant* Mask)
Declared at: llvm/include/llvm/IR/Instructions.h:2177
Parameters
- const llvm::Constant* Mask
¶static bool isZeroEltSplatMask(ArrayRef<int> Mask)
static bool isZeroEltSplatMask(ArrayRef<int> Mask)
Description
Return true if this shuffle mask chooses all elements with the same value as the first element of exactly one source vector. Example: < 4,undef,undef,4> This assumes that vector operands are the same length as the mask.
Declared at: llvm/include/llvm/IR/Instructions.h:2176
Parameters
- ArrayRef<int> Mask