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 | 82c3d8f | 2006-10-11 04:29:42 +0000 | [diff] [blame] | 22 | #include "AlphaISelLowering.h" |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 23 | #include "AlphaSubtarget.h" |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 24 | |
| 25 | namespace llvm { |
| 26 | |
| 27 | class GlobalValue; |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 28 | |
Chris Lattner | 1911fd4 | 2006-09-04 04:14:57 +0000 | [diff] [blame] | 29 | class AlphaTargetMachine : public LLVMTargetMachine { |
Owen Anderson | a69571c | 2006-05-03 01:29:57 +0000 | [diff] [blame] | 30 | const TargetData DataLayout; // Calculates type size & alignment |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 31 | AlphaInstrInfo InstrInfo; |
| 32 | TargetFrameInfo FrameInfo; |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 33 | AlphaJITInfo JITInfo; |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 34 | AlphaSubtarget Subtarget; |
Andrew Lenharth | 82c3d8f | 2006-10-11 04:29:42 +0000 | [diff] [blame] | 35 | AlphaTargetLowering TLInfo; |
Jim Laskey | fde1b3b | 2006-09-07 23:39:26 +0000 | [diff] [blame] | 36 | |
| 37 | protected: |
| 38 | virtual const TargetAsmInfo *createTargetAsmInfo() const; |
Owen Anderson | a69571c | 2006-05-03 01:29:57 +0000 | [diff] [blame] | 39 | |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 40 | public: |
Chris Lattner | bc641b9 | 2006-03-23 05:43:16 +0000 | [diff] [blame] | 41 | AlphaTargetMachine(const Module &M, const std::string &FS); |
Misha Brukman | 4633f1c | 2005-04-21 23:13:11 +0000 | [diff] [blame] | 42 | |
| 43 | virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; } |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 44 | virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; } |
Andrew Lenharth | 120ab48 | 2005-09-29 22:54:56 +0000 | [diff] [blame] | 45 | virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; } |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 46 | virtual const MRegisterInfo *getRegisterInfo() const { |
| 47 | return &InstrInfo.getRegisterInfo(); |
| 48 | } |
Andrew Lenharth | 82c3d8f | 2006-10-11 04:29:42 +0000 | [diff] [blame] | 49 | virtual TargetLowering* getTargetLowering() const { |
| 50 | return const_cast<AlphaTargetLowering*>(&TLInfo); |
| 51 | } |
Owen Anderson | a69571c | 2006-05-03 01:29:57 +0000 | [diff] [blame] | 52 | virtual const TargetData *getTargetData() const { return &DataLayout; } |
Andrew Lenharth | 0934ae0 | 2005-07-22 20:52:16 +0000 | [diff] [blame] | 53 | virtual TargetJITInfo* getJITInfo() { |
| 54 | return &JITInfo; |
| 55 | } |
| 56 | |
| 57 | static unsigned getJITMatchQuality(); |
Andrew Lenharth | 2f40163 | 2005-02-01 20:35:11 +0000 | [diff] [blame] | 58 | static unsigned getModuleMatchQuality(const Module &M); |
Chris Lattner | 1911fd4 | 2006-09-04 04:14:57 +0000 | [diff] [blame] | 59 | |
| 60 | // Pass Pipeline Configuration |
| 61 | virtual bool addInstSelector(FunctionPassManager &PM, bool Fast); |
| 62 | virtual bool addPreEmitPass(FunctionPassManager &PM, bool Fast); |
| 63 | virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast, |
| 64 | std::ostream &Out); |
| 65 | virtual bool addCodeEmitter(FunctionPassManager &PM, bool Fast, |
Evan Cheng | 8bd6035 | 2007-07-20 21:56:13 +0000 | [diff] [blame^] | 66 | bool DumpAsm, MachineCodeEmitter &MCE); |
Bill Wendling | 50e4e88 | 2007-02-08 01:38:33 +0000 | [diff] [blame] | 67 | virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, |
Evan Cheng | 8bd6035 | 2007-07-20 21:56:13 +0000 | [diff] [blame^] | 68 | bool DumpAsm, MachineCodeEmitter &MCE); |
Andrew Lenharth | 304d0f3 | 2005-01-22 23:41:55 +0000 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | } // end namespace llvm |
| 72 | |
| 73 | #endif |