15 #ifndef LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H 16 #define LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H 27 #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);
409 CoverageInfo = &covinfo;
412 setupGeneratedPerFunctionState(mf);
430 template <
class PredicateBitset,
class ComplexMatcherMemFn,
431 class CustomRendererFn>
434 const PredicateBitset *FeatureBitsets,
435 const ComplexMatcherMemFn *ComplexPredicates,
436 const CustomRendererFn *CustomRenderers)
437 : TypeObjects(TypeObjects),
438 FeatureBitsets(FeatureBitsets),
439 ComplexPredicates(ComplexPredicates),
440 CustomRenderers(CustomRenderers) {
442 for (
size_t I = 0; I < NumTypeObjects; ++
I)
443 TypeIDMap[TypeObjects[I]] = I;
458 template <
class TgtInstructionSelector,
class PredicateBitset,
459 class ComplexMatcherMemFn,
class CustomRendererFn>
460 bool executeMatchTable(
475 "Subclasses must override this with a tablegen-erated function");
479 "Subclasses must override this with a tablegen-erated function");
483 "Subclasses must override this with a tablegen-erated function");
487 "Subclasses must override this with a tablegen-erated function");
494 bool constrainOperandRegToRegClass(
MachineInstr &I,
unsigned OpIdx,
517 #endif // LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H
This class represents lattice values for constants.
Constrain an instruction operand to a register class.
virtual void setupMF(MachineFunction &mf, GISelKnownBits &KB, CodeGenCoverage &covinfo)
Setup per-MF selector state.
std::vector< ComplexRendererFns::value_type > Renderers
const PredicateBitset * FeatureBitsets
unsigned const TargetRegisterInfo * TRI
PredicateBitsetImpl(std::initializer_list< unsigned > Init)
const CustomRendererFn * CustomRenderers
Add an implicit register def to the specified instruction.
const ComplexMatcherMemFn * ComplexPredicates
Merge all memory operands into instruction.
Check a memory operation has the specified atomic ordering.
Holds all the information related to register banks.
virtual const int64_t * getMatchTable() const
const HexagonInstrInfo * TII
Check the specified operands are identical.
Check the specified operand is an MBB.
Check the type of a pointer to any address space.
Render operands to the specified instruction using a custom function.
DenseMap< unsigned, unsigned > TempRegisters
SmallDenseMap< LLT, unsigned, 64 > TypeIDMap
Add an immediate to the specified instruction.
Render operands to the specified instruction using a custom function, reading from a specific operand...
Copy an operand to the specified instruction.
Switch over the LLT on the specified instruction operand.
TargetInstrInfo - Interface to description of machine instruction set.
Add an implicit register use to the specified instruction.
Container class for CodeGen predicate results.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Render sub-operands of complex operands to the specified instruction.
unsigned const MachineRegisterInfo * MRI
virtual bool testMIPredicate_MI(unsigned, const MachineInstr &) const
Copy an operand to the specified instruction.
Check the operand is a specific integer.
Check the instruction has the right number of operands.
virtual void setupGeneratedPerFunctionState(MachineFunction &MF)
Check if the specified operand is safe to fold into the current instruction.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Switch over the opcode on the specified instruction.
Check a floating point immediate predicate on the specified instruction.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Indicates the end of the variable-length MergeInsnID list in a GIR_MergeMemOperands opcode...
Check the minimum alignment of the memory access for the given machine memory operand.
Check the opcode on the specified instruction.
Check a generic C++ instruction predicate.
Constrain an instructions operands according to the instruction description.
Render a G_CONSTANT operator as a sign-extended immediate.
Increment the rule coverage counter.
Check the register bank for the specified operand.
Check the type for the specified operand.
MachineOperand class - Representation of each machine instruction operand.
Check the size of the memory access for the given machine memory operand against the size of an opera...
Class for arbitrary precision integers.
Create a new temporary register that's not constrained.
RegisterBankInfo(RegisterBank **RegBanks, unsigned NumRegBanks)
Create a RegisterBankInfo that can accommodate up to NumRegBanks RegisterBank instances.
Copy an operand to the specified instruction or add a zero register if the operand is a zero immediat...
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.
Render complex operands to the specified instruction.
virtual bool testImmPredicate_I64(unsigned, int64_t) const
Check the specified operand is an Imm.
Fail the current try-block, or completely fail to match if there is no current try-block.
PredicateBitsetImpl()=default
Check the operand is a specific literal integer (i.e.
Check the size of the memory access for the given machine memory operand.
Check an immediate predicate on the specified instruction.
Check the operand is a specific predicate.
Begin a try-block to attempt a match and jump to OnFail if it is unsuccessful.
Add an register to the specified instruction.
Check the operand matches a complex predicate.
Check the address space of the memory access for the given machine memory operand.
LLVM Value Representation.
Record the specified instruction.
Render a G_FCONSTANT operator as a sign-extended immediate.
virtual bool testImmPredicate_APInt(unsigned, const APInt &) const
Check the operand is a specific intrinsic ID.
virtual bool testImmPredicate_APFloat(unsigned, const APFloat &) const
PredicateBitsetImpl(const std::bitset< MaxPredicates > &B)
Keeping track of the number of the GI opcodes. Must be the last entry.
Add a temporary register to the specified instruction.
Check an immediate predicate on the specified instruction via an APInt.