R600/SI: Add VI versions of MUBUF atomics
[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 protected:
33   TargetLoweringObjectFile *TLOF;
34   AMDGPUSubtarget Subtarget;
35   AMDGPUIntrinsicInfo IntrinsicInfo;
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   // FIXME: This is currently broken, the DataLayout needs to move to
43   // the target machine.
44   const DataLayout *getDataLayout() const override {
45     return getSubtargetImpl()->getDataLayout();
46   }
47   const AMDGPUSubtarget *getSubtargetImpl() const override {
48     return &Subtarget;
49   }
50   const AMDGPUIntrinsicInfo *getIntrinsicInfo() const override {
51     return &IntrinsicInfo;
52   }
53   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
54
55   /// \brief Register R600 analysis passes with a pass manager.
56   void addAnalysisPasses(PassManagerBase &PM) override;
57   TargetLoweringObjectFile *getObjFileLowering() const override {
58     return TLOF;
59   }
60 };
61
62 //===----------------------------------------------------------------------===//
63 // GCN Target Machine (SI+)
64 //===----------------------------------------------------------------------===//
65
66 class GCNTargetMachine : public AMDGPUTargetMachine {
67
68 public:
69   GCNTargetMachine(const Target &T, StringRef TT, StringRef FS,
70                     StringRef CPU, TargetOptions Options, Reloc::Model RM,
71                     CodeModel::Model CM, CodeGenOpt::Level OL);
72 };
73
74 } // End namespace llvm
75
76 #endif