[llvm-commits] [llvm] r114688 - /llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp

Evan Cheng evan.cheng at apple.com
Thu Sep 23 12:42:03 PDT 2010


Author: evancheng
Date: Thu Sep 23 14:42:03 2010
New Revision: 114688

URL: http://llvm.org/viewvc/llvm-project?rev=114688&view=rev
Log:
Fix r114632. Return if the only terminator is an unconditional branch after the redundant ones are deleted.

Modified:
    llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=114688&r1=114687&r2=114688&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Sep 23 14:42:03 2010
@@ -284,9 +284,11 @@
       LastInst->eraseFromParent();
       LastInst = SecondLastInst;
       LastOpc = LastInst->getOpcode();
-      if (I == MBB.begin() || !isUnpredicatedTerminator(--I))
-        break;
-      else {
+      if (I == MBB.begin() || !isUnpredicatedTerminator(--I)) {
+        // Return now the only terminator is an unconditional branch.
+        TBB = LastInst->getOperand(0).getMBB();
+        return false;
+      } else {
         SecondLastInst = I;
         SecondLastOpc = SecondLastInst->getOpcode();
       }





More information about the llvm-commits mailing list