36 return canVectorizeTy(Ty) && !Ty->isX86_FP80Ty() && !Ty->isPPC_FP128Ty() &&
42 return SI->getValueOperand()->getType();
45 return CI->getOperand(0)->getType();
48 return IE->getOperand(1)->getType();
50 return IV->getOperand(1)->getType();
62 "expected unpacked struct literal");
64 "expected all element types to be valid vector element types");
66 StructTy->getContext(),
68 return FixedVectorType::get(ElTy, 1);
78 unsigned Sz,
bool ReVec) {
83 if (NumParts == 0 || NumParts >= Sz)
89 Type *Ty,
unsigned Sz,
bool ReVec) {
94 if (NumParts == 0 || NumParts >= Sz)
99 return (Sz / RegVF) * RegVF;
103 unsigned Opcode,
Type *ScalarTy,
104 unsigned NumElts,
bool ReVec) {
107 unsigned PaddedNumElts =
109 if (PaddedNumElts == NumElts)
115 unsigned Sz,
bool ReVec) {
125 return NumParts > 0 && NumParts < Sz &&
has_single_bit(Sz / NumParts) &&
135 Type *ScalarTy,
bool ReVec,
unsigned Limit) {
138 unsigned NumParts = QueryNumParts ?
TTI.getNumberOfParts(VecTy)
139 :
TTI.getRegUsageForType(VecTy);
140 if (NumParts == 0 || NumParts >= Limit)
146 if (NumParts >= Sz || PWSz % NumParts != 0 ||
147 (PWSz / NumParts) % ScalarSz != 0 ||
150 const unsigned NumElts = PWSz / NumParts;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file implements the C++20 <bit> header.
static const uint32_t IV[8]
A parsed version of the target data layout string in and methods for querying it.
static constexpr ElementCount getFixed(ScalarTy MinVal)
Class to represent fixed width SIMD vectors.
static LLVM_ABI FixedVectorType * get(Type *ElementType, unsigned NumElts)
static LLVM_ABI StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
static LLVM_ABI bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
A private "module" namespace for types and utilities used by this pass.
unsigned getNumberOfPartsOrRegs(bool QueryNumParts, const TargetTransformInfo &TTI, Type *VecTy, Type *ScalarTy, bool ReVec, unsigned Limit)
Returns number of parts, the type VecTy will be split at the codegen phase.
unsigned getFloorFullVectorNumberOfElements(const TargetTransformInfo &TTI, Type *Ty, unsigned Sz, bool ReVec)
Returns the number of elements of the given type Ty, not greater than Sz, which forms type,...
unsigned getNumElements(Type *Ty)
Type * getWidenedType(Type *ScalarTy, unsigned VF)
bool hasFullVectorsOrPowerOf2(const TargetTransformInfo &TTI, Type *Ty, unsigned Sz, bool ReVec)
Returns true if widened type of Ty elements with size Sz represents full vector type,...
bool isAllowedNonPowerOf2VF(unsigned NumElts, bool AllowNonPowerOf2)
True when AllowNonPowerOf2 is set and NumElts is a supported non-power-of-2 width: NumElts + 1 must b...
FixedVectorType * getMaskedDivRemType(const TargetTransformInfo &TTI, unsigned Opcode, Type *ScalarTy, unsigned NumElts, bool ReVec)
For a non-power-of-2 NumElts-wide integer div/rem Opcode, returns the padded full-register vector typ...
bool isValidElementType(Type *Ty, bool ReVec)
Predicate for the element types that the SLP vectorizer supports.
Type * getValueType(Value *V, bool ReVec, bool LookThroughCmp)
Returns the "element type" of the given value/instruction V.
bool isTypeLimitNeutral(const Value *V, bool IsMax, const DataLayout &DL)
Returns true if the type limit of the smax (IsMax) or smin lane V stays neutral after narrowing.
unsigned getFullVectorNumberOfElements(const TargetTransformInfo &TTI, Type *Ty, unsigned Sz, bool ReVec)
Returns the number of elements of the given type Ty, not less than Sz, which forms type,...
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
Type * toScalarizedTy(Type *Ty)
A helper for converting vectorized types to scalarized (non-vector) types.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
bool isUnpackedStructLiteral(StructType *StructTy)
auto map_to_vector(ContainerTy &&C, FuncTy &&F)
Map a range to a SmallVector with element types deduced from the mapping.
bool isVectorizedTy(Type *Ty)
Returns true if Ty is a vector type or a struct of vector types where all vector types share the same...
T bit_ceil(T Value)
Returns the smallest integral power of two no smaller than Value if Value is nonzero.
constexpr bool has_single_bit(T Value) noexcept
LLVM_ABI bool isKnownNegative(const Value *V, const SimplifyQuery &SQ, unsigned Depth=0)
Returns true if the given value is known be negative (i.e.
ElementCount getVectorizedTypeVF(Type *Ty)
Returns the number of vector elements for a vectorized type.
Type * toVectorizedTy(Type *Ty, ElementCount EC)
A helper for converting to vectorized types.
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
constexpr T divideCeil(U Numerator, V Denominator)
Returns the integer ceil(Numerator / Denominator).
bool canVectorizeTy(Type *Ty)
Returns true if Ty is a valid vector element type, void, or an unpacked literal struct where all elem...
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
T bit_floor(T Value)
Returns the largest integral power of two no greater than Value if Value is nonzero.
LLVM_ABI bool isKnownNonNegative(const Value *V, const SimplifyQuery &SQ, unsigned Depth=0)
Returns true if the give value is known to be non-negative.