1 //===-- AMDGPUTargetMachine.h - AMDGPU TargetMachine Interface --*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief The AMDGPU TargetMachine interface definition for hw codgen targets.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_R600_AMDGPUTARGETMACHINE_H
16 #define LLVM_LIB_TARGET_R600_AMDGPUTARGETMACHINE_H
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"
27 //===----------------------------------------------------------------------===//
28 // AMDGPU Target Machine (R600+)
29 //===----------------------------------------------------------------------===//
31 class AMDGPUTargetMachine : public LLVMTargetMachine {
33 TargetLoweringObjectFile *TLOF;
34 AMDGPUSubtarget Subtarget;
35 AMDGPUIntrinsicInfo IntrinsicInfo;
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 AMDGPUSubtarget *getSubtargetImpl() const override {
45 const AMDGPUIntrinsicInfo *getIntrinsicInfo() const override {
46 return &IntrinsicInfo;
48 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
50 /// \brief Register R600 analysis passes with a pass manager.
51 void addAnalysisPasses(PassManagerBase &PM) override;
52 TargetLoweringObjectFile *getObjFileLowering() const override {
57 //===----------------------------------------------------------------------===//
58 // GCN Target Machine (SI+)
59 //===----------------------------------------------------------------------===//
61 class GCNTargetMachine : public AMDGPUTargetMachine {
64 GCNTargetMachine(const Target &T, StringRef TT, StringRef FS,
65 StringRef CPU, TargetOptions Options, Reloc::Model RM,
66 CodeModel::Model CM, CodeGenOpt::Level OL);
69 } // End namespace llvm