implement uncond branch insertion for the branch folding pass
authorChris Lattner <sabre@nondot.org>
Tue, 24 Oct 2006 16:44:55 +0000 (16:44 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 24 Oct 2006 16:44:55 +0000 (16:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31159 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/IA64/IA64InstrInfo.cpp
lib/Target/IA64/IA64InstrInfo.h

index 81b3277ed61dbd46b1d97cbefcfd6a9688cf75b1..a4cdbce6bf11af7ae0cc93e7922b8f7cd795805e 100644 (file)
@@ -46,3 +46,10 @@ bool IA64InstrInfo::isMoveInstr(const MachineInstr& MI,
                 // move instruction
 }
 
+void IA64InstrInfo::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, IA64::BRL_NOTCALL, 1).addMBB(TBB);
+}
\ No newline at end of file
index 2e52a9683f96cc4f675f4632d18b1f61a15b4326..ceb5c297377c601b17318cc8d75417bd58c88cc1 100644 (file)
 
 namespace llvm {
 
-/// IA64II - This namespace holds all of the target specific flags that
-/// instruction info tracks.
-/// FIXME: now gone!
-
-  class IA64InstrInfo : public TargetInstrInfo {
+class IA64InstrInfo : public TargetInstrInfo {
   const IA64RegisterInfo RI;
 public:
   IA64InstrInfo();
@@ -41,6 +37,9 @@ public:
   virtual bool isMoveInstr(const MachineInstr& MI,
                            unsigned& sourceReg,
                            unsigned& destReg) const;
+  virtual void InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+                            MachineBasicBlock *FBB,
+                            const std::vector<MachineOperand> &Cond) const;
 
 };