Mask out reserved registers when constructing the set of allocatable regs.

llvm-svn: 112828
This commit is contained in:
Jim Grosbach 2010-09-02 16:31:21 +00:00
parent 5a1df805e5
commit 5d43a35e6d
1 changed files with 5 additions and 0 deletions

View File

@ -80,6 +80,11 @@ BitVector TargetRegisterInfo::getAllocatableSet(const MachineFunction &MF,
for (TargetRegisterInfo::regclass_iterator I = regclass_begin(),
E = regclass_end(); I != E; ++I)
getAllocatableSetForRC(MF, *I, Allocatable);
// Mask out the reserved registers
BitVector Reserved = getReservedRegs(MF);
Allocatable ^= Reserved & Allocatable;
return Allocatable;
}