diff options
| author | Jim Grosbach <grosbach@apple.com> | 2010-09-02 18:29:04 +0000 |
|---|---|---|
| committer | Jim Grosbach <grosbach@apple.com> | 2010-09-02 18:29:04 +0000 |
| commit | 35f3252036bf5d4ccc5d78c972465e47047165d4 (patch) | |
| tree | a627fc278ceb1cb1c276c7cefd3af2f783c14935 /llvm/lib/CodeGen/RegisterScavenging.cpp | |
| parent | 9e857449de7d901680f9ef3777e95bbdceeda34d (diff) | |
| download | bcm5719-llvm-35f3252036bf5d4ccc5d78c972465e47047165d4.tar.gz bcm5719-llvm-35f3252036bf5d4ccc5d78c972465e47047165d4.zip | |
The scavenger should just use getAllocatableSet() rather than reinventing it
locally.
llvm-svn: 112845
Diffstat (limited to 'llvm/lib/CodeGen/RegisterScavenging.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/RegisterScavenging.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/RegisterScavenging.cpp b/llvm/lib/CodeGen/RegisterScavenging.cpp index 9e9b48df551..a2580b85bcc 100644 --- a/llvm/lib/CodeGen/RegisterScavenging.cpp +++ b/llvm/lib/CodeGen/RegisterScavenging.cpp @@ -228,14 +228,6 @@ void RegScavenger::getRegsUsed(BitVector &used, bool includeReserved) { used = ~RegsAvailable & ~ReservedRegs; } -/// CreateRegClassMask - Set the bits that represent the registers in the -/// TargetRegisterClass. -static void CreateRegClassMask(const TargetRegisterClass *RC, BitVector &Mask) { - for (TargetRegisterClass::iterator I = RC->begin(), E = RC->end(); I != E; - ++I) - Mask.set(*I); -} - unsigned RegScavenger::FindUnusedReg(const TargetRegisterClass *RC) const { for (TargetRegisterClass::iterator I = RC->begin(), E = RC->end(); I != E; ++I) @@ -330,11 +322,9 @@ unsigned RegScavenger::findSurvivorReg(MachineBasicBlock::iterator StartMI, unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC, MachineBasicBlock::iterator I, int SPAdj) { - // Mask off the registers which are not in the TargetRegisterClass. - BitVector Candidates(NumPhysRegs, false); - CreateRegClassMask(RC, Candidates); - // Do not include reserved registers. - Candidates ^= ReservedRegs & Candidates; + // Consider all allocatable registers in the register class initially + BitVector Candidates = + TRI->getAllocatableSet(*I->getParent()->getParent(), RC); // Exclude all the registers being used by the instruction. for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) { |

