1 //===-- NVPTXTargetMachine.h - Define TargetMachine for NVPTX ---*- 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 //===----------------------------------------------------------------------===//
10 // This file declares the NVPTX specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_NVPTX_NVPTXTARGETMACHINE_H
17 #include "NVPTXSubtarget.h"
18 #include "ManagedStringPool.h"
19 #include "llvm/Target/TargetFrameLowering.h"
20 #include "llvm/Target/TargetMachine.h"
21 #include "llvm/Target/TargetSelectionDAGInfo.h"
25 /// NVPTXTargetMachine
27 class NVPTXTargetMachine : public LLVMTargetMachine {
28 NVPTXSubtarget Subtarget;
30 // Hold Strings that can be free'd all together with NVPTXTargetMachine
31 ManagedStringPool ManagedStrPool;
34 NVPTXTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
35 const TargetOptions &Options, Reloc::Model RM,
36 CodeModel::Model CM, CodeGenOpt::Level OP, bool is64bit);
38 using LLVMTargetMachine::getSubtargetImpl;
39 const NVPTXSubtarget *getSubtargetImpl() const override { return &Subtarget; }
41 ManagedStringPool *getManagedStrPool() const {
42 return const_cast<ManagedStringPool *>(&ManagedStrPool);
45 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
47 // Emission of machine code through MCJIT is not supported.
48 bool addPassesToEmitMC(PassManagerBase &, MCContext *&, raw_ostream &,
49 bool = true) override {
53 }; // NVPTXTargetMachine.
55 class NVPTXTargetMachine32 : public NVPTXTargetMachine {
56 virtual void anchor();
58 NVPTXTargetMachine32(const Target &T, StringRef TT, StringRef CPU,
59 StringRef FS, const TargetOptions &Options,
60 Reloc::Model RM, CodeModel::Model CM,
61 CodeGenOpt::Level OL);
64 class NVPTXTargetMachine64 : public NVPTXTargetMachine {
65 virtual void anchor();
67 NVPTXTargetMachine64(const Target &T, StringRef TT, StringRef CPU,
68 StringRef FS, const TargetOptions &Options,
69 Reloc::Model RM, CodeModel::Model CM,
70 CodeGenOpt::Level OL);
73 } // end namespace llvm