diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-03-01 02:27:30 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-03-01 02:27:30 +0000 |
| commit | d6450ba1dc05a28064df4397908e583e0e6e374d (patch) | |
| tree | f75c7d72a90e3f511cadb6301e078abfdb0292cf | |
| parent | 31215d1395c7c602dfd6f9f610819121960a5f84 (diff) | |
| download | bcm5719-llvm-d6450ba1dc05a28064df4397908e583e0e6e374d.tar.gz bcm5719-llvm-d6450ba1dc05a28064df4397908e583e0e6e374d.zip | |
A restore is promoted to copy (or deleted entirely), remove the kill from the last use of the targetted register.
llvm-svn: 34773
| -rw-r--r-- | llvm/lib/CodeGen/VirtRegMap.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index ceb4acee698..0f5c48aaa9b 100644 --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/lib/CodeGen/VirtRegMap.cpp @@ -855,14 +855,15 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) { } else DOUT << "Removing now-noop copy: " << MI; - // Extend the live range of the MI that last kill the register if - // the next MI reuse it. + // Either way, the live range of the last kill of InReg has been + // extended. Remove its kill. MachineOperand *MOK = SSMI->findRegisterUseOperand(InReg, true); if (MOK && NextMII != MBB.end()) { + MOK->unsetIsKill(); + // If NextMII uses InReg (must be the copy?), mark it killed. MachineOperand *MOU = NextMII->findRegisterUseOperand(InReg); if (MOU) { MOU->setIsKill(); - MOK->unsetIsKill(); Spills.UpdateLastUse(InReg, &(*NextMII)); } } |

