diff options
author | dim <dim@FreeBSD.org> | 2012-04-14 13:54:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-04-14 13:54:10 +0000 |
commit | 1fc08f5e9ef733ef1ce6f363fecedc2260e78974 (patch) | |
tree | 19c69a04768629f2d440944b71cbe90adae0b615 /lib/Target/Alpha/AlphaBranchSelector.cpp | |
parent | 07637c87f826cdf411f0673595e9bc92ebd793f2 (diff) | |
download | FreeBSD-src-1fc08f5e9ef733ef1ce6f363fecedc2260e78974.zip FreeBSD-src-1fc08f5e9ef733ef1ce6f363fecedc2260e78974.tar.gz |
Vendor import of llvm trunk r154661:
http://llvm.org/svn/llvm-project/llvm/trunk@r154661
Diffstat (limited to 'lib/Target/Alpha/AlphaBranchSelector.cpp')
-rw-r--r-- | lib/Target/Alpha/AlphaBranchSelector.cpp | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/lib/Target/Alpha/AlphaBranchSelector.cpp b/lib/Target/Alpha/AlphaBranchSelector.cpp deleted file mode 100644 index 3768117..0000000 --- a/lib/Target/Alpha/AlphaBranchSelector.cpp +++ /dev/null @@ -1,66 +0,0 @@ -//===-- AlphaBranchSelector.cpp - Convert Pseudo branchs ----------*- C++ -*-=// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Replace Pseudo COND_BRANCH_* with their appropriate real branch -// Simplified version of the PPC Branch Selector -// -//===----------------------------------------------------------------------===// - -#include "Alpha.h" -#include "AlphaInstrInfo.h" -#include "llvm/CodeGen/MachineFunctionPass.h" -#include "llvm/Target/TargetMachine.h" -#include "llvm/MC/MCAsmInfo.h" -using namespace llvm; - -namespace { - struct AlphaBSel : public MachineFunctionPass { - static char ID; - AlphaBSel() : MachineFunctionPass(ID) {} - - virtual bool runOnMachineFunction(MachineFunction &Fn); - - virtual const char *getPassName() const { - return "Alpha Branch Selection"; - } - }; - char AlphaBSel::ID = 0; -} - -/// createAlphaBranchSelectionPass - returns an instance of the Branch Selection -/// Pass -/// -FunctionPass *llvm::createAlphaBranchSelectionPass() { - return new AlphaBSel(); -} - -bool AlphaBSel::runOnMachineFunction(MachineFunction &Fn) { - - for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E; - ++MFI) { - MachineBasicBlock *MBB = MFI; - - for (MachineBasicBlock::iterator MBBI = MBB->begin(), EE = MBB->end(); - MBBI != EE; ++MBBI) { - if (MBBI->getOpcode() == Alpha::COND_BRANCH_I || - MBBI->getOpcode() == Alpha::COND_BRANCH_F) { - - // condbranch operands: - // 0. bc opcode - // 1. reg - // 2. target MBB - const TargetInstrInfo *TII = Fn.getTarget().getInstrInfo(); - MBBI->setDesc(TII->get(MBBI->getOperand(0).getImm())); - } - } - } - - return true; -} - |