mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-25 21:16:19 +00:00
Oops. Didn't mean to check in a quick hack.
llvm-svn: 36227
This commit is contained in:
parent
1677782ef0
commit
fe5856c4f3
@ -34,18 +34,26 @@ MRegisterInfo::MRegisterInfo(const TargetRegisterDesc *D, unsigned NR,
|
||||
|
||||
MRegisterInfo::~MRegisterInfo() {}
|
||||
|
||||
/// getAllocatableSetForRC - Toggle the bits that represent allocatable
|
||||
/// registers for the specific register class.
|
||||
static void getAllocatableSetForRC(MachineFunction &MF,
|
||||
const TargetRegisterClass *RC, BitVector &R){
|
||||
for (TargetRegisterClass::iterator I = RC->allocation_order_begin(MF),
|
||||
E = RC->allocation_order_end(MF); I != E; ++I)
|
||||
R.set(*I);
|
||||
}
|
||||
|
||||
BitVector MRegisterInfo::getAllocatableSet(MachineFunction &MF,
|
||||
const TargetRegisterClass *RC) const {
|
||||
BitVector Allocatable(NumRegs);
|
||||
for (MRegisterInfo::regclass_iterator I = regclass_begin(),
|
||||
E = regclass_end(); I != E; ++I) {
|
||||
const TargetRegisterClass *TRC = *I;
|
||||
if (RC && TRC != RC)
|
||||
continue;
|
||||
for (TargetRegisterClass::iterator I = TRC->allocation_order_begin(MF),
|
||||
E = TRC->allocation_order_end(MF); I != E; ++I)
|
||||
Allocatable.set(*I);
|
||||
if (RC) {
|
||||
getAllocatableSetForRC(MF, RC, Allocatable);
|
||||
return Allocatable;
|
||||
}
|
||||
|
||||
for (MRegisterInfo::regclass_iterator I = regclass_begin(),
|
||||
E = regclass_end(); I != E; ++I)
|
||||
getAllocatableSetForRC(MF, *I, Allocatable);
|
||||
return Allocatable;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user