LLVM 24.0.0git
SLPUtils.h File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/MemoryLocation.h"
#include <optional>
#include <string>

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
namespace  llvm::slpvectorizer
 A private "module" namespace for types and utilities used by this pass.

Enumerations

enum class  llvm::slpvectorizer::UseMask { llvm::slpvectorizer::FirstArg , llvm::slpvectorizer::SecondArg , llvm::slpvectorizer::UndefsAsMask }
 Specifies the way the mask should be analyzed for undefs/poisonous elements in the shuffle mask. More...

Functions

bool llvm::slpvectorizer::isConstant (Value *V)
bool llvm::slpvectorizer::isVectorLikeInstWithConstOps (Value *V)
 Checks if V is one of vector-like instructions, i.e.
unsigned llvm::slpvectorizer::getNumElements (Type *Ty)
unsigned llvm::slpvectorizer::getPartNumElems (unsigned Size, unsigned NumParts)
 Returns power-of-2 number of elements in a single register (part), given the total number of elements Size and number of registers (parts) NumParts.
unsigned llvm::slpvectorizer::getNumElems (unsigned Size, unsigned PartNumElems, unsigned Part)
 Returns correct remaining number of elements, considering total amount Size, (power-of-2 number) of elements in a single register PartNumElems and current register (part) Part.
std::string llvm::slpvectorizer::shortBundleName (ArrayRef< Value * > VL, int Idx=-1)
 Print a short descriptor of the instruction bundle suitable for debug output.
bool llvm::slpvectorizer::allSameBlock (ArrayRef< Value * > VL)
bool llvm::slpvectorizer::allConstant (ArrayRef< Value * > VL)
bool llvm::slpvectorizer::isSplat (ArrayRef< Value * > VL)
bool llvm::slpvectorizer::isCommutative (const Instruction *I, const Value *ValWithUses, bool IsCopyable)
bool llvm::slpvectorizer::isCommutative (const Instruction *I)
 This is a helper function to check whether I is commutative.
bool llvm::slpvectorizer::isCommutableOperand (const Instruction *I, Value *ValWithUses, unsigned Op, bool IsCopyable=false)
 Checks if the operand is commutative.
unsigned llvm::slpvectorizer::getNumberOfPotentiallyCommutativeOps (Instruction *I)
std::optional< unsignedllvm::slpvectorizer::getElementIndex (const Value *Inst, unsigned Offset)
bool llvm::slpvectorizer::allSameOpcode (ArrayRef< Value * > VL)
std::optional< unsignedllvm::slpvectorizer::getExtractIndex (const Instruction *E)
void llvm::slpvectorizer::inversePermutation (ArrayRef< unsigned > Indices, SmallVectorImpl< int > &Mask)
 Compute the inverse permutation Mask of Indices.
void llvm::slpvectorizer::reorderScalars (SmallVectorImpl< Value * > &Scalars, ArrayRef< int > Mask)
 Reorders the list of scalars in accordance with the given Mask.
bool llvm::slpvectorizer::allSameType (ArrayRef< Value * > VL)
bool llvm::slpvectorizer::areAllOperandsNonInsts (Value *V)
 Checks if the provided value does not require scheduling.
bool llvm::slpvectorizer::isUsedOutsideBlock (Value *V)
 Checks if the provided value does not require scheduling.
bool llvm::slpvectorizer::doesNotNeedToBeScheduled (Value *V)
 Checks if the specified value does not require scheduling.
bool llvm::slpvectorizer::doesNotNeedToSchedule (ArrayRef< Value * > VL)
 Checks if the specified array of instructions does not require scheduling.
template<typename T>
std::optional< unsignedllvm::slpvectorizer::getInsertExtractIndex (const Value *Inst, unsigned Offset)
void llvm::slpvectorizer::transformScalarShuffleIndiciesToVector (unsigned VecTyNumElements, SmallVectorImpl< int > &Mask)
unsigned llvm::slpvectorizer::getShufflevectorNumGroups (ArrayRef< Value * > VL)
SmallVector< int > llvm::slpvectorizer::calculateShufflevectorMask (ArrayRef< Value * > VL)
SmallBitVector llvm::slpvectorizer::buildUseMask (int VF, ArrayRef< int > Mask, UseMask MaskArg)
 Prepares a use bitset for the given mask either for the first argument or for the second.
template<bool IsPoisonOnly>
SmallBitVector llvm::slpvectorizer::isUndefVector (const Value *V, const SmallBitVector &UseMask={})
 Checks if the given value is actually an undefined constant vector.
bool llvm::slpvectorizer::doesInTreeUserNeedToExtract (Value *Scalar, Instruction *UserInst, TargetLibraryInfo *TLI, const TargetTransformInfo *TTI)
MemoryLocation llvm::slpvectorizer::getLocation (Instruction *I)
bool llvm::slpvectorizer::isSimple (Instruction *I)
void llvm::slpvectorizer::addMask (SmallVectorImpl< int > &Mask, ArrayRef< int > SubMask, bool ExtendingManyInputs=false)
 Shuffles Mask in accordance with the given SubMask.
void llvm::slpvectorizer::fixupOrderingIndices (MutableArrayRef< unsigned > Order)
 Order may have elements assigned special value (size) which is out of bounds.
SmallBitVector llvm::slpvectorizer::getAltInstrMask (ArrayRef< Value * > VL, Type *ScalarTy, unsigned Opcode0, unsigned Opcode1)
SmallVector< Constant * > llvm::slpvectorizer::replicateMask (ArrayRef< Constant * > Val, unsigned VF)
 Replicates the given Val VF times.

Variables

constexpr int llvm::slpvectorizer::UsesLimit = 64
 Limit of the number of uses for potentially transformed instructions/values, used in checks to avoid compile-time explode.