mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
eliminateFrameIndex() change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8e33473321
commit
97de913821
@ -689,7 +689,7 @@ unsigned findScratchRegister(RegScavenger *RS, const TargetRegisterClass *RC,
|
||||
}
|
||||
|
||||
void ARMRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
RegScavenger *RS) const{
|
||||
int SPAdj, RegScavenger *RS) const{
|
||||
unsigned i = 0;
|
||||
MachineInstr &MI = *II;
|
||||
MachineBasicBlock &MBB = *MI.getParent();
|
||||
@ -705,7 +705,7 @@ void ARMRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
unsigned FrameReg = ARM::SP;
|
||||
int FrameIndex = MI.getOperand(i).getFrameIndex();
|
||||
int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex) +
|
||||
MF.getFrameInfo()->getStackSize();
|
||||
MF.getFrameInfo()->getStackSize() + SPAdj;
|
||||
|
||||
if (AFI->isGPRCalleeSavedArea1Frame(FrameIndex))
|
||||
Offset -= AFI->getGPRCalleeSavedArea1Offset();
|
||||
@ -714,6 +714,7 @@ void ARMRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
else if (AFI->isDPRCalleeSavedAreaFrame(FrameIndex))
|
||||
Offset -= AFI->getDPRCalleeSavedAreaOffset();
|
||||
else if (hasFP(MF)) {
|
||||
assert(SPAdj == 0 && "Unexpected");
|
||||
// There is alloca()'s in this function, must reference off the frame
|
||||
// pointer instead.
|
||||
FrameReg = getFrameRegister(MF);
|
||||
@ -988,7 +989,7 @@ void ARMRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
unsigned ScratchReg = findScratchRegister(RS, &ARM::GPRRegClass, AFI);
|
||||
if (ScratchReg == 0)
|
||||
// No register is "free". Scavenge a register.
|
||||
ScratchReg = RS->scavengeRegister(&ARM::GPRRegClass, II);
|
||||
ScratchReg = RS->scavengeRegister(&ARM::GPRRegClass, II, SPAdj);
|
||||
emitARMRegPlusImmediate(MBB, II, ScratchReg, FrameReg,
|
||||
isSub ? -Offset : Offset, TII);
|
||||
MI.getOperand(i).ChangeToRegister(ScratchReg, false, false, true);
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
MachineBasicBlock::iterator I) const;
|
||||
|
||||
void eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
RegScavenger *RS = NULL) const;
|
||||
int SPAdj, RegScavenger *RS = NULL) const;
|
||||
|
||||
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
|
||||
RegScavenger *RS = NULL) const;
|
||||
|
@ -255,7 +255,9 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
||||
//<- SP
|
||||
|
||||
void AlphaRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
RegScavenger *RS) const {
|
||||
int SPAdj, RegScavenger *RS) const {
|
||||
assert(SPAdj == 0 && "Unexpected");
|
||||
|
||||
unsigned i = 0;
|
||||
MachineInstr &MI = *II;
|
||||
MachineBasicBlock &MBB = *MI.getParent();
|
||||
|
@ -61,7 +61,7 @@ struct AlphaRegisterInfo : public AlphaGenRegisterInfo {
|
||||
MachineBasicBlock::iterator I) const;
|
||||
|
||||
void eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
RegScavenger *RS = NULL) const;
|
||||
int SPAdj, RegScavenger *RS = NULL) const;
|
||||
|
||||
//void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
||||
|
||||
|
@ -177,7 +177,9 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
||||
}
|
||||
|
||||
void IA64RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
RegScavenger *RS)const{
|
||||
int SPAdj, RegScavenger *RS)const{
|
||||
assert(SPAdj == 0 && "Unexpected");
|
||||
|
||||
unsigned i = 0;
|
||||
MachineInstr &MI = *II;
|
||||
MachineBasicBlock &MBB = *MI.getParent();
|
||||
|
@ -60,7 +60,7 @@ struct IA64RegisterInfo : public IA64GenRegisterInfo {
|
||||
MachineBasicBlock::iterator MI) const;
|
||||
|
||||
void eliminateFrameIndex(MachineBasicBlock::iterator MI,
|
||||
RegScavenger *RS = NULL) const;
|
||||
int SPAdj, RegScavenger *RS = NULL) const;
|
||||
|
||||
void emitPrologue(MachineFunction &MF) const;
|
||||
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
||||
|
@ -589,7 +589,9 @@ void PPCRegisterInfo::lowerDynamicAlloc(MachineBasicBlock::iterator II) const {
|
||||
}
|
||||
|
||||
void PPCRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
RegScavenger *RS) const {
|
||||
int SPAdj, RegScavenger *RS) const {
|
||||
assert(SPAdj == 0 && "Unexpected");
|
||||
|
||||
// Get the instruction.
|
||||
MachineInstr &MI = *II;
|
||||
// Get the instruction's basic block.
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
|
||||
void lowerDynamicAlloc(MachineBasicBlock::iterator II) const;
|
||||
void eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
RegScavenger *RS = NULL) const;
|
||||
int SPAdj, RegScavenger *RS = NULL) const;
|
||||
|
||||
/// determineFrameLayout - Determine the size of the frame and maximum call
|
||||
/// frame size.
|
||||
|
@ -165,7 +165,9 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
||||
}
|
||||
|
||||
void SparcRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
RegScavenger *RS) const {
|
||||
int SPAdj, RegScavenger *RS) const {
|
||||
assert(SPAdj == 0 && "Unexpected");
|
||||
|
||||
unsigned i = 0;
|
||||
MachineInstr &MI = *II;
|
||||
while (!MI.getOperand(i).isFrameIndex()) {
|
||||
|
@ -64,7 +64,7 @@ struct SparcRegisterInfo : public SparcGenRegisterInfo {
|
||||
MachineBasicBlock::iterator I) const;
|
||||
|
||||
void eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
RegScavenger *RS = NULL) const;
|
||||
int SPAdj, RegScavenger *RS = NULL) const;
|
||||
|
||||
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
||||
|
||||
|
@ -986,7 +986,9 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
||||
}
|
||||
|
||||
void X86RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||
RegScavenger *RS) const{
|
||||
int SPAdj, RegScavenger *RS) const{
|
||||
assert(SPAdj == 0 && "Unexpected");
|
||||
|
||||
unsigned i = 0;
|
||||
MachineInstr &MI = *II;
|
||||
MachineFunction &MF = *MI.getParent()->getParent();
|
||||
|
@ -94,7 +94,7 @@ public:
|
||||
MachineBasicBlock::iterator MI) const;
|
||||
|
||||
void eliminateFrameIndex(MachineBasicBlock::iterator MI,
|
||||
RegScavenger *RS = NULL) const;
|
||||
int SPAdj, RegScavenger *RS = NULL) const;
|
||||
|
||||
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user