mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
The scavenger should just use getAllocatableSet() rather than reinventing it
locally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112845 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -228,14 +228,6 @@ void RegScavenger::getRegsUsed(BitVector &used, bool includeReserved) {
|
|||||||
used = ~RegsAvailable & ~ReservedRegs;
|
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 {
|
unsigned RegScavenger::FindUnusedReg(const TargetRegisterClass *RC) const {
|
||||||
for (TargetRegisterClass::iterator I = RC->begin(), E = RC->end();
|
for (TargetRegisterClass::iterator I = RC->begin(), E = RC->end();
|
||||||
I != E; ++I)
|
I != E; ++I)
|
||||||
@@ -330,11 +322,9 @@ unsigned RegScavenger::findSurvivorReg(MachineBasicBlock::iterator StartMI,
|
|||||||
unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
|
unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC,
|
||||||
MachineBasicBlock::iterator I,
|
MachineBasicBlock::iterator I,
|
||||||
int SPAdj) {
|
int SPAdj) {
|
||||||
// Mask off the registers which are not in the TargetRegisterClass.
|
// Consider all allocatable registers in the register class initially
|
||||||
BitVector Candidates(NumPhysRegs, false);
|
BitVector Candidates =
|
||||||
CreateRegClassMask(RC, Candidates);
|
TRI->getAllocatableSet(*I->getParent()->getParent(), RC);
|
||||||
// Do not include reserved registers.
|
|
||||||
Candidates ^= ReservedRegs & Candidates;
|
|
||||||
|
|
||||||
// Exclude all the registers being used by the instruction.
|
// Exclude all the registers being used by the instruction.
|
||||||
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
|
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user