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());
Interface for Targets to specify which operations they can successfully select and how the others sho...
static constexpr ElementCount getFixed(ScalarTy MinVal)
constexpr unsigned getScalarSizeInBits() const
constexpr 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.
static constexpr LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
constexpr uint16_t getNumElements() const
Returns the number of elements in a vector LLT.
constexpr bool isVector() const
constexpr LLT getElementType() const
Returns the vector's element type. Only valid for vector types.
constexpr ElementCount getElementCount() const
constexpr 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.
static constexpr LLT fixed_vector(unsigned NumElements, unsigned ScalarSizeInBits)
Get a low-level fixed-width vector of some number of elements and element width.
constexpr LLT changeElementCount(ElementCount EC) const
Return a vector or scalar with the same element type and the new element count.
LegalizeMutation moreElementsToNextPow2(unsigned TypeIdx, unsigned Min=0)
Add more elements to the type for the given type index to the next power of.
LegalizeMutation changeElementCountTo(unsigned TypeIdx, unsigned FromTypeIdx)
Keep the same scalar or element type as TypeIdx, but take the number of elements from FromTypeIdx.
LegalizeMutation scalarize(unsigned TypeIdx)
Break up the vector type for the given type index into the element type.
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.
LegalizeMutation changeTo(unsigned TypeIdx, LLT Ty)
Select this specific type for the given type index.
LegalizeMutation widenScalarOrEltToNextMultipleOf(unsigned TypeIdx, unsigned Size)
Widen the scalar type or vector element type for the given type index to next multiple of Size.
LegalizeMutation changeElementSizeTo(unsigned TypeIdx, unsigned FromTypeIdx)
Change the scalar size or element size to have the same scalar size as type index FromIndex.
This is an optimization pass for GlobalISel generic memory operations.
unsigned Log2_32_Ceil(uint32_t Value)
Return the ceil log base 2 of the specified value, 32 if the value is zero.
std::function< std::pair< unsigned, LLT >(const LegalityQuery &)> LegalizeMutation
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
The LegalityQuery object bundles together all the information that's needed to decide whether a given...