mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Remove unused member functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76960 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
050578fb4a
commit
23ed52752b
@ -284,18 +284,6 @@ public:
|
||||
assert(0 && "Target didn't implement TargetInstrInfo::storeRegToStackSlot!");
|
||||
}
|
||||
|
||||
/// storeRegToAddr - Store the specified register of the given register class
|
||||
/// to the specified address. The store instruction is to be added to the
|
||||
/// given machine basic block before the specified machine instruction. If
|
||||
/// isKill is true, the register operand is the last use and must be marked
|
||||
/// kill.
|
||||
virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const {
|
||||
assert(0 && "Target didn't implement TargetInstrInfo::storeRegToAddr!");
|
||||
}
|
||||
|
||||
/// loadRegFromStackSlot - Load the specified register of the given register
|
||||
/// class from the specified stack frame index. The load instruction is to be
|
||||
/// added to the given machine basic block before the specified machine
|
||||
@ -306,16 +294,6 @@ public:
|
||||
const TargetRegisterClass *RC) const {
|
||||
assert(0 && "Target didn't implement TargetInstrInfo::loadRegFromStackSlot!");
|
||||
}
|
||||
|
||||
/// loadRegFromAddr - Load the specified register of the given register class
|
||||
/// class from the specified address. The load instruction is to be added to
|
||||
/// the given machine basic block before the specified machine instruction.
|
||||
virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const {
|
||||
assert(0 && "Target didn't implement TargetInstrInfo::loadRegFromAddr!");
|
||||
}
|
||||
|
||||
/// spillCalleeSavedRegisters - Issues instruction(s) to spill all callee
|
||||
/// saved registers and returns true if it isn't possible / profitable to do
|
||||
|
@ -631,35 +631,6 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARMBaseInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
|
||||
bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const{
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
unsigned Opc = 0;
|
||||
if (RC == ARM::GPRRegisterClass) {
|
||||
if ((Addr.size() > 1) && Addr[1].isImm())
|
||||
Opc = getOpcode(ARMII::STRri);
|
||||
else
|
||||
Opc = getOpcode(ARMII::STRrr);
|
||||
} else if (RC == ARM::DPRRegisterClass) {
|
||||
Opc = ARM::FSTD;
|
||||
} else {
|
||||
assert(RC == ARM::SPRRegisterClass && "Unknown regclass!");
|
||||
Opc = ARM::FSTS;
|
||||
}
|
||||
|
||||
MachineInstrBuilder MIB =
|
||||
BuildMI(MF, DL, get(Opc)).addReg(SrcReg, getKillRegState(isKill));
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
AddDefaultPred(MIB);
|
||||
NewMIs.push_back(MIB);
|
||||
return;
|
||||
}
|
||||
|
||||
void ARMBaseInstrInfo::
|
||||
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FI,
|
||||
@ -680,33 +651,6 @@ loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
}
|
||||
}
|
||||
|
||||
void ARMBaseInstrInfo::
|
||||
loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const {
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
unsigned Opc = 0;
|
||||
if (RC == ARM::GPRRegisterClass) {
|
||||
if ((Addr.size() > 1) && Addr[1].isImm())
|
||||
Opc = getOpcode(ARMII::LDRri);
|
||||
else
|
||||
Opc = getOpcode(ARMII::LDRrr);
|
||||
} else if (RC == ARM::DPRRegisterClass) {
|
||||
Opc = ARM::FLDD;
|
||||
} else {
|
||||
assert(RC == ARM::SPRRegisterClass && "Unknown regclass!");
|
||||
Opc = ARM::FLDS;
|
||||
}
|
||||
|
||||
MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc), DestReg);
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
AddDefaultPred(MIB);
|
||||
NewMIs.push_back(MIB);
|
||||
return;
|
||||
}
|
||||
|
||||
MachineInstr *ARMBaseInstrInfo::
|
||||
foldMemoryOperandImpl(MachineFunction &MF, MachineInstr *MI,
|
||||
const SmallVectorImpl<unsigned> &Ops, int FI) const {
|
||||
|
@ -279,21 +279,11 @@ public:
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
virtual bool canFoldMemoryOperand(const MachineInstr *MI,
|
||||
const SmallVectorImpl<unsigned> &Ops) const;
|
||||
|
||||
|
@ -205,28 +205,6 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
}
|
||||
}
|
||||
|
||||
void Thumb1InstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
|
||||
bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const{
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
unsigned Opc = 0;
|
||||
|
||||
assert(RC == ARM::GPRRegisterClass && "Unknown regclass!");
|
||||
if (RC == ARM::GPRRegisterClass) {
|
||||
Opc = Addr[0].isFI() ? ARM::tSpill : ARM::tSTR;
|
||||
}
|
||||
|
||||
MachineInstrBuilder MIB =
|
||||
BuildMI(MF, DL, get(Opc)).addReg(SrcReg, getKillRegState(isKill));
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
AddDefaultPred(MIB);
|
||||
NewMIs.push_back(MIB);
|
||||
return;
|
||||
}
|
||||
|
||||
void Thumb1InstrInfo::
|
||||
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FI,
|
||||
@ -242,26 +220,6 @@ loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
}
|
||||
}
|
||||
|
||||
void Thumb1InstrInfo::
|
||||
loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const {
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
unsigned Opc = 0;
|
||||
|
||||
if (RC == ARM::GPRRegisterClass) {
|
||||
Opc = Addr[0].isFI() ? ARM::tRestore : ARM::tLDR;
|
||||
}
|
||||
|
||||
MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc), DestReg);
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
AddDefaultPred(MIB);
|
||||
NewMIs.push_back(MIB);
|
||||
return;
|
||||
}
|
||||
|
||||
bool Thumb1InstrInfo::
|
||||
spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
|
@ -68,21 +68,11 @@ public:
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
bool canFoldMemoryOperand(const MachineInstr *MI,
|
||||
const SmallVectorImpl<unsigned> &Ops) const;
|
||||
|
||||
|
@ -204,28 +204,6 @@ AlphaInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
llvm_unreachable("Unhandled register class");
|
||||
}
|
||||
|
||||
void AlphaInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
|
||||
bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const {
|
||||
unsigned Opc = 0;
|
||||
if (RC == Alpha::F4RCRegisterClass)
|
||||
Opc = Alpha::STS;
|
||||
else if (RC == Alpha::F8RCRegisterClass)
|
||||
Opc = Alpha::STT;
|
||||
else if (RC == Alpha::GPRCRegisterClass)
|
||||
Opc = Alpha::STQ;
|
||||
else
|
||||
llvm_unreachable("Unhandled register class");
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
MachineInstrBuilder MIB =
|
||||
BuildMI(MF, DL, get(Opc)).addReg(SrcReg, getKillRegState(isKill));
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
NewMIs.push_back(MIB);
|
||||
}
|
||||
|
||||
void
|
||||
AlphaInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
@ -249,27 +227,6 @@ AlphaInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
llvm_unreachable("Unhandled register class");
|
||||
}
|
||||
|
||||
void AlphaInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const {
|
||||
unsigned Opc = 0;
|
||||
if (RC == Alpha::F4RCRegisterClass)
|
||||
Opc = Alpha::LDS;
|
||||
else if (RC == Alpha::F8RCRegisterClass)
|
||||
Opc = Alpha::LDT;
|
||||
else if (RC == Alpha::GPRCRegisterClass)
|
||||
Opc = Alpha::LDQ;
|
||||
else
|
||||
llvm_unreachable("Unhandled register class");
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
MachineInstrBuilder MIB =
|
||||
BuildMI(MF, DL, get(Opc), DestReg);
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
NewMIs.push_back(MIB);
|
||||
}
|
||||
|
||||
MachineInstr *AlphaInstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
|
||||
MachineInstr *MI,
|
||||
const SmallVectorImpl<unsigned> &Ops,
|
||||
|
@ -54,20 +54,10 @@ public:
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
virtual MachineInstr* foldMemoryOperandImpl(MachineFunction &MF,
|
||||
MachineInstr* MI,
|
||||
|
@ -323,41 +323,6 @@ SPUInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
.addReg(SrcReg, getKillRegState(isKill)), FrameIdx);
|
||||
}
|
||||
|
||||
void SPUInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
|
||||
bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const {
|
||||
llvm_report_error("storeRegToAddr() invoked!");
|
||||
|
||||
if (Addr[0].isFI()) {
|
||||
/* do what storeRegToStackSlot does here */
|
||||
} else {
|
||||
unsigned Opc = 0;
|
||||
if (RC == SPU::GPRCRegisterClass) {
|
||||
/* Opc = PPC::STW; */
|
||||
} else if (RC == SPU::R16CRegisterClass) {
|
||||
/* Opc = PPC::STD; */
|
||||
} else if (RC == SPU::R32CRegisterClass) {
|
||||
/* Opc = PPC::STFD; */
|
||||
} else if (RC == SPU::R32FPRegisterClass) {
|
||||
/* Opc = PPC::STFD; */
|
||||
} else if (RC == SPU::R64FPRegisterClass) {
|
||||
/* Opc = PPC::STFS; */
|
||||
} else if (RC == SPU::VECREGRegisterClass) {
|
||||
/* Opc = PPC::STVX; */
|
||||
} else {
|
||||
llvm_unreachable("Unknown regclass!");
|
||||
}
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc))
|
||||
.addReg(SrcReg, getKillRegState(isKill));
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
NewMIs.push_back(MIB);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SPUInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
@ -391,45 +356,6 @@ SPUInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
addFrameReference(BuildMI(MBB, MI, DL, get(opc), DestReg), FrameIdx);
|
||||
}
|
||||
|
||||
/*!
|
||||
\note We are really pessimistic here about what kind of a load we're doing.
|
||||
*/
|
||||
void SPUInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs)
|
||||
const {
|
||||
llvm_report_error("loadRegToAddr() invoked!");
|
||||
|
||||
if (Addr[0].isFI()) {
|
||||
/* do what loadRegFromStackSlot does here... */
|
||||
} else {
|
||||
unsigned Opc = 0;
|
||||
if (RC == SPU::R8CRegisterClass) {
|
||||
/* do brilliance here */
|
||||
} else if (RC == SPU::R16CRegisterClass) {
|
||||
/* Opc = PPC::LWZ; */
|
||||
} else if (RC == SPU::R32CRegisterClass) {
|
||||
/* Opc = PPC::LD; */
|
||||
} else if (RC == SPU::R32FPRegisterClass) {
|
||||
/* Opc = PPC::LFD; */
|
||||
} else if (RC == SPU::R64FPRegisterClass) {
|
||||
/* Opc = PPC::LFS; */
|
||||
} else if (RC == SPU::VECREGRegisterClass) {
|
||||
/* Opc = PPC::LVX; */
|
||||
} else if (RC == SPU::GPRCRegisterClass) {
|
||||
/* Opc = something else! */
|
||||
} else {
|
||||
llvm_unreachable("Unknown regclass!");
|
||||
}
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc), DestReg);
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
NewMIs.push_back(MIB);
|
||||
}
|
||||
}
|
||||
|
||||
//! Return true if the specified load or store can be folded
|
||||
bool
|
||||
SPUInstrInfo::canFoldMemoryOperand(const MachineInstr *MI,
|
||||
|
@ -68,24 +68,12 @@ namespace llvm {
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
//! Store a register to an address, based on its register class
|
||||
virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
//! Load a register from a stack slot, based on its register class.
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
//! Loqad a register from an address, based on its register class
|
||||
virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
//! Return true if the specified load or store can be folded
|
||||
virtual
|
||||
bool canFoldMemoryOperand(const MachineInstr *MI,
|
||||
|
@ -209,29 +209,6 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
.addImm(0).addFrameIndex(FI);
|
||||
}
|
||||
|
||||
void MipsInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
|
||||
bool isKill, SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC, SmallVectorImpl<MachineInstr*> &NewMIs) const
|
||||
{
|
||||
unsigned Opc;
|
||||
if (RC == Mips::CPURegsRegisterClass)
|
||||
Opc = Mips::SW;
|
||||
else if (RC == Mips::FGR32RegisterClass)
|
||||
Opc = Mips::SWC1;
|
||||
else {
|
||||
assert(RC == Mips::AFGR64RegisterClass);
|
||||
Opc = Mips::SDC1;
|
||||
}
|
||||
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc))
|
||||
.addReg(SrcReg, getKillRegState(isKill));
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
NewMIs.push_back(MIB);
|
||||
return;
|
||||
}
|
||||
|
||||
void MipsInstrInfo::
|
||||
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FI,
|
||||
@ -252,28 +229,6 @@ loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
BuildMI(MBB, I, DL, get(Opc), DestReg).addImm(0).addFrameIndex(FI);
|
||||
}
|
||||
|
||||
void MipsInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const {
|
||||
unsigned Opc;
|
||||
if (RC == Mips::CPURegsRegisterClass)
|
||||
Opc = Mips::LW;
|
||||
else if (RC == Mips::FGR32RegisterClass)
|
||||
Opc = Mips::LWC1;
|
||||
else {
|
||||
assert(RC == Mips::AFGR64RegisterClass);
|
||||
Opc = Mips::LDC1;
|
||||
}
|
||||
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc), DestReg);
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
NewMIs.push_back(MIB);
|
||||
return;
|
||||
}
|
||||
|
||||
MachineInstr *MipsInstrInfo::
|
||||
foldMemoryOperandImpl(MachineFunction &MF,
|
||||
MachineInstr* MI,
|
||||
|
@ -183,21 +183,11 @@ public:
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
virtual MachineInstr* foldMemoryOperandImpl(MachineFunction &MF,
|
||||
MachineInstr* MI,
|
||||
const SmallVectorImpl<unsigned> &Ops,
|
||||
|
@ -510,44 +510,6 @@ PPCInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MBB.insert(MI, NewMIs[i]);
|
||||
}
|
||||
|
||||
void PPCInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
|
||||
bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const{
|
||||
if (Addr[0].isFI()) {
|
||||
if (StoreRegToStackSlot(MF, SrcReg, isKill,
|
||||
Addr[0].getIndex(), RC, NewMIs)) {
|
||||
PPCFunctionInfo *FuncInfo = MF.getInfo<PPCFunctionInfo>();
|
||||
FuncInfo->setSpillsCR();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
unsigned Opc = 0;
|
||||
if (RC == PPC::GPRCRegisterClass) {
|
||||
Opc = PPC::STW;
|
||||
} else if (RC == PPC::G8RCRegisterClass) {
|
||||
Opc = PPC::STD;
|
||||
} else if (RC == PPC::F8RCRegisterClass) {
|
||||
Opc = PPC::STFD;
|
||||
} else if (RC == PPC::F4RCRegisterClass) {
|
||||
Opc = PPC::STFS;
|
||||
} else if (RC == PPC::VRRCRegisterClass) {
|
||||
Opc = PPC::STVX;
|
||||
} else {
|
||||
llvm_unreachable("Unknown regclass!");
|
||||
}
|
||||
MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc))
|
||||
.addReg(SrcReg, getKillRegState(isKill));
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
NewMIs.push_back(MIB);
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
PPCInstrInfo::LoadRegFromStackSlot(MachineFunction &MF, DebugLoc DL,
|
||||
unsigned DestReg, int FrameIdx,
|
||||
@ -652,40 +614,6 @@ PPCInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MBB.insert(MI, NewMIs[i]);
|
||||
}
|
||||
|
||||
void PPCInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs)const{
|
||||
if (Addr[0].isFI()) {
|
||||
LoadRegFromStackSlot(MF, DebugLoc::getUnknownLoc(),
|
||||
DestReg, Addr[0].getIndex(), RC, NewMIs);
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned Opc = 0;
|
||||
if (RC == PPC::GPRCRegisterClass) {
|
||||
assert(DestReg != PPC::LR && "Can't handle this yet!");
|
||||
Opc = PPC::LWZ;
|
||||
} else if (RC == PPC::G8RCRegisterClass) {
|
||||
assert(DestReg != PPC::LR8 && "Can't handle this yet!");
|
||||
Opc = PPC::LD;
|
||||
} else if (RC == PPC::F8RCRegisterClass) {
|
||||
Opc = PPC::LFD;
|
||||
} else if (RC == PPC::F4RCRegisterClass) {
|
||||
Opc = PPC::LFS;
|
||||
} else if (RC == PPC::VRRCRegisterClass) {
|
||||
Opc = PPC::LVX;
|
||||
} else {
|
||||
llvm_unreachable("Unknown regclass!");
|
||||
}
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc), DestReg);
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
NewMIs.push_back(MIB);
|
||||
return;
|
||||
}
|
||||
|
||||
/// foldMemoryOperand - PowerPC (like most RISC's) can only fold spills into
|
||||
/// copy instructions, turning them into load/store instructions.
|
||||
MachineInstr *PPCInstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
|
||||
|
@ -121,20 +121,10 @@ public:
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
/// foldMemoryOperand - PowerPC (like most RISC's) can only fold spills into
|
||||
/// copy instructions, turning them into load/store instructions.
|
||||
|
@ -164,29 +164,6 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
llvm_unreachable("Can't store this register to stack slot");
|
||||
}
|
||||
|
||||
void SparcInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
|
||||
bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const {
|
||||
unsigned Opc = 0;
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
if (RC == SP::IntRegsRegisterClass)
|
||||
Opc = SP::STri;
|
||||
else if (RC == SP::FPRegsRegisterClass)
|
||||
Opc = SP::STFri;
|
||||
else if (RC == SP::DFPRegsRegisterClass)
|
||||
Opc = SP::STDFri;
|
||||
else
|
||||
llvm_unreachable("Can't load this register");
|
||||
MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc));
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
MIB.addReg(SrcReg, getKillRegState(isKill));
|
||||
NewMIs.push_back(MIB);
|
||||
return;
|
||||
}
|
||||
|
||||
void SparcInstrInfo::
|
||||
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FI,
|
||||
@ -204,27 +181,6 @@ loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
llvm_unreachable("Can't load this register from stack slot");
|
||||
}
|
||||
|
||||
void SparcInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const {
|
||||
unsigned Opc = 0;
|
||||
if (RC == SP::IntRegsRegisterClass)
|
||||
Opc = SP::LDri;
|
||||
else if (RC == SP::FPRegsRegisterClass)
|
||||
Opc = SP::LDFri;
|
||||
else if (RC == SP::DFPRegsRegisterClass)
|
||||
Opc = SP::LDDFri;
|
||||
else
|
||||
llvm_unreachable("Can't load this register");
|
||||
DebugLoc DL = DebugLoc::getUnknownLoc();
|
||||
MachineInstrBuilder MIB = BuildMI(MF, DL, get(Opc), DestReg);
|
||||
for (unsigned i = 0, e = Addr.size(); i != e; ++i)
|
||||
MIB.addOperand(Addr[i]);
|
||||
NewMIs.push_back(MIB);
|
||||
return;
|
||||
}
|
||||
|
||||
MachineInstr *SparcInstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
|
||||
MachineInstr* MI,
|
||||
const SmallVectorImpl<unsigned> &Ops,
|
||||
|
@ -81,20 +81,10 @@ public:
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
virtual MachineInstr* foldMemoryOperandImpl(MachineFunction &MF,
|
||||
MachineInstr* MI,
|
||||
|
@ -403,14 +403,6 @@ void XCoreInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
.addImm(0);
|
||||
}
|
||||
|
||||
void XCoreInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
|
||||
bool isKill, SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const
|
||||
{
|
||||
llvm_unreachable("unimplemented");
|
||||
}
|
||||
|
||||
void XCoreInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
@ -423,14 +415,6 @@ void XCoreInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
.addImm(0);
|
||||
}
|
||||
|
||||
void XCoreInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const
|
||||
{
|
||||
llvm_unreachable("unimplemented");
|
||||
}
|
||||
|
||||
bool XCoreInstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
const std::vector<CalleeSavedInfo> &CSI) const
|
||||
|
@ -76,21 +76,11 @@ public:
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
|
||||
virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
const TargetRegisterClass *RC,
|
||||
SmallVectorImpl<MachineInstr*> &NewMIs) const;
|
||||
|
||||
virtual bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
const std::vector<CalleeSavedInfo> &CSI) const;
|
||||
|
Loading…
Reference in New Issue
Block a user