John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1 | //===-- 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 Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 14 | #include "AlphaTargetMachine.h" |
| 15 | #include "llvm/PassManager.h" |
| 16 | #include "llvm/Support/FormattedStream.h" |
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame^] | 17 | #include "llvm/Support/TargetRegistry.h" |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 18 | using namespace llvm; |
| 19 | |
| 20 | extern "C" void LLVMInitializeAlphaTarget() { |
| 21 | // Register the target. |
| 22 | RegisterTargetMachine<AlphaTargetMachine> X(TheAlphaTarget); |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 23 | } |
| 24 | |
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame^] | 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), |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 29 | DataLayout("e-f128:128:128-n64"), |
John Bauman | 19bac1e | 2014-05-06 15:23:49 -0400 | [diff] [blame^] | 30 | FrameLowering(Subtarget), |
| 31 | Subtarget(TT, CPU, FS), |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 32 | TLInfo(*this), |
| 33 | TSInfo(*this) { |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 34 | } |
| 35 | |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 36 | //===----------------------------------------------------------------------===// |
| 37 | // Pass Pipeline Configuration |
| 38 | //===----------------------------------------------------------------------===// |
| 39 | |
| 40 | bool AlphaTargetMachine::addInstSelector(PassManagerBase &PM, |
| 41 | CodeGenOpt::Level OptLevel) { |
| 42 | PM.add(createAlphaISelDag(*this)); |
| 43 | return false; |
| 44 | } |
| 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)); |
| 50 | return false; |
| 51 | } |