From 0476b2852541575cc1628685cdb1d02d38ba6f87 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 24 Oct 2006 16:41:36 +0000 Subject: [PATCH] implement uncond branch insertion so alpha works work branchfolding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31158 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Alpha/AlphaInstrInfo.cpp | 7 +++++++ lib/Target/Alpha/AlphaInstrInfo.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/lib/Target/Alpha/AlphaInstrInfo.cpp b/lib/Target/Alpha/AlphaInstrInfo.cpp index c30f38aee3a..84f54803a63 100644 --- a/lib/Target/Alpha/AlphaInstrInfo.cpp +++ b/lib/Target/Alpha/AlphaInstrInfo.cpp @@ -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 &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 diff --git a/lib/Target/Alpha/AlphaInstrInfo.h b/lib/Target/Alpha/AlphaInstrInfo.h index 7eed9effbf1..25a4841c8ea 100644 --- a/lib/Target/Alpha/AlphaInstrInfo.h +++ b/lib/Target/Alpha/AlphaInstrInfo.h @@ -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 &Cond) const; }; }