mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
If the first definition of a virtual register is a partial redef, add an
<imp-def> operand for the full register. This ensures that the full physical register is marked live after register allocation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104320 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1388,11 +1388,21 @@ bool MachineInstr::addRegisterDead(unsigned IncomingReg,
|
||||
|
||||
void MachineInstr::addRegisterDefined(unsigned IncomingReg,
|
||||
const TargetRegisterInfo *RegInfo) {
|
||||
MachineOperand *MO = findRegisterDefOperand(IncomingReg, false, RegInfo);
|
||||
if (!MO || MO->getSubReg())
|
||||
addOperand(MachineOperand::CreateReg(IncomingReg,
|
||||
true /*IsDef*/,
|
||||
true /*IsImp*/));
|
||||
if (TargetRegisterInfo::isPhysicalRegister(IncomingReg)) {
|
||||
MachineOperand *MO = findRegisterDefOperand(IncomingReg, false, RegInfo);
|
||||
if (MO)
|
||||
return;
|
||||
} else {
|
||||
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
|
||||
const MachineOperand &MO = getOperand(i);
|
||||
if (MO.isReg() && MO.getReg() == IncomingReg && MO.isDef() &&
|
||||
MO.getSubReg() == 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
addOperand(MachineOperand::CreateReg(IncomingReg,
|
||||
true /*IsDef*/,
|
||||
true /*IsImp*/));
|
||||
}
|
||||
|
||||
unsigned
|
||||
|
Reference in New Issue
Block a user