mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Fix bug: Jello/2003-08-23-RegisterAllocatePhysReg.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8095 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -400,6 +400,13 @@ unsigned RA::getReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
|
||||
"Couldn't find a register of the appropriate class!");
|
||||
|
||||
unsigned R = PhysRegsUseOrder[i];
|
||||
|
||||
// We can only use this register if it holds a virtual register (ie, it
|
||||
// can be spilled). Do not use it if it is an explicitly allocated
|
||||
// physical register!
|
||||
assert(PhysRegsUsed.count(R) &&
|
||||
"PhysReg in PhysRegsUseOrder, but is not allocated?");
|
||||
if (PhysRegsUsed[R]) {
|
||||
// If the current register is compatible, use it.
|
||||
if (RegInfo->getRegClass(R) == RC) {
|
||||
PhysReg = R;
|
||||
@ -415,6 +422,7 @@ unsigned RA::getReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert(PhysReg && "Physical register not assigned!?!?");
|
||||
|
||||
|
Reference in New Issue
Block a user