LLVM 17.0.0git
SIRegisterInfo.h
Go to the documentation of this file.
1//===-- SIRegisterInfo.h - SI Register Info Interface ----------*- C++ -*--===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9/// \file
10/// Interface definition for SIRegisterInfo
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_AMDGPU_SIREGISTERINFO_H
15#define LLVM_LIB_TARGET_AMDGPU_SIREGISTERINFO_H
16
17#define GET_REGINFO_HEADER
18#include "AMDGPUGenRegisterInfo.inc"
19
20#include "SIDefines.h"
21
22namespace llvm {
23
24class GCNSubtarget;
25class LiveIntervals;
26class LivePhysRegs;
27class RegisterBank;
28struct SGPRSpillBuilder;
29
31private:
32 const GCNSubtarget &ST;
33 bool SpillSGPRToVGPR;
34 bool isWave32;
35 BitVector RegPressureIgnoredUnits;
36
37 /// Sub reg indexes for getRegSplitParts.
38 /// First index represents subreg size from 1 to 16 DWORDs.
39 /// The inner vector is sorted by bit offset.
40 /// Provided a register can be fully split with given subregs,
41 /// all elements of the inner vector combined give a full lane mask.
42 static std::array<std::vector<int16_t>, 16> RegSplitParts;
43
44 // Table representing sub reg of given width and offset.
45 // First index is subreg size: 32, 64, 96, 128, 160, 192, 224, 256, 512.
46 // Second index is 32 different dword offsets.
47 static std::array<std::array<uint16_t, 32>, 9> SubRegFromChannelTable;
48
49 void reserveRegisterTuples(BitVector &, MCRegister Reg) const;
50
51public:
53
54 struct SpilledReg {
56 int Lane = -1;
57
58 SpilledReg() = default;
59 SpilledReg(Register R, int L) : VGPR(R), Lane(L) {}
60
61 bool hasLane() { return Lane != -1; }
62 bool hasReg() { return VGPR != 0; }
63 };
64
65 /// \returns the sub reg enum value for the given \p Channel
66 /// (e.g. getSubRegFromChannel(0) -> AMDGPU::sub0)
67 static unsigned getSubRegFromChannel(unsigned Channel, unsigned NumRegs = 1);
68
69 bool spillSGPRToVGPR() const {
70 return SpillSGPRToVGPR;
71 }
72
73 /// Return the end register initially reserved for the scratch buffer in case
74 /// spilling is needed.
76
77 BitVector getReservedRegs(const MachineFunction &MF) const override;
78 bool isAsmClobberable(const MachineFunction &MF,
79 MCRegister PhysReg) const override;
80
81 const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;
84 CallingConv::ID) const override;
85 const uint32_t *getNoPreservedMask() const override;
86
87 // Stack access is very expensive. CSRs are also the high registers, and we
88 // want to minimize the number of used registers.
89 unsigned getCSRFirstUseCost() const override {
90 return 100;
91 }
92
95 const MachineFunction &MF) const override;
96
97 Register getFrameRegister(const MachineFunction &MF) const override;
98
99 bool hasBasePointer(const MachineFunction &MF) const;
101
102 bool shouldRealignStack(const MachineFunction &MF) const override;
103 bool requiresRegisterScavenging(const MachineFunction &Fn) const override;
104
105 bool requiresFrameIndexScavenging(const MachineFunction &MF) const override;
107 const MachineFunction &MF) const override;
108 bool requiresVirtualBaseRegisters(const MachineFunction &Fn) const override;
109
110 int64_t getScratchInstrOffset(const MachineInstr *MI) const;
111
113 int Idx) const override;
114
115 bool needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const override;
116
118 int64_t Offset) const override;
119
121 int64_t Offset) const override;
122
123 bool isFrameOffsetLegal(const MachineInstr *MI, Register BaseReg,
124 int64_t Offset) const override;
125
127 const MachineFunction &MF, unsigned Kind = 0) const override;
128
129 /// Returns a legal register class to copy a register in the specified class
130 /// to or from. If it is possible to copy the register directly without using
131 /// a cross register class copy, return the specified RC. Returns NULL if it
132 /// is not possible to copy between two registers of the specified class.
133 const TargetRegisterClass *
134 getCrossCopyRegClass(const TargetRegisterClass *RC) const override;
135
137 bool IsLoad, bool IsKill = true) const;
138
139 /// If \p OnlyToVGPR is true, this will only succeed if this
141 SlotIndexes *Indexes = nullptr, LiveIntervals *LIS = nullptr,
142 bool OnlyToVGPR = false) const;
143
145 SlotIndexes *Indexes = nullptr, LiveIntervals *LIS = nullptr,
146 bool OnlyToVGPR = false) const;
147
149 MachineBasicBlock &RestoreMBB, Register SGPR,
150 RegScavenger *RS) const;
151
152 bool supportsBackwardScavenger() const override {
153 return true;
154 }
155
157 unsigned FIOperandNum,
158 RegScavenger *RS) const override;
159
161 int FI, RegScavenger *RS,
162 SlotIndexes *Indexes = nullptr,
163 LiveIntervals *LIS = nullptr) const;
164
165 StringRef getRegAsmName(MCRegister Reg) const override;
166
167 // Pseudo regs are not allowed
168 unsigned getHWRegIndex(MCRegister Reg) const {
169 return getEncodingValue(Reg) & 0xff;
170 }
171
174
177
179 const TargetRegisterClass *
181
184
185 /// \returns true if this class contains only SGPR registers
186 static bool isSGPRClass(const TargetRegisterClass *RC) {
187 return hasSGPRs(RC) && !hasVGPRs(RC) && !hasAGPRs(RC);
188 }
189
190 /// \returns true if this class ID contains only SGPR registers
191 bool isSGPRClassID(unsigned RCID) const {
192 return isSGPRClass(getRegClass(RCID));
193 }
194
195 bool isSGPRReg(const MachineRegisterInfo &MRI, Register Reg) const;
196
197 /// \returns true if this class contains only VGPR registers
198 static bool isVGPRClass(const TargetRegisterClass *RC) {
199 return hasVGPRs(RC) && !hasAGPRs(RC) && !hasSGPRs(RC);
200 }
201
202 /// \returns true if this class contains only AGPR registers
203 static bool isAGPRClass(const TargetRegisterClass *RC) {
204 return hasAGPRs(RC) && !hasVGPRs(RC) && !hasSGPRs(RC);
205 }
206
207 /// \returns true only if this class contains both VGPR and AGPR registers
209 return hasVGPRs(RC) && hasAGPRs(RC) && !hasSGPRs(RC);
210 }
211
212 /// \returns true only if this class contains both VGPR and SGPR registers
213 bool isVSSuperClass(const TargetRegisterClass *RC) const {
214 return hasVGPRs(RC) && hasSGPRs(RC) && !hasAGPRs(RC);
215 }
216
217 /// \returns true if this class contains VGPR registers.
218 static bool hasVGPRs(const TargetRegisterClass *RC) {
219 return RC->TSFlags & SIRCFlags::HasVGPR;
220 }
221
222 /// \returns true if this class contains AGPR registers.
223 static bool hasAGPRs(const TargetRegisterClass *RC) {
224 return RC->TSFlags & SIRCFlags::HasAGPR;
225 }
226
227 /// \returns true if this class contains SGPR registers.
228 static bool hasSGPRs(const TargetRegisterClass *RC) {
229 return RC->TSFlags & SIRCFlags::HasSGPR;
230 }
231
232 /// \returns true if this class contains any vector registers.
234 return hasVGPRs(RC) || hasAGPRs(RC);
235 }
236
237 /// \returns A VGPR reg class with the same width as \p SRC
238 const TargetRegisterClass *
240
241 /// \returns An AGPR reg class with the same width as \p SRC
242 const TargetRegisterClass *
244
245 /// \returns A SGPR reg class with the same width as \p SRC
246 const TargetRegisterClass *
248
249 /// Returns a register class which is compatible with \p SuperRC, such that a
250 /// subregister exists with class \p SubRC with subregister index \p
251 /// SubIdx. If this is impossible (e.g., an unaligned subregister index within
252 /// a register tuple), return null.
253 const TargetRegisterClass *
255 const TargetRegisterClass *SubRC,
256 unsigned SubIdx) const;
257
259 unsigned DefSubReg,
260 const TargetRegisterClass *SrcRC,
261 unsigned SrcSubReg) const override;
262
263 /// \returns True if operands defined with this operand type can accept
264 /// a literal constant (i.e. any 32-bit immediate).
265 bool opCanUseLiteralConstant(unsigned OpType) const;
266
267 /// \returns True if operands defined with this operand type can accept
268 /// an inline constant. i.e. An integer value in the range (-16, 64) or
269 /// -4.0f, -2.0f, -1.0f, -0.5f, 0.0f, 0.5f, 1.0f, 2.0f, 4.0f.
270 bool opCanUseInlineConstant(unsigned OpType) const;
271
273 const TargetRegisterClass *RC,
274 const MachineFunction &MF,
275 bool ReserveHighestVGPR = false) const;
276
278 Register Reg) const;
279 const TargetRegisterClass *
281 const MachineOperand &MO) const;
282
283 bool isVGPR(const MachineRegisterInfo &MRI, Register Reg) const;
284 bool isAGPR(const MachineRegisterInfo &MRI, Register Reg) const;
286 return isVGPR(MRI, Reg) || isAGPR(MRI, Reg);
287 }
288
289 // FIXME: SGPRs are assumed to be uniform, but this is not true for i1 SGPRs
290 // (such as VCC) which hold a wave-wide vector of boolean values. Examining
291 // just the register class is not suffcient; it needs to be combined with a
292 // value type. The next predicate isUniformReg() does this correctly.
293 bool isDivergentRegClass(const TargetRegisterClass *RC) const override {
294 return !isSGPRClass(RC);
295 }
296
298 Register Reg) const override;
299
301 unsigned EltSize) const;
302
304 const TargetRegisterClass *SrcRC,
305 unsigned SubReg,
306 const TargetRegisterClass *DstRC,
307 unsigned DstSubReg,
308 const TargetRegisterClass *NewRC,
309 LiveIntervals &LIS) const override;
310
311 unsigned getRegPressureLimit(const TargetRegisterClass *RC,
312 MachineFunction &MF) const override;
313
314 unsigned getRegPressureSetLimit(const MachineFunction &MF,
315 unsigned Idx) const override;
316
317 const int *getRegUnitPressureSets(unsigned RegUnit) const override;
318
320
321 const TargetRegisterClass *
322 getRegClassForSizeOnBank(unsigned Size, const RegisterBank &Bank) const;
323
324 const TargetRegisterClass *
326 return getRegClassForSizeOnBank(Ty.getSizeInBits(), Bank);
327 }
328
329 const TargetRegisterClass *
331 const MachineRegisterInfo &MRI) const override;
332
334 return isWave32 ? &AMDGPU::SReg_32RegClass
335 : &AMDGPU::SReg_64RegClass;
336 }
337
339 return isWave32 ? &AMDGPU::SReg_32_XM0_XEXECRegClass
340 : &AMDGPU::SReg_64_XEXECRegClass;
341 }
342
343 // Return the appropriate register class to use for 64-bit VGPRs for the
344 // subtarget.
345 const TargetRegisterClass *getVGPR64Class() const;
346
347 MCRegister getVCC() const;
348
349 MCRegister getExec() const;
350
351 const TargetRegisterClass *getRegClass(unsigned RCID) const;
352
353 // Find reaching register definition
357 LiveIntervals *LIS) const;
358
359 const uint32_t *getAllVGPRRegMask() const;
360 const uint32_t *getAllAGPRRegMask() const;
361 const uint32_t *getAllVectorRegMask() const;
362 const uint32_t *getAllAllocatableSRegMask() const;
363
364 // \returns number of 32 bit registers covered by a \p LM
365 static unsigned getNumCoveredRegs(LaneBitmask LM) {
366 // The assumption is that every lo16 subreg is an even bit and every hi16
367 // is an adjacent odd bit or vice versa.
368 uint64_t Mask = LM.getAsInteger();
369 uint64_t Even = Mask & 0xAAAAAAAAAAAAAAAAULL;
370 Mask = (Even >> 1) | Mask;
371 uint64_t Odd = Mask & 0x5555555555555555ULL;
372 return llvm::popcount(Odd);
373 }
374
375 // \returns a DWORD offset of a \p SubReg
376 unsigned getChannelFromSubReg(unsigned SubReg) const {
377 return SubReg ? (getSubRegIdxOffset(SubReg) + 31) / 32 : 0;
378 }
379
380 // \returns a DWORD size of a \p SubReg
381 unsigned getNumChannelsFromSubReg(unsigned SubReg) const {
382 return getNumCoveredRegs(getSubRegIndexLaneMask(SubReg));
383 }
384
385 // For a given 16 bit \p Reg \returns a 32 bit register holding it.
386 // \returns \p Reg otherwise.
388
389 // Returns true if a given register class is properly aligned for
390 // the subtarget.
391 bool isProperlyAlignedRC(const TargetRegisterClass &RC) const;
392
393 // Given \p RC returns corresponding aligned register class if required
394 // by the subtarget.
395 const TargetRegisterClass *
397
398 /// Return all SGPR128 which satisfy the waves per execution unit requirement
399 /// of the subtarget.
401
402 /// Return all SGPR64 which satisfy the waves per execution unit requirement
403 /// of the subtarget.
405
406 /// Return all SGPR32 which satisfy the waves per execution unit requirement
407 /// of the subtarget.
409
410 // Insert spill or restore instructions.
411 // When lowering spill pseudos, the RegScavenger should be set.
412 // For creating spill instructions during frame lowering, where no scavenger
413 // is available, LiveRegs can be used.
416 unsigned LoadStoreOp, int Index, Register ValueReg,
417 bool ValueIsKill, MCRegister ScratchOffsetReg,
418 int64_t InstrOffset, MachineMemOperand *MMO,
419 RegScavenger *RS,
420 LivePhysRegs *LiveRegs = nullptr) const;
421
422 // Return alignment in register file of first register in a register tuple.
424 return (RC->TSFlags & SIRCFlags::RegTupleAlignUnitsMask) * 32;
425 }
426
427 // Check if register class RC has required alignment.
429 unsigned AlignNumBits) const {
430 assert(AlignNumBits != 0);
431 unsigned RCAlign = getRegClassAlignmentNumBits(RC);
432 return RCAlign == AlignNumBits ||
433 (RCAlign > AlignNumBits && (RCAlign % AlignNumBits) == 0);
434 }
435
436 // Return alignment of a SubReg relative to start of a register in RC class.
437 // No check if the subreg is supported by the current RC is made.
439 unsigned SubReg) const;
440};
441
442} // End namespace llvm
443
444#endif
unsigned SubReg
unsigned const MachineRegisterInfo * MRI
MachineBasicBlock & MBB
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define LLVM_READONLY
Definition: Compiler.h:196
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
uint64_t Size
IRTranslator LLVM IR MI
unsigned Reg
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
A debug info location.
Definition: DebugLoc.h:33
constexpr TypeSize getSizeInBits() const
Returns the total size of the type. Must only be called on sized types.
Definition: LowLevelType.h:159
A set of physical registers with utility functions to track liveness when walking backward/forward th...
Definition: LivePhysRegs.h:50
Wrapper class representing physical registers. Should be passed by value.
Definition: MCRegister.h:24
Representation of each machine instruction.
Definition: MachineInstr.h:68
A description of a memory reference used in the backend.
MachineOperand class - Representation of each machine instruction operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Holds all the information related to register banks.
This class implements the register bank concept.
Definition: RegisterBank.h:28
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
Register materializeFrameBaseRegister(MachineBasicBlock *MBB, int FrameIdx, int64_t Offset) const override
int64_t getScratchInstrOffset(const MachineInstr *MI) const
bool isFrameOffsetLegal(const MachineInstr *MI, Register BaseReg, int64_t Offset) const override
const TargetRegisterClass * getRegClass(unsigned RCID) const
const TargetRegisterClass * getCompatibleSubRegClass(const TargetRegisterClass *SuperRC, const TargetRegisterClass *SubRC, unsigned SubIdx) const
Returns a register class which is compatible with SuperRC, such that a subregister exists with class ...
ArrayRef< MCPhysReg > getAllSGPR64(const MachineFunction &MF) const
Return all SGPR64 which satisfy the waves per execution unit requirement of the subtarget.
MCRegister findUnusedRegister(const MachineRegisterInfo &MRI, const TargetRegisterClass *RC, const MachineFunction &MF, bool ReserveHighestVGPR=false) const
Returns a lowest register that is not used at any point in the function.
static unsigned getSubRegFromChannel(unsigned Channel, unsigned NumRegs=1)
static unsigned getNumCoveredRegs(LaneBitmask LM)
MCPhysReg get32BitRegister(MCPhysReg Reg) const
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
bool requiresFrameIndexReplacementScavenging(const MachineFunction &MF) const override
const TargetRegisterClass * getProperlyAlignedRC(const TargetRegisterClass *RC) const
bool shouldRealignStack(const MachineFunction &MF) const override
bool isProperlyAlignedRC(const TargetRegisterClass &RC) const
static bool hasVectorRegisters(const TargetRegisterClass *RC)
const TargetRegisterClass * getEquivalentVGPRClass(const TargetRegisterClass *SRC) const
Register getFrameRegister(const MachineFunction &MF) const override
LLVM_READONLY const TargetRegisterClass * getVectorSuperClassForBitWidth(unsigned BitWidth) const
bool spillEmergencySGPR(MachineBasicBlock::iterator MI, MachineBasicBlock &RestoreMBB, Register SGPR, RegScavenger *RS) const
const uint32_t * getAllVGPRRegMask() const
MCRegister getReturnAddressReg(const MachineFunction &MF) const
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
bool hasBasePointer(const MachineFunction &MF) const
const TargetRegisterClass * getCrossCopyRegClass(const TargetRegisterClass *RC) const override
Returns a legal register class to copy a register in the specified class to or from.
ArrayRef< int16_t > getRegSplitParts(const TargetRegisterClass *RC, unsigned EltSize) const
ArrayRef< MCPhysReg > getAllSGPR32(const MachineFunction &MF) const
Return all SGPR32 which satisfy the waves per execution unit requirement of the subtarget.
const TargetRegisterClass * getLargestLegalSuperClass(const TargetRegisterClass *RC, const MachineFunction &MF) const override
MCRegister reservedPrivateSegmentBufferReg(const MachineFunction &MF) const
Return the end register initially reserved for the scratch buffer in case spilling is needed.
bool isVGPR(const MachineRegisterInfo &MRI, Register Reg) const
bool isAsmClobberable(const MachineFunction &MF, MCRegister PhysReg) const override
LLVM_READONLY const TargetRegisterClass * getAGPRClassForBitWidth(unsigned BitWidth) const
bool requiresRegisterScavenging(const MachineFunction &Fn) const override
bool opCanUseInlineConstant(unsigned OpType) const
const TargetRegisterClass * getRegClassForSizeOnBank(unsigned Size, const RegisterBank &Bank) const
const TargetRegisterClass * getConstrainedRegClassForOperand(const MachineOperand &MO, const MachineRegisterInfo &MRI) const override
bool isUniformReg(const MachineRegisterInfo &MRI, const RegisterBankInfo &RBI, Register Reg) const override
const uint32_t * getNoPreservedMask() const override
StringRef getRegAsmName(MCRegister Reg) const override
const uint32_t * getAllAllocatableSRegMask() const
bool isVectorRegister(const MachineRegisterInfo &MRI, Register Reg) const
const TargetRegisterClass * getRegClassForReg(const MachineRegisterInfo &MRI, Register Reg) const
const MCPhysReg * getCalleeSavedRegsViaCopy(const MachineFunction *MF) const
const uint32_t * getAllVectorRegMask() const
const TargetRegisterClass * getEquivalentAGPRClass(const TargetRegisterClass *SRC) const
static LLVM_READONLY const TargetRegisterClass * getSGPRClassForBitWidth(unsigned BitWidth)
const TargetRegisterClass * getRegClassForTypeOnBank(LLT Ty, const RegisterBank &Bank) const
bool opCanUseLiteralConstant(unsigned OpType) const
Register getBaseRegister() const
LLVM_READONLY const TargetRegisterClass * getVGPRClassForBitWidth(unsigned BitWidth) const
bool requiresFrameIndexScavenging(const MachineFunction &MF) const override
bool shouldRewriteCopySrc(const TargetRegisterClass *DefRC, unsigned DefSubReg, const TargetRegisterClass *SrcRC, unsigned SrcSubReg) const override
static bool hasVGPRs(const TargetRegisterClass *RC)
static bool isVGPRClass(const TargetRegisterClass *RC)
unsigned getHWRegIndex(MCRegister Reg) const
MachineInstr * findReachingDef(Register Reg, unsigned SubReg, MachineInstr &Use, MachineRegisterInfo &MRI, LiveIntervals *LIS) const
bool isSGPRReg(const MachineRegisterInfo &MRI, Register Reg) const
const TargetRegisterClass * getEquivalentSGPRClass(const TargetRegisterClass *VRC) const
bool spillSGPR(MachineBasicBlock::iterator MI, int FI, RegScavenger *RS, SlotIndexes *Indexes=nullptr, LiveIntervals *LIS=nullptr, bool OnlyToVGPR=false) const
If OnlyToVGPR is true, this will only succeed if this.
unsigned getNumChannelsFromSubReg(unsigned SubReg) const
unsigned getRegPressureLimit(const TargetRegisterClass *RC, MachineFunction &MF) const override
ArrayRef< MCPhysReg > getAllSGPR128(const MachineFunction &MF) const
Return all SGPR128 which satisfy the waves per execution unit requirement of the subtarget.
unsigned getRegPressureSetLimit(const MachineFunction &MF, unsigned Idx) const override
unsigned getCSRFirstUseCost() const override
BitVector getReservedRegs(const MachineFunction &MF) const override
bool needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const override
const TargetRegisterClass * getRegClassForOperandReg(const MachineRegisterInfo &MRI, const MachineOperand &MO) const
bool isSGPRClassID(unsigned RCID) const
void buildSpillLoadStore(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL, unsigned LoadStoreOp, int Index, Register ValueReg, bool ValueIsKill, MCRegister ScratchOffsetReg, int64_t InstrOffset, MachineMemOperand *MMO, RegScavenger *RS, LivePhysRegs *LiveRegs=nullptr) const
const uint32_t * getAllAGPRRegMask() const
bool supportsBackwardScavenger() const override
bool shouldCoalesce(MachineInstr *MI, const TargetRegisterClass *SrcRC, unsigned SubReg, const TargetRegisterClass *DstRC, unsigned DstSubReg, const TargetRegisterClass *NewRC, LiveIntervals &LIS) const override
bool isDivergentRegClass(const TargetRegisterClass *RC) const override
bool eliminateSGPRToVGPRSpillFrameIndex(MachineBasicBlock::iterator MI, int FI, RegScavenger *RS, SlotIndexes *Indexes=nullptr, LiveIntervals *LIS=nullptr) const
Special case of eliminateFrameIndex.
const TargetRegisterClass * getBoolRC() const
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const override
bool isAGPR(const MachineRegisterInfo &MRI, Register Reg) const
bool eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS) const override
bool isVSSuperClass(const TargetRegisterClass *RC) const
unsigned getChannelFromSubReg(unsigned SubReg) const
bool restoreSGPR(MachineBasicBlock::iterator MI, int FI, RegScavenger *RS, SlotIndexes *Indexes=nullptr, LiveIntervals *LIS=nullptr, bool OnlyToVGPR=false) const
MCRegister getExec() const
MCRegister getVCC() const
int64_t getFrameIndexInstrOffset(const MachineInstr *MI, int Idx) const override
bool isVectorSuperClass(const TargetRegisterClass *RC) const
bool isRegClassAligned(const TargetRegisterClass *RC, unsigned AlignNumBits) const
static bool hasAGPRs(const TargetRegisterClass *RC)
const TargetRegisterClass * getWaveMaskRegClass() const
unsigned getSubRegAlignmentNumBits(const TargetRegisterClass *RC, unsigned SubReg) const
static bool hasSGPRs(const TargetRegisterClass *RC)
void resolveFrameIndex(MachineInstr &MI, Register BaseReg, int64_t Offset) const override
bool requiresVirtualBaseRegisters(const MachineFunction &Fn) const override
bool spillSGPRToVGPR() const
const TargetRegisterClass * getVGPR64Class() const
void buildVGPRSpillLoadStore(SGPRSpillBuilder &SB, int Index, int Offset, bool IsLoad, bool IsKill=true) const
unsigned getRegClassAlignmentNumBits(const TargetRegisterClass *RC) const
static bool isSGPRClass(const TargetRegisterClass *RC)
static bool isAGPRClass(const TargetRegisterClass *RC)
const int * getRegUnitPressureSets(unsigned RegUnit) const override
SlotIndexes pass.
Definition: SlotIndexes.h:319
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
const uint8_t TSFlags
Configurable target specific flags.
A Use represents the edge between a Value definition and its users.
Definition: Use.h:43
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:406
int popcount(T Value) noexcept
Count the number of set bits in a value.
Definition: bit.h:349
@ HasSGPR
Definition: SIDefines.h:26
@ RegTupleAlignUnitsMask
Definition: SIDefines.h:28
@ HasVGPR
Definition: SIDefines.h:24
@ HasAGPR
Definition: SIDefines.h:25
constexpr unsigned BitWidth
Definition: BitmaskEnum.h:184
constexpr Type getAsInteger() const
Definition: LaneBitmask.h:74