19 #define DEBUG_TYPE "mips-isel" 25 #define GET_GLOBALISEL_PREDICATE_BITSET 26 #include "MipsGenGlobalISel.inc" 27 #undef GET_GLOBALISEL_PREDICATE_BITSET 46 #define GET_GLOBALISEL_PREDICATES_DECL 47 #include "MipsGenGlobalISel.inc" 48 #undef GET_GLOBALISEL_PREDICATES_DECL 50 #define GET_GLOBALISEL_TEMPORARIES_DECL 51 #include "MipsGenGlobalISel.inc" 52 #undef GET_GLOBALISEL_TEMPORARIES_DECL 57 #define GET_GLOBALISEL_IMPL 58 #include "MipsGenGlobalISel.inc" 59 #undef GET_GLOBALISEL_IMPL 61 MipsInstructionSelector::MipsInstructionSelector(
65 TRI(*STI.getRegisterInfo()), RBI(RBI),
68 #include
"MipsGenGlobalISel.inc" 71 #include
"MipsGenGlobalISel.inc" 80 if (TargetRegisterInfo::isPhysicalRegister(DstReg))
107 if (selectImpl(I, CoverageInfo)) {
112 using namespace TargetOpcode;
122 case G_FRAME_INDEX: {
132 const unsigned DestRegBank = RBI.
getRegBank(DestReg, MRI, TRI)->
getID();
135 if (DestRegBank != Mips::GPRBRegBankID || OpSize != 32)
138 const unsigned NewOpc = I.
getOpcode() == G_STORE ? Mips::SW : Mips::LW;
169 case G_GLOBAL_VALUE: {
209 return new MipsInstructionSelector(TM, Subtarget, RBI);
Compute iterated dominance frontiers using a linear time algorithm.
void setTargetFlags(unsigned F)
#define GET_GLOBALISEL_TEMPORARIES_INIT
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
unsigned getReg() const
getReg - Returns the register number.
LLT getType(unsigned Reg) const
Get the low-level type of Reg or LLT{} if Reg is not a generic (target independent) virtual register...
unsigned const TargetRegisterInfo * TRI
const MachineInstrBuilder & addGlobalAddress(const GlobalValue *GV, int64_t Offset=0, unsigned char TargetFlags=0) const
Holds all the information related to register banks.
const HexagonInstrInfo * TII
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
static StringRef getName(Value *V)
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
This file declares the targeting of the RegisterBankInfo class for Mips.
const APInt & getValue() const
Return the constant as an APInt value reference.
InstructionSelector * createMipsInstructionSelector(const MipsTargetMachine &, MipsSubtarget &, MipsRegisterBankInfo &)
TargetInstrInfo - Interface to description of machine instruction set.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
unsigned const MachineRegisterInfo * MRI
const GlobalValue * getGlobal() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
StringRef getName(unsigned Opcode) const
Returns the name for the instructions with the given opcode.
mmo_iterator memoperands_begin() const
Access to memory operands of the instruction.
RegisterBank & getRegBank(unsigned ID)
Get the register bank identified by ID.
unsigned getSizeInBits() const
Returns the total size of the type. Must only be called on sized types.
This class provides the information for the target register banks.
bool constrainSelectedInstRegOperands(MachineInstr &I, const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI)
Mutate the newly-selected instruction I to constrain its (possibly generic) virtual register operands...
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
const MachineBasicBlock * getParent() 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.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
bool isPositionIndependent() const
uint64_t getLimitedValue(uint64_t Limit=UINT64_MAX) const
If this value is smaller than the specified limit, return it, otherwise return the limit value...
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
static const TargetRegisterClass * constrainGenericRegister(unsigned Reg, const TargetRegisterClass &RC, MachineRegisterInfo &MRI)
Constrain the (possibly generic) virtual register Reg to RC.
#define GET_GLOBALISEL_PREDICATES_INIT
bool isPreISelGenericOpcode(unsigned Opcode)
Check whether the given Opcode is a generic opcode that is not supposed to appear after ISel...
static bool selectCopy(MachineInstr &I, const TargetInstrInfo &TII, MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI)
const MachineOperand & getOperand(unsigned i) const
const ConstantInt * getCImm() const
unsigned createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
unsigned getID() const
Get the identifier of this register bank.