implement uncond branch insertion, mark branches with isBranch.
authorChris Lattner <sabre@nondot.org>
Tue, 24 Oct 2006 16:47:57 +0000 (16:47 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 24 Oct 2006 16:47:57 +0000 (16:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31160 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrInfo.cpp
lib/Target/ARM/ARMInstrInfo.h
lib/Target/ARM/ARMInstrInfo.td

index 810c254f9c076b3229705d5772f42a587596f0b5..c61d83630c95a3d66d6380d0abf752c7e750d775 100644 (file)
@@ -48,3 +48,11 @@ bool ARMInstrInfo::isMoveInstr(const MachineInstr &MI,
   }
   return false;
 }
+
+void ARMInstrInfo::InsertBranch(MachineBasicBlock &MBB,MachineBasicBlock *TBB,
+                                  MachineBasicBlock *FBB,
+                                  const std::vector<MachineOperand> &Cond)const{
+  // Can only insert uncond branches so far.
+  assert(Cond.empty() && !FBB && TBB && "Can only handle uncond branches!");
+  BuildMI(&MBB, ARM::b, 1).addMBB(TBB);
+}
\ No newline at end of file
index 6318caa8db05955951729067cb124c9adac92cb1..0621c70d14b7a3de558d1897684908c739021217 100644 (file)
@@ -40,6 +40,10 @@ public:
   ///
   virtual bool isMoveInstr(const MachineInstr &MI,
                            unsigned &SrcReg, unsigned &DstReg) const;
+
+  virtual void InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+                            MachineBasicBlock *FBB,
+                            const std::vector<MachineOperand> &Cond) const;
 };
 
 }
index 816970f1169fda86fd96cca00be233793872f2a8..f2100e11ca4de12df9a3b3df04b20e875e988f49 100644 (file)
@@ -227,7 +227,7 @@ let Defs = [R0] in {
   def UMULL   : IntBinOp<"umull r12,", mulhu>;
 }
 
-let isTerminator = 1 in {
+let isTerminator = 1, isBranch = 1 in {
   def bcond   : InstARM<(ops brtarget:$dst, CCOp:$cc),
                            "b$cc $dst",
                            [(armbr bb:$dst, imm:$cc)]>;