Implement a basic VectorTargetTransformInfo interface to be used by the loop and...
[oota-llvm.git] / lib / Target / Mips / MipsTargetMachine.h
1 //===-- MipsTargetMachine.h - Define TargetMachine for Mips -----*- C++ -*-===//
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 // This file declares the Mips specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef MIPSTARGETMACHINE_H
15 #define MIPSTARGETMACHINE_H
16
17 #include "MipsFrameLowering.h"
18 #include "MipsInstrInfo.h"
19 #include "MipsISelLowering.h"
20 #include "MipsJITInfo.h"
21 #include "MipsSelectionDAGInfo.h"
22 #include "MipsSubtarget.h"
23 #include "MipsELFWriterInfo.h"
24 #include "llvm/Target/TargetMachine.h"
25 #include "llvm/DataLayout.h"
26 #include "llvm/Target/TargetFrameLowering.h"
27 #include "llvm/Target/TargetTransformImpl.h"
28
29 namespace llvm {
30 class formatted_raw_ostream;
31 class MipsRegisterInfo;
32
33 class MipsTargetMachine : public LLVMTargetMachine {
34   MipsSubtarget       Subtarget;
35   const DataLayout    DL; // Calculates type size & alignment
36   const MipsInstrInfo *InstrInfo;
37   const MipsFrameLowering *FrameLowering;
38   MipsTargetLowering  TLInfo;
39   MipsSelectionDAGInfo TSInfo;
40   MipsJITInfo JITInfo;
41   MipsELFWriterInfo   ELFWriterInfo;
42   ScalarTargetTransformImpl STTI;
43   VectorTargetTransformImpl VTTI;
44
45 public:
46   MipsTargetMachine(const Target &T, StringRef TT,
47                     StringRef CPU, StringRef FS, const TargetOptions &Options,
48                     Reloc::Model RM, CodeModel::Model CM,
49                     CodeGenOpt::Level OL,
50                     bool isLittle);
51
52   virtual ~MipsTargetMachine() { delete InstrInfo; }
53
54   virtual const MipsInstrInfo *getInstrInfo() const
55   { return InstrInfo; }
56   virtual const TargetFrameLowering *getFrameLowering() const
57   { return FrameLowering; }
58   virtual const MipsSubtarget *getSubtargetImpl() const
59   { return &Subtarget; }
60   virtual const DataLayout *getDataLayout()    const
61   { return &DL;}
62   virtual MipsJITInfo *getJITInfo()
63   { return &JITInfo; }
64
65   virtual const MipsRegisterInfo *getRegisterInfo()  const {
66     return &InstrInfo->getRegisterInfo();
67   }
68
69   virtual const MipsTargetLowering *getTargetLowering() const {
70     return &TLInfo;
71   }
72
73   virtual const MipsSelectionDAGInfo* getSelectionDAGInfo() const {
74     return &TSInfo;
75   }
76
77   virtual const MipsELFWriterInfo *getELFWriterInfo() const {
78     return &ELFWriterInfo;
79   }
80   virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
81     return &STTI;
82   }
83   virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
84     return &VTTI;
85   }
86
87   // Pass Pipeline Configuration
88   virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
89   virtual bool addCodeEmitter(PassManagerBase &PM, JITCodeEmitter &JCE);
90 };
91
92 /// MipsebTargetMachine - Mips32/64 big endian target machine.
93 ///
94 class MipsebTargetMachine : public MipsTargetMachine {
95   virtual void anchor();
96 public:
97   MipsebTargetMachine(const Target &T, StringRef TT,
98                       StringRef CPU, StringRef FS, const TargetOptions &Options,
99                       Reloc::Model RM, CodeModel::Model CM,
100                       CodeGenOpt::Level OL);
101 };
102
103 /// MipselTargetMachine - Mips32/64 little endian target machine.
104 ///
105 class MipselTargetMachine : public MipsTargetMachine {
106   virtual void anchor();
107 public:
108   MipselTargetMachine(const Target &T, StringRef TT,
109                       StringRef CPU, StringRef FS, const TargetOptions &Options,
110                       Reloc::Model RM, CodeModel::Model CM,
111                       CodeGenOpt::Level OL);
112 };
113
114 } // End llvm namespace
115
116 #endif