LLVM  8.0.1
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 LLVM_LIB_TARGET_NVPTX_NVPTXTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_NVPTX_NVPTXTARGETMACHINE_H
16 
17 #include "ManagedStringPool.h"
18 #include "NVPTXSubtarget.h"
22 
23 namespace llvm {
24 
25 /// NVPTXTargetMachine
26 ///
28  bool is64bit;
29  // Use 32-bit pointers for accessing const/local/short AS.
30  bool UseShortPointers;
31  std::unique_ptr<TargetLoweringObjectFile> TLOF;
32  NVPTX::DrvInterface drvInterface;
33  NVPTXSubtarget Subtarget;
34 
35  // Hold Strings that can be free'd all together with NVPTXTargetMachine
36  ManagedStringPool ManagedStrPool;
37 
38 public:
39  NVPTXTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
40  StringRef FS, const TargetOptions &Options,
42  CodeGenOpt::Level OP, bool is64bit);
43 
44  ~NVPTXTargetMachine() override;
45  const NVPTXSubtarget *getSubtargetImpl(const Function &) const override {
46  return &Subtarget;
47  }
48  const NVPTXSubtarget *getSubtargetImpl() const { return &Subtarget; }
49  bool is64Bit() const { return is64bit; }
50  bool useShortPointers() const { return UseShortPointers; }
51  NVPTX::DrvInterface getDrvInterface() const { return drvInterface; }
53  return const_cast<ManagedStringPool *>(&ManagedStrPool);
54  }
55 
57 
58  // Emission of machine code through MCJIT is not supported.
60  bool = true) override {
61  return true;
62  }
64  return TLOF.get();
65  }
66 
67  void adjustPassManager(PassManagerBuilder &) override;
68 
70 
71  bool isMachineVerifierClean() const override {
72  return false;
73  }
74 }; // NVPTXTargetMachine.
75 
77  virtual void anchor();
78 public:
79  NVPTXTargetMachine32(const Target &T, const Triple &TT, StringRef CPU,
80  StringRef FS, const TargetOptions &Options,
82  CodeGenOpt::Level OL, bool JIT);
83 };
84 
86  virtual void anchor();
87 public:
88  NVPTXTargetMachine64(const Target &T, const Triple &TT, StringRef CPU,
89  StringRef FS, const TargetOptions &Options,
91  CodeGenOpt::Level OL, bool JIT);
92 };
93 
94 } // end namespace llvm
95 
96 #endif
PassManagerBuilder - This class is used to set up a standard optimization sequence for languages like...
This class represents lattice values for constants.
Definition: AllocatorList.h:24
F(f)
ManagedStringPool - The strings allocated from a managed string pool are owned by the string pool and...
DrvInterface
Definition: NVPTX.h:62
bool isMachineVerifierClean() const override
Returns true if the target is expected to pass all machine verifier checks.
Target-Independent Code Generator Pass Configuration Options.
Context object for machine code objects.
Definition: MCContext.h:63
ManagedStringPool * getManagedStrPool() const
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
const NVPTXSubtarget * getSubtargetImpl(const Function &) const override
Virtual method implemented by subclasses that returns a reference to that target&#39;s TargetSubtargetInf...
TargetTransformInfo getTargetTransformInfo(const Function &F) override
Get a TargetTransformInfo implementation for the target.
TargetLoweringObjectFile * getObjFileLowering() const override
NVPTXTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional< Reloc::Model > RM, Optional< CodeModel::Model > CM, CodeGenOpt::Level OP, bool is64bit)
This class describes a target machine that is implemented with the LLVM target-independent code gener...
NVPTX::DrvInterface getDrvInterface() const
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
Target - Wrapper for Target specific information.
NVPTXTargetMachine.
~NVPTXTargetMachine() override
bool addPassesToEmitMC(PassManagerBase &, MCContext *&, raw_pwrite_stream &, bool=true) override
Add passes to the specified pass manager to get machine code emitted with the MCJIT.
TargetOptions Options
Definition: TargetMachine.h:97
void adjustPassManager(PassManagerBuilder &) override
Allow the target to modify the pass manager, e.g.
An abstract base class for streams implementations that also support a pwrite operation.
Definition: raw_ostream.h:341
const NVPTXSubtarget * getSubtargetImpl() const
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
#define OP(n)
Definition: regex2.h:73