LLVM: include/llvm/IR/VectorTypeUtils.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_IR_VECTORTYPEUTILS_H
10#define LLVM_IR_VECTORTYPEUTILS_H
11
14
15namespace llvm {
16
17
18
19
21 if (Scalar->isVoidTy() || Scalar->isMetadataTy() || EC.isScalar())
22 return Scalar;
24}
25
29
30
31
32
33
35
36
37
39
40
41
43
44
45
47
48
49
50
51
52
53
54
60
61
62
63
64
68 return Ty->getScalarType();
69}
70
71
72
76 return Ty->isVectorTy();
77}
78
79
80
81
82
83
84
90
91
92
95 return StructTy->elements();
97}
98
99
104
108
109}
110
111#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
static constexpr ElementCount getFixed(ScalarTy MinVal)
Class to represent struct types.
bool isLiteral() const
Return true if this type is uniqued by structural equivalence, false if it is a struct definition.
The instances of the Type class are immutable: once they are created, they are never changed.
static LLVM_ABI VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
static LLVM_ABI bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI bool canVectorizeStructTy(StructType *StructTy)
Returns true if StructTy is an unpacked literal struct where all elements are scalars that can be use...
Type * toScalarizedTy(Type *Ty)
A helper for converting vectorized types to scalarized (non-vector) types.
Definition VectorTypeUtils.h:65
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
bool isUnpackedStructLiteral(StructType *StructTy)
Definition VectorTypeUtils.h:105
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...
Definition VectorTypeUtils.h:73
ElementCount getVectorizedTypeVF(Type *Ty)
Returns the number of vector elements for a vectorized type.
Definition VectorTypeUtils.h:100
LLVM_ABI Type * toVectorizedStructTy(StructType *StructTy, ElementCount EC)
A helper for converting structs of scalar types to structs of vector types.
Type * toVectorizedTy(Type *Ty, ElementCount EC)
A helper for converting to vectorized types.
Definition VectorTypeUtils.h:55
bool canVectorizeTy(Type *Ty)
Returns true if Ty is a valid vector element type, void, or an unpacked literal struct where all elem...
Definition VectorTypeUtils.h:85
ArrayRef(const T &OneElt) -> ArrayRef< T >
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
ArrayRef< Type * > getContainedTypes(Type *const &Ty)
Returns the types contained in Ty.
Definition VectorTypeUtils.h:93
Type * toVectorTy(Type *Scalar, ElementCount EC)
A helper function for converting Scalar types to vector types.
Definition VectorTypeUtils.h:20
LLVM_ABI Type * toScalarizedStructTy(StructType *StructTy)
A helper for converting structs of vector types to structs of scalar types.
LLVM_ABI bool isVectorizedStructTy(StructType *StructTy)
Returns true if StructTy is an unpacked literal struct where all elements are vectors of matching ele...