Prevent LiveRangeEdit from deleting bundled instructions.
authorAndrew Trick <atrick@apple.com>
Sat, 22 Jun 2013 00:33:48 +0000 (00:33 +0000)
committerAndrew Trick <atrick@apple.com>
Sat, 22 Jun 2013 00:33:48 +0000 (00:33 +0000)
We have no targets on trunk that bundle before regalloc. However, we
have been advertising regalloc as bundle safe for use with out-of-tree
targets. We need to at least contain the parts of the code that are
still unsafe.

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

lib/CodeGen/LiveRangeEdit.cpp

index d215d0c28a4b8c36c01437c30c47554cb067b0e8..792ef5405e2a67705974261e458e76b10f88bb1a 100644 (file)
@@ -220,6 +220,10 @@ void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink) {
   assert(MI->allDefsAreDead() && "Def isn't really dead");
   SlotIndex Idx = LIS.getInstructionIndex(MI).getRegSlot();
 
+  // Never delete a bundled instruction.
+  if (MI->isBundled()) {
+    return;
+  }
   // Never delete inline asm.
   if (MI->isInlineAsm()) {
     DEBUG(dbgs() << "Won't delete: " << Idx << '\t' << *MI);