diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-05-17 01:47:47 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-05-17 01:47:47 +0000 |
commit | 166a7993bae64b645439c3bab0afbbab7c02eca7 (patch) | |
tree | cfbba7a205f4512983542b49ca9ce3e287c96457 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 5a2809cbd8b3270b5e019c5db9639ec1afb3dbc5 (diff) | |
download | bcm5719-llvm-166a7993bae64b645439c3bab0afbbab7c02eca7.tar.gz bcm5719-llvm-166a7993bae64b645439c3bab0afbbab7c02eca7.zip |
Yes, if the redef is a copy, update the old val# with the copy. But make sure to clear the copy field if the redef is not a copy.
llvm-svn: 103922
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 99d94c30150..2ad91584369 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -454,14 +454,13 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, // Value#0 is now defined by the 2-addr instruction. OldValNo->def = RedefIndex; - if (!PartReDef) - OldValNo->setCopy(0); - else { - // A re-def may be a copy. e.g. %reg1030:6<def> = VMOVD %reg1026, ... - unsigned SrcReg, DstReg, SrcSubReg, DstSubReg; - if (tii_->isMoveInstr(*mi, SrcReg, DstReg, SrcSubReg, DstSubReg)) - OldValNo->setCopy(&*mi); - } + OldValNo->setCopy(0); + + // A re-def may be a copy. e.g. %reg1030:6<def> = VMOVD %reg1026, ... + unsigned SrcReg, DstReg, SrcSubReg, DstSubReg; + if (PartReDef && + tii_->isMoveInstr(*mi, SrcReg, DstReg, SrcSubReg, DstSubReg)) + OldValNo->setCopy(&*mi); // Add the new live interval which replaces the range for the input copy. LiveRange LR(DefIndex, RedefIndex, ValNo); |