Avoid creating BitVector temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149188 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2012-01-29 01:29:25 +00:00
parent 19de016955
commit 685c23e758

View File

@ -234,10 +234,10 @@ void RegScavenger::forward() {
}
void RegScavenger::getRegsUsed(BitVector &used, bool includeReserved) {
if (includeReserved)
used = ~RegsAvailable;
else
used = ~RegsAvailable & ~ReservedRegs;
used = RegsAvailable;
if (!includeReserved)
used |= ReservedRegs;
used.flip();
}
unsigned RegScavenger::FindUnusedReg(const TargetRegisterClass *RC) const {
@ -352,9 +352,9 @@ unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
// RegsAvailable, as RegsAvailable does not take aliases into account.
// That's what getRegsAvailable() is for.
BitVector Available = getRegsAvailable(RC);
if ((Candidates & Available).any())
Candidates &= Available;
Available &= Candidates;
if (Available.any())
Candidates = Available;
// Find the register whose use is furthest away.
MachineBasicBlock::iterator UseMI;