mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 23:32:27 +00:00
Simplify resolveFrameIndex() signature.
Just pass a MachineInstr reference rather than an MBB iterator. Creating a MachineInstr& is the first thing every implementation did anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205453 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
acb6d9834a
commit
bc07242d9b
@ -770,8 +770,8 @@ public:
|
|||||||
|
|
||||||
/// resolveFrameIndex - Resolve a frame index operand of an instruction
|
/// resolveFrameIndex - Resolve a frame index operand of an instruction
|
||||||
/// to reference the indicated base register plus offset instead.
|
/// to reference the indicated base register plus offset instead.
|
||||||
virtual void resolveFrameIndex(MachineBasicBlock::iterator I,
|
virtual void resolveFrameIndex(MachineInstr &MI, unsigned BaseReg,
|
||||||
unsigned BaseReg, int64_t Offset) const {
|
int64_t Offset) const {
|
||||||
llvm_unreachable("resolveFrameIndex does not exist on this target");
|
llvm_unreachable("resolveFrameIndex does not exist on this target");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,7 +411,7 @@ bool LocalStackSlotPass::insertFrameReferenceRegisters(MachineFunction &Fn) {
|
|||||||
|
|
||||||
// Modify the instruction to use the new base register rather
|
// Modify the instruction to use the new base register rather
|
||||||
// than the frame index operand.
|
// than the frame index operand.
|
||||||
TRI->resolveFrameIndex(I, BaseReg, Offset);
|
TRI->resolveFrameIndex(*I, BaseReg, Offset);
|
||||||
DEBUG(dbgs() << "Resolved: " << *MI);
|
DEBUG(dbgs() << "Resolved: " << *MI);
|
||||||
|
|
||||||
++NumReplacements;
|
++NumReplacements;
|
||||||
|
@ -595,10 +595,8 @@ materializeFrameBaseRegister(MachineBasicBlock *MBB,
|
|||||||
AddDefaultCC(MIB);
|
AddDefaultCC(MIB);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void ARMBaseRegisterInfo::resolveFrameIndex(MachineInstr &MI, unsigned BaseReg,
|
||||||
ARMBaseRegisterInfo::resolveFrameIndex(MachineBasicBlock::iterator I,
|
int64_t Offset) const {
|
||||||
unsigned BaseReg, int64_t Offset) const {
|
|
||||||
MachineInstr &MI = *I;
|
|
||||||
MachineBasicBlock &MBB = *MI.getParent();
|
MachineBasicBlock &MBB = *MI.getParent();
|
||||||
MachineFunction &MF = *MBB.getParent();
|
MachineFunction &MF = *MBB.getParent();
|
||||||
const ARMBaseInstrInfo &TII =
|
const ARMBaseInstrInfo &TII =
|
||||||
|
@ -150,8 +150,8 @@ public:
|
|||||||
void materializeFrameBaseRegister(MachineBasicBlock *MBB,
|
void materializeFrameBaseRegister(MachineBasicBlock *MBB,
|
||||||
unsigned BaseReg, int FrameIdx,
|
unsigned BaseReg, int FrameIdx,
|
||||||
int64_t Offset) const override;
|
int64_t Offset) const override;
|
||||||
void resolveFrameIndex(MachineBasicBlock::iterator I,
|
void resolveFrameIndex(MachineInstr &MI, unsigned BaseReg,
|
||||||
unsigned BaseReg, int64_t Offset) const override;
|
int64_t Offset) const override;
|
||||||
bool isFrameOffsetLegal(const MachineInstr *MI,
|
bool isFrameOffsetLegal(const MachineInstr *MI,
|
||||||
int64_t Offset) const override;
|
int64_t Offset) const override;
|
||||||
|
|
||||||
|
@ -482,10 +482,8 @@ rewriteFrameIndex(MachineBasicBlock::iterator II, unsigned FrameRegIdx,
|
|||||||
return Offset == 0;
|
return Offset == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void Thumb1RegisterInfo::resolveFrameIndex(MachineInstr &MI, unsigned BaseReg,
|
||||||
Thumb1RegisterInfo::resolveFrameIndex(MachineBasicBlock::iterator I,
|
int64_t Offset) const {
|
||||||
unsigned BaseReg, int64_t Offset) const {
|
|
||||||
MachineInstr &MI = *I;
|
|
||||||
const ARMBaseInstrInfo &TII =
|
const ARMBaseInstrInfo &TII =
|
||||||
*static_cast<const ARMBaseInstrInfo*>(
|
*static_cast<const ARMBaseInstrInfo*>(
|
||||||
MI.getParent()->getParent()->getTarget().getInstrInfo());
|
MI.getParent()->getParent()->getTarget().getInstrInfo());
|
||||||
|
@ -47,8 +47,8 @@ public:
|
|||||||
bool rewriteFrameIndex(MachineBasicBlock::iterator II, unsigned FrameRegIdx,
|
bool rewriteFrameIndex(MachineBasicBlock::iterator II, unsigned FrameRegIdx,
|
||||||
unsigned FrameReg, int &Offset,
|
unsigned FrameReg, int &Offset,
|
||||||
const ARMBaseInstrInfo &TII) const;
|
const ARMBaseInstrInfo &TII) const;
|
||||||
void resolveFrameIndex(MachineBasicBlock::iterator I,
|
void resolveFrameIndex(MachineInstr &MI, unsigned BaseReg,
|
||||||
unsigned BaseReg, int64_t Offset) const override;
|
int64_t Offset) const override;
|
||||||
bool saveScavengerRegister(MachineBasicBlock &MBB,
|
bool saveScavengerRegister(MachineBasicBlock &MBB,
|
||||||
MachineBasicBlock::iterator I,
|
MachineBasicBlock::iterator I,
|
||||||
MachineBasicBlock::iterator &UseMI,
|
MachineBasicBlock::iterator &UseMI,
|
||||||
|
@ -299,10 +299,8 @@ void ARM64RegisterInfo::materializeFrameBaseRegister(MachineBasicBlock *MBB,
|
|||||||
.addImm(Shifter);
|
.addImm(Shifter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARM64RegisterInfo::resolveFrameIndex(MachineBasicBlock::iterator I,
|
void ARM64RegisterInfo::resolveFrameIndex(MachineInstr &MI, unsigned BaseReg,
|
||||||
unsigned BaseReg,
|
|
||||||
int64_t Offset) const {
|
int64_t Offset) const {
|
||||||
MachineInstr &MI = *I;
|
|
||||||
int Off = Offset; // ARM doesn't need the general 64-bit offsets
|
int Off = Offset; // ARM doesn't need the general 64-bit offsets
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ public:
|
|||||||
void materializeFrameBaseRegister(MachineBasicBlock *MBB, unsigned BaseReg,
|
void materializeFrameBaseRegister(MachineBasicBlock *MBB, unsigned BaseReg,
|
||||||
int FrameIdx,
|
int FrameIdx,
|
||||||
int64_t Offset) const override;
|
int64_t Offset) const override;
|
||||||
void resolveFrameIndex(MachineBasicBlock::iterator I, unsigned BaseReg,
|
void resolveFrameIndex(MachineInstr &MI, unsigned BaseReg,
|
||||||
int64_t Offset) const override;
|
int64_t Offset) const override;
|
||||||
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
|
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
|
||||||
unsigned FIOperandNum,
|
unsigned FIOperandNum,
|
||||||
|
@ -959,11 +959,8 @@ materializeFrameBaseRegister(MachineBasicBlock *MBB,
|
|||||||
.addFrameIndex(FrameIdx).addImm(Offset);
|
.addFrameIndex(FrameIdx).addImm(Offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void PPCRegisterInfo::resolveFrameIndex(MachineInstr &MI, unsigned BaseReg,
|
||||||
PPCRegisterInfo::resolveFrameIndex(MachineBasicBlock::iterator I,
|
int64_t Offset) const {
|
||||||
unsigned BaseReg, int64_t Offset) const {
|
|
||||||
MachineInstr &MI = *I;
|
|
||||||
|
|
||||||
unsigned FIOperandNum = 0;
|
unsigned FIOperandNum = 0;
|
||||||
while (!MI.getOperand(FIOperandNum).isFI()) {
|
while (!MI.getOperand(FIOperandNum).isFI()) {
|
||||||
++FIOperandNum;
|
++FIOperandNum;
|
||||||
|
@ -92,8 +92,8 @@ public:
|
|||||||
void materializeFrameBaseRegister(MachineBasicBlock *MBB,
|
void materializeFrameBaseRegister(MachineBasicBlock *MBB,
|
||||||
unsigned BaseReg, int FrameIdx,
|
unsigned BaseReg, int FrameIdx,
|
||||||
int64_t Offset) const;
|
int64_t Offset) const;
|
||||||
void resolveFrameIndex(MachineBasicBlock::iterator I,
|
void resolveFrameIndex(MachineInstr &MI, unsigned BaseReg,
|
||||||
unsigned BaseReg, int64_t Offset) const;
|
int64_t Offset) const;
|
||||||
bool isFrameOffsetLegal(const MachineInstr *MI, int64_t Offset) const;
|
bool isFrameOffsetLegal(const MachineInstr *MI, int64_t Offset) const;
|
||||||
|
|
||||||
// Debug information queries.
|
// Debug information queries.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user