LLVM  14.0.0git
Classes | Functions
llvm::LegalityPredicates Namespace Reference

Classes

struct  TypePairAndMemDesc
 

Functions

template<typename Predicate >
Predicate all (Predicate P0, Predicate P1)
 True iff P0 and P1 are true. More...
 
template<typename Predicate , typename... Args>
Predicate all (Predicate P0, Predicate P1, Args... args)
 True iff all given predicates are true. More...
 
template<typename Predicate >
Predicate any (Predicate P0, Predicate P1)
 True iff P0 or P1 are true. More...
 
template<typename Predicate , typename... Args>
Predicate any (Predicate P0, Predicate P1, Args... args)
 True iff any given predicates are true. More...
 
LegalityPredicate typeIs (unsigned TypeIdx, LLT TypesInit)
 True iff the given type index is the specified type. More...
 
LegalityPredicate typeInSet (unsigned TypeIdx, std::initializer_list< LLT > TypesInit)
 True iff the given type index is one of the specified types. More...
 
LegalityPredicate typeIsNot (unsigned TypeIdx, LLT Type)
 True iff the given type index is not the specified type. More...
 
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. More...
 
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. More...
 
LegalityPredicate isScalar (unsigned TypeIdx)
 True iff the specified type index is a scalar. More...
 
LegalityPredicate isVector (unsigned TypeIdx)
 True iff the specified type index is a vector. More...
 
LegalityPredicate isPointer (unsigned TypeIdx)
 True iff the specified type index is a pointer (with any address space). More...
 
LegalityPredicate isPointer (unsigned TypeIdx, unsigned AddrSpace)
 True iff the specified type index is a pointer with the specified address space. More...
 
LegalityPredicate elementTypeIs (unsigned TypeIdx, LLT EltTy)
 True if the type index is a vector with element type EltTy. More...
 
LegalityPredicate scalarNarrowerThan (unsigned TypeIdx, unsigned Size)
 True iff the specified type index is a scalar that's narrower than the given size. More...
 
LegalityPredicate scalarWiderThan (unsigned TypeIdx, unsigned Size)
 True iff the specified type index is a scalar that's wider than the given size. More...
 
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 given size. More...
 
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 given size. More...
 
LegalityPredicate sizeNotMultipleOf (unsigned TypeIdx, unsigned Size)
 True iff the specified type index is a scalar whose size is not a multiple of Size. More...
 
LegalityPredicate sizeNotPow2 (unsigned TypeIdx)
 True iff the specified type index is a scalar whose size is not a power of. More...
 
LegalityPredicate scalarOrEltSizeNotPow2 (unsigned TypeIdx)
 True iff the specified type index is a scalar or vector whose element size is not a power of 2. More...
 
LegalityPredicate sizeIs (unsigned TypeIdx, unsigned Size)
 True if the total bitwidth of the specified type index is Size bits. More...
 
LegalityPredicate sameSize (unsigned TypeIdx0, unsigned TypeIdx1)
 True iff the specified type indices are both the same bit size. More...
 
LegalityPredicate largerThan (unsigned TypeIdx0, unsigned TypeIdx1)
 True iff the first type index has a larger total bit size than second type index. More...
 
LegalityPredicate smallerThan (unsigned TypeIdx0, unsigned TypeIdx1)
 True iff the first type index has a smaller total bit size than second type index. More...
 
LegalityPredicate memSizeInBytesNotPow2 (unsigned MMOIdx)
 True iff the specified MMO index has a size that is not a power of 2. More...
 
LegalityPredicate numElementsNotPow2 (unsigned TypeIdx)
 True iff the specified type index is a vector whose element count is not a power of 2. More...
 
LegalityPredicate atomicOrderingAtLeastOrStrongerThan (unsigned MMOIdx, AtomicOrdering Ordering)
 True iff the specified MMO index has at an atomic ordering of at Ordering or stronger. More...
 

Function Documentation

◆ all() [1/2]

template<typename Predicate >
Predicate llvm::LegalityPredicates::all ( Predicate  P0,
Predicate  P1 
)

◆ all() [2/2]

template<typename Predicate , typename... Args>
Predicate llvm::LegalityPredicates::all ( Predicate  P0,
Predicate  P1,
Args...  args 
)

True iff all given predicates are true.

Definition at line 235 of file LegalizerInfo.h.

References all().

Referenced by llvm::LegalizeRuleSet::minScalarOrEltIf(), and llvm::LegalizeRuleSet::scalarizeIf().

◆ any() [1/2]

template<typename Predicate >
Predicate llvm::LegalityPredicates::any ( Predicate  P0,
Predicate  P1 
)

◆ any() [2/2]

template<typename Predicate , typename... Args>
Predicate llvm::LegalityPredicates::any ( Predicate  P0,
Predicate  P1,
Args...  args 
)

True iff any given predicates are true.

Definition at line 248 of file LegalizerInfo.h.

References any().

◆ atomicOrderingAtLeastOrStrongerThan()

LegalityPredicate llvm::LegalityPredicates::atomicOrderingAtLeastOrStrongerThan ( unsigned  MMOIdx,
AtomicOrdering  Ordering 
)

True iff the specified MMO index has at an atomic ordering of at Ordering or stronger.

Definition at line 198 of file LegalityPredicates.cpp.

References llvm::isAtLeastOrStrongerThan().

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo().

◆ elementTypeIs()

LegalityPredicate llvm::LegalityPredicates::elementTypeIs ( unsigned  TypeIdx,
LLT  EltTy 
)

True if the type index is a vector with element type EltTy.

Definition at line 93 of file LegalityPredicates.cpp.

References llvm::LLT::getElementType(), and llvm::LLT::isVector().

◆ isPointer() [1/2]

LegalityPredicate llvm::LegalityPredicates::isPointer ( unsigned  TypeIdx)

◆ isPointer() [2/2]

LegalityPredicate llvm::LegalityPredicates::isPointer ( unsigned  TypeIdx,
unsigned  AddrSpace 
)

True iff the specified type index is a pointer with the specified address space.

Definition at line 85 of file LegalityPredicates.cpp.

References llvm::LLT::getAddressSpace(), and llvm::LLT::isPointer().

◆ isScalar()

LegalityPredicate llvm::LegalityPredicates::isScalar ( unsigned  TypeIdx)

◆ isVector()

LegalityPredicate llvm::LegalityPredicates::isVector ( unsigned  TypeIdx)

◆ largerThan()

LegalityPredicate llvm::LegalityPredicates::largerThan ( unsigned  TypeIdx0,
unsigned  TypeIdx1 
)

True iff the first type index has a larger total bit size than second type index.

Definition at line 125 of file LegalityPredicates.cpp.

◆ memSizeInBytesNotPow2()

LegalityPredicate llvm::LegalityPredicates::memSizeInBytesNotPow2 ( unsigned  MMOIdx)

True iff the specified MMO index has a size that is not a power of 2.

Definition at line 185 of file LegalityPredicates.cpp.

References llvm::isPowerOf2_32().

Referenced by llvm::LegalizeRuleSet::lowerIfMemSizeNotPow2(), and llvm::LegalizeRuleSet::unsupportedIfMemSizeNotPow2().

◆ numElementsNotPow2()

LegalityPredicate llvm::LegalityPredicates::numElementsNotPow2 ( unsigned  TypeIdx)

True iff the specified type index is a vector whose element count is not a power of 2.

Definition at line 191 of file LegalityPredicates.cpp.

References llvm::LLT::getNumElements(), llvm::isPowerOf2_32(), and llvm::LLT::isVector().

Referenced by llvm::LegalizeRuleSet::moreElementsToNextPow2().

◆ sameSize()

LegalityPredicate llvm::LegalityPredicates::sameSize ( unsigned  TypeIdx0,
unsigned  TypeIdx1 
)

True iff the specified type indices are both the same bit size.

Definition at line 177 of file LegalityPredicates.cpp.

◆ scalarNarrowerThan()

LegalityPredicate llvm::LegalityPredicates::scalarNarrowerThan ( unsigned  TypeIdx,
unsigned  Size 
)

True iff the specified type index is a scalar that's narrower than the given size.

Definition at line 101 of file LegalityPredicates.cpp.

References llvm::LLT::getSizeInBits(), llvm::LLT::isScalar(), and llvm::Check::Size.

Referenced by llvm::LegalizeRuleSet::minScalar().

◆ scalarOrEltNarrowerThan()

LegalityPredicate llvm::LegalityPredicates::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 given size.

Definition at line 133 of file LegalityPredicates.cpp.

References llvm::LLT::getScalarSizeInBits(), and llvm::Check::Size.

Referenced by llvm::LegalizeRuleSet::minScalarOrElt(), and llvm::LegalizeRuleSet::minScalarOrEltIf().

◆ scalarOrEltSizeNotPow2()

LegalityPredicate llvm::LegalityPredicates::scalarOrEltSizeNotPow2 ( unsigned  TypeIdx)

True iff the specified type index is a scalar or vector whose element size is not a power of 2.

Definition at line 149 of file LegalityPredicates.cpp.

References llvm::LLT::getScalarSizeInBits(), and llvm::isPowerOf2_32().

Referenced by llvm::LegalizeRuleSet::widenScalarOrEltToNextPow2().

◆ scalarOrEltWiderThan()

LegalityPredicate llvm::LegalityPredicates::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 given size.

Definition at line 141 of file LegalityPredicates.cpp.

References llvm::LLT::getScalarSizeInBits(), and llvm::Check::Size.

Referenced by llvm::LegalizeRuleSet::maxScalarOrElt().

◆ scalarWiderThan()

LegalityPredicate llvm::LegalityPredicates::scalarWiderThan ( unsigned  TypeIdx,
unsigned  Size 
)

True iff the specified type index is a scalar that's wider than the given size.

Definition at line 109 of file LegalityPredicates.cpp.

References llvm::LLT::getSizeInBits(), llvm::LLT::isScalar(), and llvm::Check::Size.

Referenced by llvm::LegalizeRuleSet::maxScalar().

◆ sizeIs()

LegalityPredicate llvm::LegalityPredicates::sizeIs ( unsigned  TypeIdx,
unsigned  Size 
)

True if the total bitwidth of the specified type index is Size bits.

Definition at line 171 of file LegalityPredicates.cpp.

References llvm::Check::Size.

◆ sizeNotMultipleOf()

LegalityPredicate llvm::LegalityPredicates::sizeNotMultipleOf ( unsigned  TypeIdx,
unsigned  Size 
)

True iff the specified type index is a scalar whose size is not a multiple of Size.

Definition at line 156 of file LegalityPredicates.cpp.

References llvm::LLT::getSizeInBits(), llvm::LLT::isScalar(), and llvm::Check::Size.

Referenced by llvm::LegalizeRuleSet::widenScalarToNextMultipleOf().

◆ sizeNotPow2()

LegalityPredicate llvm::LegalityPredicates::sizeNotPow2 ( unsigned  TypeIdx)

True iff the specified type index is a scalar whose size is not a power of.

Definition at line 164 of file LegalityPredicates.cpp.

References llvm::LLT::getSizeInBits(), llvm::isPowerOf2_32(), and llvm::LLT::isScalar().

Referenced by llvm::LegalizeRuleSet::widenScalarToNextPow2().

◆ smallerThan()

LegalityPredicate llvm::LegalityPredicates::smallerThan ( unsigned  TypeIdx0,
unsigned  TypeIdx1 
)

True iff the first type index has a smaller total bit size than second type index.

Definition at line 117 of file LegalityPredicates.cpp.

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo().

◆ typeInSet()

LegalityPredicate llvm::LegalityPredicates::typeInSet ( unsigned  TypeIdx,
std::initializer_list< LLT TypesInit 
)

True iff the given type index is one of the specified types.

Definition at line 34 of file LegalityPredicates.cpp.

References llvm::is_contained().

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo().

◆ typeIs()

LegalityPredicate llvm::LegalityPredicates::typeIs ( unsigned  TypeIdx,
LLT  TypesInit 
)

True iff the given type index is the specified type.

Definition at line 28 of file LegalityPredicates.cpp.

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(), and llvm::AMDGPULegalizerInfo::AMDGPULegalizerInfo().

◆ typeIsNot()

LegalityPredicate llvm::LegalityPredicates::typeIsNot ( unsigned  TypeIdx,
LLT  Type 
)
inline

True iff the given type index is not the specified type.

Definition at line 259 of file LegalizerInfo.h.

Referenced by llvm::AMDGPULegalizerInfo::AMDGPULegalizerInfo().

◆ typePairAndMemDescInSet()

LegalityPredicate llvm::LegalityPredicates::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.

Definition at line 52 of file LegalityPredicates.cpp.

References llvm::any_of(), and llvm::Match.

Referenced by llvm::LegalizeRuleSet::legalForTypesWithMemDesc().

◆ typePairInSet()

LegalityPredicate llvm::LegalityPredicates::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.

Definition at line 42 of file LegalityPredicates.cpp.

References llvm::is_contained(), and llvm::Match.