[llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.cpp

Dale Johannesen dalej at apple.com
Wed Jun 13 11:00:16 PDT 2007



Changes in directory llvm/lib/Target/ARM:

ARMInstrInfo.cpp updated: 1.35 -> 1.36
---
Log message:

Handle blocks with 2 unconditional branches in AnalyzeBranch.


---
Diffs of the changes:  (+10 -0)

 ARMInstrInfo.cpp |   10 ++++++++++
 1 files changed, 10 insertions(+)


Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp
diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.35 llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.36
--- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.35	Fri Jun  8 16:59:56 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.cpp	Wed Jun 13 12:59:52 2007
@@ -345,6 +345,16 @@
     return false;
   }
   
+  // If the block ends with two B's or tB's, handle it.  The second one is not
+  // executed, so remove it.
+  if ((SecondLastOpc == ARM::B || SecondLastOpc==ARM::tB) &&
+      (LastOpc == ARM::B || LastOpc == ARM::tB)) {
+    TBB = SecondLastInst->getOperand(0).getMachineBasicBlock();
+    I = LastInst;
+    I->eraseFromParent();
+    return false;
+  }
+
   // Otherwise, can't handle this.
   return true;
 }






More information about the llvm-commits mailing list