mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-18 10:24:45 +00:00
MRegisterInfo disowns RegScavenger. It's immutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34706 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -214,12 +214,6 @@ protected:
|
|||||||
virtual ~MRegisterInfo();
|
virtual ~MRegisterInfo();
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// getRegScavenger - Returns pointer to an instance of register scavenger it
|
|
||||||
/// the specific target is making use of one.
|
|
||||||
virtual RegScavenger *getRegScavenger() const {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum { // Define some target independent constants
|
enum { // Define some target independent constants
|
||||||
/// NoRegister - This physical register is not a real target register. It
|
/// NoRegister - This physical register is not a real target register. It
|
||||||
/// is useful as a sentinal.
|
/// is useful as a sentinal.
|
||||||
@@ -398,6 +392,12 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// requiresRegisterScavenging - returns true if the target requires (and
|
||||||
|
/// can make use of) the register scavenger.
|
||||||
|
virtual bool requiresRegisterScavenging() const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// hasFP - Return true if the specified function should have a dedicated frame
|
/// hasFP - Return true if the specified function should have a dedicated frame
|
||||||
/// pointer register. For most targets this is true only if the function has
|
/// pointer register. For most targets this is true only if the function has
|
||||||
/// variable sized allocas or if frame pointer elimination is disabled.
|
/// variable sized allocas or if frame pointer elimination is disabled.
|
||||||
@@ -452,7 +452,8 @@ public:
|
|||||||
/// finished product. The return value is the number of instructions
|
/// finished product. The return value is the number of instructions
|
||||||
/// added to (negative if removed from) the basic block.
|
/// added to (negative if removed from) the basic block.
|
||||||
///
|
///
|
||||||
virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI) const = 0;
|
virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI,
|
||||||
|
RegScavenger *RS = NULL) const = 0;
|
||||||
|
|
||||||
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
||||||
/// the function. The return value is the number of instructions
|
/// the function. The return value is the number of instructions
|
||||||
|
@@ -442,7 +442,7 @@ void PEI::replaceFrameIndices(MachineFunction &Fn) {
|
|||||||
const TargetMachine &TM = Fn.getTarget();
|
const TargetMachine &TM = Fn.getTarget();
|
||||||
assert(TM.getRegisterInfo() && "TM::getRegisterInfo() must be implemented!");
|
assert(TM.getRegisterInfo() && "TM::getRegisterInfo() must be implemented!");
|
||||||
const MRegisterInfo &MRI = *TM.getRegisterInfo();
|
const MRegisterInfo &MRI = *TM.getRegisterInfo();
|
||||||
RegScavenger *RS = MRI.getRegScavenger();
|
RegScavenger *RS = MRI.requiresRegisterScavenging() ? new RegScavenger():NULL;
|
||||||
|
|
||||||
for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) {
|
for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) {
|
||||||
if (RS) RS->reset(BB);
|
if (RS) RS->reset(BB);
|
||||||
@@ -451,7 +451,7 @@ void PEI::replaceFrameIndices(MachineFunction &Fn) {
|
|||||||
if (I->getOperand(i).isFrameIndex()) {
|
if (I->getOperand(i).isFrameIndex()) {
|
||||||
// If this instruction has a FrameIndex operand, we need to use that
|
// If this instruction has a FrameIndex operand, we need to use that
|
||||||
// target machine register info object to eliminate it.
|
// target machine register info object to eliminate it.
|
||||||
MRI.eliminateFrameIndex(I);
|
MRI.eliminateFrameIndex(I, RS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Update register states.
|
// Update register states.
|
||||||
|
Reference in New Issue
Block a user