mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
include MipsGenFastISel.inc
Summary: Included this file which is needed to enable tablegen generated functionality for fast mips-isel Test Plan: This has no visible functionality by itself but just adding the include file creates some issues so I have it as a separate patch. Reviewers: dsanders Reviewed By: dsanders Differential Revision: http://reviews.llvm.org/D3812 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210410 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e668525dd1
commit
b8ff7273c6
@ -12,6 +12,7 @@
|
|||||||
#include "MipsISelLowering.h"
|
#include "MipsISelLowering.h"
|
||||||
#include "MipsMachineFunction.h"
|
#include "MipsMachineFunction.h"
|
||||||
#include "MipsSubtarget.h"
|
#include "MipsSubtarget.h"
|
||||||
|
#include "MipsTargetMachine.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
@ -36,11 +37,11 @@ class MipsFastISel final : public FastISel {
|
|||||||
|
|
||||||
/// Subtarget - Keep a pointer to the MipsSubtarget around so that we can
|
/// Subtarget - Keep a pointer to the MipsSubtarget around so that we can
|
||||||
/// make the right decision when generating code for different targets.
|
/// make the right decision when generating code for different targets.
|
||||||
const MipsSubtarget *Subtarget;
|
|
||||||
Module &M;
|
Module &M;
|
||||||
const TargetMachine &TM;
|
const TargetMachine &TM;
|
||||||
const TargetInstrInfo &TII;
|
const TargetInstrInfo &TII;
|
||||||
const TargetLowering &TLI;
|
const TargetLowering &TLI;
|
||||||
|
const MipsSubtarget &Subtarget;
|
||||||
MipsFunctionInfo *MFI;
|
MipsFunctionInfo *MFI;
|
||||||
|
|
||||||
// Convenience variables to avoid some queries.
|
// Convenience variables to avoid some queries.
|
||||||
@ -54,12 +55,12 @@ public:
|
|||||||
: FastISel(funcInfo, libInfo),
|
: FastISel(funcInfo, libInfo),
|
||||||
M(const_cast<Module &>(*funcInfo.Fn->getParent())),
|
M(const_cast<Module &>(*funcInfo.Fn->getParent())),
|
||||||
TM(funcInfo.MF->getTarget()), TII(*TM.getInstrInfo()),
|
TM(funcInfo.MF->getTarget()), TII(*TM.getInstrInfo()),
|
||||||
TLI(*TM.getTargetLowering()) {
|
TLI(*TM.getTargetLowering()),
|
||||||
Subtarget = &TM.getSubtarget<MipsSubtarget>();
|
Subtarget(TM.getSubtarget<MipsSubtarget>()) {
|
||||||
MFI = funcInfo.MF->getInfo<MipsFunctionInfo>();
|
MFI = funcInfo.MF->getInfo<MipsFunctionInfo>();
|
||||||
Context = &funcInfo.Fn->getContext();
|
Context = &funcInfo.Fn->getContext();
|
||||||
TargetSupported = ((Subtarget->getRelocationModel() == Reloc::PIC_) &&
|
TargetSupported = ((Subtarget.getRelocationModel() == Reloc::PIC_) &&
|
||||||
(Subtarget->hasMips32r2() && (Subtarget->isABI_O32())));
|
(Subtarget.hasMips32r2() && (Subtarget.isABI_O32())));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TargetSelectInstruction(const Instruction *I) override;
|
bool TargetSelectInstruction(const Instruction *I) override;
|
||||||
@ -80,6 +81,17 @@ private:
|
|||||||
unsigned MaterializeGV(const GlobalValue *GV, MVT VT);
|
unsigned MaterializeGV(const GlobalValue *GV, MVT VT);
|
||||||
unsigned MaterializeInt(const Constant *C, MVT VT);
|
unsigned MaterializeInt(const Constant *C, MVT VT);
|
||||||
unsigned Materialize32BitInt(int64_t Imm, const TargetRegisterClass *RC);
|
unsigned Materialize32BitInt(int64_t Imm, const TargetRegisterClass *RC);
|
||||||
|
|
||||||
|
// for some reason, this default is not generated by tablegen
|
||||||
|
// so we explicitly generate it here.
|
||||||
|
//
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "MipsGenFastISel.inc"
|
||||||
};
|
};
|
||||||
|
|
||||||
bool MipsFastISel::isTypeLegal(Type *Ty, MVT &VT) {
|
bool MipsFastISel::isTypeLegal(Type *Ty, MVT &VT) {
|
||||||
|
Loading…
Reference in New Issue
Block a user