LLVM
8.0.1
|
This instruction constructs a fixed permutation of two input vectors. More...
#include "llvm/IR/Instructions.h"
Public Member Functions | |
ShuffleVectorInst (Value *V1, Value *V2, Value *Mask, const Twine &NameStr="", Instruction *InsertBefor=nullptr) | |
ShuffleVectorInst (Value *V1, Value *V2, Value *Mask, const Twine &NameStr, BasicBlock *InsertAtEnd) | |
void * | operator new (size_t s) |
VectorType * | getType () const |
Overload to return most specific vector type. More... | |
DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
Transparently provide more efficient getOperand methods. More... | |
Constant * | getMask () const |
int | getMaskValue (unsigned Elt) const |
Return the shuffle mask value of this instruction for the given element index. More... | |
void | getShuffleMask (SmallVectorImpl< int > &Result) const |
Return the mask for this instruction as a vector of integers. More... | |
SmallVector< int, 16 > | getShuffleMask () const |
bool | changesLength () const |
Return true if this shuffle returns a vector with a different number of elements than its source vectors. More... | |
bool | increasesLength () const |
Return true if this shuffle returns a vector with a greater number of elements than its source vectors. More... | |
bool | isSingleSource () const |
Return true if this shuffle chooses elements from exactly one source vector without changing the length of that vector. More... | |
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. More... | |
bool | isIdentityWithPadding () const |
Return true if this shuffle lengthens exactly one source vector with undefs in the high elements. More... | |
bool | isIdentityWithExtract () const |
Return true if this shuffle extracts the first N elements of exactly one source vector. More... | |
bool | isConcat () const |
Return true if this shuffle concatenates its 2 source vectors. More... | |
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. More... | |
bool | isReverse () const |
Return true if this shuffle swaps the order of elements from exactly one source vector. More... | |
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. More... | |
bool | isTranspose () const |
Return true if this shuffle transposes the elements of its inputs without changing the length of the vectors. More... | |
bool | isExtractSubvectorMask (int &Index) const |
Return true if this shuffle mask is an extract subvector mask. More... | |
Public Member Functions inherited from llvm::Instruction | |
Instruction (const Instruction &)=delete | |
Instruction & | operator= (const Instruction &)=delete |
Instruction * | user_back () |
Specialize the methods defined in Value, as we know that an instruction can only be used by other instructions. More... | |
const Instruction * | user_back () const |
const BasicBlock * | getParent () const |
BasicBlock * | getParent () |
const Module * | getModule () const |
Return the module owning the function this instruction belongs to or nullptr it the function does not have a module. More... | |
Module * | getModule () |
const Function * | getFunction () const |
Return the function this instruction belongs to. More... | |
Function * | getFunction () |
void | removeFromParent () |
This method unlinks 'this' from the containing basic block, but does not delete it. More... | |
SymbolTableList< Instruction >::iterator | eraseFromParent () |
This method unlinks 'this' from the containing basic block and deletes it. More... | |
void | insertBefore (Instruction *InsertPos) |
Insert an unlinked instruction into a basic block immediately before the specified instruction. More... | |
void | insertAfter (Instruction *InsertPos) |
Insert an unlinked instruction into a basic block immediately after the specified instruction. More... | |
void | moveBefore (Instruction *MovePos) |
Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right before MovePos. More... | |
void | moveBefore (BasicBlock &BB, SymbolTableList< Instruction >::iterator I) |
Unlink this instruction and insert into BB before I. More... | |
void | moveAfter (Instruction *MovePos) |
Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right after MovePos. More... | |
unsigned | getOpcode () const |
Returns a member of one of the enums like Instruction::Add. More... | |
const char * | getOpcodeName () const |
bool | isTerminator () const |
bool | isUnaryOp () const |
bool | isBinaryOp () const |
bool | isIntDivRem () const |
bool | isShift () |
bool | isCast () const |
bool | isFuncletPad () const |
bool | isExceptionalTerminator () const |
bool | isLogicalShift () const |
Return true if this is a logical shift left or a logical shift right. More... | |
bool | isArithmeticShift () const |
Return true if this is an arithmetic shift right. More... | |
bool | isBitwiseLogicOp () const |
Return true if this is and/or/xor. More... | |
bool | hasMetadata () const |
Return true if this instruction has any metadata attached to it. More... | |
bool | hasMetadataOtherThanDebugLoc () const |
Return true if this instruction has metadata attached to it other than a debug location. More... | |
MDNode * | getMetadata (unsigned KindID) const |
Get the metadata of given kind attached to this Instruction. More... | |
MDNode * | getMetadata (StringRef Kind) const |
Get the metadata of given kind attached to this Instruction. More... | |
void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode *>> &MDs) const |
Get all metadata attached to this Instruction. More... | |
void | getAllMetadataOtherThanDebugLoc (SmallVectorImpl< std::pair< unsigned, MDNode *>> &MDs) const |
This does the same thing as getAllMetadata, except that it filters out the debug location. More... | |
void | getAAMetadata (AAMDNodes &N, bool Merge=false) const |
Fills the AAMDNodes structure with AA metadata from this instruction. More... | |
void | setMetadata (unsigned KindID, MDNode *Node) |
Set the metadata of the specified kind to the specified node. More... | |
void | setMetadata (StringRef Kind, MDNode *Node) |
void | copyMetadata (const Instruction &SrcInst, ArrayRef< unsigned > WL=ArrayRef< unsigned >()) |
Copy metadata from SrcInst to this instruction. More... | |
void | swapProfMetadata () |
If the instruction has "branch_weights" MD_prof metadata and the MDNode has three operands (including name string), swap the order of the metadata. More... | |
void | setAAMetadata (const AAMDNodes &N) |
Sets the metadata on this instruction from the AAMDNodes structure. More... | |
bool | extractProfMetadata (uint64_t &TrueVal, uint64_t &FalseVal) const |
Retrieve the raw weight values of a conditional branch or select. More... | |
bool | extractProfTotalWeight (uint64_t &TotalVal) const |
Retrieve total raw weight values of a branch. More... | |
void | updateProfWeight (uint64_t S, uint64_t T) |
Updates branch_weights metadata by scaling it by S / T . More... | |
void | setProfWeight (uint64_t W) |
Sets the branch_weights metadata to W for CallInst. More... | |
void | setDebugLoc (DebugLoc Loc) |
Set the debug location information for this instruction. More... | |
const DebugLoc & | getDebugLoc () const |
Return the debug location for this node as a DebugLoc. More... | |
void | setHasNoUnsignedWrap (bool b=true) |
Set or clear the nuw flag on this instruction, which must be an operator which supports this flag. More... | |
void | setHasNoSignedWrap (bool b=true) |
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag. More... | |
void | setIsExact (bool b=true) |
Set or clear the exact flag on this instruction, which must be an operator which supports this flag. More... | |
bool | hasNoUnsignedWrap () const |
Determine whether the no unsigned wrap flag is set. More... | |
bool | hasNoSignedWrap () const |
Determine whether the no signed wrap flag is set. More... | |
void | dropPoisonGeneratingFlags () |
Drops flags that may cause this instruction to evaluate to poison despite having non-poison inputs. More... | |
bool | isExact () const |
Determine whether the exact flag is set. More... | |
void | setFast (bool B) |
Set or clear all fast-math-flags on this instruction, which must be an operator which supports this flag. More... | |
void | setHasAllowReassoc (bool B) |
Set or clear the reassociation flag on this instruction, which must be an operator which supports this flag. More... | |
void | setHasNoNaNs (bool B) |
Set or clear the no-nans flag on this instruction, which must be an operator which supports this flag. More... | |
void | setHasNoInfs (bool B) |
Set or clear the no-infs flag on this instruction, which must be an operator which supports this flag. More... | |
void | setHasNoSignedZeros (bool B) |
Set or clear the no-signed-zeros flag on this instruction, which must be an operator which supports this flag. More... | |
void | setHasAllowReciprocal (bool B) |
Set or clear the allow-reciprocal flag on this instruction, which must be an operator which supports this flag. More... | |
void | setHasApproxFunc (bool B) |
Set or clear the approximate-math-functions flag on this instruction, which must be an operator which supports this flag. More... | |
void | setFastMathFlags (FastMathFlags FMF) |
Convenience function for setting multiple fast-math flags on this instruction, which must be an operator which supports these flags. More... | |
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. More... | |
bool | isFast () const |
Determine whether all fast-math-flags are set. More... | |
bool | hasAllowReassoc () const |
Determine whether the allow-reassociation flag is set. More... | |
bool | hasNoNaNs () const |
Determine whether the no-NaNs flag is set. More... | |
bool | hasNoInfs () const |
Determine whether the no-infs flag is set. More... | |
bool | hasNoSignedZeros () const |
Determine whether the no-signed-zeros flag is set. More... | |
bool | hasAllowReciprocal () const |
Determine whether the allow-reciprocal flag is set. More... | |
bool | hasAllowContract () const |
Determine whether the allow-contract flag is set. More... | |
bool | hasApproxFunc () const |
Determine whether the approximate-math-functions flag is set. More... | |
FastMathFlags | getFastMathFlags () const |
Convenience function for getting all the fast-math flags, which must be an operator which supports these flags. More... | |
void | copyFastMathFlags (const Instruction *I) |
Copy I's fast-math flags. More... | |
void | copyIRFlags (const Value *V, bool IncludeWrapFlags=true) |
Convenience method to copy supported exact, fast-math, and (optionally) wrapping flags from V to this instruction. More... | |
void | andIRFlags (const Value *V) |
Logical 'and' of any supported wrapping, exact, and fast-math flags of V and this instruction. More... | |
void | applyMergedLocation (const DILocation *LocA, const DILocation *LocB) |
Merge 2 debug locations and apply it to the Instruction. More... | |
bool | isAssociative () const LLVM_READONLY |
Return true if the instruction is associative: More... | |
bool | isCommutative () const |
Return true if the instruction is commutative: More... | |
bool | isIdempotent () const |
Return true if the instruction is idempotent: More... | |
bool | isNilpotent () const |
Return true if the instruction is nilpotent: More... | |
bool | mayWriteToMemory () const |
Return true if this instruction may modify memory. More... | |
bool | mayReadFromMemory () const |
Return true if this instruction may read memory. More... | |
bool | mayReadOrWriteMemory () const |
Return true if this instruction may read or write memory. More... | |
bool | isAtomic () const |
Return true if this instruction has an AtomicOrdering of unordered or higher. More... | |
bool | hasAtomicLoad () const |
Return true if this atomic instruction loads from memory. More... | |
bool | hasAtomicStore () const |
Return true if this atomic instruction stores to memory. More... | |
bool | mayThrow () const |
Return true if this instruction may throw an exception. More... | |
bool | isFenceLike () const |
Return true if this instruction behaves like a memory fence: it can load or store to memory location without being given a memory location. More... | |
bool | mayHaveSideEffects () const |
Return true if the instruction may have side effects. More... | |
bool | isSafeToRemove () const |
Return true if the instruction can be removed if the result is unused. More... | |
bool | isEHPad () const |
Return true if the instruction is a variety of EH-block. More... | |
bool | isLifetimeStartOrEnd () const |
Return true if the instruction is a llvm.lifetime.start or llvm.lifetime.end marker. More... | |
const Instruction * | getNextNonDebugInstruction () const |
Return a pointer to the next non-debug instruction in the same basic block as 'this', or nullptr if no such instruction exists. More... | |
Instruction * | getNextNonDebugInstruction () |
const Instruction * | getPrevNonDebugInstruction () const |
Return a pointer to the previous non-debug instruction in the same basic block as 'this', or nullptr if no such instruction exists. More... | |
Instruction * | getPrevNonDebugInstruction () |
Instruction * | clone () const |
Create a copy of 'this' instruction that is identical in all ways except the following: More... | |
bool | isIdenticalTo (const Instruction *I) const |
Return true if the specified instruction is exactly identical to the current one. More... | |
bool | isIdenticalToWhenDefined (const Instruction *I) const |
This is like isIdenticalTo, except that it ignores the SubclassOptionalData flags, which may specify conditions under which the instruction's result is undefined. More... | |
bool | isSameOperationAs (const Instruction *I, unsigned flags=0) const |
This function determines if the specified instruction executes the same operation as the current one. More... | |
bool | isUsedOutsideOfBlock (const BasicBlock *BB) const |
Return true if there are any uses of this instruction in blocks other than the specified block. More... | |
unsigned | getNumSuccessors () const |
Return the number of successors that this instruction has. More... | |
BasicBlock * | getSuccessor (unsigned Idx) const |
Return the specified successor. This instruction must be a terminator. More... | |
void | setSuccessor (unsigned Idx, BasicBlock *BB) |
Update the specified successor to point at the provided block. More... | |
void | dropUnknownNonDebugMetadata (ArrayRef< unsigned > KnownIDs) |
Drop all unknown metadata except for debug locations. More... | |
void | dropUnknownNonDebugMetadata () |
void | dropUnknownNonDebugMetadata (unsigned ID1) |
void | dropUnknownNonDebugMetadata (unsigned ID1, unsigned ID2) |
Public Member Functions inherited from llvm::User | |
User (const User &)=delete | |
void | operator delete (void *Usr) |
Free memory allocated for User and Use objects. More... | |
void | operator delete (void *Usr, unsigned) |
Placement delete - required by std, called if the ctor throws. More... | |
void | operator delete (void *Usr, unsigned, bool) |
Placement delete - required by std, called if the ctor throws. More... | |
const Use * | getOperandList () const |
Use * | getOperandList () |
Value * | getOperand (unsigned i) const |
void | setOperand (unsigned i, Value *Val) |
const Use & | getOperandUse (unsigned i) const |
Use & | getOperandUse (unsigned i) |
unsigned | getNumOperands () const |
ArrayRef< const uint8_t > | getDescriptor () const |
Returns the descriptor co-allocated with this User instance. More... | |
MutableArrayRef< uint8_t > | getDescriptor () |
Returns the descriptor co-allocated with this User instance. More... | |
void | setGlobalVariableNumOperands (unsigned NumOps) |
Set the number of operands on a GlobalVariable. More... | |
void | setNumHungOffUseOperands (unsigned NumOps) |
Subclasses with hung off uses need to manage the operand count themselves. More... | |
op_iterator | op_begin () |
const_op_iterator | op_begin () const |
op_iterator | op_end () |
const_op_iterator | op_end () const |
op_range | operands () |
const_op_range | operands () const |
value_op_iterator | value_op_begin () |
value_op_iterator | value_op_end () |
iterator_range< value_op_iterator > | operand_values () |
const_value_op_iterator | value_op_begin () const |
const_value_op_iterator | value_op_end () const |
iterator_range< const_value_op_iterator > | operand_values () const |
void | dropAllReferences () |
Drop all references to operands. More... | |
void | replaceUsesOfWith (Value *From, Value *To) |
Replace uses of one Value with another. More... | |
Public Member Functions inherited from llvm::Value | |
Value (const Value &)=delete | |
Value & | operator= (const Value &)=delete |
void | deleteValue () |
Delete a pointer to a generic Value. More... | |
void | dump () const |
Support for debugging, callable in GDB: V->dump() More... | |
Type * | getType () const |
All values are typed, get the type of this value. More... | |
LLVMContext & | getContext () const |
All values hold a context through their type. More... | |
bool | hasName () const |
ValueName * | getValueName () const |
void | setValueName (ValueName *VN) |
StringRef | getName () const |
Return a constant reference to the value's name. More... | |
void | setName (const Twine &Name) |
Change the name of the value. More... | |
void | takeName (Value *V) |
Transfer the name from V to this value. More... | |
void | replaceAllUsesWith (Value *V) |
Change all uses of this to point to a new Value. More... | |
void | replaceNonMetadataUsesWith (Value *V) |
Change non-metadata uses of this to point to a new Value. More... | |
void | replaceUsesOutsideBlock (Value *V, BasicBlock *BB) |
replaceUsesOutsideBlock - Go through the uses list for this definition and make each use point to "V" instead of "this" when the use is outside the block. More... | |
void | assertModuleIsMaterializedImpl () const |
void | assertModuleIsMaterialized () const |
bool | use_empty () const |
bool | materialized_use_empty () const |
use_iterator | materialized_use_begin () |
const_use_iterator | materialized_use_begin () const |
use_iterator | use_begin () |
const_use_iterator | use_begin () const |
use_iterator | use_end () |
const_use_iterator | use_end () const |
iterator_range< use_iterator > | materialized_uses () |
iterator_range< const_use_iterator > | materialized_uses () const |
iterator_range< use_iterator > | uses () |
iterator_range< const_use_iterator > | uses () const |
bool | user_empty () const |
user_iterator | materialized_user_begin () |
const_user_iterator | materialized_user_begin () const |
user_iterator | user_begin () |
const_user_iterator | user_begin () const |
user_iterator | user_end () |
const_user_iterator | user_end () const |
User * | user_back () |
const User * | user_back () const |
iterator_range< user_iterator > | materialized_users () |
iterator_range< const_user_iterator > | materialized_users () const |
iterator_range< user_iterator > | users () |
iterator_range< const_user_iterator > | users () const |
bool | hasOneUse () const |
Return true if there is exactly one user of this value. More... | |
bool | hasNUses (unsigned N) const |
Return true if this Value has exactly N users. More... | |
bool | hasNUsesOrMore (unsigned N) const |
Return true if this value has N users or more. More... | |
bool | isUsedInBasicBlock (const BasicBlock *BB) const |
Check if this value is used in the specified basic block. More... | |
unsigned | getNumUses () const |
This method computes the number of uses of this Value. More... | |
void | addUse (Use &U) |
This method should only be used by the Use class. More... | |
unsigned | getValueID () const |
Return an ID for the concrete type of this object. More... | |
unsigned | getRawSubclassOptionalData () const |
Return the raw optional flags value contained in this value. More... | |
void | clearSubclassOptionalData () |
Clear the optional flags contained in this value. More... | |
bool | hasSameSubclassOptionalData (const Value *V) const |
Check the optional flags for equality. More... | |
bool | hasValueHandle () const |
Return true if there is a value handle associated with this value. More... | |
bool | isUsedByMetadata () const |
Return true if there is metadata referencing this value. More... | |
bool | isSwiftError () const |
Return true if this value is a swifterror value. More... | |
const Value * | stripPointerCasts () const |
Strip off pointer casts, all-zero GEPs, and aliases. More... | |
Value * | stripPointerCasts () |
const Value * | stripPointerCastsAndInvariantGroups () const |
Strip off pointer casts, all-zero GEPs, aliases and invariant group info. More... | |
Value * | stripPointerCastsAndInvariantGroups () |
const Value * | stripPointerCastsNoFollowAliases () const |
Strip off pointer casts and all-zero GEPs. More... | |
Value * | stripPointerCastsNoFollowAliases () |
const Value * | stripInBoundsConstantOffsets () const |
Strip off pointer casts and all-constant inbounds GEPs. More... | |
Value * | stripInBoundsConstantOffsets () |
const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
Accumulate offsets from stripInBoundsConstantOffsets(). More... | |
Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
const Value * | stripInBoundsOffsets () const |
Strip off pointer casts and inbounds GEPs. More... | |
Value * | stripInBoundsOffsets () |
uint64_t | getPointerDereferenceableBytes (const DataLayout &DL, bool &CanBeNull) const |
Returns the number of bytes known to be dereferenceable for the pointer value. More... | |
unsigned | getPointerAlignment (const DataLayout &DL) const |
Returns an alignment of the pointer value. More... | |
const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
Translate PHI node to its predecessor from the given basic block. More... | |
Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
void | mutateType (Type *Ty) |
Mutate the type of this Value to be of the specified type. More... | |
template<class Compare > | |
void | sortUseList (Compare Cmp) |
Sort the use-list. More... | |
void | reverseUseList () |
Reverse the use-list. More... | |
void | print (raw_ostream &O, bool IsForDebug=false) const |
Implement operator<< on Value. More... | |
void | print (raw_ostream &O, ModuleSlotTracker &MST, bool IsForDebug=false) const |
void | printAsOperand (raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const |
Print the name of this Value out to the specified raw_ostream. More... | |
void | printAsOperand (raw_ostream &O, bool PrintType, ModuleSlotTracker &MST) const |
Public Member Functions inherited from llvm::ilist_node_with_parent< Instruction, BasicBlock > | |
Instruction * | getPrevNode () |
const Instruction * | getPrevNode () const |
Get the previous node, or nullptr for the list head. More... | |
Instruction * | getNextNode () |
Get the next node, or nullptr for the list tail. More... | |
const Instruction * | getNextNode () const |
Get the next node, or nullptr for the list tail. More... | |
Public Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< Instruction, Options... >::type > | |
self_iterator | getIterator () |
const_self_iterator | getIterator () const |
reverse_self_iterator | getReverseIterator () |
const_reverse_self_iterator | getReverseIterator () const |
bool | isSentinel () const |
Check whether this is the sentinel node. More... | |
Static Public Member Functions | |
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. More... | |
static int | getMaskValue (const Constant *Mask, unsigned Elt) |
Return the shuffle mask value for the specified element of the mask. More... | |
static void | getShuffleMask (const Constant *Mask, SmallVectorImpl< int > &Result) |
Convert the input shuffle mask operand to a vector of integers. More... | |
static bool | isSingleSourceMask (ArrayRef< int > Mask) |
Return true if this shuffle mask chooses elements from exactly one source vector. More... | |
static bool | isSingleSourceMask (const Constant *Mask) |
static bool | isIdentityMask (ArrayRef< int > Mask) |
Return true if this shuffle mask chooses elements from exactly one source vector without lane crossings. More... | |
static bool | isIdentityMask (const Constant *Mask) |
static bool | isSelectMask (ArrayRef< int > Mask) |
Return true if this shuffle mask chooses elements from its source vectors without lane crossings. More... | |
static bool | isSelectMask (const Constant *Mask) |
static bool | isReverseMask (ArrayRef< int > Mask) |
Return true if this shuffle mask swaps the order of elements from exactly one source vector. More... | |
static bool | isReverseMask (const Constant *Mask) |
static bool | isZeroEltSplatMask (ArrayRef< int > Mask) |
Return true if this shuffle mask chooses all elements with the same value as the first element of exactly one source vector. More... | |
static bool | isZeroEltSplatMask (const Constant *Mask) |
static bool | isTransposeMask (ArrayRef< int > Mask) |
Return true if this shuffle mask is a transpose mask. More... | |
static bool | isTransposeMask (const Constant *Mask) |
static bool | isExtractSubvectorMask (ArrayRef< int > Mask, int NumSrcElts, int &Index) |
Return true if this shuffle mask is an extract subvector mask. More... | |
static bool | isExtractSubvectorMask (const Constant *Mask, int NumSrcElts, int &Index) |
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. More... | |
static bool | classof (const Instruction *I) |
static bool | classof (const Value *V) |
Static Public Member Functions inherited from llvm::Instruction | |
static const char * | getOpcodeName (unsigned OpCode) |
static bool | isTerminator (unsigned OpCode) |
static bool | isUnaryOp (unsigned Opcode) |
static bool | isBinaryOp (unsigned Opcode) |
static bool | isIntDivRem (unsigned Opcode) |
static bool | isShift (unsigned Opcode) |
Determine if the Opcode is one of the shift instructions. More... | |
static bool | isBitwiseLogicOp (unsigned Opcode) |
Determine if the Opcode is and/or/xor. More... | |
static bool | isCast (unsigned OpCode) |
Determine if the OpCode is one of the CastInst instructions. More... | |
static bool | isFuncletPad (unsigned OpCode) |
Determine if the OpCode is one of the FuncletPadInst instructions. More... | |
static bool | isExceptionalTerminator (unsigned OpCode) |
Returns true if the OpCode is a terminator related to exception handling. More... | |
static bool | isAssociative (unsigned Opcode) |
static bool | isCommutative (unsigned Opcode) |
static bool | isIdempotent (unsigned Opcode) |
static bool | isNilpotent (unsigned Opcode) |
static bool | classof (const Value *V) |
Methods for support type inquiry through isa, cast, and dyn_cast: More... | |
Static Public Member Functions inherited from llvm::User | |
static bool | classof (const Value *V) |
Protected Member Functions | |
ShuffleVectorInst * | cloneImpl () const |
Protected Member Functions inherited from llvm::Instruction | |
~Instruction () | |
void | setInstructionSubclassData (unsigned short D) |
unsigned | getSubclassDataFromInstruction () const |
Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=nullptr) | |
Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd) | |
Protected Member Functions inherited from llvm::User | |
void * | operator new (size_t Size) |
Allocate a User with an operand pointer co-allocated. More... | |
void * | operator new (size_t Size, unsigned Us) |
Allocate a User with the operands co-allocated. More... | |
void * | operator new (size_t Size, unsigned Us, unsigned DescBytes) |
Allocate a User with the operands co-allocated. More... | |
User (Type *ty, unsigned vty, Use *, unsigned NumOps) | |
void | allocHungoffUses (unsigned N, bool IsPhi=false) |
Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User. More... | |
void | growHungoffUses (unsigned N, bool IsPhi=false) |
Grow the number of hung off uses. More... | |
~User ()=default | |
template<int Idx> | |
Use & | Op () |
template<int Idx> | |
const Use & | Op () const |
Protected Member Functions inherited from llvm::Value | |
Value (Type *Ty, unsigned scid) | |
~Value () | |
Value's destructor should be virtual by design, but that would require that Value and all of its subclasses have a vtable that effectively duplicates the information in the value ID. More... | |
unsigned short | getSubclassDataFromValue () const |
void | setValueSubclassData (unsigned short D) |
Protected Member Functions inherited from llvm::ilist_node_with_parent< Instruction, BasicBlock > | |
ilist_node_with_parent ()=default | |
Protected Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< Instruction, Options... >::type > | |
ilist_node_impl ()=default | |
Friends | |
class | Instruction |
This instruction constructs a fixed permutation of two input vectors.
Definition at line 1992 of file Instructions.h.
ShuffleVectorInst::ShuffleVectorInst | ( | Value * | V1, |
Value * | V2, | ||
Value * | Mask, | ||
const Twine & | NameStr = "" , |
||
Instruction * | InsertBefor = nullptr |
||
) |
Definition at line 1634 of file Instructions.cpp.
References assert(), isValidOperands(), and llvm::Value::setName().
ShuffleVectorInst::ShuffleVectorInst | ( | Value * | V1, |
Value * | V2, | ||
Value * | Mask, | ||
const Twine & | NameStr, | ||
BasicBlock * | InsertAtEnd | ||
) |
Definition at line 1651 of file Instructions.cpp.
References assert(), isValidOperands(), and llvm::Value::setName().
|
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 2060 of file Instructions.h.
References llvm::AllocaInst::getType(), and llvm::Type::getVectorNumElements().
Referenced by matchVectorSplittingReduction().
|
inlinestatic |
Definition at line 2281 of file Instructions.h.
References llvm::Instruction::getOpcode().
Definition at line 2284 of file Instructions.h.
References llvm::AllocaInst::classof().
|
protected |
Definition at line 3949 of file Instructions.cpp.
References llvm::User::getOperand().
|
inlinestatic |
Change values in a shuffle permute mask assuming the two vector operands of length InVecNumElts have swapped position.
Definition at line 2269 of file Instructions.h.
References assert().
Referenced by foldShuffleWithInsert(), and SimplifyShuffleVectorInst().
llvm::ShuffleVectorInst::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Value | ) |
Transparently provide more efficient getOperand methods.
|
inline |
Definition at line 2025 of file Instructions.h.
References llvm::User::getOperand().
Referenced by foldIdentityExtractShuffle(), foldSelectShuffle(), foldSelectShuffleWith1Binop(), isShuffleEquivalentToSelect(), narrowVectorSelect(), and llvm::InstCombiner::visitShuffleVectorInst().
Return the shuffle mask value for the specified element of the mask.
Return -1 if the element is undef.
Definition at line 1716 of file Instructions.cpp.
References assert(), C, llvm::Constant::getAggregateElement(), and getType().
Referenced by llvm::ConstantFoldShuffleVectorInstruction(), getScalarIntrinsicDeclaration(), isShuffleEquivalentToSelect(), and ShrinkDemandedConstant().
|
inline |
Return the shuffle mask value of this instruction for the given element index.
Return -1 if the element is undef.
Definition at line 2035 of file Instructions.h.
|
static |
Convert the input shuffle mask operand to a vector of integers.
Undefined elements of the mask are returned as -1.
Definition at line 1726 of file Instructions.cpp.
References llvm::Constant::getAggregateElement(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by foldShuffleWithInsert(), isBroadcastShuffle(), isReInterleaveMask(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::X86TargetLowering::lowerInterleavedStore(), matchPairwiseShuffleMask(), matchVectorSplittingReduction(), and llvm::InstCombiner::visitShuffleVectorInst().
|
inline |
Return the mask for this instruction as a vector of integers.
Undefined elements of the mask are returned as -1.
Definition at line 2046 of file Instructions.h.
|
inline |
Definition at line 2050 of file Instructions.h.
References llvm::BitmaskEnumDetail::Mask().
Referenced by hasOnlySelectUsers(), isConcat(), isIdentityWithExtract(), isIdentityWithPadding(), shouldMergeGEPs(), and SimplifyShuffleVectorInst().
|
inline |
Overload to return most specific vector type.
Definition at line 2018 of file Instructions.h.
References llvm::UnaryInstruction::DECLARE_TRANSPARENT_OPERAND_ACCESSORS(), and llvm::Value::getType().
Referenced by foldIdentityExtractShuffle(), foldSelectShuffleWith1Binop(), getMaskValue(), getScalarIntrinsicDeclaration(), isBroadcastShuffle(), isConcat(), isIdentityWithExtract(), isIdentityWithPadding(), llvm::AArch64TargetLowering::lowerInterleavedLoad(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), llvm::X86TargetLowering::lowerInterleavedStore(), matchPairwiseShuffleMask(), matchVectorSplittingReduction(), narrowVectorSelect(), ShrinkDemandedConstant(), llvm::Interpreter::visitShuffleVectorInst(), and llvm::InstCombiner::visitShuffleVectorInst().
|
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 2069 of file Instructions.h.
References llvm::AllocaInst::getType(), and llvm::Type::getVectorNumElements().
bool ShuffleVectorInst::isConcat | ( | ) | const |
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 1912 of file Instructions.cpp.
References assert(), llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::end(), llvm::ExtractValueInst::getIndexedType(), llvm::User::getNumOperands(), llvm::User::getOperand(), getShuffleMask(), llvm::Value::getType(), getType(), llvm::Type::getVectorNumElements(), Instruction, isIdentityMaskImpl(), llvm::Value::setName(), and llvm::Value::SubclassOptionalData.
|
static |
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 1855 of file Instructions.cpp.
References isSingleSourceMaskImpl(), and llvm::ArrayRef< T >::size().
Referenced by matchVectorSplittingReduction().
|
inlinestatic |
Definition at line 2253 of file Instructions.h.
References assert(), llvm::Value::getType(), and llvm::Type::isVectorTy().
|
inline |
Return true if this shuffle mask is an extract subvector mask.
Definition at line 2262 of file Instructions.h.
References llvm::AllocaInst::getType(), and llvm::Type::getVectorNumElements().
|
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 2112 of file Instructions.h.
Referenced by matchVectorSplittingReduction().
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 1778 of file Instructions.cpp.
References isIdentityMaskImpl(), and llvm::ArrayRef< T >::size().
Definition at line 2101 of file Instructions.h.
References assert(), llvm::Value::getType(), and llvm::Type::isVectorTy().
bool ShuffleVectorInst::isIdentityWithExtract | ( | ) | const |
Return true if this shuffle extracts the first N elements of exactly one source vector.
Definition at line 1903 of file Instructions.cpp.
References getShuffleMask(), getType(), llvm::Type::getVectorNumElements(), and isIdentityMaskImpl().
Referenced by foldIdentityExtractShuffle(), and narrowVectorSelect().
bool ShuffleVectorInst::isIdentityWithPadding | ( | ) | const |
Return true if this shuffle lengthens exactly one source vector with undefs in the high elements.
Definition at line 1884 of file Instructions.cpp.
References getShuffleMask(), getType(), llvm::Type::getVectorNumElements(), isIdentityMaskImpl(), and llvm::BitmaskEnumDetail::Mask().
|
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> TODO: Optionally allow length-changing shuffles.
Definition at line 2173 of file Instructions.h.
References isReverseMask().
Referenced by matchVectorSplittingReduction().
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.
Definition at line 1784 of file Instructions.cpp.
References isSingleSourceMask(), and llvm::ArrayRef< T >::size().
Definition at line 2162 of file Instructions.h.
References assert(), llvm::Value::getType(), isReverseMask(), and llvm::Type::isVectorTy().
|
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. TODO: Optionally allow length-changing shuffles.
Definition at line 2153 of file Instructions.h.
References isReverseMask().
Referenced by foldSelectShuffle(), foldSelectShuffleWith1Binop(), and matchVectorSplittingReduction().
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 1808 of file Instructions.cpp.
References isSingleSourceMask(), and llvm::ArrayRef< T >::size().
Definition at line 2138 of file Instructions.h.
References assert(), llvm::Value::getType(), and llvm::Type::isVectorTy().
|
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> TODO: Optionally allow length-changing shuffles.
Definition at line 2091 of file Instructions.h.
Referenced by matchVectorSplittingReduction().
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.
Definition at line 1760 of file Instructions.cpp.
References isSingleSourceMaskImpl(), and llvm::ArrayRef< T >::size().
Referenced by isReverseMask(), isSelectMask(), and isZeroEltSplatMask().
Definition at line 2080 of file Instructions.h.
References assert(), llvm::Value::getType(), and llvm::Type::isVectorTy().
|
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 2244 of file Instructions.h.
Referenced by matchVectorSplittingReduction().
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 1821 of file Instructions.cpp.
References llvm::isPowerOf2_32(), and llvm::ArrayRef< T >::size().
Definition at line 2232 of file Instructions.h.
References assert(), llvm::Value::getType(), and llvm::Type::isVectorTy().
|
static |
Return true if a shufflevector instruction can be formed with the specified operands.
Definition at line 1669 of file Instructions.cpp.
References llvm::dyn_cast(), llvm::Value::getType(), llvm::Type::isVectorTy(), llvm::BitmaskEnumDetail::Mask(), and llvm::User::Op().
Referenced by FunctionNumber(), getParameterABIAttributes(), llvm::ConstantExpr::getShuffleVector(), ShuffleVectorInst(), and validShuffleVectorIndex().
|
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> TODO: Optionally allow length-changing shuffles. TODO: Optionally allow splats from other elements.
Definition at line 2195 of file Instructions.h.
Referenced by matchVectorSplittingReduction().
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.
Definition at line 1796 of file Instructions.cpp.
References isSingleSourceMask(), and llvm::ArrayRef< T >::size().
Definition at line 2182 of file Instructions.h.
References assert(), llvm::Value::getType(), and llvm::Type::isVectorTy().
|
inline |
Definition at line 2007 of file Instructions.h.
References llvm::BitmaskEnumDetail::Mask(), and llvm::NVPTX::PTXLdStInstCode::V2.
|
friend |
Definition at line 1995 of file Instructions.h.
Referenced by isConcat().