1 //===-- AlphaTargetMachine.cpp - Define TargetMachine for Alpha -----------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
14 #include "AlphaTargetMachine.h"
15 #include "llvm/PassManager.h"
16 #include "llvm/Support/FormattedStream.h"
17 #include "llvm/Target/TargetRegistry.h"
20 extern "C" void LLVMInitializeAlphaTarget() {
21 // Register the target.
22 RegisterTargetMachine<AlphaTargetMachine> X(TheAlphaTarget);
25 AlphaTargetMachine::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),
29 DataLayout("e-f128:128:128-n64"),
30 FrameLowering(Subtarget),
31 Subtarget(TT, CPU, FS),
36 //===----------------------------------------------------------------------===//
37 // Pass Pipeline Configuration
38 //===----------------------------------------------------------------------===//
40 bool AlphaTargetMachine::addInstSelector(PassManagerBase &PM,
41 CodeGenOpt::Level OptLevel) {
42 PM.add(createAlphaISelDag(*this));
45 bool 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));