]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/llvm/lib/Target/R600/AMDGPUTargetMachine.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / llvm / 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/ADT/OwningPtr.h"
24 #include "llvm/IR/DataLayout.h"
25
26 namespace llvm {
27
28 MCAsmInfo* createMCAsmInfo(const Target &T, StringRef TT);
29
30 class AMDGPUTargetMachine : public LLVMTargetMachine {
31
32   AMDGPUSubtarget Subtarget;
33   const DataLayout Layout;
34   AMDGPUFrameLowering FrameLowering;
35   AMDGPUIntrinsicInfo IntrinsicInfo;
36   const AMDGPUInstrInfo * InstrInfo;
37   AMDGPUTargetLowering * TLInfo;
38   const InstrItineraryData* InstrItins;
39
40 public:
41    AMDGPUTargetMachine(const Target &T, StringRef TT, StringRef FS,
42                        StringRef CPU,
43                        TargetOptions Options,
44                        Reloc::Model RM, CodeModel::Model CM,
45                        CodeGenOpt::Level OL);
46    ~AMDGPUTargetMachine();
47    virtual const AMDGPUFrameLowering* getFrameLowering() const {
48      return &FrameLowering;
49    }
50    virtual const AMDGPUIntrinsicInfo* getIntrinsicInfo() const {
51      return &IntrinsicInfo;
52    }
53    virtual const AMDGPUInstrInfo *getInstrInfo() const {return InstrInfo;}
54    virtual const AMDGPUSubtarget *getSubtargetImpl() const {return &Subtarget; }
55    virtual const AMDGPURegisterInfo *getRegisterInfo() const {
56       return &InstrInfo->getRegisterInfo();
57    }
58    virtual AMDGPUTargetLowering * getTargetLowering() const {
59       return TLInfo;
60    }
61    virtual const InstrItineraryData* getInstrItineraryData() const {
62       return InstrItins;
63    }
64    virtual const DataLayout* getDataLayout() const { return &Layout; }
65    virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
66 };
67
68 } // End namespace llvm
69
70 #endif // AMDGPU_TARGET_MACHINE_H