Add <imp-def> of super-register when lowering SUBREG_TO_REG.

Patch by Tyler Nowicki!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160888 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2012-07-27 20:19:49 +00:00
parent e82fafe9e2
commit 72e7dbf88b
2 changed files with 8 additions and 5 deletions

View File

@@ -131,13 +131,16 @@ bool ExpandPostRA::LowerSubregToReg(MachineInstr *MI) {
} else { } else {
TII->copyPhysReg(*MBB, MI, MI->getDebugLoc(), DstSubReg, InsReg, TII->copyPhysReg(*MBB, MI, MI->getDebugLoc(), DstSubReg, InsReg,
MI->getOperand(2).isKill()); MI->getOperand(2).isKill());
// Implicitly define DstReg for subsequent uses.
MachineBasicBlock::iterator CopyMI = MI;
--CopyMI;
CopyMI->addRegisterDefined(DstReg);
// Transfer the kill/dead flags, if needed. // Transfer the kill/dead flags, if needed.
if (MI->getOperand(0).isDead()) if (MI->getOperand(0).isDead())
TransferDeadFlag(MI, DstSubReg, TRI); TransferDeadFlag(MI, DstSubReg, TRI);
DEBUG({ DEBUG(dbgs() << "subreg: " << *CopyMI);
MachineBasicBlock::iterator dMI = MI;
dbgs() << "subreg: " << *(--dMI);
});
} }
DEBUG(dbgs() << '\n'); DEBUG(dbgs() << '\n');

View File

@@ -1,4 +1,4 @@
; RUN: llc < %s -mcpu=generic -regalloc=fast -optimize-regalloc=0 -verify-machineinstrs -mtriple=x86_64-apple-darwin10 ; RUN: llc < %s -regalloc=fast -optimize-regalloc=0 -verify-machineinstrs -mtriple=x86_64-apple-darwin10
; <rdar://problem/7755473> ; <rdar://problem/7755473>
; PR12821 ; PR12821