2014-04-18 06:15:34 +08:00
|
|
|
//===-- MipsastISel.cpp - Mips FastISel implementation
|
|
|
|
//---------------------===//
|
|
|
|
|
|
|
|
#include "llvm/CodeGen/FunctionLoweringInfo.h"
|
|
|
|
#include "llvm/CodeGen/FastISel.h"
|
2014-04-30 01:57:50 +08:00
|
|
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
2014-05-02 04:39:21 +08:00
|
|
|
#include "llvm/IR/GlobalAlias.h"
|
|
|
|
#include "llvm/IR/GlobalVariable.h"
|
2014-04-30 01:57:50 +08:00
|
|
|
#include "llvm/Target/TargetInstrInfo.h"
|
2014-04-18 06:15:34 +08:00
|
|
|
#include "llvm/Target/TargetLibraryInfo.h"
|
2014-05-02 04:39:21 +08:00
|
|
|
#include "MipsRegisterInfo.h"
|
2014-04-18 06:15:34 +08:00
|
|
|
#include "MipsISelLowering.h"
|
2014-04-30 01:57:50 +08:00
|
|
|
#include "MipsMachineFunction.h"
|
|
|
|
#include "MipsSubtarget.h"
|
2014-06-08 10:08:43 +08:00
|
|
|
#include "MipsTargetMachine.h"
|
2014-04-18 06:15:34 +08:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2014-05-02 04:39:21 +08:00
|
|
|
// All possible address modes.
|
|
|
|
typedef struct Address {
|
|
|
|
enum { RegBase, FrameIndexBase } BaseType;
|
|
|
|
|
|
|
|
union {
|
|
|
|
unsigned Reg;
|
|
|
|
int FI;
|
|
|
|
} Base;
|
|
|
|
|
|
|
|
int64_t Offset;
|
|
|
|
|
|
|
|
// Innocuous defaults for our address.
|
|
|
|
Address() : BaseType(RegBase), Offset(0) { Base.Reg = 0; }
|
|
|
|
} Address;
|
|
|
|
|
2014-04-18 06:15:34 +08:00
|
|
|
class MipsFastISel final : public FastISel {
|
|
|
|
|
2014-04-30 01:57:50 +08:00
|
|
|
/// Subtarget - Keep a pointer to the MipsSubtarget around so that we can
|
|
|
|
/// make the right decision when generating code for different targets.
|
|
|
|
Module &M;
|
|
|
|
const TargetMachine &TM;
|
|
|
|
const TargetInstrInfo &TII;
|
|
|
|
const TargetLowering &TLI;
|
2014-07-11 01:26:51 +08:00
|
|
|
const MipsSubtarget *Subtarget;
|
2014-04-30 01:57:50 +08:00
|
|
|
MipsFunctionInfo *MFI;
|
|
|
|
|
|
|
|
// Convenience variables to avoid some queries.
|
|
|
|
LLVMContext *Context;
|
|
|
|
|
|
|
|
bool TargetSupported;
|
|
|
|
|
2014-04-18 06:15:34 +08:00
|
|
|
public:
|
|
|
|
explicit MipsFastISel(FunctionLoweringInfo &funcInfo,
|
|
|
|
const TargetLibraryInfo *libInfo)
|
2014-04-30 01:57:50 +08:00
|
|
|
: FastISel(funcInfo, libInfo),
|
|
|
|
M(const_cast<Module &>(*funcInfo.Fn->getParent())),
|
2014-08-05 05:25:23 +08:00
|
|
|
TM(funcInfo.MF->getTarget()),
|
|
|
|
TII(*TM.getSubtargetImpl()->getInstrInfo()),
|
|
|
|
TLI(*TM.getSubtargetImpl()->getTargetLowering()),
|
2014-07-11 01:26:51 +08:00
|
|
|
Subtarget(&TM.getSubtarget<MipsSubtarget>()) {
|
2014-04-30 01:57:50 +08:00
|
|
|
MFI = funcInfo.MF->getInfo<MipsFunctionInfo>();
|
|
|
|
Context = &funcInfo.Fn->getContext();
|
2014-07-11 01:26:51 +08:00
|
|
|
TargetSupported = ((Subtarget->getRelocationModel() == Reloc::PIC_) &&
|
|
|
|
(Subtarget->hasMips32r2() && (Subtarget->isABI_O32())));
|
2014-04-30 01:57:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool TargetSelectInstruction(const Instruction *I) override;
|
2014-05-02 04:39:21 +08:00
|
|
|
unsigned TargetMaterializeConstant(const Constant *C) override;
|
|
|
|
|
|
|
|
bool ComputeAddress(const Value *Obj, Address &Addr);
|
2014-04-30 01:57:50 +08:00
|
|
|
|
2014-05-02 04:39:21 +08:00
|
|
|
private:
|
2014-06-17 06:05:47 +08:00
|
|
|
bool EmitLoad(MVT VT, unsigned &ResultReg, Address &Addr,
|
|
|
|
unsigned Alignment = 0);
|
2014-05-02 04:39:21 +08:00
|
|
|
bool EmitStore(MVT VT, unsigned SrcReg, Address &Addr,
|
|
|
|
unsigned Alignment = 0);
|
2014-06-17 06:05:47 +08:00
|
|
|
bool SelectLoad(const Instruction *I);
|
2014-04-30 01:57:50 +08:00
|
|
|
bool SelectRet(const Instruction *I);
|
2014-05-02 04:39:21 +08:00
|
|
|
bool SelectStore(const Instruction *I);
|
|
|
|
|
|
|
|
bool isTypeLegal(Type *Ty, MVT &VT);
|
|
|
|
bool isLoadTypeLegal(Type *Ty, MVT &VT);
|
|
|
|
|
|
|
|
unsigned MaterializeFP(const ConstantFP *CFP, MVT VT);
|
|
|
|
unsigned MaterializeGV(const GlobalValue *GV, MVT VT);
|
|
|
|
unsigned MaterializeInt(const Constant *C, MVT VT);
|
2014-05-16 05:54:15 +08:00
|
|
|
unsigned Materialize32BitInt(int64_t Imm, const TargetRegisterClass *RC);
|
2014-06-08 10:08:43 +08:00
|
|
|
|
|
|
|
// for some reason, this default is not generated by tablegen
|
2014-06-08 11:04:42 +08:00
|
|
|
// so we explicitly generate it here.
|
2014-06-08 10:08:43 +08:00
|
|
|
//
|
|
|
|
unsigned FastEmitInst_riir(uint64_t inst, const TargetRegisterClass *RC,
|
|
|
|
unsigned Op0, bool Op0IsKill, uint64_t imm1,
|
|
|
|
uint64_t imm2, unsigned Op3, bool Op3IsKill) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-06-08 11:04:42 +08:00
|
|
|
MachineInstrBuilder EmitInst(unsigned Opc) {
|
|
|
|
return BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc));
|
|
|
|
}
|
|
|
|
|
|
|
|
MachineInstrBuilder EmitInst(unsigned Opc, unsigned DstReg) {
|
|
|
|
return BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc),
|
|
|
|
DstReg);
|
|
|
|
}
|
|
|
|
|
|
|
|
MachineInstrBuilder EmitInstStore(unsigned Opc, unsigned SrcReg,
|
|
|
|
unsigned MemReg, int64_t MemOffset) {
|
|
|
|
return EmitInst(Opc).addReg(SrcReg).addReg(MemReg).addImm(MemOffset);
|
|
|
|
}
|
|
|
|
|
2014-06-17 06:05:47 +08:00
|
|
|
MachineInstrBuilder EmitInstLoad(unsigned Opc, unsigned DstReg,
|
2014-08-08 06:09:01 +08:00
|
|
|
unsigned MemReg, int64_t MemOffset) {
|
2014-06-17 06:05:47 +08:00
|
|
|
return EmitInst(Opc, DstReg).addReg(MemReg).addImm(MemOffset);
|
|
|
|
}
|
|
|
|
|
2014-06-08 10:08:43 +08:00
|
|
|
#include "MipsGenFastISel.inc"
|
2014-04-18 06:15:34 +08:00
|
|
|
};
|
2014-04-30 01:57:50 +08:00
|
|
|
|
2014-05-02 04:39:21 +08:00
|
|
|
bool MipsFastISel::isTypeLegal(Type *Ty, MVT &VT) {
|
|
|
|
EVT evt = TLI.getValueType(Ty, true);
|
|
|
|
// Only handle simple types.
|
|
|
|
if (evt == MVT::Other || !evt.isSimple())
|
|
|
|
return false;
|
|
|
|
VT = evt.getSimpleVT();
|
|
|
|
|
|
|
|
// Handle all legal types, i.e. a register that will directly hold this
|
|
|
|
// value.
|
|
|
|
return TLI.isTypeLegal(VT);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MipsFastISel::isLoadTypeLegal(Type *Ty, MVT &VT) {
|
|
|
|
if (isTypeLegal(Ty, VT))
|
|
|
|
return true;
|
|
|
|
// We will extend this in a later patch:
|
|
|
|
// If this is a type than can be sign or zero-extended to a basic operation
|
|
|
|
// go ahead and accept it now.
|
2014-06-17 06:05:47 +08:00
|
|
|
if (VT == MVT::i8 || VT == MVT::i16)
|
|
|
|
return true;
|
2014-05-02 04:39:21 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MipsFastISel::ComputeAddress(const Value *Obj, Address &Addr) {
|
|
|
|
// This construct looks a big awkward but it is how other ports handle this
|
|
|
|
// and as this function is more fully completed, these cases which
|
|
|
|
// return false will have additional code in them.
|
|
|
|
//
|
|
|
|
if (isa<Instruction>(Obj))
|
|
|
|
return false;
|
|
|
|
else if (isa<ConstantExpr>(Obj))
|
|
|
|
return false;
|
|
|
|
Addr.Base.Reg = getRegForValue(Obj);
|
|
|
|
return Addr.Base.Reg != 0;
|
|
|
|
}
|
|
|
|
|
2014-06-17 06:05:47 +08:00
|
|
|
bool MipsFastISel::EmitLoad(MVT VT, unsigned &ResultReg, Address &Addr,
|
|
|
|
unsigned Alignment) {
|
|
|
|
//
|
|
|
|
// more cases will be handled here in following patches.
|
|
|
|
//
|
|
|
|
unsigned Opc;
|
|
|
|
switch (VT.SimpleTy) {
|
|
|
|
case MVT::i32: {
|
|
|
|
ResultReg = createResultReg(&Mips::GPR32RegClass);
|
|
|
|
Opc = Mips::LW;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MVT::i16: {
|
|
|
|
ResultReg = createResultReg(&Mips::GPR32RegClass);
|
|
|
|
Opc = Mips::LHu;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MVT::i8: {
|
|
|
|
ResultReg = createResultReg(&Mips::GPR32RegClass);
|
|
|
|
Opc = Mips::LBu;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MVT::f32: {
|
|
|
|
ResultReg = createResultReg(&Mips::FGR32RegClass);
|
|
|
|
Opc = Mips::LWC1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MVT::f64: {
|
|
|
|
ResultReg = createResultReg(&Mips::AFGR64RegClass);
|
|
|
|
Opc = Mips::LDC1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
EmitInstLoad(Opc, ResultReg, Addr.Base.Reg, Addr.Offset);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-05-02 04:39:21 +08:00
|
|
|
// Materialize a constant into a register, and return the register
|
|
|
|
// number (or zero if we failed to handle it).
|
|
|
|
unsigned MipsFastISel::TargetMaterializeConstant(const Constant *C) {
|
|
|
|
EVT CEVT = TLI.getValueType(C->getType(), true);
|
|
|
|
|
|
|
|
// Only handle simple types.
|
|
|
|
if (!CEVT.isSimple())
|
|
|
|
return 0;
|
|
|
|
MVT VT = CEVT.getSimpleVT();
|
|
|
|
|
|
|
|
if (const ConstantFP *CFP = dyn_cast<ConstantFP>(C))
|
|
|
|
return MaterializeFP(CFP, VT);
|
|
|
|
else if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
|
|
|
|
return MaterializeGV(GV, VT);
|
|
|
|
else if (isa<ConstantInt>(C))
|
|
|
|
return MaterializeInt(C, VT);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MipsFastISel::EmitStore(MVT VT, unsigned SrcReg, Address &Addr,
|
|
|
|
unsigned Alignment) {
|
|
|
|
//
|
|
|
|
// more cases will be handled here in following patches.
|
|
|
|
//
|
2014-06-17 06:05:47 +08:00
|
|
|
unsigned Opc;
|
|
|
|
switch (VT.SimpleTy) {
|
|
|
|
case MVT::i8:
|
|
|
|
Opc = Mips::SB;
|
|
|
|
break;
|
|
|
|
case MVT::i16:
|
|
|
|
Opc = Mips::SH;
|
|
|
|
break;
|
|
|
|
case MVT::i32:
|
|
|
|
Opc = Mips::SW;
|
|
|
|
break;
|
|
|
|
case MVT::f32:
|
|
|
|
Opc = Mips::SWC1;
|
|
|
|
break;
|
|
|
|
case MVT::f64:
|
|
|
|
Opc = Mips::SDC1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
EmitInstStore(Opc, SrcReg, Addr.Base.Reg, Addr.Offset);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MipsFastISel::SelectLoad(const Instruction *I) {
|
|
|
|
// Atomic loads need special handling.
|
|
|
|
if (cast<LoadInst>(I)->isAtomic())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Verify we have a legal type before going any further.
|
|
|
|
MVT VT;
|
|
|
|
if (!isLoadTypeLegal(I->getType(), VT))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// See if we can handle this address.
|
|
|
|
Address Addr;
|
|
|
|
if (!ComputeAddress(I->getOperand(0), Addr))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
unsigned ResultReg;
|
|
|
|
if (!EmitLoad(VT, ResultReg, Addr, cast<LoadInst>(I)->getAlignment()))
|
2014-05-02 04:39:21 +08:00
|
|
|
return false;
|
2014-06-17 06:05:47 +08:00
|
|
|
UpdateValueMap(I, ResultReg);
|
2014-05-02 04:39:21 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MipsFastISel::SelectStore(const Instruction *I) {
|
|
|
|
Value *Op0 = I->getOperand(0);
|
|
|
|
unsigned SrcReg = 0;
|
|
|
|
|
|
|
|
// Atomic stores need special handling.
|
|
|
|
if (cast<StoreInst>(I)->isAtomic())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Verify we have a legal type before going any further.
|
|
|
|
MVT VT;
|
|
|
|
if (!isLoadTypeLegal(I->getOperand(0)->getType(), VT))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Get the value to be stored into a register.
|
|
|
|
SrcReg = getRegForValue(Op0);
|
|
|
|
if (SrcReg == 0)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// See if we can handle this address.
|
|
|
|
Address Addr;
|
|
|
|
if (!ComputeAddress(I->getOperand(1), Addr))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!EmitStore(VT, SrcReg, Addr, cast<StoreInst>(I)->getAlignment()))
|
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-04-30 01:57:50 +08:00
|
|
|
bool MipsFastISel::SelectRet(const Instruction *I) {
|
|
|
|
const ReturnInst *Ret = cast<ReturnInst>(I);
|
|
|
|
|
|
|
|
if (!FuncInfo.CanLowerReturn)
|
|
|
|
return false;
|
|
|
|
if (Ret->getNumOperands() > 0) {
|
|
|
|
return false;
|
|
|
|
}
|
2014-06-08 11:04:42 +08:00
|
|
|
EmitInst(Mips::RetRA);
|
2014-04-30 01:57:50 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool MipsFastISel::TargetSelectInstruction(const Instruction *I) {
|
|
|
|
if (!TargetSupported)
|
|
|
|
return false;
|
|
|
|
switch (I->getOpcode()) {
|
|
|
|
default:
|
|
|
|
break;
|
2014-06-17 06:05:47 +08:00
|
|
|
case Instruction::Load:
|
|
|
|
return SelectLoad(I);
|
2014-05-02 04:39:21 +08:00
|
|
|
case Instruction::Store:
|
|
|
|
return SelectStore(I);
|
2014-04-30 01:57:50 +08:00
|
|
|
case Instruction::Ret:
|
|
|
|
return SelectRet(I);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2014-04-18 06:15:34 +08:00
|
|
|
}
|
|
|
|
|
2014-05-02 04:39:21 +08:00
|
|
|
unsigned MipsFastISel::MaterializeFP(const ConstantFP *CFP, MVT VT) {
|
2014-06-11 00:45:44 +08:00
|
|
|
int64_t Imm = CFP->getValueAPF().bitcastToAPInt().getZExtValue();
|
|
|
|
if (VT == MVT::f32) {
|
|
|
|
const TargetRegisterClass *RC = &Mips::FGR32RegClass;
|
|
|
|
unsigned DestReg = createResultReg(RC);
|
|
|
|
unsigned TempReg = Materialize32BitInt(Imm, &Mips::GPR32RegClass);
|
|
|
|
EmitInst(Mips::MTC1, DestReg).addReg(TempReg);
|
|
|
|
return DestReg;
|
|
|
|
} else if (VT == MVT::f64) {
|
|
|
|
const TargetRegisterClass *RC = &Mips::AFGR64RegClass;
|
|
|
|
unsigned DestReg = createResultReg(RC);
|
|
|
|
unsigned TempReg1 = Materialize32BitInt(Imm >> 32, &Mips::GPR32RegClass);
|
|
|
|
unsigned TempReg2 =
|
|
|
|
Materialize32BitInt(Imm & 0xFFFFFFFF, &Mips::GPR32RegClass);
|
|
|
|
EmitInst(Mips::BuildPairF64, DestReg).addReg(TempReg2).addReg(TempReg1);
|
|
|
|
return DestReg;
|
|
|
|
}
|
2014-05-02 04:39:21 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned MipsFastISel::MaterializeGV(const GlobalValue *GV, MVT VT) {
|
|
|
|
// For now 32-bit only.
|
|
|
|
if (VT != MVT::i32)
|
|
|
|
return 0;
|
|
|
|
const TargetRegisterClass *RC = &Mips::GPR32RegClass;
|
|
|
|
unsigned DestReg = createResultReg(RC);
|
|
|
|
const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
|
|
|
|
bool IsThreadLocal = GVar && GVar->isThreadLocal();
|
|
|
|
// TLS not supported at this time.
|
|
|
|
if (IsThreadLocal)
|
|
|
|
return 0;
|
2014-06-08 11:04:42 +08:00
|
|
|
EmitInst(Mips::LW, DestReg).addReg(MFI->getGlobalBaseReg()).addGlobalAddress(
|
|
|
|
GV, 0, MipsII::MO_GOT);
|
2014-08-08 06:09:01 +08:00
|
|
|
if ((GV->hasInternalLinkage() ||
|
|
|
|
(GV->hasLocalLinkage() && !isa<Function>(GV)))) {
|
|
|
|
unsigned TempReg = createResultReg(RC);
|
|
|
|
EmitInst(Mips::ADDiu, TempReg).addReg(DestReg).addGlobalAddress(
|
|
|
|
GV, 0, MipsII::MO_ABS_LO);
|
|
|
|
DestReg = TempReg;
|
|
|
|
}
|
2014-05-02 04:39:21 +08:00
|
|
|
return DestReg;
|
|
|
|
}
|
2014-08-08 06:09:01 +08:00
|
|
|
|
2014-05-02 04:39:21 +08:00
|
|
|
unsigned MipsFastISel::MaterializeInt(const Constant *C, MVT VT) {
|
2014-05-16 05:54:15 +08:00
|
|
|
if (VT != MVT::i32 && VT != MVT::i16 && VT != MVT::i8 && VT != MVT::i1)
|
2014-05-02 04:39:21 +08:00
|
|
|
return 0;
|
|
|
|
const TargetRegisterClass *RC = &Mips::GPR32RegClass;
|
|
|
|
const ConstantInt *CI = cast<ConstantInt>(C);
|
2014-05-16 05:54:15 +08:00
|
|
|
int64_t Imm;
|
2014-08-08 06:09:01 +08:00
|
|
|
if ((VT != MVT::i1) && CI->isNegative())
|
2014-05-16 05:54:15 +08:00
|
|
|
Imm = CI->getSExtValue();
|
|
|
|
else
|
|
|
|
Imm = CI->getZExtValue();
|
|
|
|
return Materialize32BitInt(Imm, RC);
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned MipsFastISel::Materialize32BitInt(int64_t Imm,
|
|
|
|
const TargetRegisterClass *RC) {
|
|
|
|
unsigned ResultReg = createResultReg(RC);
|
|
|
|
|
|
|
|
if (isInt<16>(Imm)) {
|
2014-05-02 04:39:21 +08:00
|
|
|
unsigned Opc = Mips::ADDiu;
|
2014-06-08 11:04:42 +08:00
|
|
|
EmitInst(Opc, ResultReg).addReg(Mips::ZERO).addImm(Imm);
|
2014-05-16 05:54:15 +08:00
|
|
|
return ResultReg;
|
|
|
|
} else if (isUInt<16>(Imm)) {
|
2014-06-08 11:04:42 +08:00
|
|
|
EmitInst(Mips::ORi, ResultReg).addReg(Mips::ZERO).addImm(Imm);
|
2014-05-16 05:54:15 +08:00
|
|
|
return ResultReg;
|
2014-05-02 04:39:21 +08:00
|
|
|
}
|
2014-05-16 05:54:15 +08:00
|
|
|
unsigned Lo = Imm & 0xFFFF;
|
|
|
|
unsigned Hi = (Imm >> 16) & 0xFFFF;
|
|
|
|
if (Lo) {
|
|
|
|
// Both Lo and Hi have nonzero bits.
|
|
|
|
unsigned TmpReg = createResultReg(RC);
|
2014-06-08 11:04:42 +08:00
|
|
|
EmitInst(Mips::LUi, TmpReg).addImm(Hi);
|
|
|
|
EmitInst(Mips::ORi, ResultReg).addReg(TmpReg).addImm(Lo);
|
2014-05-16 05:54:15 +08:00
|
|
|
} else {
|
2014-06-08 11:04:42 +08:00
|
|
|
EmitInst(Mips::LUi, ResultReg).addImm(Hi);
|
2014-05-16 05:54:15 +08:00
|
|
|
}
|
|
|
|
return ResultReg;
|
2014-05-02 04:39:21 +08:00
|
|
|
}
|
|
|
|
|
2014-04-18 06:15:34 +08:00
|
|
|
namespace llvm {
|
|
|
|
FastISel *Mips::createFastISel(FunctionLoweringInfo &funcInfo,
|
|
|
|
const TargetLibraryInfo *libInfo) {
|
|
|
|
return new MipsFastISel(funcInfo, libInfo);
|
|
|
|
}
|
|
|
|
}
|