LLVM 22.0.0git
|
#include "llvm/SandboxIR/Instruction.h"
Public Member Functions | |
LLVM_ABI void | commute () |
Swap the operands and adjust the mask to preserve the semantics of the instruction. | |
LLVM_ABI VectorType * | getType () const |
Overload to return most specific vector type. | |
int | getMaskValue (unsigned Elt) const |
Return the shuffle mask value of this instruction for the given element index. | |
void | getShuffleMask (SmallVectorImpl< int > &Result) const |
Return the mask for this instruction as a vector of integers. | |
LLVM_ABI Constant * | getShuffleMaskForBitcode () const |
Return the mask for this instruction, for use in bitcode. | |
LLVM_ABI void | setShuffleMask (ArrayRef< int > Mask) |
ArrayRef< int > | getShuffleMask () const |
bool | changesLength () const |
Return true if this shuffle returns a vector with a different number of elements than its source vectors. | |
bool | increasesLength () const |
Return true if this shuffle returns a vector with a greater number of elements than its source vectors. | |
bool | isSingleSource () const |
Return true if this shuffle chooses elements from exactly one source vector without changing the length of that vector. | |
bool | isIdentity () const |
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. | |
bool | isIdentityWithPadding () const |
Return true if this shuffle lengthens exactly one source vector with undefs in the high elements. | |
bool | isIdentityWithExtract () const |
Return true if this shuffle extracts the first N elements of exactly one source vector. | |
bool | isConcat () const |
Return true if this shuffle concatenates its 2 source vectors. | |
bool | isSelect () const |
Return true if this shuffle chooses elements from its source vectors without lane crossings and all operands have the same number of elements. | |
bool | isReverse () const |
Return true if this shuffle swaps the order of elements from exactly one source vector. | |
bool | isZeroEltSplat () const |
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. | |
bool | isTranspose () const |
Return true if this shuffle transposes the elements of its inputs without changing the length of the vectors. | |
bool | isSplice (int &Index) const |
Return true if this shuffle splices two inputs without changing the length of the vectors. | |
bool | isExtractSubvectorMask (int &Index) const |
Return true if this shuffle mask is an extract subvector mask. | |
bool | isInsertSubvectorMask (int &NumSubElts, int &Index) const |
Return true if this shuffle mask is an insert subvector mask. | |
bool | isReplicationMask (int &ReplicationFactor, int &VF) const |
Return true if this shuffle mask is a replication mask. | |
bool | isOneUseSingleSourceMask (int VF) const |
Return true if this shuffle mask is a one-use-single-source("clustered") mask. | |
bool | isInterleave (unsigned Factor) const |
Return if this shuffle interleaves its two input vectors together. | |
![]() | |
unsigned | getUseOperandNo (const Use &Use) const final |
\Returns the operand index of Use . | |
unsigned | getNumOfIRInstrs () const final |
This is used by BasicBlock::iterator. | |
void | verify () const final |
Should crash if there is something wrong with the instruction. | |
void | dumpOS (raw_ostream &OS) const override |
![]() | |
virtual unsigned | getNumOfIRInstrs () const =0 |
This is used by BasicBlock::iterator. | |
LLVM_ABI BBIterator | getIterator () const |
\Returns a BasicBlock::iterator for this Instruction. | |
LLVM_ABI Instruction * | getNextNode () const |
\Returns the next sandboxir::Instruction in the block, or nullptr if at the end of the block. | |
LLVM_ABI Instruction * | getPrevNode () const |
\Returns the previous sandboxir::Instruction in the block, or nullptr if at the beginning of the block. | |
Opcode | getOpcode () const |
\Returns this Instruction's opcode. | |
const char * | getOpcodeName () const |
const DataLayout & | getDataLayout () const |
bool | isTerminator () const |
bool | isUnaryOp () const |
bool | isBinaryOp () const |
bool | isIntDivRem () const |
bool | isShift () const |
bool | isCast () const |
bool | isFuncletPad () const |
bool | isSpecialTerminator () const |
bool | isOnlyUserOfAnyOperand () const |
bool | isLogicalShift () const |
bool | hasMetadata () const |
Return true if the instruction has any metadata attached to it. | |
bool | hasMetadataOtherThanDebugLoc () const |
Return true if this instruction has metadata attached to it other than a debug location. | |
bool | hasMetadata (unsigned KindID) const |
Return true if this instruction has the given type of metadata attached. | |
LLVM_ABI void | removeFromParent () |
Detach this from its parent BasicBlock without deleting it. | |
LLVM_ABI void | eraseFromParent () |
Detach this Value from its parent and delete it. | |
LLVM_ABI void | insertBefore (Instruction *BeforeI) |
Insert this detached instruction before BeforeI . | |
LLVM_ABI void | insertAfter (Instruction *AfterI) |
Insert this detached instruction after AfterI . | |
LLVM_ABI void | insertInto (BasicBlock *BB, const BBIterator &WhereIt) |
Insert this detached instruction into BB at WhereIt . | |
LLVM_ABI void | moveBefore (BasicBlock &BB, const BBIterator &WhereIt) |
Move this instruction to WhereIt . | |
void | moveBefore (Instruction *Before) |
Move this instruction before Before . | |
void | moveAfter (Instruction *After) |
Move this instruction after After . | |
bool | comesBefore (const Instruction *Other) const |
Given an instruction Other in the same basic block as this instruction, return true if this instruction comes before Other. | |
LLVM_ABI BasicBlock * | getParent () const |
\Returns the BasicBlock containing this Instruction, or null if it is detached. | |
bool | hasNoUnsignedWrap () const |
Determine whether the no signed wrap flag is set. | |
LLVM_ABI void | setHasNoUnsignedWrap (bool B=true) |
Set or clear the nuw flag on this instruction, which must be an operator which supports this flag. | |
bool | hasNoSignedWrap () const |
Determine whether the no signed wrap flag is set. | |
LLVM_ABI void | setHasNoSignedWrap (bool B=true) |
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag. | |
bool | isFast () const |
Determine whether all fast-math-flags are set. | |
LLVM_ABI void | setFast (bool B) |
Set or clear all fast-math-flags on this instruction, which must be an operator which supports this flag. | |
bool | hasAllowReassoc () const |
Determine whether the allow-reassociation flag is set. | |
LLVM_ABI void | setHasAllowReassoc (bool B) |
Set or clear the reassociation flag on this instruction, which must be an operator which supports this flag. | |
bool | isExact () const |
Determine whether the exact flag is set. | |
LLVM_ABI void | setIsExact (bool B=true) |
Set or clear the exact flag on this instruction, which must be an operator which supports this flag. | |
bool | hasNoNaNs () const |
Determine whether the no-NaNs flag is set. | |
LLVM_ABI void | setHasNoNaNs (bool B) |
Set or clear the no-nans flag on this instruction, which must be an operator which supports this flag. | |
bool | hasNoInfs () const |
Determine whether the no-infs flag is set. | |
LLVM_ABI void | setHasNoInfs (bool B) |
Set or clear the no-infs flag on this instruction, which must be an operator which supports this flag. | |
bool | hasNoSignedZeros () const |
Determine whether the no-signed-zeros flag is set. | |
LLVM_ABI void | setHasNoSignedZeros (bool B) |
Set or clear the no-signed-zeros flag on this instruction, which must be an operator which supports this flag. | |
bool | hasAllowReciprocal () const |
Determine whether the allow-reciprocal flag is set. | |
LLVM_ABI void | setHasAllowReciprocal (bool B) |
Set or clear the allow-reciprocal flag on this instruction, which must be an operator which supports this flag. | |
bool | hasAllowContract () const |
Determine whether the allow-contract flag is set. | |
LLVM_ABI void | setHasAllowContract (bool B) |
Set or clear the allow-contract flag on this instruction, which must be an operator which supports this flag. | |
bool | hasApproxFunc () const |
Determine whether the approximate-math-functions flag is set. | |
LLVM_ABI void | setHasApproxFunc (bool B) |
Set or clear the approximate-math-functions flag on this instruction, which must be an operator which supports this flag. | |
FastMathFlags | getFastMathFlags () const |
Convenience function for getting all the fast-math flags, which must be an operator which supports these flags. | |
LLVM_ABI void | setFastMathFlags (FastMathFlags FMF) |
Convenience function for setting multiple fast-math flags on this instruction, which must be an operator which supports these flags. | |
LLVM_ABI void | copyFastMathFlags (FastMathFlags FMF) |
Convenience function for transferring all fast-math flag values to this instruction, which must be an operator which supports these flags. | |
bool | isAssociative () const |
bool | isCommutative () const |
bool | isIdempotent () const |
bool | isNilpotent () const |
bool | mayWriteToMemory () const |
bool | mayReadFromMemory () const |
bool | mayReadOrWriteMemory () const |
bool | isAtomic () const |
bool | hasAtomicLoad () const |
bool | hasAtomicStore () const |
bool | isVolatile () const |
LLVM_ABI Type * | getAccessType () const |
bool | mayThrow (bool IncludePhaseOneUnwind=false) const |
bool | isFenceLike () const |
bool | mayHaveSideEffects () const |
void | dumpOS (raw_ostream &OS) const override |
![]() | |
virtual op_iterator | op_begin () |
virtual op_iterator | op_end () |
virtual const_op_iterator | op_begin () const |
virtual const_op_iterator | op_end () const |
op_range | operands () |
const_op_range | operands () const |
Value * | getOperand (unsigned OpIdx) const |
Use | getOperandUse (unsigned OpIdx) const |
\Returns the operand edge for OpIdx . | |
virtual unsigned | getNumOperands () const |
virtual void | setOperand (unsigned OperandIdx, Value *Operand) |
bool | replaceUsesOfWith (Value *FromV, Value *ToV) |
Replaces any operands that match FromV with ToV . | |
void | verify () const override |
Should crash if there is something wrong with the instruction. | |
void | dumpCommonHeader (raw_ostream &OS) const final |
void | dumpOS (raw_ostream &OS) const override |
![]() | |
virtual | ~Value ()=default |
ClassID | getSubclassID () const |
LLVM_ABI use_iterator | use_begin () |
const_use_iterator | use_begin () const |
use_iterator | use_end () |
const_use_iterator | use_end () const |
iterator_range< use_iterator > | uses () |
iterator_range< const_use_iterator > | uses () const |
LLVM_ABI user_iterator | user_begin () |
user_iterator | user_end () |
const_user_iterator | user_begin () const |
const_user_iterator | user_end () const |
iterator_range< user_iterator > | users () |
iterator_range< const_user_iterator > | users () const |
LLVM_ABI unsigned | getNumUses () const |
\Returns the number of user edges (not necessarily to unique users). | |
bool | hasNUsesOrMore (unsigned Num) const |
Return true if this value has N uses or more. | |
bool | hasNUses (unsigned Num) const |
Return true if this Value has exactly N uses. | |
LLVM_ABI Type * | getType () const |
Context & | getContext () const |
LLVM_ABI void | replaceUsesWithIf (Value *OtherV, llvm::function_ref< bool(const Use &)> ShouldReplace) |
LLVM_ABI void | replaceAllUsesWith (Value *Other) |
StringRef | getName () const |
\Returns the LLVM IR name of the bottom-most LLVM value. | |
virtual void | verify () const =0 |
Should crash if there is something wrong with the instruction. | |
std::string | getUid () const |
Returns the unique id in the form 'SB<number>.' like 'SB1.'. | |
virtual void | dumpCommonHeader (raw_ostream &OS) const |
void | dumpCommonFooter (raw_ostream &OS) const |
void | dumpCommonPrefix (raw_ostream &OS) const |
void | dumpCommonSuffix (raw_ostream &OS) const |
void | printAsOperandCommon (raw_ostream &OS) const |
virtual void | dumpOS (raw_ostream &OS) const =0 |
LLVM_DUMP_METHOD void | dump () const |
Static Public Member Functions | |
static LLVM_ABI Value * | create (Value *V1, Value *V2, Value *Mask, InsertPosition Pos, Context &Ctx, const Twine &Name="") |
static LLVM_ABI Value * | create (Value *V1, Value *V2, ArrayRef< int > Mask, InsertPosition Pos, Context &Ctx, const Twine &Name="") |
static bool | classof (const Value *From) |
static bool | isValidOperands (const Value *V1, const Value *V2, const Value *Mask) |
Return true if a shufflevector instruction can be formed with the specified operands. | |
static bool | isValidOperands (const Value *V1, const Value *V2, ArrayRef< int > Mask) |
static void | getShuffleMask (const Constant *Mask, SmallVectorImpl< int > &Result) |
Convert the input shuffle mask operand to a vector of integers. | |
static LLVM_ABI Constant * | convertShuffleMaskForBitcode (ArrayRef< int > Mask, Type *ResultTy) |
static bool | isSingleSourceMask (ArrayRef< int > Mask, int NumSrcElts) |
Return true if this shuffle mask chooses elements from exactly one source vector. | |
static bool | isSingleSourceMask (const Constant *Mask, int NumSrcElts) |
static bool | isIdentityMask (ArrayRef< int > Mask, int NumSrcElts) |
Return true if this shuffle mask chooses elements from exactly one source vector without lane crossings. | |
static bool | isIdentityMask (const Constant *Mask, int NumSrcElts) |
static bool | isSelectMask (ArrayRef< int > Mask, int NumSrcElts) |
Return true if this shuffle mask chooses elements from its source vectors without lane crossings. | |
static bool | isSelectMask (const Constant *Mask, int NumSrcElts) |
static bool | isReverseMask (ArrayRef< int > Mask, int NumSrcElts) |
Return true if this shuffle mask swaps the order of elements from exactly one source vector. | |
static bool | isReverseMask (const Constant *Mask, int NumSrcElts) |
static bool | isZeroEltSplatMask (ArrayRef< int > Mask, int NumSrcElts) |
Return true if this shuffle mask chooses all elements with the same value as the first element of exactly one source vector. | |
static bool | isZeroEltSplatMask (const Constant *Mask, int NumSrcElts) |
static bool | isTransposeMask (ArrayRef< int > Mask, int NumSrcElts) |
Return true if this shuffle mask is a transpose mask. | |
static bool | isTransposeMask (const Constant *Mask, int NumSrcElts) |
static bool | isSpliceMask (ArrayRef< int > Mask, int NumSrcElts, int &Index) |
Return true if this shuffle mask is a splice mask, concatenating the two inputs together and then extracts an original width vector starting from the splice index. | |
static bool | isSpliceMask (const Constant *Mask, int NumSrcElts, int &Index) |
static bool | isExtractSubvectorMask (ArrayRef< int > Mask, int NumSrcElts, int &Index) |
Return true if this shuffle mask is an extract subvector mask. | |
static bool | isExtractSubvectorMask (const Constant *Mask, int NumSrcElts, int &Index) |
static bool | isInsertSubvectorMask (ArrayRef< int > Mask, int NumSrcElts, int &NumSubElts, int &Index) |
Return true if this shuffle mask is an insert subvector mask. | |
static bool | isInsertSubvectorMask (const Constant *Mask, int NumSrcElts, int &NumSubElts, int &Index) |
static bool | isReplicationMask (ArrayRef< int > Mask, int &ReplicationFactor, int &VF) |
Return true if this shuffle mask replicates each of the VF elements in a vector ReplicationFactor times. | |
static bool | isReplicationMask (const Constant *Mask, int &ReplicationFactor, int &VF) |
static bool | isOneUseSingleSourceMask (ArrayRef< int > Mask, int VF) |
Return true if this shuffle mask represents "clustered" mask of size VF, i.e. | |
static void | commuteShuffleMask (MutableArrayRef< int > Mask, unsigned InVecNumElts) |
Change values in a shuffle permute mask assuming the two vector operands of length InVecNumElts have swapped position. | |
static bool | isInterleaveMask (ArrayRef< int > Mask, unsigned Factor, unsigned NumInputElts, SmallVectorImpl< unsigned > &StartIndexes) |
Return true if the mask interleaves one or more input vectors together. | |
static bool | isInterleaveMask (ArrayRef< int > Mask, unsigned Factor, unsigned NumInputElts) |
static bool | isDeInterleaveMaskOfFactor (ArrayRef< int > Mask, unsigned Factor, unsigned &Index) |
Check if the mask is a DE-interleave mask of the given factor Factor like: <Index, Index+Factor, ..., Index+(NumElts-1)*Factor> | |
static bool | isDeInterleaveMaskOfFactor (ArrayRef< int > Mask, unsigned Factor) |
static bool | isBitRotateMask (ArrayRef< int > Mask, unsigned EltSizeInBits, unsigned MinSubElts, unsigned MaxSubElts, unsigned &NumSubElts, unsigned &RotateAmt) |
Checks if the shuffle is a bit rotation of the first operand across multiple subelements, e.g: | |
![]() | |
static LLVM_ABI const char * | getOpcodeName (Opcode Opc) |
static LLVM_ABI bool | classof (const sandboxir::Value *From) |
For isa/dyn_cast. | |
![]() | |
static bool | classof (const Value *From) |
For isa/dyn_cast. | |
Friends | |
class | Context |
Additional Inherited Members | |
![]() | |
enum class | Opcode { OP , OPCODES , DEF_INSTR } |
![]() | |
using | op_iterator = OperandUseIterator |
using | const_op_iterator = OperandUseIterator |
using | op_range = iterator_range< op_iterator > |
using | const_op_range = iterator_range< const_op_iterator > |
![]() | |
enum class | ClassID : unsigned { DEF_VALUE , DEF_USER , DEF_CONST , DEF_INSTR } |
using | use_iterator = UserUseIterator |
using | const_use_iterator = UserUseIterator |
using | user_iterator = mapped_iterator< sandboxir::UserUseIterator, UseToUser > |
using | const_user_iterator = user_iterator |
![]() | |
Instruction (ClassID ID, Opcode Opc, llvm::Instruction *I, sandboxir::Context &SBCtx) | |
LLVM_ABI llvm::Instruction * | getTopmostLLVMInstruction () const |
A SandboxIR Instruction may map to multiple LLVM IR Instruction. | |
virtual SmallVector< llvm::Instruction *, 1 > | getLLVMInstrs () const =0 |
\Returns the LLVM IR Instructions that this SandboxIR maps to in program order. | |
![]() | |
User (ClassID ID, llvm::Value *V, Context &Ctx) | |
Use | getOperandUseDefault (unsigned OpIdx, bool Verify) const |
\Returns the Use edge that corresponds to OpIdx . | |
virtual Use | getOperandUseInternal (unsigned OpIdx, bool Verify) const =0 |
\Returns the Use for the OpIdx'th operand. | |
unsigned | getUseOperandNoDefault (const Use &Use) const |
The default implementation works only for single-LLVMIR-instruction Users and only if they match exactly the LLVM instruction. | |
virtual unsigned | getUseOperandNo (const Use &Use) const =0 |
\Returns the operand index of Use . | |
void | swapOperandsInternal (unsigned OpIdxA, unsigned OpIdxB) |
void | verifyUserOfLLVMUse (const llvm::Use &Use) const |
![]() | |
void | clearValue () |
LLVM_ABI | Value (ClassID SubclassID, llvm::Value *Val, Context &Ctx) |
Value (const Value &)=delete | |
Disable copies. | |
Value & | operator= (const Value &)=delete |
![]() | |
static IRBuilder & | setInsertPos (InsertPosition Pos) |
Helper function for create(). | |
![]() | |
static const char * | getSubclassIDStr (ClassID ID) |
![]() | |
Opcode | Opc |
![]() | |
ClassID | SubclassID |
For isa/dyn_cast. | |
unsigned | UID |
A unique ID used for forming the name (used for debugging). | |
llvm::Value * | Val = nullptr |
The LLVM Value that corresponds to this SandboxIR Value. | |
Context & | Ctx |
All values point to the context. | |
Definition at line 523 of file Instruction.h.
|
inline |
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>
Definition at line 597 of file Instruction.h.
References llvm::sandboxir::Value::Val.
Definition at line 538 of file Instruction.h.
References From.
void llvm::sandboxir::ShuffleVectorInst::commute | ( | ) |
Swap the operands and adjust the mask to preserve the semantics of the instruction.
Definition at line 1507 of file Instruction.cpp.
References llvm::sandboxir::Value::Ctx, llvm::sandboxir::Tracker::emplaceIfTracking(), llvm::sandboxir::User::getOperandUse(), llvm::sandboxir::Context::getTracker(), and llvm::sandboxir::Value::Val.
|
inlinestatic |
Change values in a shuffle permute mask assuming the two vector operands of length InVecNumElts have swapped position.
Definition at line 889 of file Instruction.h.
References llvm::ShuffleVectorInst::commuteShuffleMask().
|
static |
Definition at line 1519 of file Instruction.cpp.
References llvm::ShuffleVectorInst::convertShuffleMaskForBitcode(), llvm::sandboxir::Type::getContext(), llvm::sandboxir::Context::getOrCreateConstant(), and llvm::sandboxir::Type::LLVMTy.
|
static |
Definition at line 1486 of file Instruction.cpp.
References assert(), llvm::IRBuilderBase::CreateShuffleVector(), llvm::sandboxir::Context::createShuffleVectorInst(), llvm::sandboxir::Value::Ctx, llvm::sandboxir::Context::getOrCreateConstant(), Name, llvm::sandboxir::Instruction::setInsertPos(), and llvm::sandboxir::Value::Val.
|
static |
Definition at line 1474 of file Instruction.cpp.
References assert(), llvm::IRBuilderBase::CreateShuffleVector(), llvm::sandboxir::Context::createShuffleVectorInst(), llvm::sandboxir::Value::Ctx, llvm::sandboxir::Context::getOrCreateConstant(), Name, llvm::sandboxir::Instruction::setInsertPos(), and llvm::sandboxir::Value::Val.
|
inline |
Return the shuffle mask value of this instruction for the given element index.
Return PoisonMaskElem if the element is undef.
Definition at line 563 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inline |
Definition at line 589 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
Convert the input shuffle mask operand to a vector of integers.
Undefined elements of the mask are returned as PoisonMaskElem.
Definition at line 569 of file Instruction.h.
References llvm::ShuffleVectorInst::getShuffleMask().
|
inline |
Return the mask for this instruction as a vector of integers.
Undefined elements of the mask are returned as PoisonMaskElem.
Definition at line 577 of file Instruction.h.
References llvm::sandboxir::Value::Val.
Constant * llvm::sandboxir::ShuffleVectorInst::getShuffleMaskForBitcode | ( | ) | const |
Return the mask for this instruction, for use in bitcode.
Definition at line 1514 of file Instruction.cpp.
References llvm::sandboxir::Value::Ctx, llvm::sandboxir::Context::getOrCreateConstant(), getShuffleMaskForBitcode(), and llvm::sandboxir::Value::Val.
Referenced by getShuffleMaskForBitcode().
VectorType * llvm::sandboxir::ShuffleVectorInst::getType | ( | ) | const |
Overload to return most specific vector type.
Definition at line 1502 of file Instruction.cpp.
References llvm::sandboxir::Value::Ctx, llvm::sandboxir::Context::getType(), and llvm::sandboxir::Value::Val.
|
inline |
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>
Definition at line 604 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
Checks if the shuffle is a bit rotation of the first operand across multiple subelements, e.g:
shuffle <8 x i8> a, <8 x i8> poison, <8 x i32> <1, 0, 3, 2, 5, 4, 7, 6>
could be expressed as
rotl <4 x i16> a, 8
If it can be expressed as a rotation, returns the number of subelements to group by in NumSubElts and the number of bits to rotate left in RotateAmt.
Definition at line 953 of file Instruction.h.
References llvm::ShuffleVectorInst::isBitRotateMask().
|
inline |
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.
Definition at line 664 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
Definition at line 938 of file Instruction.h.
References llvm::ShuffleVectorInst::isDeInterleaveMaskOfFactor().
|
inlinestatic |
Check if the mask is a DE-interleave mask of the given factor Factor
like: <Index, Index+Factor, ..., Index+(NumElts-1)*Factor>
Definition at line 933 of file Instruction.h.
References Index, and llvm::ShuffleVectorInst::isDeInterleaveMaskOfFactor().
|
inlinestatic |
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.
Definition at line 810 of file Instruction.h.
References Index, and llvm::ShuffleVectorInst::isExtractSubvectorMask().
|
inlinestatic |
Definition at line 815 of file Instruction.h.
References Index, and llvm::ShuffleVectorInst::isExtractSubvectorMask().
|
inline |
Return true if this shuffle mask is an extract subvector mask.
Definition at line 822 of file Instruction.h.
References Index, and llvm::sandboxir::Value::Val.
|
inline |
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>
Definition at line 645 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
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>
Definition at line 633 of file Instruction.h.
References llvm::ShuffleVectorInst::isIdentityMask().
|
inlinestatic |
Definition at line 636 of file Instruction.h.
References llvm::ShuffleVectorInst::isIdentityMask().
|
inline |
Return true if this shuffle extracts the first N elements of exactly one source vector.
Definition at line 657 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inline |
Return true if this shuffle lengthens exactly one source vector with undefs in the high elements.
Definition at line 651 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
Return true if this shuffle mask is an insert subvector mask.
A valid insert subvector mask inserts the lowest elements of a second source operand into an in-place first source operand. Both the sub vector width and the insertion index is returned.
Definition at line 830 of file Instruction.h.
References Index, and llvm::ShuffleVectorInst::isInsertSubvectorMask().
|
inlinestatic |
Definition at line 835 of file Instruction.h.
References Index, and llvm::ShuffleVectorInst::isInsertSubvectorMask().
|
inline |
Return true if this shuffle mask is an insert subvector mask.
Definition at line 842 of file Instruction.h.
References Index, and llvm::sandboxir::Value::Val.
Return if this shuffle interleaves its two input vectors together.
Definition at line 895 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
Definition at line 924 of file Instruction.h.
References llvm::ShuffleVectorInst::isInterleaveMask().
|
inlinestatic |
Return true if the mask interleaves one or more input vectors together.
I.e. <0, LaneLen, ... , LaneLen*(Factor - 1), 1, LaneLen + 1, ...> E.g. For a Factor of 2 (LaneLen=4): <0, 4, 1, 5, 2, 6, 3, 7> E.g. For a Factor of 3 (LaneLen=4): <4, 0, 9, 5, 1, 10, 6, 2, 11, 7, 3, 12> E.g. For a Factor of 4 (LaneLen=2): <0, 2, 6, 4, 1, 3, 7, 5>
NumInputElts is the total number of elements in the input vectors.
StartIndexes are the first indexes of each vector being interleaved, substituting any indexes that were undef E.g. <4, -1, 2, 5, 1, 3> (Factor=3): StartIndexes=<4, 0, 2>
Note that this does not check if the input vectors are consecutive: It will return true for masks such as <0, 4, 6, 1, 5, 7> (Factor=3, LaneLen=2)
Definition at line 918 of file Instruction.h.
References llvm::ShuffleVectorInst::isInterleaveMask().
|
inlinestatic |
Return true if this shuffle mask represents "clustered" mask of size VF, i.e.
each index between [0..VF) is used exactly once in each submask of size VF. For example, the mask for VF=4
is: 0, 1, 2, 3, 3, 2, 0, 1 - "clustered", because each submask of size 4 (0,1,2,3 and 3,2,0,1) uses indices [0..VF) exactly one time. 0, 1, 2, 3, 3, 3, 1, 0 - not "clustered", because element 3 is used twice in the second submask (3,3,1,0) and index 2 is not used at all.
Definition at line 877 of file Instruction.h.
References llvm::ShuffleVectorInst::isOneUseSingleSourceMask().
|
inline |
Return true if this shuffle mask is a one-use-single-source("clustered") mask.
Definition at line 883 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
Return true if this shuffle mask replicates each of the VF
elements in a vector ReplicationFactor
times.
For example, the mask for ReplicationFactor=3
and VF=4
is: <0,0,0,1,1,1,2,2,2,3,3,3>
Definition at line 851 of file Instruction.h.
References llvm::ShuffleVectorInst::isReplicationMask().
|
inlinestatic |
Definition at line 856 of file Instruction.h.
References llvm::ShuffleVectorInst::isReplicationMask().
|
inline |
Return true if this shuffle mask is a replication mask.
Definition at line 863 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inline |
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>
Definition at line 711 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
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 (of length NumSrcElts
) are the same length as the mask.
Definition at line 700 of file Instruction.h.
References llvm::ShuffleVectorInst::isReverseMask().
|
inlinestatic |
Definition at line 703 of file Instruction.h.
References llvm::ShuffleVectorInst::isReverseMask().
|
inline |
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.
Definition at line 691 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
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).
Definition at line 676 of file Instruction.h.
References llvm::ShuffleVectorInst::isSelectMask().
|
inlinestatic |
Definition at line 679 of file Instruction.h.
References llvm::ShuffleVectorInst::isSelectMask().
|
inline |
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>
Definition at line 624 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
Return true if this shuffle mask chooses elements from exactly one source vector.
Example: <7,5,undef,7> This assumes that vector operands (of length NumSrcElts
) are the same length as the mask.
Definition at line 613 of file Instruction.h.
References llvm::ShuffleVectorInst::isSingleSourceMask().
|
inlinestatic |
Definition at line 616 of file Instruction.h.
References llvm::ShuffleVectorInst::isSingleSourceMask().
|
inline |
Return true if this shuffle splices two inputs without changing the length of the vectors.
This operation concatenates the two inputs together and then extracts an original width vector starting from the splice index. Example: shufflevector <4 x n> A, <4 x n> B, <1,2,3,4>
Definition at line 803 of file Instruction.h.
References Index, and llvm::sandboxir::Value::Val.
|
inlinestatic |
Return true if this shuffle mask is a splice mask, concatenating the two inputs together and then extracts an original width vector starting from the splice index.
Example: shufflevector <4 x n> A, <4 x n> B, <1,2,3,4> This assumes that vector operands (of length NumSrcElts
) are the same length as the mask.
Definition at line 791 of file Instruction.h.
References Index, and llvm::ShuffleVectorInst::isSpliceMask().
|
inlinestatic |
Definition at line 794 of file Instruction.h.
References Index, and llvm::ShuffleVectorInst::isSpliceMask().
|
inline |
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>
Definition at line 781 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
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 >
Definition at line 768 of file Instruction.h.
References llvm::ShuffleVectorInst::isTransposeMask().
|
inlinestatic |
Definition at line 771 of file Instruction.h.
References llvm::ShuffleVectorInst::isTransposeMask().
|
inlinestatic |
Definition at line 553 of file Instruction.h.
References llvm::ShuffleVectorInst::isValidOperands(), and llvm::sandboxir::Value::Val.
|
inlinestatic |
Return true if a shufflevector instruction can be formed with the specified operands.
Definition at line 548 of file Instruction.h.
References llvm::ShuffleVectorInst::isValidOperands(), and llvm::sandboxir::Value::Val.
|
inline |
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>
Definition at line 732 of file Instruction.h.
References llvm::sandboxir::Value::Val.
|
inlinestatic |
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 (of length NumSrcElts
) are the same length as the mask.
Definition at line 720 of file Instruction.h.
References llvm::ShuffleVectorInst::isZeroEltSplatMask().
|
inlinestatic |
Definition at line 723 of file Instruction.h.
References llvm::ShuffleVectorInst::isZeroEltSplatMask().
void llvm::sandboxir::ShuffleVectorInst::setShuffleMask | ( | ArrayRef< int > | Mask | ) |
Definition at line 1497 of file Instruction.cpp.
References llvm::sandboxir::Value::Ctx, llvm::sandboxir::Tracker::emplaceIfTracking(), llvm::sandboxir::Context::getTracker(), and llvm::sandboxir::Value::Val.
Referenced by llvm::sandboxir::ShuffleVectorSetMask::revert().
|
friend |
Definition at line 529 of file Instruction.h.