forked from OSchip/llvm-project
Re-enable 150652 and 150654 - Make FPSCR non-reserved, and make MachineCSE bail on reserved registers. This *should* be safe as of r150786.
llvm-svn: 150769
This commit is contained in:
parent
0d72bb49f0
commit
5bade3dc6e
|
@ -63,6 +63,8 @@ namespace {
|
||||||
virtual void releaseMemory() {
|
virtual void releaseMemory() {
|
||||||
ScopeMap.clear();
|
ScopeMap.clear();
|
||||||
Exps.clear();
|
Exps.clear();
|
||||||
|
AllocatableRegs.clear();
|
||||||
|
ReservedRegs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -76,6 +78,8 @@ namespace {
|
||||||
ScopedHTType VNT;
|
ScopedHTType VNT;
|
||||||
SmallVector<MachineInstr*, 64> Exps;
|
SmallVector<MachineInstr*, 64> Exps;
|
||||||
unsigned CurrVN;
|
unsigned CurrVN;
|
||||||
|
BitVector AllocatableRegs;
|
||||||
|
BitVector ReservedRegs;
|
||||||
|
|
||||||
bool PerformTrivialCoalescing(MachineInstr *MI, MachineBasicBlock *MBB);
|
bool PerformTrivialCoalescing(MachineInstr *MI, MachineBasicBlock *MBB);
|
||||||
bool isPhysDefTriviallyDead(unsigned Reg,
|
bool isPhysDefTriviallyDead(unsigned Reg,
|
||||||
|
@ -236,9 +240,9 @@ bool MachineCSE::PhysRegDefsReach(MachineInstr *CSMI, MachineInstr *MI,
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (unsigned i = 0, e = PhysDefs.size(); i != e; ++i) {
|
for (unsigned i = 0, e = PhysDefs.size(); i != e; ++i) {
|
||||||
if (TRI->isInAllocatableClass(PhysDefs[i]))
|
if (AllocatableRegs.test(PhysDefs[i]) || ReservedRegs.test(PhysDefs[i]))
|
||||||
// Avoid extending live range of physical registers unless
|
// Avoid extending live range of physical registers if they are
|
||||||
// they are unallocatable.
|
//allocatable or reserved.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
CrossMBB = true;
|
CrossMBB = true;
|
||||||
|
@ -588,5 +592,7 @@ bool MachineCSE::runOnMachineFunction(MachineFunction &MF) {
|
||||||
MRI = &MF.getRegInfo();
|
MRI = &MF.getRegInfo();
|
||||||
AA = &getAnalysis<AliasAnalysis>();
|
AA = &getAnalysis<AliasAnalysis>();
|
||||||
DT = &getAnalysis<MachineDominatorTree>();
|
DT = &getAnalysis<MachineDominatorTree>();
|
||||||
|
AllocatableRegs = TRI->getAllocatableSet(MF);
|
||||||
|
ReservedRegs = TRI->getReservedRegs(MF);
|
||||||
return PerformCSE(DT->getRootNode());
|
return PerformCSE(DT->getRootNode());
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,6 @@ getReservedRegs(const MachineFunction &MF) const {
|
||||||
BitVector Reserved(getNumRegs());
|
BitVector Reserved(getNumRegs());
|
||||||
Reserved.set(ARM::SP);
|
Reserved.set(ARM::SP);
|
||||||
Reserved.set(ARM::PC);
|
Reserved.set(ARM::PC);
|
||||||
Reserved.set(ARM::FPSCR);
|
|
||||||
if (TFI->hasFP(MF))
|
if (TFI->hasFP(MF))
|
||||||
Reserved.set(FramePtr);
|
Reserved.set(FramePtr);
|
||||||
if (hasBasePointer(MF))
|
if (hasBasePointer(MF))
|
||||||
|
|
Loading…
Reference in New Issue