19 [=](
const LegalityQuery &Query) {
return Query.Types[TypeIdx] == Type; };
24 std::initializer_list<LLT> TypesInit) {
32 unsigned TypeIdx0,
unsigned TypeIdx1,
33 std::initializer_list<std::pair<LLT, LLT>> TypesInit) {
36 std::pair<LLT, LLT>
Match = {Query.Types[TypeIdx0], Query.Types[TypeIdx1]};
42 unsigned TypeIdx0,
unsigned TypeIdx1,
unsigned MMOIdx,
43 std::initializer_list<TypePairAndMemDesc> TypesAndMemDescInit) {
47 Query.MMODescrs[MMOIdx].SizeInBits,
48 Query.MMODescrs[MMOIdx].AlignInBits};
50 TypesAndMemDesc.
begin(), TypesAndMemDesc.
end(),
53 }) != TypesAndMemDesc.
end();
59 return Query.Types[TypeIdx].isScalar();
65 return Query.Types[TypeIdx].isVector();
71 return Query.Types[TypeIdx].isPointer();
78 LLT Ty = Query.Types[TypeIdx];
86 const LLT QueryTy = Query.Types[TypeIdx];
94 const LLT QueryTy = Query.Types[TypeIdx];
102 const LLT QueryTy = Query.Types[TypeIdx];
110 const LLT QueryTy = Query.Types[TypeIdx];
117 const LLT QueryTy = Query.Types[TypeIdx];
124 const LLT QueryTy = Query.Types[TypeIdx];
132 return Query.Types[TypeIdx0].getSizeInBits() ==
133 Query.Types[TypeIdx1].getSizeInBits();
139 return !
isPowerOf2_32(Query.MMODescrs[MMOIdx].SizeInBits / 8);
145 const LLT QueryTy = Query.Types[TypeIdx];
This class represents lattice values for constants.
unsigned getScalarSizeInBits() const
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...
The LegalityQuery object bundles together all the information that's needed to decide whether a given...
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 ...
LegalityPredicate typeIs(unsigned TypeIdx, LLT TypesInit)
True iff the given type index is the specified types.
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 isPointer(unsigned TypeIdx)
True iff the specified type index is a pointer (with any address space).
LegalityPredicate isVector(unsigned TypeIdx)
True iff the specified type index is a vector.
LegalityPredicate atomicOrderingAtLeastOrStrongerThan(unsigned MMOIdx, AtomicOrdering Ordering)
True iff the specified MMO index has at an atomic ordering of at Ordering or stronger.
AtomicOrdering
Atomic ordering for LLVM's memory model.
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...
LegalityPredicate numElementsNotPow2(unsigned TypeIdx)
True iff the specified type index is a vector whose element count is not a power of 2...
bool isAtLeastOrStrongerThan(AtomicOrdering ao, AtomicOrdering other)
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
The instances of the Type class are immutable: once they are created, they are never changed...
LegalityPredicate narrowerThan(unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar that's narrower than the given size.
LegalityPredicate memSizeInBytesNotPow2(unsigned MMOIdx)
True iff the specified MMO index has a size that is not a power of 2.
unsigned getAddressSpace() const
auto find_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
LegalityPredicate scalarOrEltSizeNotPow2(unsigned TypeIdx)
True iff the specified type index is a scalar or vector whose element size is not a power of 2...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
unsigned getSizeInBits() const
Returns the total size of the type. Must only be called on sized types.
LegalityPredicate isScalar(unsigned TypeIdx)
True iff the specified type index is a scalar.
LegalityPredicate typeInSet(unsigned TypeIdx, std::initializer_list< LLT > TypesInit)
True iff the given type index is one of the specified types.
bool isCompatible(const TypePairAndMemDesc &Other) const
uint16_t getNumElements() const
Returns the number of elements in a vector LLT.
std::function< bool(const LegalityQuery &)> LegalityPredicate
LegalityPredicate sizeNotPow2(unsigned TypeIdx)
True iff the specified type index is a scalar whose size is not a power of.
LegalityPredicate sameSize(unsigned TypeIdx0, unsigned TypeIdx1)
True iff the specified type indices are both the same bit size.
LegalityPredicate widerThan(unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar that's wider than the given size.