1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Fix bug in RegScavenger::scavengeRegister().

Reserved registers are not candidates for scavenging, and they were removed
from the candidate list like this:

CreateRegClassMask(RC, Candidates);
Candidates ^= ReservedRegs;

However, when there are reserved registers outside RC, this causes invalid
bits to be set in Candidates.

llvm-svn: 75847
This commit is contained in:
Jakob Stoklund Olesen 2009-07-15 22:32:11 +00:00
parent 5c64fb5a80
commit d6f85bc49b

View File

@ -426,7 +426,7 @@ unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
// Mask off the registers which are not in the TargetRegisterClass.
BitVector Candidates(NumPhysRegs, false);
CreateRegClassMask(RC, Candidates);
Candidates ^= ReservedRegs; // Do not include reserved registers.
Candidates ^= ReservedRegs & Candidates; // Do not include reserved registers.
// Exclude all the registers being used by the instruction.
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {