Go to the documentation of this file.
16 #if defined(_MSC_VER) && !defined(__clang__) && defined(_M_IX86)
20 #pragma runtime_checks("", off)
21 #pragma optimize("gs", on)
35 std::initializer_list<LLT> TypesInit) {
43 unsigned TypeIdx0,
unsigned TypeIdx1,
44 std::initializer_list<std::pair<LLT, LLT>> TypesInit) {
47 std::pair<LLT, LLT>
Match = {Query.Types[TypeIdx0], Query.Types[TypeIdx1]};
53 unsigned TypeIdx0,
unsigned TypeIdx1,
unsigned MMOIdx,
54 std::initializer_list<TypePairAndMemDesc> TypesAndMemDescInit) {
58 Query.MMODescrs[MMOIdx].MemoryTy,
59 Query.MMODescrs[MMOIdx].AlignInBits};
62 return Match.isCompatible(Entry);
69 return Query.Types[TypeIdx].isScalar();
75 return Query.Types[TypeIdx].isVector();
81 return Query.Types[TypeIdx].isPointer();
88 LLT Ty = Query.Types[TypeIdx];
96 const LLT QueryTy = Query.Types[TypeIdx];
104 const LLT QueryTy = Query.Types[TypeIdx];
112 const LLT QueryTy = Query.Types[TypeIdx];
120 return Query.Types[TypeIdx0].getSizeInBits() <
121 Query.Types[TypeIdx1].getSizeInBits();
128 return Query.Types[TypeIdx0].getSizeInBits() >
129 Query.Types[TypeIdx1].getSizeInBits();
136 const LLT QueryTy = Query.Types[TypeIdx];
144 const LLT QueryTy = Query.Types[TypeIdx];
151 const LLT QueryTy = Query.Types[TypeIdx];
159 const LLT QueryTy = Query.Types[TypeIdx];
166 const LLT QueryTy = Query.Types[TypeIdx];
173 return Query.Types[TypeIdx].getSizeInBits() == Size;
180 return Query.Types[TypeIdx0].getSizeInBits() ==
181 Query.Types[TypeIdx1].getSizeInBits();
187 return !
isPowerOf2_32(Query.MMODescrs[MMOIdx].MemoryTy.getSizeInBytes());
193 const LLT MemTy = Query.MMODescrs[MMOIdx].MemoryTy;
200 const LLT QueryTy = Query.Types[TypeIdx];
This is an optimization pass for GlobalISel generic memory operations.
LegalityPredicate scalarOrEltWiderThan(unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar or a vector with an element type that's wider than the ...
unsigned getScalarSizeInBits() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
The instances of the Type class are immutable: once they are created, they are never changed.
LegalityPredicate largerThan(unsigned TypeIdx0, unsigned TypeIdx1)
True iff the first type index has a larger total bit size than second type index.
LegalityPredicate scalarNarrowerThan(unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar that's narrower than the given size.
LegalityPredicate elementTypeIs(unsigned TypeIdx, LLT EltTy)
True if the type index is a vector with element type EltTy.
LegalityPredicate sizeNotMultipleOf(unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar whose size is not a multiple of Size.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
LegalityPredicate isPointer(unsigned TypeIdx)
True iff the specified type index is a pointer (with any address space).
LegalityPredicate atomicOrderingAtLeastOrStrongerThan(unsigned MMOIdx, AtomicOrdering Ordering)
True iff the specified MMO index has at an atomic ordering of at Ordering or stronger.
bool isAtLeastOrStrongerThan(AtomicOrdering AO, AtomicOrdering Other)
LegalityPredicate typeIs(unsigned TypeIdx, LLT TypesInit)
True iff the given type index is the specified type.
LegalityPredicate smallerThan(unsigned TypeIdx0, unsigned TypeIdx1)
True iff the first type index has a smaller total bit size than second type index.
TypeSize getSizeInBits() const
Returns the total size of the type. Must only be called on sized types.
LegalityPredicate scalarOrEltSizeNotPow2(unsigned TypeIdx)
True iff the specified type index is a scalar or vector whose element size is not a power of 2.
unsigned getAddressSpace() const
AtomicOrdering
Atomic ordering for LLVM's memory model.
uint16_t getNumElements() const
Returns the number of elements in a vector LLT.
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
std::function< bool(const LegalityQuery &)> LegalityPredicate
LegalityPredicate typeInSet(unsigned TypeIdx, std::initializer_list< LLT > TypesInit)
True iff the given type index is one of the specified types.
The LegalityQuery object bundles together all the information that's needed to decide whether a given...
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
LegalityPredicate typePairInSet(unsigned TypeIdx0, unsigned TypeIdx1, std::initializer_list< std::pair< LLT, LLT >> TypesInit)
True iff the given types for the given pair of type indexes is one of the specified type pairs.
LegalityPredicate sizeNotPow2(unsigned TypeIdx)
True iff the specified type index is a scalar whose size is not a power of.
LegalityPredicate isScalar(unsigned TypeIdx)
True iff the specified type index is a scalar.
LegalityPredicate scalarOrEltNarrowerThan(unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar or vector with an element type that's narrower than the...
LegalityPredicate sizeIs(unsigned TypeIdx, unsigned Size)
True if the total bitwidth of the specified type index is Size bits.
LegalityPredicate memSizeInBytesNotPow2(unsigned MMOIdx)
True iff the specified MMO index has a size (rounded to bytes) that is not a power of 2.
LegalityPredicate scalarWiderThan(unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar that's wider than the given size.
TypeSize getSizeInBytes() const
Returns the total size of the type in bytes, i.e.
LegalityPredicate memSizeNotByteSizePow2(unsigned MMOIdx)
True iff the specified MMO index has a size that is not an even byte size, or that even byte size is ...
LegalityPredicate numElementsNotPow2(unsigned TypeIdx)
True iff the specified type index is a vector whose element count is not a power of 2.
LegalityPredicate isVector(unsigned TypeIdx)
True iff the specified type index is a vector.
LegalityPredicate typePairAndMemDescInSet(unsigned TypeIdx0, unsigned TypeIdx1, unsigned MMOIdx, std::initializer_list< TypePairAndMemDesc > TypesAndMemDescInit)
True iff the given types for the given pair of type indexes is one of the specified type pairs.
LLT getElementType() const
Returns the vector's element type. Only valid for vector types.
LegalityPredicate sameSize(unsigned TypeIdx0, unsigned TypeIdx1)
True iff the specified type indices are both the same bit size.