comparison lib/Target/NVPTX/NVPTXSubtarget.h @ 95:afa8332a0e37 LLVM3.8

LLVM 3.8
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Tue, 13 Oct 2015 17:48:58 +0900
parents 60c9769439b8
children 1172e4bd9c6f
comparison
equal deleted inserted replaced
84:f3e34b893a5f 95:afa8332a0e37
30 namespace llvm { 30 namespace llvm {
31 31
32 class NVPTXSubtarget : public NVPTXGenSubtargetInfo { 32 class NVPTXSubtarget : public NVPTXGenSubtargetInfo {
33 virtual void anchor(); 33 virtual void anchor();
34 std::string TargetName; 34 std::string TargetName;
35 NVPTX::DrvInterface drvInterface;
36 bool Is64Bit;
37 35
38 // PTX version x.y is represented as 10*x+y, e.g. 3.1 == 31 36 // PTX version x.y is represented as 10*x+y, e.g. 3.1 == 31
39 unsigned PTXVersion; 37 unsigned PTXVersion;
40 38
41 // SM version x.y is represented as 10*x+y, e.g. 3.1 == 31 39 // SM version x.y is represented as 10*x+y, e.g. 3.1 == 31
42 unsigned int SmVersion; 40 unsigned int SmVersion;
43 41
42 const NVPTXTargetMachine &TM;
44 NVPTXInstrInfo InstrInfo; 43 NVPTXInstrInfo InstrInfo;
45 NVPTXTargetLowering TLInfo; 44 NVPTXTargetLowering TLInfo;
46 TargetSelectionDAGInfo TSInfo; 45 TargetSelectionDAGInfo TSInfo;
47 46
48 // NVPTX does not have any call stack frame, but need a NVPTX specific 47 // NVPTX does not have any call stack frame, but need a NVPTX specific
51 50
52 public: 51 public:
53 /// This constructor initializes the data members to match that 52 /// This constructor initializes the data members to match that
54 /// of the specified module. 53 /// of the specified module.
55 /// 54 ///
56 NVPTXSubtarget(const std::string &TT, const std::string &CPU, 55 NVPTXSubtarget(const Triple &TT, const std::string &CPU,
57 const std::string &FS, const TargetMachine &TM, bool is64Bit); 56 const std::string &FS, const NVPTXTargetMachine &TM);
58 57
59 const TargetFrameLowering *getFrameLowering() const override { 58 const TargetFrameLowering *getFrameLowering() const override {
60 return &FrameLowering; 59 return &FrameLowering;
61 } 60 }
62 const NVPTXInstrInfo *getInstrInfo() const override { return &InstrInfo; } 61 const NVPTXInstrInfo *getInstrInfo() const override { return &InstrInfo; }
91 inline bool hasSWROT32() const { 90 inline bool hasSWROT32() const {
92 return ((SmVersion >= 20) && (SmVersion < 32)); 91 return ((SmVersion >= 20) && (SmVersion < 32));
93 } 92 }
94 inline bool hasROT32() const { return hasHWROT32() || hasSWROT32(); } 93 inline bool hasROT32() const { return hasHWROT32() || hasSWROT32(); }
95 inline bool hasROT64() const { return SmVersion >= 20; } 94 inline bool hasROT64() const { return SmVersion >= 20; }
96 95 bool hasImageHandles() const;
97 bool hasImageHandles() const {
98 // Enable handles for Kepler+, where CUDA supports indirect surfaces and
99 // textures
100 if (getDrvInterface() == NVPTX::CUDA)
101 return (SmVersion >= 30);
102
103 // Disabled, otherwise
104 return false;
105 }
106 bool is64Bit() const { return Is64Bit; }
107 96
108 unsigned int getSmVersion() const { return SmVersion; } 97 unsigned int getSmVersion() const { return SmVersion; }
109 NVPTX::DrvInterface getDrvInterface() const { return drvInterface; }
110 std::string getTargetName() const { return TargetName; } 98 std::string getTargetName() const { return TargetName; }
111 99
112 unsigned getPTXVersion() const { return PTXVersion; } 100 unsigned getPTXVersion() const { return PTXVersion; }
113 101
114 NVPTXSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS); 102 NVPTXSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);