1349cc55cSDimitry Andric //===-- R600TargetMachine.h - AMDGPU TargetMachine Interface ----*- C++ -*-===// 2349cc55cSDimitry Andric // 3349cc55cSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4349cc55cSDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5349cc55cSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6349cc55cSDimitry Andric // 7349cc55cSDimitry Andric //===----------------------------------------------------------------------===// 8349cc55cSDimitry Andric // 9349cc55cSDimitry Andric /// \file 1081ad6265SDimitry Andric /// The AMDGPU TargetMachine interface definition for hw codegen targets. 11349cc55cSDimitry Andric // 12349cc55cSDimitry Andric //===----------------------------------------------------------------------===// 13349cc55cSDimitry Andric 14349cc55cSDimitry Andric #ifndef LLVM_LIB_TARGET_AMDGPU_R600TARGETMACHINE_H 15349cc55cSDimitry Andric #define LLVM_LIB_TARGET_AMDGPU_R600TARGETMACHINE_H 16349cc55cSDimitry Andric 17349cc55cSDimitry Andric #include "AMDGPUTargetMachine.h" 18349cc55cSDimitry Andric #include "R600Subtarget.h" 19349cc55cSDimitry Andric #include "llvm/Target/TargetMachine.h" 20bdd1243dSDimitry Andric #include <optional> 21349cc55cSDimitry Andric 22349cc55cSDimitry Andric namespace llvm { 23349cc55cSDimitry Andric 24349cc55cSDimitry Andric //===----------------------------------------------------------------------===// 25349cc55cSDimitry Andric // R600 Target Machine (R600 -> Cayman) 26349cc55cSDimitry Andric //===----------------------------------------------------------------------===// 27349cc55cSDimitry Andric 28349cc55cSDimitry Andric class R600TargetMachine final : public AMDGPUTargetMachine { 29349cc55cSDimitry Andric private: 30349cc55cSDimitry Andric mutable StringMap<std::unique_ptr<R600Subtarget>> SubtargetMap; 31349cc55cSDimitry Andric 32349cc55cSDimitry Andric public: 33349cc55cSDimitry Andric R600TargetMachine(const Target &T, const Triple &TT, StringRef CPU, 34*0fca6ea1SDimitry Andric StringRef FS, const TargetOptions &Options, 35bdd1243dSDimitry Andric std::optional<Reloc::Model> RM, 365f757f3fSDimitry Andric std::optional<CodeModel::Model> CM, CodeGenOptLevel OL, 37bdd1243dSDimitry Andric bool JIT); 38349cc55cSDimitry Andric 39349cc55cSDimitry Andric TargetPassConfig *createPassConfig(PassManagerBase &PM) override; 40349cc55cSDimitry Andric 41*0fca6ea1SDimitry Andric Error buildCodeGenPipeline(ModulePassManager &MPM, raw_pwrite_stream &Out, 42*0fca6ea1SDimitry Andric raw_pwrite_stream *DwoOut, 43*0fca6ea1SDimitry Andric CodeGenFileType FileType, 44*0fca6ea1SDimitry Andric const CGPassBuilderOption &Opt, 45*0fca6ea1SDimitry Andric PassInstrumentationCallbacks *PIC) override; 46*0fca6ea1SDimitry Andric 47349cc55cSDimitry Andric const TargetSubtargetInfo *getSubtargetImpl(const Function &) const override; 48349cc55cSDimitry Andric 4981ad6265SDimitry Andric TargetTransformInfo getTargetTransformInfo(const Function &F) const override; 50349cc55cSDimitry Andric 51349cc55cSDimitry Andric bool isMachineVerifierClean() const override { return false; } 52bdd1243dSDimitry Andric 53bdd1243dSDimitry Andric MachineFunctionInfo * 54bdd1243dSDimitry Andric createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F, 55bdd1243dSDimitry Andric const TargetSubtargetInfo *STI) const override; 56349cc55cSDimitry Andric }; 57349cc55cSDimitry Andric 58349cc55cSDimitry Andric } // end namespace llvm 59349cc55cSDimitry Andric 60349cc55cSDimitry Andric #endif // LLVM_LIB_TARGET_AMDGPU_R600TARGETMACHINE_H 61