diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-10-15 21:57:41 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-10-15 21:57:41 +0000 |
commit | c30a9af2d78765e1f7c479d7acd1fd1e4b183286 (patch) | |
tree | ee31057ef6c62608e562a43b48a2a78530aee9a3 /llvm/lib/CodeGen/MachineCSE.cpp | |
parent | 57e310613c8cda5ab050bb132efe848cd5562a5f (diff) | |
download | bcm5719-llvm-c30a9af2d78765e1f7c479d7acd1fd1e4b183286.tar.gz bcm5719-llvm-c30a9af2d78765e1f7c479d7acd1fd1e4b183286.zip |
Switch most getReservedRegs() clients to the MRI equivalent.
Using the cached bit vector in MRI avoids comstantly allocating and
recomputing the reserved register bit vector.
llvm-svn: 165983
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineCSE.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp index 896461fd194..15519c105c8 100644 --- a/llvm/lib/CodeGen/MachineCSE.cpp +++ b/llvm/lib/CodeGen/MachineCSE.cpp @@ -64,7 +64,6 @@ namespace { ScopeMap.clear(); Exps.clear(); AllocatableRegs.clear(); - ReservedRegs.clear(); } private: @@ -79,7 +78,6 @@ namespace { SmallVector<MachineInstr*, 64> Exps; unsigned CurrVN; BitVector AllocatableRegs; - BitVector ReservedRegs; bool PerformTrivialCoalescing(MachineInstr *MI, MachineBasicBlock *MBB); bool isPhysDefTriviallyDead(unsigned Reg, @@ -242,7 +240,7 @@ bool MachineCSE::PhysRegDefsReach(MachineInstr *CSMI, MachineInstr *MI, return false; for (unsigned i = 0, e = PhysDefs.size(); i != e; ++i) { - if (AllocatableRegs.test(PhysDefs[i]) || ReservedRegs.test(PhysDefs[i])) + if (MRI->isAllocatable(PhysDefs[i]) || MRI->isReserved(PhysDefs[i])) // Avoid extending live range of physical registers if they are //allocatable or reserved. return false; @@ -636,6 +634,5 @@ bool MachineCSE::runOnMachineFunction(MachineFunction &MF) { AA = &getAnalysis<AliasAnalysis>(); DT = &getAnalysis<MachineDominatorTree>(); AllocatableRegs = TRI->getAllocatableSet(MF); - ReservedRegs = TRI->getReservedRegs(MF); return PerformCSE(DT->getRootNode()); } |