15 #ifndef LLVM_CODEGEN_GLOBALISEL_LEGALIZERINFO_H 16 #define LLVM_CODEGEN_GLOBALISEL_LEGALIZERINFO_H 31 #include <unordered_map> 39 class MachineIRBuilder;
40 class MachineRegisterInfo;
108 : Opcode(Opcode), Idx(Idx), Type(Type) {}
111 return Opcode == RHS.
Opcode && Idx == RHS.
Idx && Type == RHS.
Type;
134 : Opcode(Opcode), Types(Types), MMODescrs(MMODescrs) {}
136 : LegalityQuery(Opcode, Types, {}) {}
154 : Action(Action), TypeIdx(TypeIdx), NewType(NewType) {}
157 return std::tie(Action, TypeIdx, NewType) ==
173 return Type0 == Other.
Type0 && Type1 == Other.
Type1 &&
179 template<
typename Predicate>
188 return all(
all(P0, P1), args...);
194 std::initializer_list<LLT> TypesInit);
199 std::initializer_list<std::pair<LLT, LLT>> TypesInit);
203 unsigned TypeIdx0,
unsigned TypeIdx1,
unsigned MMOIdx,
204 std::initializer_list<TypePairAndMemSize> TypesAndMemSizeInit);
227 namespace LegalizeMutations {
251 : Predicate(Predicate), Action(Action), Mutation(Mutation) {}
264 return std::make_pair(0,
LLT{});
272 bool IsAliasedByAnother;
287 unsigned typeIdx(
unsigned TypeIdx) {
290 "Type Index is out of bounds");
292 TypeIdxsCovered.set(TypeIdx);
296 void markAllTypeIdxsAsCovered() {
298 TypeIdxsCovered.set();
304 "RuleSet is aliased, change the representative opcode instead");
327 std::initializer_list<LLT> Types) {
329 return actionIf(Action,
typeInSet(typeIdx(0), Types));
334 std::initializer_list<LLT> Types,
337 return actionIf(Action,
typeInSet(typeIdx(0), Types), Mutation);
343 std::initializer_list<std::pair<LLT, LLT>> Types) {
345 return actionIf(Action,
typePairInSet(typeIdx(0), typeIdx(1), Types));
351 std::initializer_list<std::pair<LLT, LLT>> Types,
354 return actionIf(Action,
typePairInSet(typeIdx(0), typeIdx(1), Types),
361 std::initializer_list<LLT> Types) {
363 return actionIf(Action,
all(
typeInSet(typeIdx(0), Types),
372 std::initializer_list<LLT> Types0,
373 std::initializer_list<LLT> Types1) {
375 return actionIf(Action,
all(
typeInSet(typeIdx(0), Types0),
384 std::initializer_list<LLT> Types1, std::initializer_list<LLT> Types2) {
386 return actionIf(Action,
all(
typeInSet(typeIdx(0), Types0),
397 assert((AliasOf == 0 || AliasOf == Opcode) &&
398 "Opcode is already aliased to another opcode");
399 assert(Rules.
empty() &&
"Aliasing will discard rules");
408 markAllTypeIdxsAsCovered();
423 std::initializer_list<LegalityPredicates::TypePairAndMemSize>
427 typeIdx(0), typeIdx(1), 0, TypesAndMemSize));
437 std::initializer_list<LLT> Types1) {
443 using namespace LegalizeMutations;
446 markAllTypeIdxsAsCovered();
452 using namespace LegalizeMutations;
455 markAllTypeIdxsAsCovered();
463 markAllTypeIdxsAsCovered();
493 std::initializer_list<LLT> Types1) {
500 std::initializer_list<LLT> Types1,
501 std::initializer_list<LLT> Types2) {
511 markAllTypeIdxsAsCovered();
518 libcallFor(std::initializer_list<std::pair<LLT, LLT>> Types) {
527 std::initializer_list<LLT> Types1) {
537 markAllTypeIdxsAsCovered();
546 markAllTypeIdxsAsCovered();
556 markAllTypeIdxsAsCovered();
565 markAllTypeIdxsAsCovered();
584 markAllTypeIdxsAsCovered();
595 std::initializer_list<LLT> Types1) {
602 unsigned MinSize = 0) {
617 using namespace LegalizeMutations;
626 using namespace LegalizeMutations;
638 using namespace LegalizeMutations;
651 return minScalar(TypeIdx, MinTy).maxScalar(TypeIdx, MaxTy);
666 unsigned MinElements) {
678 return std::make_pair(
684 unsigned MaxElements) {
696 return std::make_pair(
709 "Expected element types to agree");
712 return clampMinNumElements(TypeIdx, EltTy, MinTy.
getNumElements())
726 bool verifyTypeIdxsCoverage(
unsigned NumTypeIdxs)
const;
737 unsigned getOpcodeIdxForOpcode(
unsigned Opcode)
const;
738 unsigned getActionDefinitionsIdx(
unsigned Opcode)
const;
743 void computeTables();
766 std::function<SizeAndActionsVec(const SizeAndActionsVec &v)>;
773 assert(!needsLegalizingToDifferentSize(Action));
774 TablesInitialized =
false;
775 const unsigned OpcodeIdx = Aspect.
Opcode - FirstOp;
776 if (SpecifiedActions[OpcodeIdx].
size() <= Aspect.
Idx)
777 SpecifiedActions[OpcodeIdx].resize(Aspect.
Idx + 1);
778 SpecifiedActions[OpcodeIdx][Aspect.
Idx][Aspect.
Type] = Action;
798 const unsigned TypeIdx,
800 const unsigned OpcodeIdx = Opcode - FirstOp;
801 if (ScalarSizeChangeStrategies[OpcodeIdx].
size() <= TypeIdx)
802 ScalarSizeChangeStrategies[OpcodeIdx].resize(TypeIdx + 1);
803 ScalarSizeChangeStrategies[OpcodeIdx][TypeIdx] = S;
809 const unsigned TypeIdx,
811 const unsigned OpcodeIdx = Opcode - FirstOp;
812 if (VectorElementSizeChangeStrategies[OpcodeIdx].
size() <= TypeIdx)
813 VectorElementSizeChangeStrategies[OpcodeIdx].resize(TypeIdx + 1);
814 VectorElementSizeChangeStrategies[OpcodeIdx][TypeIdx] = S;
829 return increaseToLargerTypesAndDecreaseToLargest(v,
Unsupported,
841 "At least one size that can be legalized towards is needed" 842 " for this SizeChangeStrategy");
843 return increaseToLargerTypesAndDecreaseToLargest(v,
WidenScalar,
850 return increaseToLargerTypesAndDecreaseToLargest(v,
WidenScalar,
857 return decreaseToSmallerTypesAndIncreaseToSmallest(v,
NarrowScalar,
865 "At least one size that can be legalized towards is needed" 866 " for this SizeChangeStrategy");
867 return decreaseToSmallerTypesAndIncreaseToSmallest(v,
NarrowScalar,
892 return increaseToLargerTypesAndDecreaseToLargest(v,
MoreElements,
932 getActionDefinitionsBuilder(std::initializer_list<unsigned> Opcodes);
933 void aliasActionDefinitions(
unsigned OpcodeTo,
unsigned OpcodeFrom);
961 std::pair<LegalizeAction, LLT>
981 void setScalarAction(
const unsigned Opcode,
const unsigned TypeIndex,
983 const unsigned OpcodeIdx = Opcode - FirstOp;
985 setActions(TypeIndex, Actions, SizeAndActions);
987 void setPointerAction(
const unsigned Opcode,
const unsigned TypeIndex,
990 const unsigned OpcodeIdx = Opcode - FirstOp;
991 if (AddrSpace2PointerActions[OpcodeIdx].
find(AddressSpace) ==
992 AddrSpace2PointerActions[OpcodeIdx].
end())
993 AddrSpace2PointerActions[OpcodeIdx][
AddressSpace] = {{}};
995 AddrSpace2PointerActions[OpcodeIdx].find(AddressSpace)->second;
996 setActions(TypeIndex, Actions, SizeAndActions);
1004 void setScalarInVectorAction(
const unsigned Opcode,
const unsigned TypeIndex,
1006 unsigned OpcodeIdx = Opcode - FirstOp;
1008 ScalarInVectorActions[OpcodeIdx];
1009 setActions(TypeIndex, Actions, SizeAndActions);
1015 void setVectorNumElementAction(
const unsigned Opcode,
1016 const unsigned TypeIndex,
1017 const unsigned ElementSize,
1019 const unsigned OpcodeIdx = Opcode - FirstOp;
1020 if (NumElements2Actions[OpcodeIdx].
find(ElementSize) ==
1021 NumElements2Actions[OpcodeIdx].
end())
1022 NumElements2Actions[OpcodeIdx][ElementSize] = {{}};
1024 NumElements2Actions[OpcodeIdx].find(ElementSize)->second;
1025 setActions(TypeIndex, Actions, SizeAndActions);
1044 int SmallestNarrowIdx = -1;
1045 int LargestWidenIdx = -1;
1046 int SmallestLegalizableToSameSizeIdx = -1;
1047 int LargestLegalizableToSameSizeIdx = -1;
1048 for(
size_t i=0; i<v.size(); ++i) {
1052 if (SmallestNarrowIdx == -1)
1053 SmallestNarrowIdx = i;
1057 LargestWidenIdx = i;
1062 if (SmallestLegalizableToSameSizeIdx == -1)
1063 SmallestLegalizableToSameSizeIdx = i;
1064 LargestLegalizableToSameSizeIdx = i;
1067 if (SmallestNarrowIdx != -1) {
1068 assert(SmallestLegalizableToSameSizeIdx != -1);
1069 assert(SmallestNarrowIdx > SmallestLegalizableToSameSizeIdx);
1071 if (LargestWidenIdx != -1)
1072 assert(LargestWidenIdx < LargestLegalizableToSameSizeIdx);
1083 checkPartialSizeAndActionsVector(v);
1089 void setActions(
unsigned TypeIndex,
1092 checkFullSizeAndActionsVector(SizeAndActions);
1093 if (Actions.
size() <= TypeIndex)
1094 Actions.
resize(TypeIndex + 1);
1095 Actions[TypeIndex] = SizeAndActions;
1112 std::pair<LegalizeAction, LLT>
1113 findScalarLegalAction(
const InstrAspect &Aspect)
const;
1116 std::pair<LegalizeAction, LLT>
1117 findVectorLegalAction(
const InstrAspect &Aspect)
const;
1119 static const int FirstOp = TargetOpcode::PRE_ISEL_GENERIC_OPCODE_START;
1120 static const int LastOp = TargetOpcode::PRE_ISEL_GENERIC_OPCODE_END;
1126 ScalarSizeChangeStrategies[LastOp - FirstOp + 1];
1128 VectorElementSizeChangeStrategies[LastOp - FirstOp + 1];
1129 bool TablesInitialized;
1134 std::unordered_map<uint16_t, SmallVector<SizeAndActionsVec, 1>>
1135 AddrSpace2PointerActions[LastOp - FirstOp + 1];
1136 std::unordered_map<uint16_t, SmallVector<SizeAndActionsVec, 1>>
1137 NumElements2Actions[LastOp - FirstOp + 1];
1150 #endif // LLVM_CODEGEN_GLOBALISEL_LEGALIZERINFO_H InstrAspect(unsigned Opcode, unsigned Idx, LLT Type)
constexpr LegalityQuery(unsigned Opcode, const ArrayRef< LLT > Types)
void push_back(const T &Elt)
const_iterator end(StringRef path)
Get end iterator over path.
unsigned TypeIdx
If describing an action, the type index to change. Otherwise zero.
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is ...
Compute iterated dominance frontiers using a linear time algorithm.
bool isAliasedByAnother()
unsigned getScalarSizeInBits() const
The operation should be implemented in terms of a wider scalar base-type.
LegalizeMutation widenScalarToNextPow2(unsigned TypeIdx, unsigned Min=0)
Widen the type for the given type index to the next power of 2.
Predicate all(Predicate P0, Predicate P1, Args... args)
True iff all given predicates are true.
std::function< SizeAndActionsVec(const SizeAndActionsVec &v)> SizeChangeStrategy
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...
std::vector< SizeAndAction > SizeAndActionsVec
The (vector) operation should be implemented by splitting it into sub-vectors where the operation is ...
static SizeAndActionsVec narrowToSmallerAndUnsupportedIfTooSmall(const SizeAndActionsVec &v)
unsigned getAlias() const
LegalityPredicate typeIs(unsigned TypeIdx, LLT TypesInit)
True iff the given type index is the specified types.
LegalizeRuleSet & libcallForCartesianProduct(std::initializer_list< LLT > Types)
LLT NewType
If describing an action, the new type for TypeIdx. Otherwise LLT{}.
LegalizeRuleSet & legalForCartesianProduct(std::initializer_list< LLT > Types)
The instruction is legal when type indexes 0 and 1 are both in the given list.
constexpr LegalityQuery(unsigned Opcode, const ArrayRef< LLT > Types, const ArrayRef< MemDesc > MMODescrs)
static SizeAndActionsVec unsupportedForDifferentSizes(const SizeAndActionsVec &v)
A SizeChangeStrategy for the common case where legalization for a particular operation consists of on...
The operation should be synthesized from multiple instructions acting on a narrower scalar base-type...
static SizeAndActionsVec widenToLargerTypesUnsupportedOtherwise(const SizeAndActionsVec &v)
LegalizeRuleSet & lowerIf(LegalityPredicate Predicate, LegalizeMutation Mutation)
The instruction is lowered if predicate is true.
LegalizeRuleSet & narrowScalar(unsigned TypeIdx, LegalizeMutation Mutation)
bool match(const LegalityQuery &Query) const
Test whether the LegalityQuery matches.
LegalizeAction getAction() const
LegalizeRuleSet & widenScalarToNextPow2(unsigned TypeIdx, unsigned MinSize=0)
Widen the scalar to the next power of two that is at least MinSize.
LegalizeMutation changeTo(unsigned TypeIdx, LLT Ty)
Select this specific type for the given type index.
void apply(Opt *O, const Mod &M, const Mods &... Ms)
LegalityPredicate atomicOrderingAtLeastOrStrongerThan(unsigned MMOIdx, AtomicOrdering Ordering)
True iff the specified MMO index has at an atomic ordering of at Ordering or stronger.
This operation is completely unsupported on the target.
LLT getElementType() const
Returns the vector's element type. Only valid for vector types.
AtomicOrdering
Atomic ordering for LLVM's memory model.
LegalityPredicate typePairAndMemSizeInSet(unsigned TypeIdx0, unsigned TypeIdx1, unsigned MMOIdx, std::initializer_list< TypePairAndMemSize > TypesAndMemSizeInit)
True iff the given types for the given pair of type indexes is one of the specified type pairs...
LegalizeRuleSet & customForCartesianProduct(std::initializer_list< LLT > Types)
LegalizeRuleSet & customForCartesianProduct(std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1)
LegalizeRuleSet & libcallIf(LegalityPredicate Predicate)
Like legalIf, but for the Libcall action.
LegalizeRuleSet & legalFor(std::initializer_list< std::pair< LLT, LLT >> Types)
The instruction is legal when type indexes 0 and 1 is any type pair in the given list.
InstrAspect(unsigned Opcode, LLT Type)
The (vector) operation should be implemented by widening the input vector and ignoring the lanes adde...
LegalityPredicate numElementsNotPow2(unsigned TypeIdx)
True iff the specified type index is a vector whose element count is not a power of 2...
LegalizeRuleSet & clampMaxNumElements(unsigned TypeIdx, const LLT &EltTy, unsigned MaxElements)
Limit the number of elements in EltTy vectors to at most MaxElements.
LegalizeRuleSet & clampMinNumElements(unsigned TypeIdx, const LLT &EltTy, unsigned MinElements)
Limit the number of elements in EltTy vectors to at least MinElements.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
LegalizeRuleSet & libcallForCartesianProduct(std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1)
bool operator==(const LegalizeActionStep &RHS) const
LegalizeRuleSet & legalForTypesWithMemSize(std::initializer_list< LegalityPredicates::TypePairAndMemSize > TypesAndMemSize)
The instruction is legal when type indexes 0 and 1 along with the memory size is any type and size tu...
The operation itself must be expressed in terms of simpler actions on this target.
LegalizeRuleSet & legalIf(LegalityPredicate Predicate)
The instruction is legal if predicate is true.
LegalizeRuleSet & lowerIf(LegalityPredicate Predicate)
The instruction is lowered if predicate is true.
LegalizeRuleSet & lowerForCartesianProduct(std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1)
The instruction is lowered when type indexes 0 and 1 are both in their respective lists...
unsigned const MachineRegisterInfo * MRI
Sentinel value for when no action was found in the specified table.
LegalityPredicate narrowerThan(unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar that's narrower than the given size.
LegalizeRuleSet & legalForCartesianProduct(std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1)
The instruction is legal when type indexes 0 and 1 are both their respective lists.
LegalizeRuleSet & lowerFor(std::initializer_list< LLT > Types)
The instruction is lowered when type index 0 is any type in the given list.
LegalizeRuleSet & libcallFor(std::initializer_list< LLT > Types)
Interface to description of machine instruction set.
LegalizeRuleSet & clampNumElements(unsigned TypeIdx, const LLT &MinTy, const LLT &MaxTy)
Limit the number of elements for the given vectors to at least MinTy's number of elements and at most...
LegalityPredicate memSizeInBytesNotPow2(unsigned MMOIdx)
True iff the specified MMO index has a size that is not a power of 2.
LegalizeRuleSet & unsupportedIf(LegalityPredicate Predicate)
LegalizeRuleSet & maxScalar(unsigned TypeIdx, const LLT &Ty)
Ensure the scalar is at most as wide as Ty.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
LegalizeRuleSet & clampScalar(unsigned TypeIdx, const LLT &MinTy, const LLT &MaxTy)
Limit the range of scalar sizes to MinTy and MaxTy.
LegalizeRuleSet & customIf(LegalityPredicate Predicate)
std::function< std::pair< unsigned, LLT >(const LegalityQuery &)> LegalizeMutation
Legalization is decided based on an instruction's opcode, which type slot we're considering, and what the existing type is.
LegalizeActionStep(LegalizeAction Action, unsigned TypeIdx, const LLT &NewType)
LegalizeRuleSet & minScalar(unsigned TypeIdx, const LLT &Ty)
Ensure the scalar is at least as wide as Ty.
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...
cl::opt< bool > DisableGISelLegalityCheck
LegalizeRuleSet & unsupportedIfMemSizeNotPow2()
bool verify(const TargetRegisterInfo &TRI) const
Check that information hold by this instance make sense for the given TRI.
LegalizeRuleSet & customFor(std::initializer_list< LLT > Types)
static SizeAndActionsVec narrowToSmallerAndWidenToSmallest(const SizeAndActionsVec &v)
const MachineInstr * machineFunctionIsIllegal(const MachineFunction &MF)
Checks that MIR is fully legal, returns an illegal instruction if it's not, nullptr otherwise...
void setLegalizeVectorElementToDifferentSizeStrategy(const unsigned Opcode, const unsigned TypeIdx, SizeChangeStrategy S)
See also setLegalizeScalarToDifferentSizeStrategy.
LegalizeMutation changeTo(unsigned TypeIdx, unsigned FromTypeIdx)
Keep the same type as the given type index.
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
LegalizeRuleSet & libcallFor(std::initializer_list< std::pair< LLT, LLT >> Types)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
The operation should be implemented as a call to some kind of runtime support library.
unsigned getSizeInBits() const
Returns the total size of the type. Must only be called on sized types.
LegalizeRuleSet & unsupported()
The instruction is unsupported.
The target wants to do something special with this combination of operand and type.
LegalityPredicate isScalar(unsigned TypeIdx)
True iff the specified type index is a scalar.
LegalizeRuleSet & lowerFor(std::initializer_list< LLT > Types, LegalizeMutation Mutation)
The instruction is lowered when type index 0 is any type in the given list.
LegalizeRuleSet & lowerFor(std::initializer_list< std::pair< LLT, LLT >> Types, LegalizeMutation Mutation)
The instruction is lowered when type indexes 0 and 1 is any type pair in the given list...
LegalizeRule(LegalityPredicate Predicate, LegalizeAction Action, LegalizeMutation Mutation=nullptr)
LegalizeRuleSet & moreElementsIf(LegalityPredicate Predicate, LegalizeMutation Mutation)
Add more elements to reach the type selected by the mutation if the predicate is true.
A single rule in a legalizer info ruleset.
bool operator==(const TypePairAndMemSize &Other) const
LegalizeRuleSet & fewerElementsIf(LegalityPredicate Predicate, LegalizeMutation Mutation)
Remove elements to reach the type selected by the mutation if the predicate is true.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
LegalizeRuleSet & legalFor(std::initializer_list< LLT > Types)
The instruction is legal when type index 0 is any type in the given list.
Representation of each machine instruction.
LegalizeAction Action
The action to take or the final answer.
static bool needsLegalizingToDifferentSize(const LegalizeAction Action)
Fall back onto the old rules.
LegalizeRuleSet & fallback()
Fallback on the previous implementation.
static SizeAndActionsVec widenToLargerTypesAndNarrowToLargest(const SizeAndActionsVec &v)
A SizeChangeStrategy for the common case where legalization for a particular operation consists of wi...
static SizeAndActionsVec moreToWiderTypesAndLessToWidest(const SizeAndActionsVec &v)
A SizeChangeStrategy for the common case where legalization for a particular vector operation consist...
LegalizeRuleSet & lowerFor(std::initializer_list< std::pair< LLT, LLT >> Types)
The instruction is lowered when type indexes 0 and 1 is any type pair in the given list...
LegalizeRuleSet & lower()
The instruction is lowered.
LLVM_NODISCARD bool empty() const
void aliasTo(unsigned Opcode)
void setLegalizeScalarToDifferentSizeStrategy(const unsigned Opcode, const unsigned TypeIdx, SizeChangeStrategy S)
The setAction calls record the non-size-changing legalization actions to take on specificly-sized typ...
LegalityPredicate typeInSet(unsigned TypeIdx, std::initializer_list< LLT > TypesInit)
True iff the given type index is one of the specified types.
static void Query(const MachineInstr &MI, AliasAnalysis &AA, bool &Read, bool &Write, bool &Effects, bool &StackPointer)
LegalizeMutation moreElementsToNextPow2(unsigned TypeIdx, unsigned Min=0)
Add more elements to the type for the given type index to the next power of.
LegalizeRuleSet & widenScalarIf(LegalityPredicate Predicate, LegalizeMutation Mutation)
Widen the scalar to the one selected by the mutation if the predicate is true.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LegalizeRuleSet & maxScalarIf(LegalityPredicate Predicate, unsigned TypeIdx, const LLT &Ty)
Conditionally limit the maximum size of the scalar.
LegalizeRuleSet & moreElementsToNextPow2(unsigned TypeIdx)
Add more elements to the vector to reach the next power of two.
uint16_t getNumElements() const
Returns the number of elements in a vector LLT.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
bool operator==(const InstrAspect &RHS) const
This class implements an extremely fast bulk output stream that can only output to a stream...
std::function< bool(const LegalityQuery &)> LegalityPredicate
void setIsAliasedByAnother()
static LLT vector(uint16_t NumElements, unsigned ScalarSizeInBits)
Get a low-level vector of some number of elements and element width.
ArrayRef< MemDesc > MMODescrs
Operations which require memory can use this to place requirements on the memory type for each MMO...
std::pair< unsigned, LLT > determineMutation(const LegalityQuery &Query) const
Determine the change to make.
void setAction(const InstrAspect &Aspect, LegalizeAction Action)
More friendly way to set an action for common types that have an LLT representation.
The operation is expected to be selectable directly by the target, and no transformation is necessary...
LegalityPredicate sizeNotPow2(unsigned TypeIdx)
True iff the specified type index is a scalar whose size is not a power of.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
std::pair< uint16_t, LegalizeAction > SizeAndAction
LegalizeRuleSet & lowerForCartesianProduct(std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1, std::initializer_list< LLT > Types2)
The instruction is lowered when when type indexes 0, 1, and 2 are all in their respective lists...
LegalizeRuleSet & narrowScalarIf(LegalityPredicate Predicate, LegalizeMutation Mutation)
Narrow the scalar to the one selected by the mutation if the predicate is true.
LegalityPredicate widerThan(unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar that's wider than the given size.