Clamp down on sinking of lots of instructions.
authorChris Lattner <sabre@nondot.org>
Thu, 10 Jan 2008 22:35:15 +0000 (22:35 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 10 Jan 2008 22:35:15 +0000 (22:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45841 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineSink.cpp

index c832f0a65c817b7782fce2349d69dd6ea118fd6d..b83d844a16234e665bd6948f2e2f075e6e8a745c 100644 (file)
@@ -130,6 +130,15 @@ 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) {
+  const TargetInstrDesc &TID = MI->getDesc();
+  
+  // Ignore stuff that we obviously can't sink.
+  if (TID.mayStore() || TID.isCall() || TID.isReturn() || TID.isBranch())
+    return false;
+
+  if (TID.mayLoad())
+    return false;
+  
   // Don't sink things with side-effects we don't understand.
   if (TII->hasUnmodelledSideEffects(MI))
     return false;