aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineSink.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-13 20:34:42 +0000
committerDan Gohman <gohman@apple.com>2010-05-13 20:34:42 +0000
commita858f3e98f4ebe01e1e9fb3f1733dbcd4799d452 (patch)
treed5f6dc0117786538e247416458b5f8fb9bed5367 /lib/CodeGen/MachineSink.cpp
parent377fe4161dd5ee1602959bff10c05bd57dfbf212 (diff)
downloadexternal_llvm-a858f3e98f4ebe01e1e9fb3f1733dbcd4799d452.tar.gz
external_llvm-a858f3e98f4ebe01e1e9fb3f1733dbcd4799d452.tar.bz2
external_llvm-a858f3e98f4ebe01e1e9fb3f1733dbcd4799d452.zip
Teach MachineLICM and MachineSink how to clear kill flags conservatively
when they move instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineSink.cpp')
-rw-r--r--lib/CodeGen/MachineSink.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineSink.cpp b/lib/CodeGen/MachineSink.cpp
index ef489dc556..1610e6c961 100644
--- a/lib/CodeGen/MachineSink.cpp
+++ b/lib/CodeGen/MachineSink.cpp
@@ -314,5 +314,10 @@ bool MachineSinking::SinkInstruction(MachineInstr *MI, bool &SawStore) {
// Move the instruction.
SuccToSinkTo->splice(InsertPos, ParentBlock, MI,
++MachineBasicBlock::iterator(MI));
+
+ // Conservatively, clear any kill flags, since it's possible that
+ // they are no longer correct.
+ MI->clearKillInfo();
+
return true;
}