From: Evan Cheng Date: Mon, 17 May 2010 01:47:47 +0000 (+0000) Subject: Yes, if the redef is a copy, update the old val# with the copy. But make sure to... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ad6c5a20ba87e7aba91ef7e8b270715a25379770;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103922 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 99d94c30150..2ad91584369 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/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 = 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 = 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);