Go to the documentation of this file.
19 [=](
const LegalityQuery &Query) {
return std::make_pair(TypeIdx, Ty); };
23 unsigned FromTypeIdx) {
25 return std::make_pair(TypeIdx, Query.Types[FromTypeIdx]);
30 unsigned FromTypeIdx) {
32 const LLT OldTy = Query.Types[TypeIdx];
33 const LLT NewTy = Query.Types[FromTypeIdx];
41 const LLT OldTy = Query.Types[TypeIdx];
47 unsigned FromTypeIdx) {
49 const LLT OldTy = Query.Types[TypeIdx];
50 const LLT NewTy = Query.Types[FromTypeIdx];
60 const LLT OldTy = Query.Types[TypeIdx];
68 unsigned FromTypeIdx) {
70 const LLT OldTy = Query.Types[TypeIdx];
71 const LLT NewTy = Query.Types[FromTypeIdx];
80 const LLT Ty = Query.Types[TypeIdx];
81 unsigned NewEltSizeInBits =
91 const LLT Ty = Query.Types[TypeIdx];
100 const LLT VecTy = Query.Types[TypeIdx];
101 unsigned NewNumElements =
103 return std::make_pair(
110 return std::make_pair(TypeIdx, Query.Types[TypeIdx].getElementType());
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
This is an optimization pass for GlobalISel generic memory operations.
unsigned getScalarSizeInBits() const
LegalizeMutation widenScalarOrEltToNextMultipleOf(unsigned TypeIdx, unsigned Size)
Widen the scalar type or vector element type for the given type index to next multiple of Size.
LLT changeElementCount(ElementCount EC) const
Return a vector or scalar with the same element type and the new element count.
Expected< ExpressionValue > max(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
LegalizeMutation changeTo(unsigned TypeIdx, LLT Ty)
Select this specific type for the given type index.
static LLT fixed_vector(unsigned NumElements, unsigned ScalarSizeInBits)
Get a low-level fixed-width vector of some number of elements and element width.
static ElementCount getFixed(ScalarTy MinVal)
unsigned Log2_32_Ceil(uint32_t Value)
Return the ceil log base 2 of the specified value, 32 if the value is zero.
LegalizeMutation scalarize(unsigned TypeIdx)
Break up the vector type for the given type index into the element type.
LegalizeMutation changeElementSizeTo(unsigned TypeIdx, unsigned FromTypeIdx)
Change the scalar size or element size to have the same scalar size as type index FromIndex.
LegalizeMutation changeElementCountTo(unsigned TypeIdx, unsigned FromTypeIdx)
Keep the same scalar or element type as TypeIdx, but take the number of elements from FromTypeIdx.
uint16_t getNumElements() const
Returns the number of elements in a vector LLT.
The LegalityQuery object bundles together all the information that's needed to decide whether a given...
LegalizeMutation changeElementTo(unsigned TypeIdx, unsigned FromTypeIdx)
Keep the same scalar or element type as the given type index.
LegalizeMutation widenScalarOrEltToNextPow2(unsigned TypeIdx, unsigned Min=0)
Widen the scalar type or vector element type for the given type index to the next power of 2.
LLT changeElementType(LLT NewEltTy) const
If this type is a vector, return a vector with the same number of elements but the new element type.
ElementCount getElementCount() const
std::function< std::pair< unsigned, LLT >(const LegalityQuery &)> LegalizeMutation
LegalizeMutation moreElementsToNextPow2(unsigned TypeIdx, unsigned Min=0)
Add more elements to the type for the given type index to the next power of.
LLT getElementType() const
Returns the vector's element type. Only valid for vector types.
static LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
LLT changeElementSize(unsigned NewEltSize) const
If this type is a vector, return a vector with the same number of elements but the new element size.