mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 02:25:01 +00:00
Fix PR6520. An earlyclobber physreg must not be allocated to anything else.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103133 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -843,8 +843,18 @@ void RALocal::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
||||
SmallVector<unsigned, 8> Kills;
|
||||
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
|
||||
MachineOperand &MO = MI->getOperand(i);
|
||||
if (!MO.isReg() || !MO.isKill()) continue;
|
||||
|
||||
if (!MO.isReg()) continue;
|
||||
unsigned Reg = MO.getReg();
|
||||
if (!Reg) continue;
|
||||
|
||||
// Avoid allocating assigned early clobbers below.
|
||||
if (MO.isEarlyClobber() && TargetRegisterInfo::isPhysicalRegister(Reg)) {
|
||||
spillPhysReg(MBB, MI, Reg, true); // Spill any existing value in reg
|
||||
PhysRegsUsed[Reg] = 0; // It is free and reserved now
|
||||
AddToPhysRegsUseOrder(Reg);
|
||||
}
|
||||
|
||||
if (!MO.isKill()) continue;
|
||||
if (!MO.isImplicit())
|
||||
Kills.push_back(MO.getReg());
|
||||
else if (!isReadModWriteImplicitKill(MI, MO.getReg()))
|
||||
|
Reference in New Issue
Block a user