LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NVPTXTargetMachine.h
Go to the documentation of this file.
1 //===-- NVPTXTargetMachine.h - Define TargetMachine for NVPTX ---*- 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 // This file declares the NVPTX specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef NVPTX_TARGETMACHINE_H
15 #define NVPTX_TARGETMACHINE_H
16 
17 #include "ManagedStringPool.h"
18 #include "NVPTXFrameLowering.h"
19 #include "NVPTXISelLowering.h"
20 #include "NVPTXInstrInfo.h"
21 #include "NVPTXRegisterInfo.h"
22 #include "NVPTXSubtarget.h"
23 #include "llvm/IR/DataLayout.h"
27 
28 namespace llvm {
29 
30 /// NVPTXTargetMachine
31 ///
33  NVPTXSubtarget Subtarget;
34  const DataLayout DL; // Calculates type size & alignment
35  NVPTXInstrInfo InstrInfo;
36  NVPTXTargetLowering TLInfo;
38 
39  // NVPTX does not have any call stack frame, but need a NVPTX specific
40  // FrameLowering class because TargetFrameLowering is abstract.
41  NVPTXFrameLowering FrameLowering;
42 
43  // Hold Strings that can be free'd all together with NVPTXTargetMachine
44  ManagedStringPool ManagedStrPool;
45 
46  //bool addCommonCodeGenPasses(PassManagerBase &, CodeGenOpt::Level,
47  // bool DisableVerify, MCContext *&OutCtx);
48 
49 public:
52  CodeModel::Model CM, CodeGenOpt::Level OP, bool is64bit);
53 
54  virtual const TargetFrameLowering *getFrameLowering() const {
55  return &FrameLowering;
56  }
57  virtual const NVPTXInstrInfo *getInstrInfo() const { return &InstrInfo; }
58  virtual const DataLayout *getDataLayout() const { return &DL; }
59  virtual const NVPTXSubtarget *getSubtargetImpl() const { return &Subtarget; }
60 
61  virtual const NVPTXRegisterInfo *getRegisterInfo() const {
62  return &(InstrInfo.getRegisterInfo());
63  }
64 
66  return const_cast<NVPTXTargetLowering *>(&TLInfo);
67  }
68 
70  return &TSInfo;
71  }
72 
73  //virtual bool addInstSelector(PassManagerBase &PM,
74  // CodeGenOpt::Level OptLevel);
75 
76  //virtual bool addPreRegAlloc(PassManagerBase &, CodeGenOpt::Level);
77 
79  return const_cast<ManagedStringPool *>(&ManagedStrPool);
80  }
81 
82  virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
83 
84  // Emission of machine code through JITCodeEmitter is not supported.
85  virtual bool addPassesToEmitMachineCode(PassManagerBase &, JITCodeEmitter &,
86  bool = true) {
87  return true;
88  }
89 
90  // Emission of machine code through MCJIT is not supported.
91  virtual bool addPassesToEmitMC(PassManagerBase &, MCContext *&, raw_ostream &,
92  bool = true) {
93  return true;
94  }
95 
96 }; // NVPTXTargetMachine.
97 
99  virtual void anchor();
100 public:
104  CodeGenOpt::Level OL);
105 };
106 
108  virtual void anchor();
109 public:
113  CodeGenOpt::Level OL);
114 };
115 
116 } // end namespace llvm
117 
118 #endif
virtual const DataLayout * getDataLayout() const
NVPTXTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OP, bool is64bit)
NVPTXTargetMachine64(const Target &T, StringRef TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
virtual const NVPTXRegisterInfo * getRegisterInfo() const
virtual const NVPTXRegisterInfo & getRegisterInfo() const
virtual const NVPTXInstrInfo * getInstrInfo() const
virtual const TargetFrameLowering * getFrameLowering() const
virtual bool addPassesToEmitMC(PassManagerBase &, MCContext *&, raw_ostream &, bool=true)
virtual const TargetSelectionDAGInfo * getSelectionDAGInfo() const
ManagedStringPool * getManagedStrPool() const
virtual NVPTXTargetLowering * getTargetLowering() const
virtual bool addPassesToEmitMachineCode(PassManagerBase &, JITCodeEmitter &, bool=true)
virtual const NVPTXSubtarget * getSubtargetImpl() const
NVPTXTargetMachine32(const Target &T, StringRef TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
virtual TargetPassConfig * createPassConfig(PassManagerBase &PM)
#define OP(n)
Definition: regex2.h:67