mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Add argument TargetRegisterInfo to loadRegFromStackSlot and storeRegToStackSlot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103193 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ac963b3279
commit
746ad69e08
@ -328,7 +328,8 @@ public:
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
assert(0 && "Target didn't implement TargetInstrInfo::storeRegToStackSlot!");
|
||||
}
|
||||
|
||||
@ -339,7 +340,8 @@ public:
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
assert(0 && "Target didn't implement TargetInstrInfo::loadRegFromStackSlot!");
|
||||
}
|
||||
|
||||
|
@ -1061,7 +1061,8 @@ bool PreAllocSplitting::SplitRegLiveInterval(LiveInterval *LI) {
|
||||
// Add spill.
|
||||
|
||||
SS = CreateSpillStackSlot(CurrLI->reg, RC);
|
||||
TII->storeRegToStackSlot(*BarrierMBB, SpillPt, CurrLI->reg, true, SS, RC);
|
||||
TII->storeRegToStackSlot(*BarrierMBB, SpillPt, CurrLI->reg, true, SS, RC,
|
||||
TRI);
|
||||
SpillMI = prior(SpillPt);
|
||||
SpillIndex = LIs->InsertMachineInstrInMaps(SpillMI);
|
||||
}
|
||||
@ -1097,7 +1098,8 @@ bool PreAllocSplitting::SplitRegLiveInterval(LiveInterval *LI) {
|
||||
}
|
||||
// Add spill.
|
||||
SS = CreateSpillStackSlot(CurrLI->reg, RC);
|
||||
TII->storeRegToStackSlot(*DefMBB, SpillPt, CurrLI->reg, false, SS, RC);
|
||||
TII->storeRegToStackSlot(*DefMBB, SpillPt, CurrLI->reg, false, SS, RC,
|
||||
TRI);
|
||||
SpillMI = prior(SpillPt);
|
||||
SpillIndex = LIs->InsertMachineInstrInMaps(SpillMI);
|
||||
}
|
||||
@ -1116,7 +1118,7 @@ bool PreAllocSplitting::SplitRegLiveInterval(LiveInterval *LI) {
|
||||
RestoreIndex = LIs->getInstructionIndex(RestorePt);
|
||||
FoldedRestore = true;
|
||||
} else {
|
||||
TII->loadRegFromStackSlot(*BarrierMBB, RestorePt, CurrLI->reg, SS, RC);
|
||||
TII->loadRegFromStackSlot(*BarrierMBB, RestorePt, CurrLI->reg, SS, RC, TRI);
|
||||
MachineInstr *LoadMI = prior(RestorePt);
|
||||
RestoreIndex = LIs->InsertMachineInstrInMaps(LoadMI);
|
||||
}
|
||||
|
@ -289,6 +289,7 @@ void PEI::insertCSRSpillsAndRestores(MachineFunction &Fn) {
|
||||
return;
|
||||
|
||||
const TargetInstrInfo &TII = *Fn.getTarget().getInstrInfo();
|
||||
const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo();
|
||||
MachineBasicBlock::iterator I;
|
||||
|
||||
if (! ShrinkWrapThisFunction) {
|
||||
@ -302,7 +303,7 @@ void PEI::insertCSRSpillsAndRestores(MachineFunction &Fn) {
|
||||
|
||||
// Insert the spill to the stack frame.
|
||||
TII.storeRegToStackSlot(*EntryBlock, I, CSI[i].getReg(), true,
|
||||
CSI[i].getFrameIdx(), CSI[i].getRegClass());
|
||||
CSI[i].getFrameIdx(), CSI[i].getRegClass(),TRI);
|
||||
}
|
||||
}
|
||||
|
||||
@ -328,7 +329,7 @@ void PEI::insertCSRSpillsAndRestores(MachineFunction &Fn) {
|
||||
for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
|
||||
TII.loadRegFromStackSlot(*MBB, I, CSI[i].getReg(),
|
||||
CSI[i].getFrameIdx(),
|
||||
CSI[i].getRegClass());
|
||||
CSI[i].getRegClass(), TRI);
|
||||
assert(I != MBB->begin() &&
|
||||
"loadRegFromStackSlot didn't insert any code!");
|
||||
// Insert in reverse order. loadRegFromStackSlot can insert
|
||||
@ -375,7 +376,7 @@ void PEI::insertCSRSpillsAndRestores(MachineFunction &Fn) {
|
||||
TII.storeRegToStackSlot(*MBB, I, blockCSI[i].getReg(),
|
||||
true,
|
||||
blockCSI[i].getFrameIdx(),
|
||||
blockCSI[i].getRegClass());
|
||||
blockCSI[i].getRegClass(), TRI);
|
||||
}
|
||||
}
|
||||
|
||||
@ -423,7 +424,7 @@ void PEI::insertCSRSpillsAndRestores(MachineFunction &Fn) {
|
||||
for (unsigned i = 0, e = blockCSI.size(); i != e; ++i) {
|
||||
TII.loadRegFromStackSlot(*MBB, I, blockCSI[i].getReg(),
|
||||
blockCSI[i].getFrameIdx(),
|
||||
blockCSI[i].getRegClass());
|
||||
blockCSI[i].getRegClass(), TRI);
|
||||
assert(I != MBB->begin() &&
|
||||
"loadRegFromStackSlot didn't insert any code!");
|
||||
// Insert in reverse order. loadRegFromStackSlot can insert
|
||||
|
@ -281,7 +281,7 @@ void RAFast::spillVirtReg(MachineBasicBlock &MBB,
|
||||
// happen if it is a move to a physical register), then the spill
|
||||
// instruction is not a kill.
|
||||
bool isKill = !(I != MBB.end() && I->readsRegister(PhysReg));
|
||||
TII->storeRegToStackSlot(MBB, I, PhysReg, isKill, FrameIndex, RC);
|
||||
TII->storeRegToStackSlot(MBB, I, PhysReg, isKill, FrameIndex, RC, TRI);
|
||||
++NumStores; // Update statistics
|
||||
}
|
||||
|
||||
@ -476,7 +476,7 @@ MachineInstr *RAFast::reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
|
||||
<< TRI->getName(PhysReg) << "\n");
|
||||
|
||||
// Add move instruction(s)
|
||||
TII->loadRegFromStackSlot(MBB, MI, PhysReg, FrameIndex, RC);
|
||||
TII->loadRegFromStackSlot(MBB, MI, PhysReg, FrameIndex, RC, TRI);
|
||||
++NumLoads; // Update statistics
|
||||
|
||||
MF->getRegInfo().setPhysRegUsed(PhysReg);
|
||||
|
@ -297,7 +297,7 @@ void RALocal::storeVirtReg(MachineBasicBlock &MBB,
|
||||
const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(VirtReg);
|
||||
int FrameIndex = getStackSpaceFor(VirtReg, RC);
|
||||
DEBUG(dbgs() << " to stack slot #" << FrameIndex);
|
||||
TII->storeRegToStackSlot(MBB, I, PhysReg, isKill, FrameIndex, RC);
|
||||
TII->storeRegToStackSlot(MBB, I, PhysReg, isKill, FrameIndex, RC, TRI);
|
||||
++NumStores; // Update statistics
|
||||
}
|
||||
|
||||
@ -543,7 +543,7 @@ MachineInstr *RALocal::reloadVirtReg(MachineBasicBlock &MBB, MachineInstr *MI,
|
||||
<< TRI->getName(PhysReg) << "\n");
|
||||
|
||||
// Add move instruction(s)
|
||||
TII->loadRegFromStackSlot(MBB, MI, PhysReg, FrameIndex, RC);
|
||||
TII->loadRegFromStackSlot(MBB, MI, PhysReg, FrameIndex, RC, TRI);
|
||||
++NumLoads; // Update statistics
|
||||
|
||||
MF->getRegInfo().setPhysRegUsed(PhysReg);
|
||||
|
@ -343,12 +343,12 @@ unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
|
||||
// Spill the scavenged register before I.
|
||||
assert(ScavengingFrameIndex >= 0 &&
|
||||
"Cannot scavenge register without an emergency spill slot!");
|
||||
TII->storeRegToStackSlot(*MBB, I, SReg, true, ScavengingFrameIndex, RC);
|
||||
TII->storeRegToStackSlot(*MBB, I, SReg, true, ScavengingFrameIndex, RC,TRI);
|
||||
MachineBasicBlock::iterator II = prior(I);
|
||||
TRI->eliminateFrameIndex(II, SPAdj, NULL, this);
|
||||
|
||||
// Restore the scavenged register before its use (or first terminator).
|
||||
TII->loadRegFromStackSlot(*MBB, UseMI, SReg, ScavengingFrameIndex, RC);
|
||||
TII->loadRegFromStackSlot(*MBB, UseMI, SReg, ScavengingFrameIndex, RC, TRI);
|
||||
II = prior(UseMI);
|
||||
TRI->eliminateFrameIndex(II, SPAdj, NULL, this);
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ protected:
|
||||
MachineFrameInfo *mfi;
|
||||
MachineRegisterInfo *mri;
|
||||
const TargetInstrInfo *tii;
|
||||
const TargetRegisterInfo *tri;
|
||||
VirtRegMap *vrm;
|
||||
|
||||
/// Construct a spiller base.
|
||||
@ -60,6 +61,7 @@ protected:
|
||||
mfi = mf->getFrameInfo();
|
||||
mri = &mf->getRegInfo();
|
||||
tii = mf->getTarget().getInstrInfo();
|
||||
tri = mf->getTarget().getRegisterInfo();
|
||||
}
|
||||
|
||||
/// Add spill ranges for every use/def of the live interval, inserting loads
|
||||
@ -129,7 +131,8 @@ protected:
|
||||
// Insert reload if necessary.
|
||||
MachineBasicBlock::iterator miItr(mi);
|
||||
if (hasUse) {
|
||||
tii->loadRegFromStackSlot(*mi->getParent(), miItr, newVReg, ss, trc);
|
||||
tii->loadRegFromStackSlot(*mi->getParent(), miItr, newVReg, ss, trc,
|
||||
tri);
|
||||
MachineInstr *loadInstr(prior(miItr));
|
||||
SlotIndex loadIndex =
|
||||
lis->InsertMachineInstrInMaps(loadInstr).getDefIndex();
|
||||
@ -143,7 +146,7 @@ protected:
|
||||
// Insert store if necessary.
|
||||
if (hasDef) {
|
||||
tii->storeRegToStackSlot(*mi->getParent(), llvm::next(miItr), newVReg,
|
||||
true, ss, trc);
|
||||
true, ss, trc, tri);
|
||||
MachineInstr *storeInstr(llvm::next(miItr));
|
||||
SlotIndex storeIndex =
|
||||
lis->InsertMachineInstrInMaps(storeInstr).getDefIndex();
|
||||
|
@ -907,7 +907,7 @@ unsigned ReuseInfo::GetRegForReload(const TargetRegisterClass *RC,
|
||||
TRI, VRM);
|
||||
} else {
|
||||
TII->loadRegFromStackSlot(*MBB, InsertLoc, NewPhysReg,
|
||||
NewOp.StackSlotOrReMat, AliasRC);
|
||||
NewOp.StackSlotOrReMat, AliasRC, TRI);
|
||||
MachineInstr *LoadMI = prior(InsertLoc);
|
||||
VRM.addSpillSlotUse(NewOp.StackSlotOrReMat, LoadMI);
|
||||
// Any stores to this stack slot are not dead anymore.
|
||||
@ -1265,7 +1265,7 @@ OptimizeByUnfold2(unsigned VirtReg, int SS,
|
||||
ComputeReloadLoc(MII, MBB->begin(), PhysReg, TRI, false, SS, TII, MF);
|
||||
|
||||
// Load from SS to the spare physical register.
|
||||
TII->loadRegFromStackSlot(*MBB, MII, PhysReg, SS, RC);
|
||||
TII->loadRegFromStackSlot(*MBB, MII, PhysReg, SS, RC, TRI);
|
||||
// This invalidates Phys.
|
||||
Spills.ClobberPhysReg(PhysReg);
|
||||
// Remember it's available.
|
||||
@ -1308,7 +1308,7 @@ OptimizeByUnfold2(unsigned VirtReg, int SS,
|
||||
} while (FoldsStackSlotModRef(*NextMII, SS, PhysReg, TII, TRI, *VRM));
|
||||
|
||||
// Store the value back into SS.
|
||||
TII->storeRegToStackSlot(*MBB, NextMII, PhysReg, true, SS, RC);
|
||||
TII->storeRegToStackSlot(*MBB, NextMII, PhysReg, true, SS, RC, TRI);
|
||||
MachineInstr *StoreMI = prior(NextMII);
|
||||
VRM->addSpillSlotUse(SS, StoreMI);
|
||||
VRM->virtFolded(VirtReg, StoreMI, VirtRegMap::isMod);
|
||||
@ -1523,7 +1523,7 @@ CommuteToFoldReload(MachineBasicBlock::iterator &MII,
|
||||
VRM->virtFolded(VirtReg, FoldedMI, VirtRegMap::isRef);
|
||||
// Insert new def MI and spill MI.
|
||||
const TargetRegisterClass* RC = MRI->getRegClass(VirtReg);
|
||||
TII->storeRegToStackSlot(*MBB, &MI, NewReg, true, SS, RC);
|
||||
TII->storeRegToStackSlot(*MBB, &MI, NewReg, true, SS, RC, TRI);
|
||||
MII = prior(MII);
|
||||
MachineInstr *StoreMI = MII;
|
||||
VRM->addSpillSlotUse(SS, StoreMI);
|
||||
@ -1566,7 +1566,8 @@ SpillRegToStackSlot(MachineBasicBlock::iterator &MII,
|
||||
std::vector<MachineOperand*> &KillOps) {
|
||||
|
||||
MachineBasicBlock::iterator oldNextMII = llvm::next(MII);
|
||||
TII->storeRegToStackSlot(*MBB, llvm::next(MII), PhysReg, true, StackSlot, RC);
|
||||
TII->storeRegToStackSlot(*MBB, llvm::next(MII), PhysReg, true, StackSlot, RC,
|
||||
TRI);
|
||||
MachineInstr *StoreMI = prior(oldNextMII);
|
||||
VRM->addSpillSlotUse(StackSlot, StoreMI);
|
||||
DEBUG(dbgs() << "Store:\t" << *StoreMI);
|
||||
@ -1709,7 +1710,7 @@ bool LocalRewriter::InsertEmergencySpills(MachineInstr *MI) {
|
||||
if (UsedSS.count(SS))
|
||||
llvm_unreachable("Need to spill more than one physical registers!");
|
||||
UsedSS.insert(SS);
|
||||
TII->storeRegToStackSlot(*MBB, MII, PhysReg, true, SS, RC);
|
||||
TII->storeRegToStackSlot(*MBB, MII, PhysReg, true, SS, RC, TRI);
|
||||
MachineInstr *StoreMI = prior(MII);
|
||||
VRM->addSpillSlotUse(SS, StoreMI);
|
||||
|
||||
@ -1718,7 +1719,7 @@ bool LocalRewriter::InsertEmergencySpills(MachineInstr *MI) {
|
||||
ComputeReloadLoc(llvm::next(MII), MBB->begin(), PhysReg, TRI, false, SS,
|
||||
TII, *MBB->getParent());
|
||||
|
||||
TII->loadRegFromStackSlot(*MBB, InsertLoc, PhysReg, SS, RC);
|
||||
TII->loadRegFromStackSlot(*MBB, InsertLoc, PhysReg, SS, RC, TRI);
|
||||
|
||||
MachineInstr *LoadMI = prior(InsertLoc);
|
||||
VRM->addSpillSlotUse(SS, LoadMI);
|
||||
@ -1821,7 +1822,7 @@ bool LocalRewriter::InsertRestores(MachineInstr *MI,
|
||||
ReMaterialize(*MBB, InsertLoc, Phys, VirtReg, TII, TRI, *VRM);
|
||||
} else {
|
||||
const TargetRegisterClass* RC = MRI->getRegClass(VirtReg);
|
||||
TII->loadRegFromStackSlot(*MBB, InsertLoc, Phys, SSorRMId, RC);
|
||||
TII->loadRegFromStackSlot(*MBB, InsertLoc, Phys, SSorRMId, RC, TRI);
|
||||
MachineInstr *LoadMI = prior(InsertLoc);
|
||||
VRM->addSpillSlotUse(SSorRMId, LoadMI);
|
||||
++NumLoads;
|
||||
@ -1857,7 +1858,7 @@ bool LocalRewriter::InsertSpills(MachineInstr *MI) {
|
||||
int StackSlot = VRM->getStackSlot(VirtReg);
|
||||
MachineBasicBlock::iterator oldNextMII = llvm::next(MII);
|
||||
TII->storeRegToStackSlot(*MBB, llvm::next(MII), Phys, isKill, StackSlot,
|
||||
RC);
|
||||
RC, TRI);
|
||||
MachineInstr *StoreMI = prior(oldNextMII);
|
||||
VRM->addSpillSlotUse(StackSlot, StoreMI);
|
||||
DEBUG(dbgs() << "Store:\t" << *StoreMI);
|
||||
@ -2183,7 +2184,7 @@ LocalRewriter::RewriteMBB(LiveIntervals *LIs,
|
||||
ReMaterialize(*MBB, InsertLoc, PhysReg, VirtReg, TII, TRI, *VRM);
|
||||
} else {
|
||||
const TargetRegisterClass* RC = MRI->getRegClass(VirtReg);
|
||||
TII->loadRegFromStackSlot(*MBB, InsertLoc, PhysReg, SSorRMId, RC);
|
||||
TII->loadRegFromStackSlot(*MBB, InsertLoc, PhysReg, SSorRMId, RC,TRI);
|
||||
MachineInstr *LoadMI = prior(InsertLoc);
|
||||
VRM->addSpillSlotUse(SSorRMId, LoadMI);
|
||||
++NumLoads;
|
||||
|
@ -728,7 +728,8 @@ ARMBaseInstrInfo::copyRegToReg(MachineBasicBlock &MBB,
|
||||
void ARMBaseInstrInfo::
|
||||
storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned SrcReg, bool isKill, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
@ -787,7 +788,8 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
void ARMBaseInstrInfo::
|
||||
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
|
@ -262,12 +262,14 @@ public:
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual MachineInstr *emitFrameIndexDebugValue(MachineFunction &MF,
|
||||
int FrameIx,
|
||||
|
@ -97,10 +97,8 @@ canFoldMemoryOperand(const MachineInstr *MI,
|
||||
void Thumb1InstrInfo::
|
||||
storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned SrcReg, bool isKill, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
assert((RC == ARM::tGPRRegisterClass ||
|
||||
(TargetRegisterInfo::isPhysicalRegister(SrcReg) &&
|
||||
isARMLowRegister(SrcReg))) && "Unknown regclass!");
|
||||
@ -108,6 +106,9 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
if (RC == ARM::tGPRRegisterClass ||
|
||||
(TargetRegisterInfo::isPhysicalRegister(SrcReg) &&
|
||||
isARMLowRegister(SrcReg))) {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
MachineFrameInfo &MFI = *MF.getFrameInfo();
|
||||
MachineMemOperand *MMO =
|
||||
@ -124,10 +125,8 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
void Thumb1InstrInfo::
|
||||
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
assert((RC == ARM::tGPRRegisterClass ||
|
||||
(TargetRegisterInfo::isPhysicalRegister(DestReg) &&
|
||||
isARMLowRegister(DestReg))) && "Unknown regclass!");
|
||||
@ -135,6 +134,9 @@ loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
if (RC == ARM::tGPRRegisterClass ||
|
||||
(TargetRegisterInfo::isPhysicalRegister(DestReg) &&
|
||||
isARMLowRegister(DestReg))) {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
MachineFrameInfo &MFI = *MF.getFrameInfo();
|
||||
MachineMemOperand *MMO =
|
||||
|
@ -52,12 +52,14 @@ public:
|
||||
void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
bool canFoldMemoryOperand(const MachineInstr *MI,
|
||||
const SmallVectorImpl<unsigned> &Ops) const;
|
||||
|
@ -69,11 +69,12 @@ Thumb2InstrInfo::copyRegToReg(MachineBasicBlock &MBB,
|
||||
void Thumb2InstrInfo::
|
||||
storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned SrcReg, bool isKill, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
if (RC == ARM::GPRRegisterClass || RC == ARM::tGPRRegisterClass) {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
MachineFrameInfo &MFI = *MF.getFrameInfo();
|
||||
MachineMemOperand *MMO =
|
||||
@ -87,17 +88,18 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
return;
|
||||
}
|
||||
|
||||
ARMBaseInstrInfo::storeRegToStackSlot(MBB, I, SrcReg, isKill, FI, RC);
|
||||
ARMBaseInstrInfo::storeRegToStackSlot(MBB, I, SrcReg, isKill, FI, RC, TRI);
|
||||
}
|
||||
|
||||
void Thumb2InstrInfo::
|
||||
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
if (RC == ARM::GPRRegisterClass || RC == ARM::tGPRRegisterClass) {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
MachineFrameInfo &MFI = *MF.getFrameInfo();
|
||||
MachineMemOperand *MMO =
|
||||
@ -110,7 +112,7 @@ loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
return;
|
||||
}
|
||||
|
||||
ARMBaseInstrInfo::loadRegFromStackSlot(MBB, I, DestReg, FI, RC);
|
||||
ARMBaseInstrInfo::loadRegFromStackSlot(MBB, I, DestReg, FI, RC, TRI);
|
||||
}
|
||||
|
||||
void llvm::emitT2RegPlusImmediate(MachineBasicBlock &MBB,
|
||||
|
@ -40,12 +40,14 @@ public:
|
||||
void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
/// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
|
||||
/// such, whenever a client has an instance of instruction info, it should
|
||||
|
@ -180,7 +180,8 @@ void
|
||||
AlphaInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
//cerr << "Trying to store " << getPrettyName(SrcReg) << " to "
|
||||
// << FrameIdx << "\n";
|
||||
//BuildMI(MBB, MI, Alpha::WTF, 0).addReg(SrcReg);
|
||||
@ -208,7 +209,8 @@ void
|
||||
AlphaInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
//cerr << "Trying to load " << getPrettyName(DestReg) << " to "
|
||||
// << FrameIdx << "\n";
|
||||
DebugLoc DL;
|
||||
|
@ -52,12 +52,14 @@ public:
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual MachineInstr* foldMemoryOperandImpl(MachineFunction &MF,
|
||||
MachineInstr* MI,
|
||||
|
@ -196,7 +196,8 @@ BlackfinInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
unsigned SrcReg,
|
||||
bool isKill,
|
||||
int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
DebugLoc DL = I != MBB.end() ? I->getDebugLoc() : DebugLoc();
|
||||
|
||||
if (inClass(BF::DPRegClass, SrcReg, RC)) {
|
||||
@ -242,7 +243,8 @@ BlackfinInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I,
|
||||
unsigned DestReg,
|
||||
int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
DebugLoc DL = I != MBB.end() ? I->getDebugLoc() : DebugLoc();
|
||||
if (inClass(BF::DPRegClass, DestReg, RC)) {
|
||||
BuildMI(MBB, I, DL, get(BF::LOAD32fi), DestReg)
|
||||
|
@ -56,7 +56,8 @@ namespace llvm {
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill,
|
||||
int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void storeRegToAddr(MachineFunction &MF,
|
||||
unsigned SrcReg, bool isKill,
|
||||
@ -67,7 +68,8 @@ namespace llvm {
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
|
@ -291,9 +291,10 @@ bool SPUInstrInfo::copyRegToReg(MachineBasicBlock &MBB,
|
||||
|
||||
void
|
||||
SPUInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill, int FrameIdx,
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const
|
||||
{
|
||||
unsigned opc;
|
||||
bool isValidFrameIdx = (FrameIdx < SPUFrameInfo::maxFrameOffset());
|
||||
@ -325,9 +326,10 @@ SPUInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
|
||||
void
|
||||
SPUInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIdx,
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const
|
||||
{
|
||||
unsigned opc;
|
||||
bool isValidFrameIdx = (FrameIdx < SPUFrameInfo::maxFrameOffset());
|
||||
|
@ -66,13 +66,15 @@ namespace llvm {
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) 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;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
//! Return true if the specified load or store can be folded
|
||||
virtual
|
||||
|
@ -124,7 +124,8 @@ copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
void MBlazeInstrInfo::
|
||||
storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned SrcReg, bool isKill, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
DebugLoc DL;
|
||||
BuildMI(MBB, I, DL, get(MBlaze::SWI)).addReg(SrcReg,getKillRegState(isKill))
|
||||
.addImm(0).addFrameIndex(FI);
|
||||
@ -133,7 +134,8 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
void MBlazeInstrInfo::
|
||||
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
DebugLoc DL;
|
||||
BuildMI(MBB, I, DL, get(MBlaze::LWI), DestReg)
|
||||
.addImm(0).addFrameIndex(FI);
|
||||
|
@ -207,12 +207,14 @@ public:
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual MachineInstr* foldMemoryOperandImpl(MachineFunction &MF,
|
||||
MachineInstr* MI,
|
||||
|
@ -32,7 +32,8 @@ MSP430InstrInfo::MSP430InstrInfo(MSP430TargetMachine &tm)
|
||||
void MSP430InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
DebugLoc DL;
|
||||
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
@ -59,7 +60,8 @@ void MSP430InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
void MSP430InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const{
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const{
|
||||
DebugLoc DL;
|
||||
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
|
@ -62,11 +62,13 @@ public:
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill,
|
||||
int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
|
@ -189,7 +189,8 @@ copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
void MipsInstrInfo::
|
||||
storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned SrcReg, bool isKill, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
@ -222,7 +223,8 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
void MipsInstrInfo::
|
||||
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FI,
|
||||
const TargetRegisterClass *RC) const
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const
|
||||
{
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
@ -213,12 +213,14 @@ public:
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual MachineInstr* foldMemoryOperandImpl(MachineFunction &MF,
|
||||
MachineInstr* MI,
|
||||
|
@ -70,7 +70,8 @@ unsigned PIC16InstrInfo::isLoadFromStackSlot(const MachineInstr *MI,
|
||||
void PIC16InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I,
|
||||
unsigned SrcReg, bool isKill, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
const PIC16TargetLowering *PTLI = TM.getTargetLowering();
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
@ -112,7 +113,8 @@ void PIC16InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
void PIC16InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
const PIC16TargetLowering *PTLI = TM.getTargetLowering();
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
@ -49,12 +49,14 @@ public:
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
virtual bool copyRegToReg(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, unsigned SrcReg,
|
||||
|
@ -518,7 +518,8 @@ void
|
||||
PPCInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
SmallVector<MachineInstr*, 4> NewMIs;
|
||||
|
||||
@ -633,7 +634,8 @@ void
|
||||
PPCInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
MachineFunction &MF = *MBB.getParent();
|
||||
SmallVector<MachineInstr*, 4> NewMIs;
|
||||
DebugLoc DL;
|
||||
|
@ -119,12 +119,14 @@ public:
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual MachineInstr *emitFrameIndexDebugValue(MachineFunction &MF,
|
||||
int FrameIx,
|
||||
|
@ -148,7 +148,8 @@ bool SparcInstrInfo::copyRegToReg(MachineBasicBlock &MBB,
|
||||
void SparcInstrInfo::
|
||||
storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned SrcReg, bool isKill, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
@ -169,7 +170,8 @@ storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
void SparcInstrInfo::
|
||||
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FI,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
|
||||
|
@ -79,12 +79,14 @@ public:
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MBBI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual MachineInstr* foldMemoryOperandImpl(MachineFunction &MF,
|
||||
MachineInstr* MI,
|
||||
|
@ -61,7 +61,8 @@ static inline bool isGVStub(GlobalValue *GV, SystemZTargetMachine &TM) {
|
||||
void SystemZInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
DebugLoc DL;
|
||||
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
||||
|
||||
@ -90,7 +91,8 @@ void SystemZInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
void SystemZInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const{
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const{
|
||||
DebugLoc DL;
|
||||
if (MI != MBB.end()) DL = MI->getDebugLoc();
|
||||
|
||||
@ -333,7 +335,8 @@ SystemZInstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
const TargetRegisterClass *RegClass = CSI[i].getRegClass();
|
||||
if (RegClass == &SystemZ::FP64RegClass) {
|
||||
MBB.addLiveIn(Reg);
|
||||
storeRegToStackSlot(MBB, MI, Reg, true, CSI[i].getFrameIdx(), RegClass);
|
||||
storeRegToStackSlot(MBB, MI, Reg, true, CSI[i].getFrameIdx(), RegClass,
|
||||
&RI);
|
||||
}
|
||||
}
|
||||
|
||||
@ -359,7 +362,7 @@ SystemZInstrInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
unsigned Reg = CSI[i].getReg();
|
||||
const TargetRegisterClass *RegClass = CSI[i].getRegClass();
|
||||
if (RegClass == &SystemZ::FP64RegClass)
|
||||
loadRegFromStackSlot(MBB, MI, Reg, CSI[i].getFrameIdx(), RegClass);
|
||||
loadRegFromStackSlot(MBB, MI, Reg, CSI[i].getFrameIdx(), RegClass, &RI);
|
||||
}
|
||||
|
||||
// Restore GP registers
|
||||
|
@ -75,11 +75,13 @@ public:
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill,
|
||||
int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
|
@ -2133,7 +2133,8 @@ static unsigned getStoreRegOpcode(unsigned SrcReg,
|
||||
void X86InstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const {
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
const MachineFunction &MF = *MBB.getParent();
|
||||
bool isAligned = (RI.getStackAlignment() >= 16) || RI.canRealignStack(MF);
|
||||
unsigned Opc = getStoreRegOpcode(SrcReg, RC, isAligned, TM);
|
||||
@ -2230,7 +2231,8 @@ static unsigned getLoadRegOpcode(unsigned DestReg,
|
||||
void X86InstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIdx,
|
||||
const TargetRegisterClass *RC) const{
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
const MachineFunction &MF = *MBB.getParent();
|
||||
bool isAligned = (RI.getStackAlignment() >= 16) || RI.canRealignStack(MF);
|
||||
unsigned Opc = getLoadRegOpcode(DestReg, RC, isAligned, TM);
|
||||
@ -2284,7 +2286,8 @@ bool X86InstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
CalleeFrameSize += SlotSize;
|
||||
BuildMI(MBB, MI, DL, get(Opc)).addReg(Reg, RegState::Kill);
|
||||
} else {
|
||||
storeRegToStackSlot(MBB, MI, Reg, true, CSI[i-1].getFrameIdx(), RegClass);
|
||||
storeRegToStackSlot(MBB, MI, Reg, true, CSI[i-1].getFrameIdx(), RegClass,
|
||||
&RI);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2314,7 +2317,7 @@ bool X86InstrInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
if (RegClass != &X86::VR128RegClass && !isWin64) {
|
||||
BuildMI(MBB, MI, DL, get(Opc), Reg);
|
||||
} else {
|
||||
loadRegFromStackSlot(MBB, MI, Reg, CSI[i].getFrameIdx(), RegClass);
|
||||
loadRegFromStackSlot(MBB, MI, Reg, CSI[i].getFrameIdx(), RegClass, &RI);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -594,7 +594,8 @@ public:
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
@ -606,7 +607,8 @@ public:
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
|
||||
SmallVectorImpl<MachineOperand> &Addr,
|
||||
|
@ -395,7 +395,8 @@ void XCoreInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I,
|
||||
unsigned SrcReg, bool isKill,
|
||||
int FrameIndex,
|
||||
const TargetRegisterClass *RC) const
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const
|
||||
{
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
@ -408,7 +409,8 @@ void XCoreInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
void XCoreInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator I,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const
|
||||
{
|
||||
DebugLoc DL;
|
||||
if (I != MBB.end()) DL = I->getDebugLoc();
|
||||
@ -437,7 +439,7 @@ bool XCoreInstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
MBB.addLiveIn(it->getReg());
|
||||
|
||||
storeRegToStackSlot(MBB, MI, it->getReg(), true,
|
||||
it->getFrameIdx(), it->getRegClass());
|
||||
it->getFrameIdx(), it->getRegClass(), &RI);
|
||||
if (emitFrameMoves) {
|
||||
MCSymbol *SaveLabel = MF->getContext().CreateTempSymbol();
|
||||
BuildMI(MBB, MI, DL, get(XCore::DBG_LABEL)).addSym(SaveLabel);
|
||||
@ -460,7 +462,7 @@ bool XCoreInstrInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
|
||||
loadRegFromStackSlot(MBB, MI, it->getReg(),
|
||||
it->getFrameIdx(),
|
||||
it->getRegClass());
|
||||
it->getRegClass(), &RI);
|
||||
assert(MI != MBB.begin() &&
|
||||
"loadRegFromStackSlot didn't insert any code!");
|
||||
// Insert in reverse order. loadRegFromStackSlot can insert multiple
|
||||
|
@ -72,12 +72,14 @@ public:
|
||||
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned SrcReg, bool isKill, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
unsigned DestReg, int FrameIndex,
|
||||
const TargetRegisterClass *RC) const;
|
||||
const TargetRegisterClass *RC,
|
||||
const TargetRegisterInfo *TRI) const;
|
||||
|
||||
virtual bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
|
Loading…
x
Reference in New Issue
Block a user