diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-01-26 17:52:15 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-01-26 17:52:15 +0000 |
commit | 1a96c914315b0286d84c507d696484e2c95875a4 (patch) | |
tree | 58b1f0a6bb6afe302f820c7970a4e6fe1cb5d1b7 /lib/CodeGen/MachineCopyPropagation.cpp | |
parent | ef4d3ebe2a36ebfd9370e1efbe74dff13f64c40f (diff) | |
download | llvm-1a96c914315b0286d84c507d696484e2c95875a4.tar.gz llvm-1a96c914315b0286d84c507d696484e2c95875a4.tar.bz2 llvm-1a96c914315b0286d84c507d696484e2c95875a4.tar.xz |
Clear kill flags before propagating a copy.
The live range of the source register may be extended when a redundant
copy is eliminated. Make sure any kill flags between the two copies are
cleared.
This fixes PR11765.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149069 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineCopyPropagation.cpp')
-rw-r--r-- | lib/CodeGen/MachineCopyPropagation.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineCopyPropagation.cpp b/lib/CodeGen/MachineCopyPropagation.cpp index c82f81b6b5..f96c869143 100644 --- a/lib/CodeGen/MachineCopyPropagation.cpp +++ b/lib/CodeGen/MachineCopyPropagation.cpp @@ -142,7 +142,12 @@ bool MachineCopyPropagation::CopyPropagateBlock(MachineBasicBlock &MBB) { // %RSP<def> = COPY %RAX // CALL // %RAX<def> = COPY %RSP - CopyMI->getOperand(1).setIsKill(false); + + // Clear any kills of Def between CopyMI and MI. This extends the + // live range. + for (MachineBasicBlock::iterator I = CopyMI, E = MI; I != E; ++I) + I->clearRegisterKills(Def, TRI); + MI->eraseFromParent(); Changed = true; ++NumDeletes; |