mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Remove the -disable-kill option. The register allocator is buggy with it,
and it was only for debugging in the first place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11557 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
acce13e4cc
commit
56ddada278
@ -31,9 +31,6 @@ namespace {
|
||||
Statistic<> NumSpilled ("ra-local", "Number of registers spilled");
|
||||
Statistic<> NumReloaded("ra-local", "Number of registers reloaded");
|
||||
Statistic<> NumFused ("ra-local", "Number of reloads fused into instructions");
|
||||
cl::opt<bool> DisableKill("disable-kill", cl::Hidden,
|
||||
cl::desc("Disable register kill in local-ra"));
|
||||
|
||||
class RA : public MachineFunctionPass {
|
||||
const TargetMachine *TM;
|
||||
MachineFunction *MF;
|
||||
@ -122,7 +119,6 @@ namespace {
|
||||
}
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
if (!DisableKill)
|
||||
AU.addRequired<LiveVariables>();
|
||||
AU.addRequiredID(PHIEliminationID);
|
||||
AU.addRequiredID(TwoAddressInstructionPassID);
|
||||
@ -263,7 +259,6 @@ void RA::removePhysReg(unsigned PhysReg) {
|
||||
///
|
||||
void RA::spillVirtReg(MachineBasicBlock &MBB, MachineInstr *I,
|
||||
unsigned VirtReg, unsigned PhysReg) {
|
||||
if (!VirtReg && DisableKill) return;
|
||||
assert(VirtReg && "Spilling a physical register is illegal!"
|
||||
" Must not have appropriate kill for the register or use exists beyond"
|
||||
" the intended one.");
|
||||
@ -556,7 +551,6 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
||||
MRegisterInfo::isVirtualRegister(MI->getOperand(i).getReg()))
|
||||
MI = reloadVirtReg(MBB, MI, i);
|
||||
|
||||
if (!DisableKill) {
|
||||
// If this instruction is the last user of anything in registers, kill the
|
||||
// value, freeing the register being used, so it doesn't need to be
|
||||
// spilled to memory.
|
||||
@ -579,7 +573,6 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
||||
removePhysReg(PhysReg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Loop over all of the operands of the instruction, spilling registers that
|
||||
// are defined, and marking explicit destinations in the PhysRegsUsed map.
|
||||
@ -629,7 +622,6 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
||||
MI->SetMachineOperandReg(i, DestPhysReg); // Assign the output register
|
||||
}
|
||||
|
||||
if (!DisableKill) {
|
||||
// If this instruction defines any registers that are immediately dead,
|
||||
// kill them now.
|
||||
//
|
||||
@ -652,7 +644,6 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Rewind the iterator to point to the first flow control instruction...
|
||||
const TargetInstrInfo &TII = TM->getInstrInfo();
|
||||
@ -692,6 +683,7 @@ bool RA::runOnMachineFunction(MachineFunction &Fn) {
|
||||
MF = &Fn;
|
||||
TM = &Fn.getTarget();
|
||||
RegInfo = TM->getRegisterInfo();
|
||||
LV = &getAnalysis<LiveVariables>();
|
||||
|
||||
PhysRegsUsed.assign(RegInfo->getNumRegs(), -1);
|
||||
|
||||
@ -699,9 +691,6 @@ bool RA::runOnMachineFunction(MachineFunction &Fn) {
|
||||
// mapping for all virtual registers
|
||||
Virt2PhysRegMap.assign(MF->getSSARegMap()->getNumVirtualRegs(), 0);
|
||||
|
||||
if (!DisableKill)
|
||||
LV = &getAnalysis<LiveVariables>();
|
||||
|
||||
// Loop over all of the basic blocks, eliminating virtual register references
|
||||
for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
|
||||
MBB != MBBe; ++MBB)
|
||||
|
Loading…
Reference in New Issue
Block a user