blob: fc9a6771a900377ea87da9dd991e7d44a1c9a254 [file] [log] [blame]
John Bauman89401822014-05-06 15:04:28 -04001//===-- AlphaTargetMachine.cpp - Define TargetMachine for Alpha -----------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10//
11//===----------------------------------------------------------------------===//
12
13#include "Alpha.h"
John Bauman89401822014-05-06 15:04:28 -040014#include "AlphaTargetMachine.h"
15#include "llvm/PassManager.h"
16#include "llvm/Support/FormattedStream.h"
John Bauman19bac1e2014-05-06 15:23:49 -040017#include "llvm/Support/TargetRegistry.h"
John Bauman89401822014-05-06 15:04:28 -040018using namespace llvm;
19
20extern "C" void LLVMInitializeAlphaTarget() {
21 // Register the target.
22 RegisterTargetMachine<AlphaTargetMachine> X(TheAlphaTarget);
John Bauman89401822014-05-06 15:04:28 -040023}
24
John Bauman19bac1e2014-05-06 15:23:49 -040025AlphaTargetMachine::AlphaTargetMachine(const Target &T, StringRef TT,
26 StringRef CPU, StringRef FS,
27 Reloc::Model RM, CodeModel::Model CM)
28 : LLVMTargetMachine(T, TT, CPU, FS, RM, CM),
John Bauman89401822014-05-06 15:04:28 -040029 DataLayout("e-f128:128:128-n64"),
John Bauman19bac1e2014-05-06 15:23:49 -040030 FrameLowering(Subtarget),
31 Subtarget(TT, CPU, FS),
John Bauman89401822014-05-06 15:04:28 -040032 TLInfo(*this),
33 TSInfo(*this) {
John Bauman89401822014-05-06 15:04:28 -040034}
35
John Bauman89401822014-05-06 15:04:28 -040036//===----------------------------------------------------------------------===//
37// Pass Pipeline Configuration
38//===----------------------------------------------------------------------===//
39
40bool AlphaTargetMachine::addInstSelector(PassManagerBase &PM,
41 CodeGenOpt::Level OptLevel) {
42 PM.add(createAlphaISelDag(*this));
43 return false;
44}
45bool AlphaTargetMachine::addPreEmitPass(PassManagerBase &PM,
46 CodeGenOpt::Level OptLevel) {
47 // Must run branch selection immediately preceding the asm printer
48 PM.add(createAlphaBranchSelectionPass());
49 PM.add(createAlphaLLRPPass(*this));
50 return false;
51}