16 #ifndef LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H
17 #define LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H
24 #include <initializer_list>
31 class MachineInstrBuilder;
33 class MachineRegisterInfo;
35 class TargetInstrInfo;
36 class TargetRegisterClass;
37 class TargetRegisterInfo;
50 template <std::
size_t MaxPredicates>
57 : std::bitset<MaxPredicates>(B) {}
61 std::bitset<MaxPredicates>::set(
I);
222 template <
class PredicateBitset,
class ComplexMatcherMemFn>
234 template <
class TgtInstructionSelector,
class PredicateBitset,
235 class ComplexMatcherMemFn>
242 const PredicateBitset &AvailableFeatures)
const;
276 #endif // LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H
virtual ~InstructionSelector()=default
Check the register bank for the specified operand.
const std::vector< ComplexMatcherMemFn > ComplexPredicates
Merge all memory operands into instruction.
bool constrainSelectedInstRegOperands(MachineInstr &I, const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI) const
Mutate the newly-selected instruction I to constrain its (possibly generic) virtual register operands...
Add an immediate to the specified instruction.
Copy an operand to the specified instruction.
Add an implicit register def to the specified instruction.
PredicateBitsetImpl(std::initializer_list< unsigned > Init)
Holds all the information related to register banks.
const HexagonInstrInfo * TII
Check the operand is a specific intrinsic ID.
Constrain an instructions operands according to the instruction description.
Check the instruction has the right number of operands.
Check the operand matches a complex predicate.
std::function< void(MachineInstrBuilder &)> ComplexRendererFn
TargetInstrInfo - Interface to description of machine instruction set.
Container class for CodeGen predicate results.
unsigned const MachineRegisterInfo * MRI
Record the specified instruction.
bool executeMatchTable(TgtInstructionSelector &ISel, NewMIVector &OutMIs, MatcherState &State, const MatcherInfoTy< PredicateBitset, ComplexMatcherMemFn > &MatcherInfo, const int64_t *MatchTable, const TargetInstrInfo &TII, MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI, const PredicateBitset &AvailableFeatures) const
Execute a given matcher table and return true if the match was successful and false otherwise...
std::vector< ComplexRendererFn > Renderers
bool isOperandImmEqual(const MachineOperand &MO, int64_t Value, const MachineRegisterInfo &MRI) const
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...
virtual bool select(MachineInstr &I) const =0
Select the (possibly generic) instruction I to only use target-specific opcodes.
MatcherState(unsigned MaxRenderers)
MachineOperand class - Representation of each machine instruction operand.
Check the specified operand is an MBB.
RegisterBankInfo(RegisterBank **RegBanks, unsigned NumRegBanks)
Create a RegisterBankInfo that can accommodate up to NumRegBanks RegisterBank instances.
Render complex operands to the specified instruction.
bool isObviouslySafeToFold(MachineInstr &MI) const
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.
Representation of each machine instruction.
Check the operand is a specific integer.
PredicateBitsetImpl()=default
Constrain an instruction operand to a register class.
const PredicateBitset * FeatureBitsets
Add an implicit register use to the specified instruction.
Check the opcode on the specified instruction.
Check the operand is a specific literal integer (i.e.
LLVM Value Representation.
bool constrainOperandRegToRegClass(MachineInstr &I, unsigned OpIdx, const TargetRegisterClass &RC, const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI) const
Constrain a register operand of an instruction I to a specified register class.
PredicateBitsetImpl(const std::bitset< MaxPredicates > &B)
Copy an operand to the specified instruction.
Add an register to the specified instruction.
Check the type for the specified operand.