[mips] Modify long branch for NaCl:
[oota-llvm.git] / lib / Target / R600 / AMDGPUTargetMachine.h
1 //===-- AMDGPUTargetMachine.h - AMDGPU TargetMachine Interface --*- 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 /// \file
11 /// \brief The AMDGPU TargetMachine interface definition for hw codgen targets.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef AMDGPU_TARGET_MACHINE_H
16 #define AMDGPU_TARGET_MACHINE_H
17
18 #include "AMDGPUFrameLowering.h"
19 #include "AMDGPUInstrInfo.h"
20 #include "AMDGPUSubtarget.h"
21 #include "AMDILIntrinsicInfo.h"
22 #include "R600ISelLowering.h"
23 #include "llvm/IR/DataLayout.h"
24
25 namespace llvm {
26
27 class AMDGPUTargetMachine : public LLVMTargetMachine {
28
29   AMDGPUSubtarget Subtarget;
30   const DataLayout Layout;
31   AMDGPUFrameLowering FrameLowering;
32   AMDGPUIntrinsicInfo IntrinsicInfo;
33   std::unique_ptr<AMDGPUInstrInfo> InstrInfo;
34   std::unique_ptr<AMDGPUTargetLowering> TLInfo;
35   const InstrItineraryData *InstrItins;
36
37 public:
38   AMDGPUTargetMachine(const Target &T, StringRef TT, StringRef FS,
39                       StringRef CPU, TargetOptions Options, Reloc::Model RM,
40                       CodeModel::Model CM, CodeGenOpt::Level OL);
41   ~AMDGPUTargetMachine();
42   const AMDGPUFrameLowering *getFrameLowering() const override {
43     return &FrameLowering;
44   }
45   const AMDGPUIntrinsicInfo *getIntrinsicInfo() const override {
46     return &IntrinsicInfo;
47   }
48   const AMDGPUInstrInfo *getInstrInfo() const override {
49     return InstrInfo.get();
50   }
51   const AMDGPUSubtarget *getSubtargetImpl() const override {
52     return &Subtarget;
53   }
54   const AMDGPURegisterInfo *getRegisterInfo() const override {
55     return &InstrInfo->getRegisterInfo();
56   }
57   AMDGPUTargetLowering *getTargetLowering() const override {
58     return TLInfo.get();
59   }
60   const InstrItineraryData *getInstrItineraryData() const override {
61     return InstrItins;
62   }
63   const DataLayout *getDataLayout() const override { return &Layout; }
64   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
65
66   /// \brief Register R600 analysis passes with a pass manager.
67   void addAnalysisPasses(PassManagerBase &PM) override;
68 };
69
70 } // End namespace llvm
71
72 #endif // AMDGPU_TARGET_MACHINE_H