From 79cb53ce9563fff74605454560e98ea0aa4b523f Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Mon, 1 Nov 2010 21:51:29 +0000 Subject: [PATCH] Update kill flags while rewriting instructions after splitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117959 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SplitKit.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/CodeGen/SplitKit.cpp b/lib/CodeGen/SplitKit.cpp index 5b5b602952e..f8be7d484fe 100644 --- a/lib/CodeGen/SplitKit.cpp +++ b/lib/CodeGen/SplitKit.cpp @@ -822,6 +822,7 @@ void SplitEditor::rewrite(unsigned reg) { for (MachineRegisterInfo::reg_iterator RI = mri_.reg_begin(reg), RE = mri_.reg_end(); RI != RE;) { MachineOperand &MO = RI.getOperand(); + unsigned OpNum = RI.getOperandNo(); MachineInstr *MI = MO.getParent(); ++RI; if (MI->isDebugValue()) { @@ -844,6 +845,8 @@ void SplitEditor::rewrite(unsigned reg) { DEBUG(dbgs() << " rewr BB#" << MI->getParent()->getNumber() << '\t'<< Idx); assert(LI && "No register was live at use"); MO.setReg(LI->reg); + if (MO.isUse() && !MI->isRegTiedToDefOperand(OpNum)) + MO.setIsKill(LI->killedAt(Idx.getDefIndex())); DEBUG(dbgs() << '\t' << *MI); } }