Don't hoist instructions that have implicit uses or defines. Before, it was
authorBill Wendling <isanbard@gmail.com>
Mon, 18 Aug 2008 00:33:49 +0000 (00:33 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 18 Aug 2008 00:33:49 +0000 (00:33 +0000)
hoisting out some "test" and "cmp" instructions. This was obvious badness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54908 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineLICM.cpp

index 758f42a3f5d9d4c327fec5e693d31ca91a3e24c9..302581f4dd516c329b3bfaf3292a32ffae123441 100644 (file)
@@ -264,6 +264,11 @@ bool MachineLICM::IsLoopInvariantInst(MachineInstr &I) {
       }
     });
 
+  if (I.getDesc().getImplicitDefs() || I.getDesc().getImplicitUses()) {
+    DOUT << "Cannot hoist with implicit defines or uses\n";
+    return false;
+  }
+
   // The instruction is loop invariant if all of its operands are.
   for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
     const MachineOperand &MO = I.getOperand(i);