#include "MCTargetDesc/MipsInstPrinter.h"
#include "MipsMachineFunction.h"
#include "MipsRegisterBankInfo.h"
#include "MipsTargetMachine.h"
#include "llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/IR/IntrinsicsMips.h"
#define DEBUG_TYPE …
usingnamespacellvm;
namespace {
#define GET_GLOBALISEL_PREDICATE_BITSET
#include "MipsGenGlobalISel.inc"
#undef GET_GLOBALISEL_PREDICATE_BITSET
class MipsInstructionSelector : public InstructionSelector { … };
}
#define GET_GLOBALISEL_IMPL
#include "MipsGenGlobalISel.inc"
#undef GET_GLOBALISEL_IMPL
MipsInstructionSelector::MipsInstructionSelector(
const MipsTargetMachine &TM, const MipsSubtarget &STI,
const MipsRegisterBankInfo &RBI)
: … { … }
bool MipsInstructionSelector::isRegInGprb(Register Reg,
MachineRegisterInfo &MRI) const { … }
bool MipsInstructionSelector::isRegInFprb(Register Reg,
MachineRegisterInfo &MRI) const { … }
bool MipsInstructionSelector::selectCopy(MachineInstr &I,
MachineRegisterInfo &MRI) const { … }
const TargetRegisterClass *MipsInstructionSelector::getRegClassForTypeOnBank(
Register Reg, MachineRegisterInfo &MRI) const { … }
bool MipsInstructionSelector::materialize32BitImm(Register DestReg, APInt Imm,
MachineIRBuilder &B) const { … }
unsigned
MipsInstructionSelector::selectLoadStoreOpCode(MachineInstr &I,
MachineRegisterInfo &MRI) const { … }
bool MipsInstructionSelector::buildUnalignedStore(
MachineInstr &I, unsigned Opc, MachineOperand &BaseAddr, unsigned Offset,
MachineMemOperand *MMO) const { … }
bool MipsInstructionSelector::buildUnalignedLoad(
MachineInstr &I, unsigned Opc, Register Dest, MachineOperand &BaseAddr,
unsigned Offset, Register TiedDest, MachineMemOperand *MMO) const { … }
bool MipsInstructionSelector::select(MachineInstr &I) { … }
namespace llvm {
InstructionSelector *
createMipsInstructionSelector(const MipsTargetMachine &TM,
const MipsSubtarget &Subtarget,
const MipsRegisterBankInfo &RBI) { … }
}