Add <imp-def> and <imp-kill> operands when replacing virtual sub-register defs and kills.

An instruction like this:

  %reg1097:1<def> = VMOVSR %R3<kill>, 14, %reg0

Must be replaced with this when substituting physical registers:

  %S0<def> = VMOVSR %R3<kill>, 14, %reg0, %D0<imp-def>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92812 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2010-01-06 00:29:28 +00:00
parent 3f09487404
commit 8efadf94b5
3 changed files with 52 additions and 18 deletions

View File

@ -1314,3 +1314,12 @@ bool MachineInstr::addRegisterDead(unsigned IncomingReg,
true /*IsDead*/));
return true;
}
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*/));
}