implement uncond branch insertion so alpha works work branchfolding.
authorChris Lattner <sabre@nondot.org>
Tue, 24 Oct 2006 16:41:36 +0000 (16:41 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 24 Oct 2006 16:41:36 +0000 (16:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31158 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Alpha/AlphaInstrInfo.cpp
lib/Target/Alpha/AlphaInstrInfo.h

index c30f38aee3a0cacc02f733909e5855d8109729b8..84f54803a6361a228d6cab2aaaf11da41dcf802b 100644 (file)
@@ -83,3 +83,10 @@ AlphaInstrInfo::isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const {
   return 0;
 }
 
+void AlphaInstrInfo::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, Alpha::BR, 1).addMBB(TBB);
+}
\ No newline at end of file
index 7eed9effbf1ec87eb538ffc87e6106b8d5ec0cfd..25a4841c8ea8c0cf389668420b6fc6cf73eca64f 100644 (file)
@@ -38,6 +38,10 @@ public:
   
   virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
   virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
+  
+  virtual void InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+                            MachineBasicBlock *FBB,
+                            const std::vector<MachineOperand> &Cond) const;
 };
 
 }