blob: 22cede59086ab85d24827c03bd69ec992b9f3dbe [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 "R600FrameLowering.h"
Chandler Carruth6bda14b2017-06-06 11:49:48 +000020#include "R600ISelLowering.h"
21#include "R600InstrInfo.h"
Matt Arsenault43e92fe2016-06-24 06:30:11 +000022#include "SIFrameLowering.h"
Chandler Carruth6bda14b2017-06-06 11:49:48 +000023#include "SIISelLowering.h"
24#include "SIInstrInfo.h"
Valery Pykhtinfd4c4102017-03-21 13:15:46 +000025#include "SIMachineFunctionInfo.h"
Tom Stellard347ac792015-06-26 21:15:07 +000026#include "Utils/AMDGPUBaseInfo.h"
Eugene Zelenko2bc2f332016-12-09 22:06:55 +000027#include "llvm/ADT/Triple.h"
Tom Stellard000c5af2016-04-14 19:09:28 +000028#include "llvm/CodeGen/GlobalISel/GISelAccessor.h"
Eugene Zelenko2bc2f332016-12-09 22:06:55 +000029#include "llvm/CodeGen/MachineFunction.h"
Matt Arsenault56684d42016-08-11 17:31:42 +000030#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
Eugene Zelenko2bc2f332016-12-09 22:06:55 +000031#include "llvm/MC/MCInstrItineraries.h"
32#include "llvm/Support/MathExtras.h"
33#include <cassert>
34#include <cstdint>
35#include <memory>
36#include <utility>
Tom Stellard75aadc22012-12-11 21:25:42 +000037
38#define GET_SUBTARGETINFO_HEADER
39#include "AMDGPUGenSubtargetInfo.inc"
40
Tom Stellard75aadc22012-12-11 21:25:42 +000041namespace llvm {
42
Matt Arsenault43e92fe2016-06-24 06:30:11 +000043class StringRef;
Tom Stellarde99fb652015-01-20 19:33:04 +000044
Tom Stellard75aadc22012-12-11 21:25:42 +000045class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000046public:
47 enum Generation {
48 R600 = 0,
49 R700,
50 EVERGREEN,
51 NORTHERN_ISLANDS,
Tom Stellard6e1ee472013-10-29 16:37:28 +000052 SOUTHERN_ISLANDS,
Marek Olsak5df00d62014-12-07 12:18:57 +000053 SEA_ISLANDS,
54 VOLCANIC_ISLANDS,
Matt Arsenaulte823d922017-02-18 18:29:53 +000055 GFX9,
Tom Stellarda6c6e1b2013-06-07 20:37:48 +000056 };
57
Marek Olsak4d00dd22015-03-09 15:48:09 +000058 enum {
Tom Stellard347ac792015-06-26 21:15:07 +000059 ISAVersion0_0_0,
Wei Ding7c3e5112017-06-10 03:53:19 +000060 ISAVersion6_0_0,
61 ISAVersion6_0_1,
Tom Stellard347ac792015-06-26 21:15:07 +000062 ISAVersion7_0_0,
63 ISAVersion7_0_1,
Yaxun Liu94add852016-10-26 16:37:56 +000064 ISAVersion7_0_2,
Wei Ding7c3e5112017-06-10 03:53:19 +000065 ISAVersion7_0_3,
Tom Stellard347ac792015-06-26 21:15:07 +000066 ISAVersion8_0_0,
Changpeng Fangc16be002016-01-13 20:39:25 +000067 ISAVersion8_0_1,
Changpeng Fang98317d22016-10-11 16:00:47 +000068 ISAVersion8_0_2,
Yaxun Liu94add852016-10-26 16:37:56 +000069 ISAVersion8_0_3,
70 ISAVersion8_0_4,
71 ISAVersion8_1_0,
Matt Arsenaulte823d922017-02-18 18:29:53 +000072 ISAVersion9_0_0,
Wei Ding7c3e5112017-06-10 03:53:19 +000073 ISAVersion9_0_1,
74 ISAVersion9_0_2,
75 ISAVersion9_0_3
Tom Stellard347ac792015-06-26 21:15:07 +000076 };
77
Wei Ding205bfdb2017-02-10 02:15:29 +000078 enum TrapHandlerAbi {
79 TrapHandlerAbiNone = 0,
80 TrapHandlerAbiHsa = 1
81 };
82
Wei Dingf2cce022017-02-22 23:22:19 +000083 enum TrapID {
84 TrapIDHardwareReserved = 0,
85 TrapIDHSADebugTrap = 1,
86 TrapIDLLVMTrap = 2,
87 TrapIDLLVMDebugTrap = 3,
88 TrapIDDebugBreakpoint = 7,
89 TrapIDDebugReserved8 = 8,
90 TrapIDDebugReservedFE = 0xfe,
91 TrapIDDebugReservedFF = 0xff
Wei Ding205bfdb2017-02-10 02:15:29 +000092 };
93
94 enum TrapRegValues {
Wei Dingf2cce022017-02-22 23:22:19 +000095 LLVMTrapHandlerRegValue = 1
Wei Ding205bfdb2017-02-10 02:15:29 +000096 };
97
Matt Arsenault43e92fe2016-06-24 06:30:11 +000098protected:
99 // Basic subtarget description.
100 Triple TargetTriple;
Matt Arsenaultd782d052014-06-27 17:57:00 +0000101 Generation Gen;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000102 unsigned IsaVersion;
103 unsigned WavefrontSize;
104 int LocalMemorySize;
105 int LDSBankCount;
106 unsigned MaxPrivateElementSize;
107
108 // Possibly statically set by tablegen, but may want to be overridden.
Matt Arsenaultb035a572015-01-29 19:34:25 +0000109 bool FastFMAF32;
Matt Arsenaulte83690c2016-01-18 21:13:50 +0000110 bool HalfRate64Ops;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000111
112 // Dynamially set bits that enable features.
113 bool FP32Denormals;
Matt Arsenaulta6867fd2017-01-23 22:31:03 +0000114 bool FP64FP16Denormals;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000115 bool FPExceptions;
Matt Arsenault2fdf2a12017-02-21 23:35:48 +0000116 bool DX10Clamp;
Changpeng Fangb41574a2015-12-22 20:55:23 +0000117 bool FlatForGlobal;
Konstantin Zhuravlyovbe6c0ca2017-06-02 17:40:26 +0000118 bool AutoWaitcntBeforeBarrier;
Tom Stellard64a9d082016-10-14 18:10:39 +0000119 bool UnalignedScratchAccess;
Matt Arsenault7f681ac2016-07-01 23:03:44 +0000120 bool UnalignedBufferAccess;
Matt Arsenaulte823d922017-02-18 18:29:53 +0000121 bool HasApertureRegs;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000122 bool EnableXNACK;
Wei Ding205bfdb2017-02-10 02:15:29 +0000123 bool TrapHandler;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000124 bool DebuggerInsertNops;
125 bool DebuggerReserveRegs;
Konstantin Zhuravlyovf2f3d142016-06-25 03:11:28 +0000126 bool DebuggerEmitPrologue;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000127
128 // Used as options.
129 bool EnableVGPRSpilling;
Matt Arsenaultd9a23ab2014-07-13 02:08:26 +0000130 bool EnablePromoteAlloca;
Matt Arsenault41033282014-10-10 22:01:59 +0000131 bool EnableLoadStoreOpt;
Matt Arsenault706f9302015-07-06 16:01:58 +0000132 bool EnableUnsafeDSOffsetFolding;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000133 bool EnableSIScheduler;
134 bool DumpCode;
135
136 // Subtarget statically properties set by tablegen
137 bool FP64;
Tom Stellardd7e6f132015-04-08 01:09:26 +0000138 bool IsGCN;
139 bool GCN1Encoding;
140 bool GCN3Encoding;
Tom Stellardd1f0f022015-04-23 19:33:54 +0000141 bool CIInsts;
Matt Arsenault2021f082017-02-18 19:12:26 +0000142 bool GFX9Insts;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000143 bool SGPRInitBug;
Matt Arsenault9d82ee72016-02-27 08:53:55 +0000144 bool HasSMemRealTime;
145 bool Has16BitInsts;
Matt Arsenault9be7b0d2017-02-27 18:49:11 +0000146 bool HasVOP3PInsts;
Matt Arsenaultcc88ce32016-10-12 18:00:51 +0000147 bool HasMovrel;
148 bool HasVGPRIndexMode;
Matt Arsenault7b647552016-10-28 21:55:15 +0000149 bool HasScalarStores;
Matt Arsenaultc88ba362016-10-29 04:05:06 +0000150 bool HasInv2PiInlineImm;
Sam Kolton07dbde22017-01-20 10:01:25 +0000151 bool HasSDWA;
Sam Kolton3c4933f2017-06-22 06:26:41 +0000152 bool HasSDWAOmod;
153 bool HasSDWAScalar;
154 bool HasSDWASdst;
155 bool HasSDWAMac;
Sam Koltona179d252017-06-27 15:02:23 +0000156 bool HasSDWAOutModsVOPC;
Sam Kolton07dbde22017-01-20 10:01:25 +0000157 bool HasDPP;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000158 bool FlatAddressSpace;
Matt Arsenaultacdc7652017-05-10 21:19:05 +0000159 bool FlatInstOffsets;
160 bool FlatGlobalInsts;
161 bool FlatScratchInsts;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000162 bool R600ALUInst;
163 bool CaymanISA;
164 bool CFALUBug;
165 bool HasVertexCache;
166 short TexVTXClauseSize;
Alexander Timofeev18009562016-12-08 17:28:47 +0000167 bool ScalarizeGlobal;
Tom Stellard75aadc22012-12-11 21:25:42 +0000168
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000169 // Dummy feature to use for assembler in tablegen.
170 bool FeatureDisable;
171
Tom Stellard75aadc22012-12-11 21:25:42 +0000172 InstrItineraryData InstrItins;
Matt Arsenault56684d42016-08-11 17:31:42 +0000173 SelectionDAGTargetInfo TSInfo;
Yaxun Liu1a14bfa2017-03-27 14:04:01 +0000174 AMDGPUAS AS;
Tom Stellard75aadc22012-12-11 21:25:42 +0000175
176public:
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000177 AMDGPUSubtarget(const Triple &TT, StringRef GPU, StringRef FS,
178 const TargetMachine &TM);
Eugene Zelenko2bc2f332016-12-09 22:06:55 +0000179 ~AMDGPUSubtarget() override;
180
Daniel Sandersa73f1fd2015-06-10 12:11:26 +0000181 AMDGPUSubtarget &initializeSubtargetDependencies(const Triple &TT,
182 StringRef GPU, StringRef FS);
Tom Stellard75aadc22012-12-11 21:25:42 +0000183
Matt Arsenaultf9245b72016-07-22 17:01:25 +0000184 const AMDGPUInstrInfo *getInstrInfo() const override = 0;
185 const AMDGPUFrameLowering *getFrameLowering() const override = 0;
186 const AMDGPUTargetLowering *getTargetLowering() const override = 0;
187 const AMDGPURegisterInfo *getRegisterInfo() const override = 0;
Tom Stellard000c5af2016-04-14 19:09:28 +0000188
Eric Christopherd9134482014-08-04 21:25:23 +0000189 const InstrItineraryData *getInstrItineraryData() const override {
190 return &InstrItins;
191 }
Matt Arsenaultd782d052014-06-27 17:57:00 +0000192
Matt Arsenault56684d42016-08-11 17:31:42 +0000193 // Nothing implemented, just prevent crashes on use.
194 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
195 return &TSInfo;
196 }
197
Craig Topperee7b0f32014-04-30 05:53:27 +0000198 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
Tom Stellard75aadc22012-12-11 21:25:42 +0000199
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000200 bool isAmdHsaOS() const {
201 return TargetTriple.getOS() == Triple::AMDHSA;
Matt Arsenaultd782d052014-06-27 17:57:00 +0000202 }
203
Tom Stellard0b76fc4c2016-09-16 21:34:26 +0000204 bool isMesa3DOS() const {
205 return TargetTriple.getOS() == Triple::Mesa3D;
206 }
207
Tom Stellarde88bbc32016-09-23 01:33:26 +0000208 bool isOpenCLEnv() const {
Yaxun Liua618acf2017-06-01 21:31:53 +0000209 return TargetTriple.getEnvironment() == Triple::OpenCL ||
210 TargetTriple.getEnvironmentName() == "amdgizcl";
Tom Stellarde88bbc32016-09-23 01:33:26 +0000211 }
212
Matt Arsenaultd782d052014-06-27 17:57:00 +0000213 Generation getGeneration() const {
214 return Gen;
215 }
216
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000217 unsigned getWavefrontSize() const {
218 return WavefrontSize;
219 }
220
221 int getLocalMemorySize() const {
222 return LocalMemorySize;
223 }
224
225 int getLDSBankCount() const {
226 return LDSBankCount;
227 }
228
229 unsigned getMaxPrivateElementSize() const {
230 return MaxPrivateElementSize;
231 }
232
Yaxun Liu1a14bfa2017-03-27 14:04:01 +0000233 AMDGPUAS getAMDGPUAS() const {
234 return AS;
235 }
236
Konstantin Zhuravlyovd971a112016-11-01 17:49:33 +0000237 bool has16BitInsts() const {
238 return Has16BitInsts;
239 }
240
Matt Arsenault9be7b0d2017-02-27 18:49:11 +0000241 bool hasVOP3PInsts() const {
242 return HasVOP3PInsts;
243 }
244
Matt Arsenaultd782d052014-06-27 17:57:00 +0000245 bool hasHWFP64() const {
246 return FP64;
247 }
248
Matt Arsenaultb035a572015-01-29 19:34:25 +0000249 bool hasFastFMAF32() const {
250 return FastFMAF32;
251 }
252
Matt Arsenaulte83690c2016-01-18 21:13:50 +0000253 bool hasHalfRate64Ops() const {
254 return HalfRate64Ops;
255 }
256
Matt Arsenault88701812016-06-09 23:42:48 +0000257 bool hasAddr64() const {
258 return (getGeneration() < VOLCANIC_ISLANDS);
259 }
260
Matt Arsenaultfae02982014-03-17 18:58:11 +0000261 bool hasBFE() const {
262 return (getGeneration() >= EVERGREEN);
263 }
264
Matt Arsenault6e439652014-06-10 19:00:20 +0000265 bool hasBFI() const {
266 return (getGeneration() >= EVERGREEN);
267 }
268
Matt Arsenaultfae02982014-03-17 18:58:11 +0000269 bool hasBFM() const {
270 return hasBFE();
271 }
272
Matt Arsenault60425062014-06-10 19:18:28 +0000273 bool hasBCNT(unsigned Size) const {
274 if (Size == 32)
275 return (getGeneration() >= EVERGREEN);
276
Matt Arsenault3dd43fc2014-07-18 06:07:13 +0000277 if (Size == 64)
278 return (getGeneration() >= SOUTHERN_ISLANDS);
279
280 return false;
Matt Arsenault60425062014-06-10 19:18:28 +0000281 }
282
Tom Stellard50122a52014-04-07 19:45:41 +0000283 bool hasMulU24() const {
284 return (getGeneration() >= EVERGREEN);
285 }
286
287 bool hasMulI24() const {
288 return (getGeneration() >= SOUTHERN_ISLANDS ||
289 hasCaymanISA());
290 }
291
Jan Vesely6ddb8dd2014-07-15 15:51:09 +0000292 bool hasFFBL() const {
293 return (getGeneration() >= EVERGREEN);
294 }
295
296 bool hasFFBH() const {
297 return (getGeneration() >= EVERGREEN);
298 }
299
Matt Arsenault10268f92017-02-27 22:40:39 +0000300 bool hasMed3_16() const {
301 return getGeneration() >= GFX9;
302 }
303
Matt Arsenaultee324ff2017-05-17 19:25:06 +0000304 bool hasMin3Max3_16() const {
305 return getGeneration() >= GFX9;
306 }
307
Jan Vesely808fff52015-04-30 17:15:56 +0000308 bool hasCARRY() const {
309 return (getGeneration() >= EVERGREEN);
310 }
311
312 bool hasBORROW() const {
313 return (getGeneration() >= EVERGREEN);
314 }
315
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000316 bool hasCaymanISA() const {
317 return CaymanISA;
318 }
319
Wei Ding205bfdb2017-02-10 02:15:29 +0000320 TrapHandlerAbi getTrapHandlerAbi() const {
321 return isAmdHsaOS() ? TrapHandlerAbiHsa : TrapHandlerAbiNone;
322 }
323
Matt Arsenaultd9a23ab2014-07-13 02:08:26 +0000324 bool isPromoteAllocaEnabled() const {
325 return EnablePromoteAlloca;
326 }
327
Matt Arsenault706f9302015-07-06 16:01:58 +0000328 bool unsafeDSOffsetFoldingEnabled() const {
329 return EnableUnsafeDSOffsetFolding;
330 }
331
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000332 bool dumpCode() const {
333 return DumpCode;
Matt Arsenaultd782d052014-06-27 17:57:00 +0000334 }
335
Matt Arsenault8a028bf2016-05-16 21:19:59 +0000336 /// Return the amount of LDS that can be used that will not restrict the
337 /// occupancy lower than WaveCount.
Stanislav Mekhanoshin2b913b12017-02-01 22:59:50 +0000338 unsigned getMaxLocalMemSizeWithWaveCount(unsigned WaveCount,
339 const Function &) const;
Matt Arsenault8a028bf2016-05-16 21:19:59 +0000340
341 /// Inverse of getMaxLocalMemWithWaveCount. Return the maximum wavecount if
342 /// the given LDS memory size is the only constraint.
Stanislav Mekhanoshin2b913b12017-02-01 22:59:50 +0000343 unsigned getOccupancyWithLocalMemSize(uint32_t Bytes, const Function &) const;
Matt Arsenault8a028bf2016-05-16 21:19:59 +0000344
Valery Pykhtinfd4c4102017-03-21 13:15:46 +0000345 unsigned getOccupancyWithLocalMemSize(const MachineFunction &MF) const {
346 const auto *MFI = MF.getInfo<SIMachineFunctionInfo>();
347 return getOccupancyWithLocalMemSize(MFI->getLDSSize(), *MF.getFunction());
348 }
349
Konstantin Zhuravlyovf86e4b72016-11-13 07:01:11 +0000350 bool hasFP16Denormals() const {
Matt Arsenaulta6867fd2017-01-23 22:31:03 +0000351 return FP64FP16Denormals;
Konstantin Zhuravlyovf86e4b72016-11-13 07:01:11 +0000352 }
Matt Arsenault8a028bf2016-05-16 21:19:59 +0000353
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000354 bool hasFP32Denormals() const {
355 return FP32Denormals;
Matt Arsenaultd782d052014-06-27 17:57:00 +0000356 }
Tom Stellard75aadc22012-12-11 21:25:42 +0000357
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000358 bool hasFP64Denormals() const {
Matt Arsenaulta6867fd2017-01-23 22:31:03 +0000359 return FP64FP16Denormals;
Matt Arsenault24ee0782016-02-12 02:40:47 +0000360 }
361
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000362 bool hasFPExceptions() const {
363 return FPExceptions;
Marek Olsak4d00dd22015-03-09 15:48:09 +0000364 }
365
Matt Arsenault2fdf2a12017-02-21 23:35:48 +0000366 bool enableDX10Clamp() const {
367 return DX10Clamp;
368 }
369
370 bool enableIEEEBit(const MachineFunction &MF) const {
371 return AMDGPU::isCompute(MF.getFunction()->getCallingConv());
372 }
373
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000374 bool useFlatForGlobal() const {
375 return FlatForGlobal;
Tom Stellardec87f842015-05-25 16:15:54 +0000376 }
377
Konstantin Zhuravlyovbe6c0ca2017-06-02 17:40:26 +0000378 bool hasAutoWaitcntBeforeBarrier() const {
379 return AutoWaitcntBeforeBarrier;
380 }
381
Matt Arsenault7f681ac2016-07-01 23:03:44 +0000382 bool hasUnalignedBufferAccess() const {
383 return UnalignedBufferAccess;
384 }
385
Tom Stellard64a9d082016-10-14 18:10:39 +0000386 bool hasUnalignedScratchAccess() const {
387 return UnalignedScratchAccess;
388 }
389
Matt Arsenaulte823d922017-02-18 18:29:53 +0000390 bool hasApertureRegs() const {
391 return HasApertureRegs;
392 }
393
Wei Ding205bfdb2017-02-10 02:15:29 +0000394 bool isTrapHandlerEnabled() const {
395 return TrapHandler;
396 }
397
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000398 bool isXNACKEnabled() const {
399 return EnableXNACK;
400 }
Tom Stellardb8fd6ef2014-12-02 22:00:07 +0000401
Matt Arsenaultb6491cc2017-01-31 01:20:54 +0000402 bool hasFlatAddressSpace() const {
403 return FlatAddressSpace;
404 }
405
Matt Arsenaultacdc7652017-05-10 21:19:05 +0000406 bool hasFlatInstOffsets() const {
407 return FlatInstOffsets;
408 }
409
410 bool hasFlatGlobalInsts() const {
411 return FlatGlobalInsts;
412 }
413
414 bool hasFlatScratchInsts() const {
415 return FlatScratchInsts;
416 }
417
Tom Stellard2f3f9852017-01-25 01:25:13 +0000418 bool isMesaKernel(const MachineFunction &MF) const {
419 return isMesa3DOS() && !AMDGPU::isShader(MF.getFunction()->getCallingConv());
420 }
421
422 // Covers VS/PS/CS graphics shaders
423 bool isMesaGfxShader(const MachineFunction &MF) const {
424 return isMesa3DOS() && AMDGPU::isShader(MF.getFunction()->getCallingConv());
425 }
426
427 bool isAmdCodeObjectV2(const MachineFunction &MF) const {
428 return isAmdHsaOS() || isMesaKernel(MF);
Tom Stellard0b76fc4c2016-09-16 21:34:26 +0000429 }
430
Matt Arsenaultda7a6562017-02-01 00:42:40 +0000431 bool hasFminFmaxLegacy() const {
432 return getGeneration() < AMDGPUSubtarget::VOLCANIC_ISLANDS;
433 }
434
Stanislav Mekhanoshin53a21292017-05-23 19:54:48 +0000435 bool hasSDWA() const {
436 return HasSDWA;
437 }
438
Sam Kolton3c4933f2017-06-22 06:26:41 +0000439 bool hasSDWAOmod() const {
440 return HasSDWAOmod;
441 }
442
443 bool hasSDWAScalar() const {
444 return HasSDWAScalar;
445 }
446
447 bool hasSDWASdst() const {
448 return HasSDWASdst;
449 }
450
451 bool hasSDWAMac() const {
452 return HasSDWAMac;
453 }
454
Sam Koltona179d252017-06-27 15:02:23 +0000455 bool hasSDWAOutModsVOPC() const {
456 return HasSDWAOutModsVOPC;
Sam Kolton3c4933f2017-06-22 06:26:41 +0000457 }
458
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000459 /// \brief Returns the offset in bytes from the start of the input buffer
460 /// of the first explicit kernel argument.
Tom Stellard2f3f9852017-01-25 01:25:13 +0000461 unsigned getExplicitKernelArgOffset(const MachineFunction &MF) const {
462 return isAmdCodeObjectV2(MF) ? 0 : 36;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000463 }
464
Tom Stellardb2869eb2016-09-09 19:28:00 +0000465 unsigned getAlignmentForImplicitArgPtr() const {
466 return isAmdHsaOS() ? 8 : 4;
467 }
468
Tom Stellard2f3f9852017-01-25 01:25:13 +0000469 unsigned getImplicitArgNumBytes(const MachineFunction &MF) const {
470 if (isMesaKernel(MF))
Tom Stellarde88bbc32016-09-23 01:33:26 +0000471 return 16;
472 if (isAmdHsaOS() && isOpenCLEnv())
473 return 32;
474 return 0;
475 }
476
Matt Arsenault869fec22017-04-17 19:48:24 +0000477 // Scratch is allocated in 256 dword per wave blocks for the entire
478 // wavefront. When viewed from the perspecive of an arbitrary workitem, this
479 // is 4-byte aligned.
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000480 unsigned getStackAlignment() const {
Matt Arsenault869fec22017-04-17 19:48:24 +0000481 return 4;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000482 }
Tom Stellard347ac792015-06-26 21:15:07 +0000483
Craig Topper5656db42014-04-29 07:57:24 +0000484 bool enableMachineScheduler() const override {
Tom Stellard83f0bce2015-01-29 16:55:25 +0000485 return true;
Andrew Trick978674b2013-09-20 05:14:41 +0000486 }
487
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000488 bool enableSubRegLiveness() const override {
489 return true;
490 }
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000491
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000492 void setScalarizeGlobalBehavior(bool b) { ScalarizeGlobal = b;}
493 bool getScalarizeGlobalBehavior() const { return ScalarizeGlobal;}
494
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000495 /// \returns Number of execution units per compute unit supported by the
496 /// subtarget.
497 unsigned getEUsPerCU() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000498 return AMDGPU::IsaInfo::getEUsPerCU(getFeatureBits());
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000499 }
500
501 /// \returns Maximum number of work groups per compute unit supported by the
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000502 /// subtarget and limited by given \p FlatWorkGroupSize.
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000503 unsigned getMaxWorkGroupsPerCU(unsigned FlatWorkGroupSize) const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000504 return AMDGPU::IsaInfo::getMaxWorkGroupsPerCU(getFeatureBits(),
505 FlatWorkGroupSize);
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000506 }
507
508 /// \returns Maximum number of waves per compute unit supported by the
509 /// subtarget without any kind of limitation.
510 unsigned getMaxWavesPerCU() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000511 return AMDGPU::IsaInfo::getMaxWavesPerCU(getFeatureBits());
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000512 }
513
514 /// \returns Maximum number of waves per compute unit supported by the
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000515 /// subtarget and limited by given \p FlatWorkGroupSize.
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000516 unsigned getMaxWavesPerCU(unsigned FlatWorkGroupSize) const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000517 return AMDGPU::IsaInfo::getMaxWavesPerCU(getFeatureBits(),
518 FlatWorkGroupSize);
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000519 }
520
521 /// \returns Minimum number of waves per execution unit supported by the
522 /// subtarget.
523 unsigned getMinWavesPerEU() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000524 return AMDGPU::IsaInfo::getMinWavesPerEU(getFeatureBits());
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000525 }
526
527 /// \returns Maximum number of waves per execution unit supported by the
528 /// subtarget without any kind of limitation.
529 unsigned getMaxWavesPerEU() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000530 return AMDGPU::IsaInfo::getMaxWavesPerEU(getFeatureBits());
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000531 }
532
533 /// \returns Maximum number of waves per execution unit supported by the
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000534 /// subtarget and limited by given \p FlatWorkGroupSize.
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000535 unsigned getMaxWavesPerEU(unsigned FlatWorkGroupSize) const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000536 return AMDGPU::IsaInfo::getMaxWavesPerEU(getFeatureBits(),
537 FlatWorkGroupSize);
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000538 }
539
540 /// \returns Minimum flat work group size supported by the subtarget.
541 unsigned getMinFlatWorkGroupSize() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000542 return AMDGPU::IsaInfo::getMinFlatWorkGroupSize(getFeatureBits());
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000543 }
544
545 /// \returns Maximum flat work group size supported by the subtarget.
546 unsigned getMaxFlatWorkGroupSize() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000547 return AMDGPU::IsaInfo::getMaxFlatWorkGroupSize(getFeatureBits());
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000548 }
549
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000550 /// \returns Number of waves per work group supported by the subtarget and
551 /// limited by given \p FlatWorkGroupSize.
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000552 unsigned getWavesPerWorkGroup(unsigned FlatWorkGroupSize) const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000553 return AMDGPU::IsaInfo::getWavesPerWorkGroup(getFeatureBits(),
554 FlatWorkGroupSize);
Konstantin Zhuravlyov1d650262016-09-06 20:22:28 +0000555 }
556
557 /// \returns Subtarget's default pair of minimum/maximum flat work group sizes
558 /// for function \p F, or minimum/maximum flat work group sizes explicitly
559 /// requested using "amdgpu-flat-work-group-size" attribute attached to
560 /// function \p F.
561 ///
562 /// \returns Subtarget's default values if explicitly requested values cannot
563 /// be converted to integer, or violate subtarget's specifications.
564 std::pair<unsigned, unsigned> getFlatWorkGroupSizes(const Function &F) const;
565
566 /// \returns Subtarget's default pair of minimum/maximum number of waves per
567 /// execution unit for function \p F, or minimum/maximum number of waves per
568 /// execution unit explicitly requested using "amdgpu-waves-per-eu" attribute
569 /// attached to function \p F.
570 ///
571 /// \returns Subtarget's default values if explicitly requested values cannot
572 /// be converted to integer, violate subtarget's specifications, or are not
573 /// compatible with minimum/maximum number of waves limited by flat work group
574 /// size, register usage, and/or lds usage.
575 std::pair<unsigned, unsigned> getWavesPerEU(const Function &F) const;
Stanislav Mekhanoshinc90347d2017-04-12 20:48:56 +0000576
577 /// Creates value range metadata on an workitemid.* inrinsic call or load.
578 bool makeLIDRangeMetadata(Instruction *I) const;
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000579};
580
581class R600Subtarget final : public AMDGPUSubtarget {
582private:
583 R600InstrInfo InstrInfo;
584 R600FrameLowering FrameLowering;
585 R600TargetLowering TLInfo;
586
587public:
588 R600Subtarget(const Triple &TT, StringRef CPU, StringRef FS,
589 const TargetMachine &TM);
590
591 const R600InstrInfo *getInstrInfo() const override {
592 return &InstrInfo;
593 }
594
595 const R600FrameLowering *getFrameLowering() const override {
596 return &FrameLowering;
597 }
598
599 const R600TargetLowering *getTargetLowering() const override {
600 return &TLInfo;
601 }
602
603 const R600RegisterInfo *getRegisterInfo() const override {
604 return &InstrInfo.getRegisterInfo();
605 }
606
607 bool hasCFAluBug() const {
608 return CFALUBug;
609 }
610
611 bool hasVertexCache() const {
612 return HasVertexCache;
613 }
614
615 short getTexVTXClauseSize() const {
616 return TexVTXClauseSize;
617 }
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000618};
619
620class SISubtarget final : public AMDGPUSubtarget {
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000621private:
622 SIInstrInfo InstrInfo;
623 SIFrameLowering FrameLowering;
624 SITargetLowering TLInfo;
625 std::unique_ptr<GISelAccessor> GISel;
626
627public:
628 SISubtarget(const Triple &TT, StringRef CPU, StringRef FS,
629 const TargetMachine &TM);
630
631 const SIInstrInfo *getInstrInfo() const override {
632 return &InstrInfo;
633 }
634
635 const SIFrameLowering *getFrameLowering() const override {
636 return &FrameLowering;
637 }
638
639 const SITargetLowering *getTargetLowering() const override {
640 return &TLInfo;
641 }
642
643 const CallLowering *getCallLowering() const override {
644 assert(GISel && "Access to GlobalISel APIs not set");
645 return GISel->getCallLowering();
646 }
647
Tom Stellardca166212017-01-30 21:56:46 +0000648 const InstructionSelector *getInstructionSelector() const override {
649 assert(GISel && "Access to GlobalISel APIs not set");
650 return GISel->getInstructionSelector();
651 }
652
653 const LegalizerInfo *getLegalizerInfo() const override {
654 assert(GISel && "Access to GlobalISel APIs not set");
655 return GISel->getLegalizerInfo();
656 }
657
658 const RegisterBankInfo *getRegBankInfo() const override {
659 assert(GISel && "Access to GlobalISel APIs not set");
660 return GISel->getRegBankInfo();
661 }
662
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000663 const SIRegisterInfo *getRegisterInfo() const override {
664 return &InstrInfo.getRegisterInfo();
665 }
666
667 void setGISelAccessor(GISelAccessor &GISel) {
668 this->GISel.reset(&GISel);
669 }
670
Matt Arsenault9f5e0ef2017-01-25 04:25:02 +0000671 // XXX - Why is this here if it isn't in the default pass set?
672 bool enableEarlyIfConversion() const override {
673 return true;
674 }
675
Tom Stellard83f0bce2015-01-29 16:55:25 +0000676 void overrideSchedPolicy(MachineSchedPolicy &Policy,
Tom Stellard83f0bce2015-01-29 16:55:25 +0000677 unsigned NumRegionInstrs) const override;
678
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000679 bool isVGPRSpillingEnabled(const Function& F) const;
680
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000681 unsigned getMaxNumUserSGPRs() const {
682 return 16;
683 }
684
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000685 bool hasSMemRealTime() const {
686 return HasSMemRealTime;
687 }
688
Matt Arsenaultcc88ce32016-10-12 18:00:51 +0000689 bool hasMovrel() const {
690 return HasMovrel;
691 }
692
693 bool hasVGPRIndexMode() const {
694 return HasVGPRIndexMode;
695 }
696
Marek Olsake22fdb92017-03-21 17:00:32 +0000697 bool useVGPRIndexMode(bool UserEnable) const {
698 return !hasMovrel() || (UserEnable && hasVGPRIndexMode());
699 }
700
Matt Arsenault7b1dc2c2016-09-17 02:02:19 +0000701 bool hasScalarCompareEq64() const {
702 return getGeneration() >= VOLCANIC_ISLANDS;
703 }
704
Matt Arsenault7b647552016-10-28 21:55:15 +0000705 bool hasScalarStores() const {
706 return HasScalarStores;
707 }
708
Matt Arsenaultc88ba362016-10-29 04:05:06 +0000709 bool hasInv2PiInlineImm() const {
710 return HasInv2PiInlineImm;
711 }
712
Sam Kolton07dbde22017-01-20 10:01:25 +0000713 bool hasDPP() const {
714 return HasDPP;
715 }
716
Tom Stellardde008d32016-01-21 04:28:34 +0000717 bool enableSIScheduler() const {
718 return EnableSIScheduler;
719 }
720
Konstantin Zhuravlyovf2f3d142016-06-25 03:11:28 +0000721 bool debuggerSupported() const {
722 return debuggerInsertNops() && debuggerReserveRegs() &&
723 debuggerEmitPrologue();
724 }
725
Konstantin Zhuravlyov8c273ad2016-04-18 16:28:23 +0000726 bool debuggerInsertNops() const {
727 return DebuggerInsertNops;
728 }
729
Konstantin Zhuravlyov29ddd2b2016-05-24 18:37:18 +0000730 bool debuggerReserveRegs() const {
731 return DebuggerReserveRegs;
Konstantin Zhuravlyov1d99c4d2016-04-26 15:43:14 +0000732 }
733
Konstantin Zhuravlyovf2f3d142016-06-25 03:11:28 +0000734 bool debuggerEmitPrologue() const {
735 return DebuggerEmitPrologue;
736 }
737
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000738 bool loadStoreOptEnabled() const {
739 return EnableLoadStoreOpt;
Nicolai Haehnle5b504972016-01-04 23:35:53 +0000740 }
741
Matt Arsenault43e92fe2016-06-24 06:30:11 +0000742 bool hasSGPRInitBug() const {
743 return SGPRInitBug;
Matt Arsenault41003af2015-11-30 21:16:07 +0000744 }
Tom Stellard0d23ebe2016-08-29 19:42:52 +0000745
Tom Stellardb133fbb2016-10-27 23:05:31 +0000746 bool has12DWordStoreHazard() const {
747 return getGeneration() != AMDGPUSubtarget::SOUTHERN_ISLANDS;
748 }
749
Matt Arsenaulte823d922017-02-18 18:29:53 +0000750 bool hasSMovFedHazard() const {
751 return getGeneration() >= AMDGPUSubtarget::GFX9;
752 }
753
754 bool hasReadM0Hazard() const {
755 return getGeneration() >= AMDGPUSubtarget::GFX9;
756 }
757
Tom Stellard2f3f9852017-01-25 01:25:13 +0000758 unsigned getKernArgSegmentSize(const MachineFunction &MF, unsigned ExplictArgBytes) const;
Tom Stellarde88bbc32016-09-23 01:33:26 +0000759
Tom Stellard0d23ebe2016-08-29 19:42:52 +0000760 /// Return the maximum number of waves per SIMD for kernels using \p SGPRs SGPRs
761 unsigned getOccupancyWithNumSGPRs(unsigned SGPRs) const;
762
763 /// Return the maximum number of waves per SIMD for kernels using \p VGPRs VGPRs
764 unsigned getOccupancyWithNumVGPRs(unsigned VGPRs) const;
Konstantin Zhuravlyovd7bdf242016-09-30 16:50:36 +0000765
Matt Arsenaulte823d922017-02-18 18:29:53 +0000766 /// \returns true if the flat_scratch register should be initialized with the
767 /// pointer to the wave's scratch memory rather than a size and offset.
768 bool flatScratchIsPointer() const {
769 return getGeneration() >= GFX9;
Konstantin Zhuravlyovd7bdf242016-09-30 16:50:36 +0000770 }
Matt Arsenault4eae3012016-10-28 20:31:47 +0000771
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000772 /// \returns SGPR allocation granularity supported by the subtarget.
773 unsigned getSGPRAllocGranule() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000774 return AMDGPU::IsaInfo::getSGPRAllocGranule(getFeatureBits());
Konstantin Zhuravlyove22fbcb2017-02-08 13:18:40 +0000775 }
776
777 /// \returns SGPR encoding granularity supported by the subtarget.
778 unsigned getSGPREncodingGranule() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000779 return AMDGPU::IsaInfo::getSGPREncodingGranule(getFeatureBits());
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000780 }
781
782 /// \returns Total number of SGPRs supported by the subtarget.
783 unsigned getTotalNumSGPRs() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000784 return AMDGPU::IsaInfo::getTotalNumSGPRs(getFeatureBits());
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000785 }
786
787 /// \returns Addressable number of SGPRs supported by the subtarget.
788 unsigned getAddressableNumSGPRs() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000789 return AMDGPU::IsaInfo::getAddressableNumSGPRs(getFeatureBits());
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000790 }
791
792 /// \returns Minimum number of SGPRs that meets the given number of waves per
793 /// execution unit requirement supported by the subtarget.
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000794 unsigned getMinNumSGPRs(unsigned WavesPerEU) const {
795 return AMDGPU::IsaInfo::getMinNumSGPRs(getFeatureBits(), WavesPerEU);
796 }
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000797
798 /// \returns Maximum number of SGPRs that meets the given number of waves per
799 /// execution unit requirement supported by the subtarget.
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000800 unsigned getMaxNumSGPRs(unsigned WavesPerEU, bool Addressable) const {
801 return AMDGPU::IsaInfo::getMaxNumSGPRs(getFeatureBits(), WavesPerEU,
802 Addressable);
803 }
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000804
805 /// \returns Reserved number of SGPRs for given function \p MF.
806 unsigned getReservedNumSGPRs(const MachineFunction &MF) const;
807
808 /// \returns Maximum number of SGPRs that meets number of waves per execution
809 /// unit requirement for function \p MF, or number of SGPRs explicitly
810 /// requested using "amdgpu-num-sgpr" attribute attached to function \p MF.
811 ///
812 /// \returns Value that meets number of waves per execution unit requirement
813 /// if explicitly requested value cannot be converted to integer, violates
814 /// subtarget's specifications, or does not meet number of waves per execution
815 /// unit requirement.
816 unsigned getMaxNumSGPRs(const MachineFunction &MF) const;
817
818 /// \returns VGPR allocation granularity supported by the subtarget.
819 unsigned getVGPRAllocGranule() const {
Mandeep Singh Grang5e1697e2017-06-06 05:08:36 +0000820 return AMDGPU::IsaInfo::getVGPRAllocGranule(getFeatureBits());
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000821 }
822
Konstantin Zhuravlyove22fbcb2017-02-08 13:18:40 +0000823 /// \returns VGPR encoding granularity supported by the subtarget.
824 unsigned getVGPREncodingGranule() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000825 return AMDGPU::IsaInfo::getVGPREncodingGranule(getFeatureBits());
Konstantin Zhuravlyove22fbcb2017-02-08 13:18:40 +0000826 }
827
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000828 /// \returns Total number of VGPRs supported by the subtarget.
829 unsigned getTotalNumVGPRs() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000830 return AMDGPU::IsaInfo::getTotalNumVGPRs(getFeatureBits());
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000831 }
832
833 /// \returns Addressable number of VGPRs supported by the subtarget.
834 unsigned getAddressableNumVGPRs() const {
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000835 return AMDGPU::IsaInfo::getAddressableNumVGPRs(getFeatureBits());
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000836 }
837
838 /// \returns Minimum number of VGPRs that meets given number of waves per
839 /// execution unit requirement supported by the subtarget.
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000840 unsigned getMinNumVGPRs(unsigned WavesPerEU) const {
841 return AMDGPU::IsaInfo::getMinNumVGPRs(getFeatureBits(), WavesPerEU);
842 }
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000843
844 /// \returns Maximum number of VGPRs that meets given number of waves per
845 /// execution unit requirement supported by the subtarget.
Konstantin Zhuravlyov9f89ede2017-02-08 14:05:23 +0000846 unsigned getMaxNumVGPRs(unsigned WavesPerEU) const {
847 return AMDGPU::IsaInfo::getMaxNumVGPRs(getFeatureBits(), WavesPerEU);
848 }
Konstantin Zhuravlyove03b1d72017-02-08 13:02:33 +0000849
850 /// \returns Reserved number of VGPRs for given function \p MF.
851 unsigned getReservedNumVGPRs(const MachineFunction &MF) const {
852 return debuggerReserveRegs() ? 4 : 0;
853 }
854
855 /// \returns Maximum number of VGPRs that meets number of waves per execution
856 /// unit requirement for function \p MF, or number of VGPRs explicitly
857 /// requested using "amdgpu-num-vgpr" attribute attached to function \p MF.
858 ///
859 /// \returns Value that meets number of waves per execution unit requirement
860 /// if explicitly requested value cannot be converted to integer, violates
861 /// subtarget's specifications, or does not meet number of waves per execution
862 /// unit requirement.
863 unsigned getMaxNumVGPRs(const MachineFunction &MF) const;
Tom Stellard75aadc22012-12-11 21:25:42 +0000864};
865
Eugene Zelenko2bc2f332016-12-09 22:06:55 +0000866} // end namespace llvm
Tom Stellard75aadc22012-12-11 21:25:42 +0000867
Eugene Zelenko2bc2f332016-12-09 22:06:55 +0000868#endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUSUBTARGET_H