8fc66b1fcd2420a56b9066ef3e871d5ab2fbf6e1
[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 LLVM_LIB_TARGET_R600_AMDGPUTARGETMACHINE_H
16 #define LLVM_LIB_TARGET_R600_AMDGPUTARGETMACHINE_H
17
18 #include "AMDGPUFrameLowering.h"
19 #include "AMDGPUInstrInfo.h"
20 #include "AMDGPUIntrinsicInfo.h"
21 #include "AMDGPUSubtarget.h"
22 #include "R600ISelLowering.h"
23 #include "llvm/IR/DataLayout.h"
24
25 namespace llvm {
26
27 //===----------------------------------------------------------------------===//
28 // AMDGPU Target Machine (R600+)
29 //===----------------------------------------------------------------------===//
30
31 class AMDGPUTargetMachine : public LLVMTargetMachine {
32 private:
33
34 protected:
35   TargetLoweringObjectFile *TLOF;
36   AMDGPUSubtarget Subtarget;
37   AMDGPUIntrinsicInfo IntrinsicInfo;
38
39 public:
40   AMDGPUTargetMachine(const Target &T, StringRef TT, StringRef FS,
41                       StringRef CPU, TargetOptions Options, Reloc::Model RM,
42                       CodeModel::Model CM, CodeGenOpt::Level OL);
43   ~AMDGPUTargetMachine();
44
45   const AMDGPUSubtarget *getSubtargetImpl() const override {
46     return &Subtarget;
47   }
48   const AMDGPUIntrinsicInfo *getIntrinsicInfo() const override {
49     return &IntrinsicInfo;
50   }
51   TargetIRAnalysis getTargetIRAnalysis() override;
52
53   TargetLoweringObjectFile *getObjFileLowering() const override {
54     return TLOF;
55   }
56 };
57
58 //===----------------------------------------------------------------------===//
59 // R600 Target Machine (R600 -> Cayman)
60 //===----------------------------------------------------------------------===//
61
62 class R600TargetMachine : public AMDGPUTargetMachine {
63
64 public:
65   R600TargetMachine(const Target &T, StringRef TT, StringRef FS,
66                     StringRef CPU, TargetOptions Options, Reloc::Model RM,
67                     CodeModel::Model CM, CodeGenOpt::Level OL);
68
69   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
70 };
71
72 //===----------------------------------------------------------------------===//
73 // GCN Target Machine (SI+)
74 //===----------------------------------------------------------------------===//
75
76 class GCNTargetMachine : public AMDGPUTargetMachine {
77
78 public:
79   GCNTargetMachine(const Target &T, StringRef TT, StringRef FS,
80                     StringRef CPU, TargetOptions Options, Reloc::Model RM,
81                     CodeModel::Model CM, CodeGenOpt::Level OL);
82
83   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
84 };
85
86 } // End namespace llvm
87
88 #endif