Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions llvm/lib/Target/CSKY/CSKYFrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ bool CSKYFrameLowering::spillCalleeSavedRegisters(
// Insert the spill to the stack frame.
MCRegister Reg = CS.getReg();
const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(Reg);
TII.storeRegToStackSlot(MBB, MI, Reg, true, CS.getFrameIdx(), RC, TRI,
TII.storeRegToStackSlot(MBB, MI, Reg, true, CS.getFrameIdx(), RC,
Register());
}

Expand All @@ -498,8 +498,7 @@ bool CSKYFrameLowering::restoreCalleeSavedRegisters(
for (auto &CS : reverse(CSI)) {
MCRegister Reg = CS.getReg();
const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(Reg);
TII.loadRegFromStackSlot(MBB, MI, Reg, CS.getFrameIdx(), RC, TRI,
Register());
TII.loadRegFromStackSlot(MBB, MI, Reg, CS.getFrameIdx(), RC, Register());
assert(MI != MBB.begin() && "loadRegFromStackSlot didn't insert any code!");
}

Expand Down
16 changes: 9 additions & 7 deletions llvm/lib/Target/CSKY/CSKYInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ using namespace llvm;
#define GET_INSTRINFO_CTOR_DTOR
#include "CSKYGenInstrInfo.inc"

CSKYInstrInfo::CSKYInstrInfo(const CSKYSubtarget &STI)
: CSKYGenInstrInfo(STI, RI, CSKY::ADJCALLSTACKDOWN, CSKY::ADJCALLSTACKUP),
CSKYInstrInfo::CSKYInstrInfo(const CSKYSubtarget &STI,
const CSKYRegisterInfo &TRI)
: CSKYGenInstrInfo(STI, TRI, CSKY::ADJCALLSTACKDOWN, CSKY::ADJCALLSTACKUP),
STI(STI) {
v2sf = STI.hasFPUv2SingleFloat();
v2df = STI.hasFPUv2DoubleFloat();
Expand Down Expand Up @@ -393,7 +394,6 @@ void CSKYInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I,
Register SrcReg, bool IsKill, int FI,
const TargetRegisterClass *RC,
const TargetRegisterInfo *TRI,
Register VReg,
MachineInstr::MIFlag Flags) const {
DebugLoc DL;
Expand Down Expand Up @@ -434,10 +434,12 @@ void CSKYInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
.addMemOperand(MMO);
}

void CSKYInstrInfo::loadRegFromStackSlot(
MachineBasicBlock &MBB, MachineBasicBlock::iterator I, Register DestReg,
int FI, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI,
Register VReg, MachineInstr::MIFlag Flags) const {
void CSKYInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I,
Register DestReg, int FI,
const TargetRegisterClass *RC,
Register VReg,
MachineInstr::MIFlag Flags) const {
DebugLoc DL;
if (I != MBB.end())
DL = I->getDebugLoc();
Expand Down
9 changes: 4 additions & 5 deletions llvm/lib/Target/CSKY/CSKYInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

namespace llvm {

class CSKYRegisterInfo;
class CSKYSubtarget;

class CSKYInstrInfo : public CSKYGenInstrInfo {
Expand All @@ -33,7 +34,7 @@ class CSKYInstrInfo : public CSKYGenInstrInfo {
const CSKYSubtarget &STI;

public:
explicit CSKYInstrInfo(const CSKYSubtarget &STI);
CSKYInstrInfo(const CSKYSubtarget &STI, const CSKYRegisterInfo &RI);

Register isLoadFromStackSlot(const MachineInstr &MI,
int &FrameIndex) const override;
Expand All @@ -42,14 +43,12 @@ class CSKYInstrInfo : public CSKYGenInstrInfo {

void storeRegToStackSlot(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register SrcReg,
bool IsKill, int FrameIndex, const TargetRegisterClass *RC,
const TargetRegisterInfo *TRI, Register VReg,
bool IsKill, int FrameIndex, const TargetRegisterClass *RC, Register VReg,
MachineInstr::MIFlag Flags = MachineInstr::NoFlags) const override;

void loadRegFromStackSlot(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg,
int FrameIndex, const TargetRegisterClass *RC,
const TargetRegisterInfo *TRI, Register VReg,
int FrameIndex, const TargetRegisterClass *RC, Register VReg,
MachineInstr::MIFlag Flags = MachineInstr::NoFlags) const override;

void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/CSKY/CSKYSubtarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ CSKYSubtarget::CSKYSubtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU,
StringRef FS, const TargetMachine &TM)
: CSKYGenSubtargetInfo(TT, CPU, TuneCPU, FS),
FrameLowering(initializeSubtargetDependencies(TT, CPU, TuneCPU, FS)),
InstrInfo(*this), RegInfo(), TLInfo(TM, *this) {
InstrInfo(*this, RegInfo), TLInfo(TM, *this) {
TSInfo = std::make_unique<CSKYSelectionDAGInfo>();
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/CSKY/CSKYSubtarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class CSKYSubtarget : public CSKYGenSubtargetInfo {
virtual void anchor();

CSKYFrameLowering FrameLowering;
CSKYInstrInfo InstrInfo;
CSKYRegisterInfo RegInfo;
CSKYInstrInfo InstrInfo;
CSKYTargetLowering TLInfo;
std::unique_ptr<const SelectionDAGTargetInfo> TSInfo;

Expand Down
Loading