16 #ifndef LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H 17 #define LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H 28 #include <initializer_list> 36 class MachineInstrBuilder;
37 class MachineFunction;
39 class MachineRegisterInfo;
41 class TargetInstrInfo;
42 class TargetRegisterClass;
43 class TargetRegisterInfo;
56 template <std::
size_t MaxPredicates>
63 :
std::bitset<MaxPredicates>(B) {}
67 std::bitset<MaxPredicates>::set(
I);
376 template <
class PredicateBitset,
class ComplexMatcherMemFn,
377 class CustomRendererFn>
380 const PredicateBitset *FeatureBitsets,
381 const ComplexMatcherMemFn *ComplexPredicates,
382 const CustomRendererFn *CustomRenderers)
383 : TypeObjects(TypeObjects),
384 FeatureBitsets(FeatureBitsets),
385 ComplexPredicates(ComplexPredicates),
386 CustomRenderers(CustomRenderers) {
388 for (
size_t I = 0; I < NumTypeObjects; ++
I)
389 TypeIDMap[TypeObjects[I]] = I;
404 template <
class TgtInstructionSelector,
class PredicateBitset,
405 class ComplexMatcherMemFn,
class CustomRendererFn>
406 bool executeMatchTable(
421 "Subclasses must override this with a tablegen-erated function");
425 "Subclasses must override this with a tablegen-erated function");
429 "Subclasses must override this with a tablegen-erated function");
433 "Subclasses must override this with a tablegen-erated function");
440 bool constrainOperandRegToRegClass(
MachineInstr &I,
unsigned OpIdx,
463 #endif // LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H
Check an immediate predicate on the specified instruction.
This class represents lattice values for constants.
std::vector< ComplexRendererFns::value_type > Renderers
Increment the rule coverage counter.
Check the opcode on the specified instruction.
const PredicateBitset * FeatureBitsets
unsigned const TargetRegisterInfo * TRI
PredicateBitsetImpl(std::initializer_list< unsigned > Init)
const CustomRendererFn * CustomRenderers
Check the size of the memory access for the given machine memory operand against the size of an opera...
Render operands to the specified instruction using a custom function.
Add a temporary register to the specified instruction.
const ComplexMatcherMemFn * ComplexPredicates
Keeping track of the number of the GI opcodes. Must be the last entry.
Merge all memory operands into instruction.
Check the specified operands are identical.
Copy an operand to the specified instruction or add a zero register if the operand is a zero immediat...
Check the operand matches a complex predicate.
Copy an operand to the specified instruction.
Record the specified instruction.
Add an implicit register use to the specified instruction.
Check the operand is a specific literal integer (i.e.
Switch over the opcode on the specified instruction.
Holds all the information related to register banks.
virtual const int64_t * getMatchTable() const
const HexagonInstrInfo * TII
Fail the current try-block, or completely fail to match if there is no current try-block.
Switch over the LLT on the specified instruction operand.
Constrain an instruction operand to a register class.
Check the specified operand is an MBB.
DenseMap< unsigned, unsigned > TempRegisters
Check an immediate predicate on the specified instruction via an APInt.
SmallDenseMap< LLT, unsigned, 64 > TypeIDMap
Check a generic C++ instruction predicate.
Create a new temporary register that's not constrained.
Check the type of a pointer to any address space.
Render a G_CONSTANT operator as a sign-extended immediate.
TargetInstrInfo - Interface to description of machine instruction set.
Check the operand is a specific intrinsic ID.
Copy an operand to the specified instruction.
Container class for CodeGen predicate results.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
unsigned const MachineRegisterInfo * MRI
virtual bool testMIPredicate_MI(unsigned, const MachineInstr &) const
Check the register bank for the specified operand.
Render sub-operands of complex operands to the specified instruction.
Check the size of the memory access for the given machine memory operand.
Check a memory operation has the specified atomic ordering.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Add an immediate to the specified instruction.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MachineOperand class - Representation of each machine instruction operand.
Check the operand is a specific integer.
Check if the specified operand is safe to fold into the current instruction.
Indicates the end of the variable-length MergeInsnID list in a GIR_MergeMemOperands opcode...
Check the type for the specified operand.
Add an implicit register def to the specified instruction.
Class for arbitrary precision integers.
RegisterBankInfo(RegisterBank **RegBanks, unsigned NumRegBanks)
Create a RegisterBankInfo that can accommodate up to NumRegBanks RegisterBank instances.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Provides the logic to select generic machine instructions.
ISelInfoTy(const LLT *TypeObjects, size_t NumTypeObjects, const PredicateBitset *FeatureBitsets, const ComplexMatcherMemFn *ComplexPredicates, const CustomRendererFn *CustomRenderers)
Representation of each machine instruction.
Constrain an instructions operands according to the instruction description.
virtual bool testImmPredicate_I64(unsigned, int64_t) const
PredicateBitsetImpl()=default
Check a floating point immediate predicate on the specified instruction.
Begin a try-block to attempt a match and jump to OnFail if it is unsuccessful.
LLVM Value Representation.
Render complex operands to the specified instruction.
virtual bool testImmPredicate_APInt(unsigned, const APInt &) const
virtual bool testImmPredicate_APFloat(unsigned, const APFloat &) const
PredicateBitsetImpl(const std::bitset< MaxPredicates > &B)
Add an register to the specified instruction.
Check the instruction has the right number of operands.
Render a G_FCONSTANT operator as a sign-extended immediate.