don't sink anything with side effects, this makes lots of stuff work, but sinks almos...
authorChris Lattner <sabre@nondot.org>
Sat, 5 Jan 2008 02:33:22 +0000 (02:33 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 5 Jan 2008 02:33:22 +0000 (02:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45617 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineSink.cpp

index dff60f6d395410a53a61f56ec5b7e74ce7462085..31aeea5724a3147fd1af76b21ac1032f4e88f886 100644 (file)
@@ -130,6 +130,10 @@ bool MachineSinking::ProcessBlock(MachineBasicBlock &MBB) {
 /// SinkInstruction - Determine whether it is safe to sink the specified machine
 /// instruction out of its current block into a successor.
 bool MachineSinking::SinkInstruction(MachineInstr *MI) {
+  // Don't sink things with side-effects we don't understand.
+  if (TII->hasUnmodelledSideEffects(MI))
+    return false;
+  
   // Loop over all the operands of the specified instruction.  If there is
   // anything we can't handle, bail out.
   MachineBasicBlock *ParentBlock = MI->getParent();