blob: 3298a4bd5825e93336bda1284cd31630cf713331 [file] [log] [blame]
Matt Arsenault0c90e952015-11-06 18:17:45 +00001//=====-- AMDGPUSubtarget.h - Define Subtarget for AMDGPU ------*- C++ -*-====//
Tom Stellard75aadc22012-12-11 21:25:42 +00002//
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/// \file
11/// \brief AMDGPU specific subclass of TargetSubtarget.
12//
13//===----------------------------------------------------------------------===//
14
Matt Arsenault0c90e952015-11-06 18:17:45 +000015#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUSUBTARGET_H
16#define LLVM_LIB_TARGET_AMDGPU_AMDGPUSUBTARGET_H
Matt Arsenaultf59e5382015-11-06 18:23:00 +000017
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000018#include "AMDGPU.h"
Matt Arsenault43e92fe2016-06-24 06:30:11 +000019#include "R600InstrInfo.h"
20#include "R600ISelLowering.h"
21#include "R600FrameLowering.h"
22#include "SIInstrInfo.h"
23#include "SIISelLowering.h"
24#include "SIFrameLowering.h"
Tom Stellard347ac792015-06-26 21:15:07 +000025#include "Utils/AMDGPUBaseInfo.h"
Tom Stellard000c5af2016-04-14 19:09:28 +000026#include "llvm/CodeGen/GlobalISel/GISelAccessor.h"
Matt Arsenault56684d42016-08-11 17:31:42 +000027#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
Tom Stellard75aadc22012-12-11 21:25:42 +000028#include "llvm/Target/TargetSubtargetInfo.h"
29
30#define GET_SUBTARGETINFO_HEADER
31#include "AMDGPUGenSubtargetInfo.inc"
32
Tom Stellard75aadc22012-12-11 21:25:42 +000033namespace llvm {
34
Tom Stellarde99fb652015-01-20 19:33:04 +000035class SIMachineFunctionInfo;
Matt Arsenault43e92fe2016-06-24 06:30:11 +000036class StringRef;
Tom Stellarde99fb652015-01-20 19:33:04 +000037
Tom Stellard75aadc22012-12-11 21:25:42 +000038class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000039public:
40 enum Generation {
41 R600 = 0,
42 R700,
43 EVERGREEN,
44 NORTHERN_ISLANDS,
Tom Stellard6e1ee472013-10-29 16:37:28 +000045 SOUTHERN_ISLANDS,
Marek Olsak5df00d62014-12-07 12:18:57 +000046 SEA_ISLANDS,
47 VOLCANIC_ISLANDS,
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000048 };
49
Marek Olsak4d00dd22015-03-09 15:48:09 +000050 enum {
Tom Stellard347ac792015-06-26 21:15:07 +000051 ISAVersion0_0_0,
52 ISAVersion7_0_0,
53 ISAVersion7_0_1,
54 ISAVersion8_0_0,
Changpeng Fangc16be002016-01-13 20:39:25 +000055 ISAVersion8_0_1,
56 ISAVersion8_0_3
Tom Stellard347ac792015-06-26 21:15:07 +000057 };
58
Matt Arsenault43e92fe2016-06-24 06:30:11 +000059protected:
60 // Basic subtarget description.
61 Triple TargetTriple;
Matt Arsenaultd782d052014-06-27 17:57:00 +000062 Generation Gen;
Matt Arsenault43e92fe2016-06-24 06:30:11 +000063 unsigned IsaVersion;
64 unsigned WavefrontSize;
65 int LocalMemorySize;
66 int LDSBankCount;
67 unsigned MaxPrivateElementSize;
68
69 // Possibly statically set by tablegen, but may want to be overridden.
Matt Arsenaultb035a572015-01-29 19:34:25 +000070 bool FastFMAF32;
Matt Arsenaulte83690c2016-01-18 21:13:50 +000071 bool HalfRate64Ops;
Matt Arsenault43e92fe2016-06-24 06:30:11 +000072
73 // Dynamially set bits that enable features.
74 bool FP32Denormals;
75 bool FP64Denormals;
76 bool FPExceptions;
Changpeng Fangb41574a2015-12-22 20:55:23 +000077 bool FlatForGlobal;
Matt Arsenault7f681ac2016-07-01 23:03:44 +000078 bool UnalignedBufferAccess;
Matt Arsenault43e92fe2016-06-24 06:30:11 +000079 bool EnableXNACK;
80 bool DebuggerInsertNops;
81 bool DebuggerReserveRegs;
Konstantin Zhuravlyovf2f3d142016-06-25 03:11:28 +000082 bool DebuggerEmitPrologue;
Matt Arsenault43e92fe2016-06-24 06:30:11 +000083
84 // Used as options.
85 bool EnableVGPRSpilling;
Matt Arsenaultd9a23ab2014-07-13 02:08:26 +000086 bool EnablePromoteAlloca;
Matt Arsenault41033282014-10-10 22:01:59 +000087 bool EnableLoadStoreOpt;
Matt Arsenault706f9302015-07-06 16:01:58 +000088 bool EnableUnsafeDSOffsetFolding;
Matt Arsenault43e92fe2016-06-24 06:30:11 +000089 bool EnableSIScheduler;
90 bool DumpCode;
91
92 // Subtarget statically properties set by tablegen
93 bool FP64;
Tom Stellardd7e6f132015-04-08 01:09:26 +000094 bool IsGCN;
95 bool GCN1Encoding;
96 bool GCN3Encoding;
Tom Stellardd1f0f022015-04-23 19:33:54 +000097 bool CIInsts;
Matt Arsenault43e92fe2016-06-24 06:30:11 +000098 bool SGPRInitBug;
Matt Arsenault9d82ee72016-02-27 08:53:55 +000099 bool HasSMemRealTime;
100 bool Has16BitInsts;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000101 bool FlatAddressSpace;
102 bool R600ALUInst;
103 bool CaymanISA;
104 bool CFALUBug;
105 bool HasVertexCache;
106 short TexVTXClauseSize;
Tom Stellard75aadc22012-12-11 21:25:42 +0000107
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000108 // Dummy feature to use for assembler in tablegen.
109 bool FeatureDisable;
110
Tom Stellard75aadc22012-12-11 21:25:42 +0000111 InstrItineraryData InstrItins;
Matt Arsenault56684d42016-08-11 17:31:42 +0000112 SelectionDAGTargetInfo TSInfo;
Tom Stellard75aadc22012-12-11 21:25:42 +0000113
114public:
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000115 AMDGPUSubtarget(const Triple &TT, StringRef GPU, StringRef FS,
116 const TargetMachine &TM);
117 virtual ~AMDGPUSubtarget();
Daniel Sandersa73f1fd2015-06-10 12:11:26 +0000118 AMDGPUSubtarget &initializeSubtargetDependencies(const Triple &TT,
119 StringRef GPU, StringRef FS);
Tom Stellard75aadc22012-12-11 21:25:42 +0000120
Matt Arsenaultf9245b72016-07-22 17:01:25 +0000121 const AMDGPUInstrInfo *getInstrInfo() const override = 0;
122 const AMDGPUFrameLowering *getFrameLowering() const override = 0;
123 const AMDGPUTargetLowering *getTargetLowering() const override = 0;
124 const AMDGPURegisterInfo *getRegisterInfo() const override = 0;
Tom Stellard000c5af2016-04-14 19:09:28 +0000125
Eric Christopherd9134482014-08-04 21:25:23 +0000126 const InstrItineraryData *getInstrItineraryData() const override {
127 return &InstrItins;
128 }
Matt Arsenaultd782d052014-06-27 17:57:00 +0000129
Matt Arsenault56684d42016-08-11 17:31:42 +0000130 // Nothing implemented, just prevent crashes on use.
131 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
132 return &TSInfo;
133 }
134
Craig Topperee7b0f32014-04-30 05:53:27 +0000135 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
Tom Stellard75aadc22012-12-11 21:25:42 +0000136
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000137 bool isAmdHsaOS() const {
138 return TargetTriple.getOS() == Triple::AMDHSA;
Matt Arsenaultd782d052014-06-27 17:57:00 +0000139 }
140
Tom Stellard0b76fc4c2016-09-16 21:34:26 +0000141 bool isMesa3DOS() const {
142 return TargetTriple.getOS() == Triple::Mesa3D;
143 }
144
Tom Stellarde88bbc32016-09-23 01:33:26 +0000145 bool isOpenCLEnv() const {
146 return TargetTriple.getEnvironment() == Triple::OpenCL;
147 }
148
Matt Arsenaultd782d052014-06-27 17:57:00 +0000149 Generation getGeneration() const {
150 return Gen;
151 }
152
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000153 unsigned getWavefrontSize() const {
154 return WavefrontSize;
155 }
156
157 int getLocalMemorySize() const {
158 return LocalMemorySize;
159 }
160
161 int getLDSBankCount() const {
162 return LDSBankCount;
163 }
164
165 unsigned getMaxPrivateElementSize() const {
166 return MaxPrivateElementSize;
167 }
168
Matt Arsenaultd782d052014-06-27 17:57:00 +0000169 bool hasHWFP64() const {
170 return FP64;
171 }
172
Matt Arsenaultb035a572015-01-29 19:34:25 +0000173 bool hasFastFMAF32() const {
174 return FastFMAF32;
175 }
176
Matt Arsenaulte83690c2016-01-18 21:13:50 +0000177 bool hasHalfRate64Ops() const {
178 return HalfRate64Ops;
179 }
180
Matt Arsenault88701812016-06-09 23:42:48 +0000181 bool hasAddr64() const {
182 return (getGeneration() < VOLCANIC_ISLANDS);
183 }
184
Matt Arsenaultfae02982014-03-17 18:58:11 +0000185 bool hasBFE() const {
186 return (getGeneration() >= EVERGREEN);
187 }
188
Matt Arsenault6e439652014-06-10 19:00:20 +0000189 bool hasBFI() const {
190 return (getGeneration() >= EVERGREEN);
191 }
192
Matt Arsenaultfae02982014-03-17 18:58:11 +0000193 bool hasBFM() const {
194 return hasBFE();
195 }
196
Matt Arsenault60425062014-06-10 19:18:28 +0000197 bool hasBCNT(unsigned Size) const {
198 if (Size == 32)
199 return (getGeneration() >= EVERGREEN);
200
Matt Arsenault3dd43fc2014-07-18 06:07:13 +0000201 if (Size == 64)
202 return (getGeneration() >= SOUTHERN_ISLANDS);
203
204 return false;
Matt Arsenault60425062014-06-10 19:18:28 +0000205 }
206
Tom Stellard50122a52014-04-07 19:45:41 +0000207 bool hasMulU24() const {
208 return (getGeneration() >= EVERGREEN);
209 }
210
211 bool hasMulI24() const {
212 return (getGeneration() >= SOUTHERN_ISLANDS ||
213 hasCaymanISA());
214 }
215
Jan Vesely6ddb8dd2014-07-15 15:51:09 +0000216 bool hasFFBL() const {
217 return (getGeneration() >= EVERGREEN);
218 }
219
220 bool hasFFBH() const {
221 return (getGeneration() >= EVERGREEN);
222 }
223
Jan Vesely808fff52015-04-30 17:15:56 +0000224 bool hasCARRY() const {
225 return (getGeneration() >= EVERGREEN);
226 }
227
228 bool hasBORROW() const {
229 return (getGeneration() >= EVERGREEN);
230 }
231
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000232 bool hasCaymanISA() const {
233 return CaymanISA;
234 }
235
Matt Arsenaultd9a23ab2014-07-13 02:08:26 +0000236 bool isPromoteAllocaEnabled() const {
237 return EnablePromoteAlloca;
238 }
239
Matt Arsenault706f9302015-07-06 16:01:58 +0000240 bool unsafeDSOffsetFoldingEnabled() const {
241 return EnableUnsafeDSOffsetFolding;
242 }
243
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000244 bool dumpCode() const {
245 return DumpCode;
Matt Arsenaultd782d052014-06-27 17:57:00 +0000246 }
247
Matt Arsenault8a028bf2016-05-16 21:19:59 +0000248 /// Return the amount of LDS that can be used that will not restrict the
249 /// occupancy lower than WaveCount.
250 unsigned getMaxLocalMemSizeWithWaveCount(unsigned WaveCount) const;
251
252 /// Inverse of getMaxLocalMemWithWaveCount. Return the maximum wavecount if
253 /// the given LDS memory size is the only constraint.
254 unsigned getOccupancyWithLocalMemSize(uint32_t Bytes) const;
255
256
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000257 bool hasFP32Denormals() const {
258 return FP32Denormals;
Matt Arsenaultd782d052014-06-27 17:57:00 +0000259 }
Tom Stellard75aadc22012-12-11 21:25:42 +0000260
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000261 bool hasFP64Denormals() const {
262 return FP64Denormals;
Matt Arsenault24ee0782016-02-12 02:40:47 +0000263 }
264
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000265 bool hasFPExceptions() const {
266 return FPExceptions;
Marek Olsak4d00dd22015-03-09 15:48:09 +0000267 }
268
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000269 bool useFlatForGlobal() const {
270 return FlatForGlobal;
Tom Stellardec87f842015-05-25 16:15:54 +0000271 }
272
Matt Arsenault7f681ac2016-07-01 23:03:44 +0000273 bool hasUnalignedBufferAccess() const {
274 return UnalignedBufferAccess;
275 }
276
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000277 bool isXNACKEnabled() const {
278 return EnableXNACK;
279 }
Tom Stellardb8fd6ef2014-12-02 22:00:07 +0000280
Tom Stellard0b76fc4c2016-09-16 21:34:26 +0000281 bool isAmdCodeObjectV2() const {
282 return isAmdHsaOS() || isMesa3DOS();
283 }
284
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000285 /// \brief Returns the offset in bytes from the start of the input buffer
286 /// of the first explicit kernel argument.
287 unsigned getExplicitKernelArgOffset() const {
Tom Stellard0b76fc4c2016-09-16 21:34:26 +0000288 return isAmdCodeObjectV2() ? 0 : 36;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000289 }
290
Tom Stellardb2869eb2016-09-09 19:28:00 +0000291 unsigned getAlignmentForImplicitArgPtr() const {
292 return isAmdHsaOS() ? 8 : 4;
293 }
294
Tom Stellarde88bbc32016-09-23 01:33:26 +0000295 unsigned getImplicitArgNumBytes() const {
296 if (isMesa3DOS())
297 return 16;
298 if (isAmdHsaOS() && isOpenCLEnv())
299 return 32;
300 return 0;
301 }
302
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000303 unsigned getStackAlignment() const {
304 // Scratch is allocated in 256 dword per wave blocks.
305 return 4 * 256 / getWavefrontSize();
306 }
Tom Stellard347ac792015-06-26 21:15:07 +0000307
Craig Topper5656db42014-04-29 07:57:24 +0000308 bool enableMachineScheduler() const override {
Tom Stellard83f0bce2015-01-29 16:55:25 +0000309 return true;
Andrew Trick978674b2013-09-20 05:14:41 +0000310 }
311
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000312 bool enableSubRegLiveness() const override {
313 return true;
314 }
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000315
316 /// \returns Number of execution units per compute unit supported by the
317 /// subtarget.
318 unsigned getEUsPerCU() const {
319 return 4;
320 }
321
322 /// \returns Maximum number of work groups per compute unit supported by the
323 /// subtarget and limited by given flat work group size.
324 unsigned getMaxWorkGroupsPerCU(unsigned FlatWorkGroupSize) const {
325 if (getGeneration() < AMDGPUSubtarget::SOUTHERN_ISLANDS)
326 return 8;
327 return getWavesPerWorkGroup(FlatWorkGroupSize) == 1 ? 40 : 16;
328 }
329
330 /// \returns Maximum number of waves per compute unit supported by the
331 /// subtarget without any kind of limitation.
332 unsigned getMaxWavesPerCU() const {
333 return getMaxWavesPerEU() * getEUsPerCU();
334 }
335
336 /// \returns Maximum number of waves per compute unit supported by the
337 /// subtarget and limited by given flat work group size.
338 unsigned getMaxWavesPerCU(unsigned FlatWorkGroupSize) const {
339 return getWavesPerWorkGroup(FlatWorkGroupSize);
340 }
341
342 /// \returns Minimum number of waves per execution unit supported by the
343 /// subtarget.
344 unsigned getMinWavesPerEU() const {
345 return 1;
346 }
347
348 /// \returns Maximum number of waves per execution unit supported by the
349 /// subtarget without any kind of limitation.
350 unsigned getMaxWavesPerEU() const {
351 if (getGeneration() < AMDGPUSubtarget::SOUTHERN_ISLANDS)
352 return 8;
353 // FIXME: Need to take scratch memory into account.
354 return 10;
355 }
356
357 /// \returns Maximum number of waves per execution unit supported by the
358 /// subtarget and limited by given flat work group size.
359 unsigned getMaxWavesPerEU(unsigned FlatWorkGroupSize) const {
360 return alignTo(getMaxWavesPerCU(FlatWorkGroupSize), getEUsPerCU()) /
361 getEUsPerCU();
362 }
363
364 /// \returns Minimum flat work group size supported by the subtarget.
365 unsigned getMinFlatWorkGroupSize() const {
366 return 1;
367 }
368
369 /// \returns Maximum flat work group size supported by the subtarget.
370 unsigned getMaxFlatWorkGroupSize() const {
371 return 2048;
372 }
373
374 /// \returns Number of waves per work group given the flat work group size.
375 unsigned getWavesPerWorkGroup(unsigned FlatWorkGroupSize) const {
376 return alignTo(FlatWorkGroupSize, getWavefrontSize()) / getWavefrontSize();
377 }
378
379 /// \returns Subtarget's default pair of minimum/maximum flat work group sizes
380 /// for function \p F, or minimum/maximum flat work group sizes explicitly
381 /// requested using "amdgpu-flat-work-group-size" attribute attached to
382 /// function \p F.
383 ///
384 /// \returns Subtarget's default values if explicitly requested values cannot
385 /// be converted to integer, or violate subtarget's specifications.
386 std::pair<unsigned, unsigned> getFlatWorkGroupSizes(const Function &F) const;
387
388 /// \returns Subtarget's default pair of minimum/maximum number of waves per
389 /// execution unit for function \p F, or minimum/maximum number of waves per
390 /// execution unit explicitly requested using "amdgpu-waves-per-eu" attribute
391 /// attached to function \p F.
392 ///
393 /// \returns Subtarget's default values if explicitly requested values cannot
394 /// be converted to integer, violate subtarget's specifications, or are not
395 /// compatible with minimum/maximum number of waves limited by flat work group
396 /// size, register usage, and/or lds usage.
397 std::pair<unsigned, unsigned> getWavesPerEU(const Function &F) const;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000398};
399
400class R600Subtarget final : public AMDGPUSubtarget {
401private:
402 R600InstrInfo InstrInfo;
403 R600FrameLowering FrameLowering;
404 R600TargetLowering TLInfo;
405
406public:
407 R600Subtarget(const Triple &TT, StringRef CPU, StringRef FS,
408 const TargetMachine &TM);
409
410 const R600InstrInfo *getInstrInfo() const override {
411 return &InstrInfo;
412 }
413
414 const R600FrameLowering *getFrameLowering() const override {
415 return &FrameLowering;
416 }
417
418 const R600TargetLowering *getTargetLowering() const override {
419 return &TLInfo;
420 }
421
422 const R600RegisterInfo *getRegisterInfo() const override {
423 return &InstrInfo.getRegisterInfo();
424 }
425
426 bool hasCFAluBug() const {
427 return CFALUBug;
428 }
429
430 bool hasVertexCache() const {
431 return HasVertexCache;
432 }
433
434 short getTexVTXClauseSize() const {
435 return TexVTXClauseSize;
436 }
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000437};
438
439class SISubtarget final : public AMDGPUSubtarget {
440public:
441 enum {
Marek Olsak355a8642016-08-05 21:23:29 +0000442 // The closed Vulkan driver sets 96, which limits the wave count to 8 but
443 // doesn't spill SGPRs as much as when 80 is set.
444 FIXED_SGPR_COUNT_FOR_INIT_BUG = 96
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000445 };
446
447private:
448 SIInstrInfo InstrInfo;
449 SIFrameLowering FrameLowering;
450 SITargetLowering TLInfo;
451 std::unique_ptr<GISelAccessor> GISel;
452
453public:
454 SISubtarget(const Triple &TT, StringRef CPU, StringRef FS,
455 const TargetMachine &TM);
456
457 const SIInstrInfo *getInstrInfo() const override {
458 return &InstrInfo;
459 }
460
461 const SIFrameLowering *getFrameLowering() const override {
462 return &FrameLowering;
463 }
464
465 const SITargetLowering *getTargetLowering() const override {
466 return &TLInfo;
467 }
468
469 const CallLowering *getCallLowering() const override {
470 assert(GISel && "Access to GlobalISel APIs not set");
471 return GISel->getCallLowering();
472 }
473
474 const SIRegisterInfo *getRegisterInfo() const override {
475 return &InstrInfo.getRegisterInfo();
476 }
477
478 void setGISelAccessor(GISelAccessor &GISel) {
479 this->GISel.reset(&GISel);
480 }
481
Tom Stellard83f0bce2015-01-29 16:55:25 +0000482 void overrideSchedPolicy(MachineSchedPolicy &Policy,
Tom Stellard83f0bce2015-01-29 16:55:25 +0000483 unsigned NumRegionInstrs) const override;
484
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000485 bool isVGPRSpillingEnabled(const Function& F) const;
486
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000487 unsigned getMaxNumUserSGPRs() const {
488 return 16;
489 }
490
491 bool hasFlatAddressSpace() const {
492 return FlatAddressSpace;
493 }
494
495 bool hasSMemRealTime() const {
496 return HasSMemRealTime;
497 }
498
499 bool has16BitInsts() const {
500 return Has16BitInsts;
Matt Arsenaultd782d052014-06-27 17:57:00 +0000501 }
Tom Stellard75aadc22012-12-11 21:25:42 +0000502
Matt Arsenault7b1dc2c2016-09-17 02:02:19 +0000503 bool hasScalarCompareEq64() const {
504 return getGeneration() >= VOLCANIC_ISLANDS;
505 }
506
Tom Stellardde008d32016-01-21 04:28:34 +0000507 bool enableSIScheduler() const {
508 return EnableSIScheduler;
509 }
510
Konstantin Zhuravlyovf2f3d142016-06-25 03:11:28 +0000511 bool debuggerSupported() const {
512 return debuggerInsertNops() && debuggerReserveRegs() &&
513 debuggerEmitPrologue();
514 }
515
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +0000516 bool debuggerInsertNops() const {
517 return DebuggerInsertNops;
518 }
519
Konstantin Zhuravlyov29ddd2b2016-05-24 18:37:18 +0000520 bool debuggerReserveRegs() const {
521 return DebuggerReserveRegs;
Konstantin Zhuravlyov1d99c4d2016-04-26 15:43:14 +0000522 }
523
Konstantin Zhuravlyovf2f3d142016-06-25 03:11:28 +0000524 bool debuggerEmitPrologue() const {
525 return DebuggerEmitPrologue;
526 }
527
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000528 bool loadStoreOptEnabled() const {
529 return EnableLoadStoreOpt;
Nicolai Haehnle5b504972016-01-04 23:35:53 +0000530 }
531
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000532 bool hasSGPRInitBug() const {
533 return SGPRInitBug;
Matt Arsenault41003af2015-11-30 21:16:07 +0000534 }
Tom Stellard0d23ebe2016-08-29 19:42:52 +0000535
Tom Stellarde88bbc32016-09-23 01:33:26 +0000536 unsigned getKernArgSegmentSize(unsigned ExplictArgBytes) const;
537
Tom Stellard0d23ebe2016-08-29 19:42:52 +0000538 /// Return the maximum number of waves per SIMD for kernels using \p SGPRs SGPRs
539 unsigned getOccupancyWithNumSGPRs(unsigned SGPRs) const;
540
541 /// Return the maximum number of waves per SIMD for kernels using \p VGPRs VGPRs
542 unsigned getOccupancyWithNumVGPRs(unsigned VGPRs) const;
Konstantin Zhuravlyovd7bdf242016-09-30 16:50:36 +0000543
544 /// \returns True if waitcnt instruction is needed before barrier instruction,
545 /// false otherwise.
546 bool needWaitcntBeforeBarrier() const {
547 return true;
548 }
Tom Stellard75aadc22012-12-11 21:25:42 +0000549};
550
551} // End namespace llvm
552
Benjamin Kramera7c40ef2014-08-13 16:26:38 +0000553#endif