1f4a2713aSLionel Sambuc //===-- AMDGPUTargetMachine.h - AMDGPU TargetMachine Interface --*- C++ -*-===// 2f4a2713aSLionel Sambuc // 3f4a2713aSLionel Sambuc // The LLVM Compiler Infrastructure 4f4a2713aSLionel Sambuc // 5f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source 6f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details. 7f4a2713aSLionel Sambuc // 8f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===// 9f4a2713aSLionel Sambuc // 10f4a2713aSLionel Sambuc /// \file 11f4a2713aSLionel Sambuc /// \brief The AMDGPU TargetMachine interface definition for hw codgen targets. 12f4a2713aSLionel Sambuc // 13f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===// 14f4a2713aSLionel Sambuc 15*0a6a1f1dSLionel Sambuc #ifndef LLVM_LIB_TARGET_R600_AMDGPUTARGETMACHINE_H 16*0a6a1f1dSLionel Sambuc #define LLVM_LIB_TARGET_R600_AMDGPUTARGETMACHINE_H 17f4a2713aSLionel Sambuc 18f4a2713aSLionel Sambuc #include "AMDGPUFrameLowering.h" 19f4a2713aSLionel Sambuc #include "AMDGPUInstrInfo.h" 20*0a6a1f1dSLionel Sambuc #include "AMDGPUIntrinsicInfo.h" 21f4a2713aSLionel Sambuc #include "AMDGPUSubtarget.h" 22f4a2713aSLionel Sambuc #include "R600ISelLowering.h" 23f4a2713aSLionel Sambuc #include "llvm/IR/DataLayout.h" 24f4a2713aSLionel Sambuc 25f4a2713aSLionel Sambuc namespace llvm { 26f4a2713aSLionel Sambuc 27*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===// 28*0a6a1f1dSLionel Sambuc // AMDGPU Target Machine (R600+) 29*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===// 30f4a2713aSLionel Sambuc 31*0a6a1f1dSLionel Sambuc class AMDGPUTargetMachine : public LLVMTargetMachine { 32*0a6a1f1dSLionel Sambuc protected: 33*0a6a1f1dSLionel Sambuc TargetLoweringObjectFile *TLOF; 34f4a2713aSLionel Sambuc AMDGPUSubtarget Subtarget; 35f4a2713aSLionel Sambuc AMDGPUIntrinsicInfo IntrinsicInfo; 36f4a2713aSLionel Sambuc 37f4a2713aSLionel Sambuc public: 38f4a2713aSLionel Sambuc AMDGPUTargetMachine(const Target &T, StringRef TT, StringRef FS, 39f4a2713aSLionel Sambuc StringRef CPU, TargetOptions Options, Reloc::Model RM, 40f4a2713aSLionel Sambuc CodeModel::Model CM, CodeGenOpt::Level OL); 41f4a2713aSLionel Sambuc ~AMDGPUTargetMachine(); getSubtargetImpl()42*0a6a1f1dSLionel Sambuc const AMDGPUSubtarget *getSubtargetImpl() const override { 43*0a6a1f1dSLionel Sambuc return &Subtarget; 44f4a2713aSLionel Sambuc } getIntrinsicInfo()45*0a6a1f1dSLionel Sambuc const AMDGPUIntrinsicInfo *getIntrinsicInfo() const override { 46f4a2713aSLionel Sambuc return &IntrinsicInfo; 47f4a2713aSLionel Sambuc } 48*0a6a1f1dSLionel Sambuc TargetPassConfig *createPassConfig(PassManagerBase &PM) override; 49f4a2713aSLionel Sambuc 50f4a2713aSLionel Sambuc /// \brief Register R600 analysis passes with a pass manager. 51*0a6a1f1dSLionel Sambuc void addAnalysisPasses(PassManagerBase &PM) override; getObjFileLowering()52*0a6a1f1dSLionel Sambuc TargetLoweringObjectFile *getObjFileLowering() const override { 53*0a6a1f1dSLionel Sambuc return TLOF; 54*0a6a1f1dSLionel Sambuc } 55*0a6a1f1dSLionel Sambuc }; 56*0a6a1f1dSLionel Sambuc 57*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===// 58*0a6a1f1dSLionel Sambuc // GCN Target Machine (SI+) 59*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===// 60*0a6a1f1dSLionel Sambuc 61*0a6a1f1dSLionel Sambuc class GCNTargetMachine : public AMDGPUTargetMachine { 62*0a6a1f1dSLionel Sambuc 63*0a6a1f1dSLionel Sambuc public: 64*0a6a1f1dSLionel Sambuc GCNTargetMachine(const Target &T, StringRef TT, StringRef FS, 65*0a6a1f1dSLionel Sambuc StringRef CPU, TargetOptions Options, Reloc::Model RM, 66*0a6a1f1dSLionel Sambuc CodeModel::Model CM, CodeGenOpt::Level OL); 67f4a2713aSLionel Sambuc }; 68f4a2713aSLionel Sambuc 69f4a2713aSLionel Sambuc } // End namespace llvm 70f4a2713aSLionel Sambuc 71*0a6a1f1dSLionel Sambuc #endif 72