Misha Brukman | bc9ccf6 | 2005-02-04 20:25:52 +0000 | [diff] [blame] | 1 | //===-- AlphaTargetMachine.h - Define TargetMachine for Alpha ---*- C++ -*-===// |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 2 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 7 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 9 | // |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 10 | // This file declares the Alpha-specific subclass of TargetMachine. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef ALPHA_TARGETMACHINE_H |
| 15 | #define ALPHA_TARGETMACHINE_H |
| 16 | |
| 17 | #include "llvm/Target/TargetMachine.h" |
Owen Anderson | 07000c6 | 2006-05-12 06:33:49 +0000 | [diff] [blame] | 18 | #include "llvm/Target/TargetData.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 19 | #include "llvm/Target/TargetFrameInfo.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 20 | #include "AlphaInstrInfo.h" |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 21 | #include "AlphaJITInfo.h" |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 22 | #include "AlphaSubtarget.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 23 | |
| 24 | namespace llvm { |
| 25 | |
| 26 | class GlobalValue; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 27 | |
Chris Lattner | 1911fd4 | 2006-09-04 04:14:57 +0000 | [diff] [blame^] | 28 | class AlphaTargetMachine : public LLVMTargetMachine { |
Owen Anderson | a69571c | 2006-05-03 01:29:57 +0000 | [diff] [blame] | 29 | const TargetData DataLayout; // Calculates type size & alignment |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 30 | AlphaInstrInfo InstrInfo; |
| 31 | TargetFrameInfo FrameInfo; |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 32 | AlphaJITInfo JITInfo; |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 33 | AlphaSubtarget Subtarget; |
Owen Anderson | a69571c | 2006-05-03 01:29:57 +0000 | [diff] [blame] | 34 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 35 | public: |
Chris Lattner | bc641b9 | 2006-03-23 05:43:16 +0000 | [diff] [blame] | 36 | AlphaTargetMachine(const Module &M, const std::string &FS); |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 37 | |
| 38 | virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; } |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 39 | virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 40 | virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; } |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 41 | virtual const MRegisterInfo *getRegisterInfo() const { |
| 42 | return &InstrInfo.getRegisterInfo(); |
| 43 | } |
Owen Anderson | a69571c | 2006-05-03 01:29:57 +0000 | [diff] [blame] | 44 | virtual const TargetData *getTargetData() const { return &DataLayout; } |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 45 | virtual TargetJITInfo* getJITInfo() { |
| 46 | return &JITInfo; |
| 47 | } |
| 48 | |
| 49 | static unsigned getJITMatchQuality(); |
Andrew Lenharth | 2f40163 | 2005-02-01 20:35:11 +0000 | [diff] [blame] | 50 | static unsigned getModuleMatchQuality(const Module &M); |
Chris Lattner | 1911fd4 | 2006-09-04 04:14:57 +0000 | [diff] [blame^] | 51 | |
| 52 | // Pass Pipeline Configuration |
| 53 | virtual bool addInstSelector(FunctionPassManager &PM, bool Fast); |
| 54 | virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast); |
| 55 | virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, |
| 56 | std::ostream &Out); |
| 57 | virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast, |
| 58 | MachineCodeEmitter &MCE); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 59 | }; |
| 60 | |
| 61 | } // end namespace llvm |
| 62 | |
| 63 | #endif |