LLVM  5.0.0
GCNRegPressure.cpp
Go to the documentation of this file.
1 //===------------------------- GCNRegPressure.cpp - -----------------------===//
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 /// \file
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "GCNRegPressure.h"
16 
17 using namespace llvm;
18 
19 #define DEBUG_TYPE "machine-scheduler"
20 
21 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
24  const LiveIntervals &LIS,
25  const MachineRegisterInfo &MRI) {
26  dbgs() << "Live regs at " << SI << ": "
27  << *LIS.getInstructionFromIndex(SI);
28  unsigned Num = 0;
29  for (unsigned I = 0, E = MRI.getNumVirtRegs(); I != E; ++I) {
30  const unsigned Reg = TargetRegisterInfo::index2VirtReg(I);
31  if (!LIS.hasInterval(Reg))
32  continue;
33  const auto &LI = LIS.getInterval(Reg);
34  if (LI.hasSubRanges()) {
35  bool firstTime = true;
36  for (const auto &S : LI.subranges()) {
37  if (!S.liveAt(SI)) continue;
38  if (firstTime) {
39  dbgs() << " " << PrintReg(Reg, MRI.getTargetRegisterInfo())
40  << '\n';
41  firstTime = false;
42  }
43  dbgs() << " " << S << '\n';
44  ++Num;
45  }
46  } else if (LI.liveAt(SI)) {
47  dbgs() << " " << LI << '\n';
48  ++Num;
49  }
50  }
51  if (!Num) dbgs() << " <none>\n";
52 }
53 
54 static bool isEqual(const GCNRPTracker::LiveRegSet &S1,
55  const GCNRPTracker::LiveRegSet &S2) {
56  if (S1.size() != S2.size())
57  return false;
58 
59  for (const auto &P : S1) {
60  auto I = S2.find(P.first);
61  if (I == S2.end() || I->second != P.second)
62  return false;
63  }
64  return true;
65 }
66 
67 #endif
68 
69 ///////////////////////////////////////////////////////////////////////////////
70 // GCNRegPressure
71 
72 unsigned GCNRegPressure::getRegKind(unsigned Reg,
73  const MachineRegisterInfo &MRI) {
75  const auto RC = MRI.getRegClass(Reg);
76  auto STI = static_cast<const SIRegisterInfo*>(MRI.getTargetRegisterInfo());
77  return STI->isSGPRClass(RC) ?
78  (STI->getRegSizeInBits(*RC) == 32 ? SGPR32 : SGPR_TUPLE) :
79  (STI->getRegSizeInBits(*RC) == 32 ? VGPR32 : VGPR_TUPLE);
80 }
81 
82 void GCNRegPressure::inc(unsigned Reg,
83  LaneBitmask PrevMask,
84  LaneBitmask NewMask,
85  const MachineRegisterInfo &MRI) {
86  if (NewMask == PrevMask)
87  return;
88 
89  int Sign = 1;
90  if (NewMask < PrevMask) {
91  std::swap(NewMask, PrevMask);
92  Sign = -1;
93  }
94 #ifndef NDEBUG
95  const auto MaxMask = MRI.getMaxLaneMaskForVReg(Reg);
96 #endif
97  switch (auto Kind = getRegKind(Reg, MRI)) {
98  case SGPR32:
99  case VGPR32:
100  assert(PrevMask.none() && NewMask == MaxMask);
101  Value[Kind] += Sign;
102  break;
103 
104  case SGPR_TUPLE:
105  case VGPR_TUPLE:
106  assert(NewMask < MaxMask || NewMask == MaxMask);
107  assert(PrevMask < NewMask);
108 
109  Value[Kind == SGPR_TUPLE ? SGPR32 : VGPR32] +=
110  Sign * countPopulation((~PrevMask & NewMask).getAsInteger());
111 
112  if (PrevMask.none()) {
113  assert(NewMask.any());
114  Value[Kind] += Sign * MRI.getPressureSets(Reg).getWeight();
115  }
116  break;
117 
118  default: llvm_unreachable("Unknown register kind");
119  }
120 }
121 
123  const GCNRegPressure& O,
124  unsigned MaxOccupancy) const {
125  const auto SGPROcc = std::min(MaxOccupancy,
127  const auto VGPROcc = std::min(MaxOccupancy,
129  const auto OtherSGPROcc = std::min(MaxOccupancy,
131  const auto OtherVGPROcc = std::min(MaxOccupancy,
133 
134  const auto Occ = std::min(SGPROcc, VGPROcc);
135  const auto OtherOcc = std::min(OtherSGPROcc, OtherVGPROcc);
136  if (Occ != OtherOcc)
137  return Occ > OtherOcc;
138 
139  bool SGPRImportant = SGPROcc < VGPROcc;
140  const bool OtherSGPRImportant = OtherSGPROcc < OtherVGPROcc;
141 
142  // if both pressures disagree on what is more important compare vgprs
143  if (SGPRImportant != OtherSGPRImportant) {
144  SGPRImportant = false;
145  }
146 
147  // compare large regs pressure
148  bool SGPRFirst = SGPRImportant;
149  for (int I = 2; I > 0; --I, SGPRFirst = !SGPRFirst) {
150  if (SGPRFirst) {
151  auto SW = getSGPRTuplesWeight();
152  auto OtherSW = O.getSGPRTuplesWeight();
153  if (SW != OtherSW)
154  return SW < OtherSW;
155  } else {
156  auto VW = getVGPRTuplesWeight();
157  auto OtherVW = O.getVGPRTuplesWeight();
158  if (VW != OtherVW)
159  return VW < OtherVW;
160  }
161  }
162  return SGPRImportant ? (getSGPRNum() < O.getSGPRNum()):
163  (getVGPRNum() < O.getVGPRNum());
164 }
165 
166 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
169  OS << "VGPRs: " << getVGPRNum();
170  if (ST) OS << "(O" << ST->getOccupancyWithNumVGPRs(getVGPRNum()) << ')';
171  OS << ", SGPRs: " << getSGPRNum();
172  if (ST) OS << "(O" << ST->getOccupancyWithNumSGPRs(getSGPRNum()) << ')';
173  OS << ", LVGPR WT: " << getVGPRTuplesWeight()
174  << ", LSGPR WT: " << getSGPRTuplesWeight();
175  if (ST) OS << " -> Occ: " << getOccupancy(*ST);
176  OS << '\n';
177 }
178 #endif
179 
180 
182  const MachineRegisterInfo &MRI) {
183  assert(MO.isDef() && MO.isReg() &&
185 
186  // We don't rely on read-undef flag because in case of tentative schedule
187  // tracking it isn't set correctly yet. This works correctly however since
188  // use mask has been tracked before using LIS.
189  return MO.getSubReg() == 0 ?
190  MRI.getMaxLaneMaskForVReg(MO.getReg()) :
192 }
193 
195  const MachineRegisterInfo &MRI,
196  const LiveIntervals &LIS) {
197  assert(MO.isUse() && MO.isReg() &&
199 
200  if (auto SubReg = MO.getSubReg())
202 
203  auto MaxMask = MRI.getMaxLaneMaskForVReg(MO.getReg());
204  if (MaxMask.getAsInteger() == 1) // cannot have subregs
205  return MaxMask;
206 
207  // For a tentative schedule LIS isn't updated yet but livemask should remain
208  // the same on any schedule. Subreg defs can be reordered but they all must
209  // dominate uses anyway.
210  auto SI = LIS.getInstructionIndex(*MO.getParent()).getBaseIndex();
211  return getLiveLaneMask(MO.getReg(), SI, LIS, MRI);
212 }
213 
216  const MachineRegisterInfo &MRI) {
218  for (const auto &MO : MI.operands()) {
219  if (!MO.isReg() || !TargetRegisterInfo::isVirtualRegister(MO.getReg()))
220  continue;
221  if (!MO.isUse() || !MO.readsReg())
222  continue;
223 
224  auto const UsedMask = getUsedRegMask(MO, MRI, LIS);
225 
226  auto Reg = MO.getReg();
227  auto I = std::find_if(Res.begin(), Res.end(), [Reg](const RegisterMaskPair &RM) {
228  return RM.RegUnit == Reg;
229  });
230  if (I != Res.end())
231  I->LaneMask |= UsedMask;
232  else
233  Res.push_back(RegisterMaskPair(Reg, UsedMask));
234  }
235  return Res;
236 }
237 
238 ///////////////////////////////////////////////////////////////////////////////
239 // GCNRPTracker
240 
242  SlotIndex SI,
243  const LiveIntervals &LIS,
244  const MachineRegisterInfo &MRI) {
245  LaneBitmask LiveMask;
246  const auto &LI = LIS.getInterval(Reg);
247  if (LI.hasSubRanges()) {
248  for (const auto &S : LI.subranges())
249  if (S.liveAt(SI)) {
250  LiveMask |= S.LaneMask;
251  assert(LiveMask < MRI.getMaxLaneMaskForVReg(Reg) ||
252  LiveMask == MRI.getMaxLaneMaskForVReg(Reg));
253  }
254  } else if (LI.liveAt(SI)) {
255  LiveMask = MRI.getMaxLaneMaskForVReg(Reg);
256  }
257  return LiveMask;
258 }
259 
261  const LiveIntervals &LIS,
262  const MachineRegisterInfo &MRI) {
263  GCNRPTracker::LiveRegSet LiveRegs;
264  for (unsigned I = 0, E = MRI.getNumVirtRegs(); I != E; ++I) {
266  if (!LIS.hasInterval(Reg))
267  continue;
268  auto LiveMask = getLiveLaneMask(Reg, SI, LIS, MRI);
269  if (LiveMask.any())
270  LiveRegs[Reg] = LiveMask;
271  }
272  return LiveRegs;
273 }
274 
276  const LiveRegSet *LiveRegsCopy) {
277  MRI = &MI.getParent()->getParent()->getRegInfo();
278  if (LiveRegsCopy) {
279  if (&LiveRegs != LiveRegsCopy)
280  LiveRegs = *LiveRegsCopy;
281  } else {
283  }
285 }
286 
288  assert(MRI && "call reset first");
289 
290  LastTrackedMI = &MI;
291 
292  if (MI.isDebugValue())
293  return;
294 
295  auto const RegUses = collectVirtualRegUses(MI, LIS, *MRI);
296 
297  // calc pressure at the MI (defs + uses)
298  auto AtMIPressure = CurPressure;
299  for (const auto &U : RegUses) {
300  auto LiveMask = LiveRegs[U.RegUnit];
301  AtMIPressure.inc(U.RegUnit, LiveMask, LiveMask | U.LaneMask, *MRI);
302  }
303  // update max pressure
304  MaxPressure = max(AtMIPressure, MaxPressure);
305 
306  for (const auto &MO : MI.defs()) {
307  if (!MO.isReg() || !TargetRegisterInfo::isVirtualRegister(MO.getReg()) ||
308  MO.isDead())
309  continue;
310 
311  auto Reg = MO.getReg();
312  auto I = LiveRegs.find(Reg);
313  if (I == LiveRegs.end())
314  continue;
315  auto &LiveMask = I->second;
316  auto PrevMask = LiveMask;
317  LiveMask &= ~getDefRegMask(MO, *MRI);
318  CurPressure.inc(Reg, PrevMask, LiveMask, *MRI);
319  if (LiveMask.none())
320  LiveRegs.erase(I);
321  }
322  for (const auto &U : RegUses) {
323  auto &LiveMask = LiveRegs[U.RegUnit];
324  auto PrevMask = LiveMask;
325  LiveMask |= U.LaneMask;
326  CurPressure.inc(U.RegUnit, PrevMask, LiveMask, *MRI);
327  }
329 }
330 
332  const LiveRegSet *LiveRegsCopy) {
333  MRI = &MI.getParent()->getParent()->getRegInfo();
334  LastTrackedMI = nullptr;
335  MBBEnd = MI.getParent()->end();
336  NextMI = &MI;
337  NextMI = skipDebugInstructionsForward(NextMI, MBBEnd);
338  if (NextMI == MBBEnd)
339  return false;
340  if (LiveRegsCopy) {
341  if (&LiveRegs != LiveRegsCopy)
342  LiveRegs = *LiveRegsCopy;
343  } else {
344  LiveRegs = getLiveRegsBefore(*NextMI, LIS);
345  }
347  return true;
348 }
349 
351  assert(MRI && "call reset first");
352 
353  NextMI = skipDebugInstructionsForward(NextMI, MBBEnd);
354  if (NextMI == MBBEnd)
355  return false;
356 
358  assert(SI.isValid());
359 
360  // Remove dead registers or mask bits.
361  for (auto &It : LiveRegs) {
362  const LiveInterval &LI = LIS.getInterval(It.first);
363  if (LI.hasSubRanges()) {
364  for (const auto &S : LI.subranges()) {
365  if (!S.liveAt(SI)) {
366  auto PrevMask = It.second;
367  It.second &= ~S.LaneMask;
368  CurPressure.inc(It.first, PrevMask, It.second, *MRI);
369  }
370  }
371  } else if (!LI.liveAt(SI)) {
372  auto PrevMask = It.second;
373  It.second = LaneBitmask::getNone();
374  CurPressure.inc(It.first, PrevMask, It.second, *MRI);
375  }
376  if (It.second.none())
377  LiveRegs.erase(It.first);
378  }
379 
381 
382  return true;
383 }
384 
386  LastTrackedMI = &*NextMI++;
387 
388  // Add new registers or mask bits.
389  for (const auto &MO : LastTrackedMI->defs()) {
390  if (!MO.isReg())
391  continue;
392  unsigned Reg = MO.getReg();
394  continue;
395  auto &LiveMask = LiveRegs[Reg];
396  auto PrevMask = LiveMask;
397  LiveMask |= getDefRegMask(MO, *MRI);
398  CurPressure.inc(Reg, PrevMask, LiveMask, *MRI);
399  }
400 
402 }
403 
405  // If we have just called reset live set is actual.
406  if ((NextMI == MBBEnd) || (LastTrackedMI && !advanceBeforeNext()))
407  return false;
408  advanceToNext();
409  return true;
410 }
411 
413  while (NextMI != End)
414  if (!advance()) return false;
415  return true;
416 }
417 
420  const LiveRegSet *LiveRegsCopy) {
421  reset(*Begin, LiveRegsCopy);
422  return advance(End);
423 }
424 
425 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
427 static void reportMismatch(const GCNRPTracker::LiveRegSet &LISLR,
428  const GCNRPTracker::LiveRegSet &TrackedLR,
429  const TargetRegisterInfo *TRI) {
430  for (auto const &P : TrackedLR) {
431  auto I = LISLR.find(P.first);
432  if (I == LISLR.end()) {
433  dbgs() << " " << PrintReg(P.first, TRI)
434  << ":L" << PrintLaneMask(P.second)
435  << " isn't found in LIS reported set\n";
436  }
437  else if (I->second != P.second) {
438  dbgs() << " " << PrintReg(P.first, TRI)
439  << " masks doesn't match: LIS reported "
440  << PrintLaneMask(I->second)
441  << ", tracked "
442  << PrintLaneMask(P.second)
443  << '\n';
444  }
445  }
446  for (auto const &P : LISLR) {
447  auto I = TrackedLR.find(P.first);
448  if (I == TrackedLR.end()) {
449  dbgs() << " " << PrintReg(P.first, TRI)
450  << ":L" << PrintLaneMask(P.second)
451  << " isn't found in tracked set\n";
452  }
453  }
454 }
455 
457  const auto &SI = LIS.getInstructionIndex(*LastTrackedMI).getBaseIndex();
458  const auto LISLR = llvm::getLiveRegs(SI, LIS, *MRI);
459  const auto &TrackedLR = LiveRegs;
460 
461  if (!isEqual(LISLR, TrackedLR)) {
462  dbgs() << "\nGCNUpwardRPTracker error: Tracked and"
463  " LIS reported livesets mismatch:\n";
464  printLivesAt(SI, LIS, *MRI);
465  reportMismatch(LISLR, TrackedLR, MRI->getTargetRegisterInfo());
466  return false;
467  }
468 
469  auto LISPressure = getRegPressure(*MRI, LISLR);
470  if (LISPressure != CurPressure) {
471  dbgs() << "GCNUpwardRPTracker error: Pressure sets different\nTracked: ";
473  dbgs() << "LIS rpt: ";
474  LISPressure.print(dbgs());
475  return false;
476  }
477  return true;
478 }
479 
481  const MachineRegisterInfo &MRI) {
482  const TargetRegisterInfo *TRI = MRI.getTargetRegisterInfo();
483  for (unsigned I = 0, E = MRI.getNumVirtRegs(); I != E; ++I) {
484  unsigned Reg = TargetRegisterInfo::index2VirtReg(I);
485  auto It = LiveRegs.find(Reg);
486  if (It != LiveRegs.end() && It->second.any())
487  OS << ' ' << PrintVRegOrUnit(Reg, TRI) << ':'
488  << PrintLaneMask(It->second);
489  }
490  OS << '\n';
491 }
492 #endif
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
static void printLiveRegs(raw_ostream &OS, const LiveRegSet &LiveRegs, const MachineRegisterInfo &MRI)
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
Definition: Compiler.h:449
static unsigned index2VirtReg(unsigned Index)
Convert a 0-based index to a virtual register number.
SlotIndex getBaseIndex() const
Returns the base index for associated with this index.
Definition: SlotIndexes.h:242
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
const MachineInstr * LastTrackedMI
LiveInterval - This class represents the liveness of a register, or stack slot.
Definition: LiveInterval.h:638
bool reset(const MachineInstr &MI, const LiveRegSet *LiveRegs=nullptr)
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
GCNRPTracker::LiveRegSet getLiveRegs(SlotIndex SI, const LiveIntervals &LIS, const MachineRegisterInfo &MRI)
SlotIndex getInstructionIndex(const MachineInstr &Instr) const
Returns the base index of the given instruction.
bool isSGPRClass(const TargetRegisterClass *RC) const
LaneBitmask getSubRegIndexLaneMask(unsigned SubIdx) const
Return a bitmask representing the parts of a register that are covered by SubIdx. ...
iterator_range< mop_iterator > operands()
Definition: MachineInstr.h:306
const LiveIntervals & LIS
unsigned getNumVirtRegs() const
getNumVirtRegs - Return the number of virtual registers created.
static LaneBitmask getDefRegMask(const MachineOperand &MO, const MachineRegisterInfo &MRI)
unsigned getOccupancyWithNumSGPRs(unsigned SGPRs) const
Return the maximum number of waves per SIMD for kernels using SGPRs SGPRs.
const TargetRegisterInfo * getTargetRegisterInfo() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
iterator_range< subrange_iterator > subranges()
Definition: LiveInterval.h:723
unsigned SubReg
const TargetRegisterClass * getRegClass(unsigned Reg) const
Return the register class of the specified virtual register.
Reg
All possible values of the reg field in the ModR/M byte.
void inc(unsigned Reg, LaneBitmask PrevMask, LaneBitmask NewMask, const MachineRegisterInfo &MRI)
GCNRPTracker::LiveRegSet getLiveRegsBefore(const MachineInstr &MI, const LiveIntervals &LIS)
unsigned getSGPRTuplesWeight() const
GCNRegPressure CurPressure
Printable PrintReg(unsigned Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubRegIdx=0)
Prints virtual and physical registers with or without a TRI instance.
void print(raw_ostream &OS, const SISubtarget *ST=nullptr) const
void reset(const MachineInstr &MI, const LiveRegSet *LiveRegs=nullptr)
const MachineBasicBlock * getParent() const
Definition: MachineInstr.h:139
iterator find(const_arg_type_t< KeyT > Val)
Definition: DenseMap.h:131
bool isDebugValue() const
Definition: MachineInstr.h:785
#define P(N)
static bool isEqual(const GCNRPTracker::LiveRegSet &S1, const GCNRPTracker::LiveRegSet &S2)
bool erase(const KeyT &Val)
Definition: DenseMap.h:247
bool isValid() const
Returns true if this is a valid index.
Definition: SlotIndexes.h:152
unsigned const MachineRegisterInfo * MRI
constexpr bool none() const
Definition: LaneBitmask.h:52
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
Definition: SmallVector.h:115
unsigned getOccupancyWithNumVGPRs(unsigned VGPRs) const
Return the maximum number of waves per SIMD for kernels using VGPRs VGPRs.
iterator_range< mop_iterator > defs()
Returns a range over all explicit operands that are register definitions.
Definition: MachineInstr.h:328
static const unsigned End
unsigned getSubReg() const
GCNRPTracker::LiveRegSet getLiveRegsAfter(const MachineInstr &MI, const LiveIntervals &LIS)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
bool liveAt(SlotIndex index) const
Definition: LiveInterval.h:389
unsigned getVGPRTuplesWeight() const
static SmallVector< RegisterMaskPair, 8 > collectVirtualRegUses(const MachineInstr &MI, const LiveIntervals &LIS, const MachineRegisterInfo &MRI)
static LLVM_DUMP_METHOD void reportMismatch(const GCNRPTracker::LiveRegSet &LISLR, const GCNRPTracker::LiveRegSet &TrackedLR, const TargetRegisterInfo *TRI)
unsigned countPopulation(T Value)
Count the number of set bits in a value.
Definition: MathExtras.h:512
#define E
Definition: LargeTest.cpp:27
void printLivesAt(SlotIndex SI, const LiveIntervals &LIS, const MachineRegisterInfo &MRI)
static LaneBitmask getUsedRegMask(const MachineOperand &MO, const MachineRegisterInfo &MRI, const LiveIntervals &LIS)
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:861
static LaneBitmask getNone()
Definition: LaneBitmask.h:76
unsigned getWeight() const
LiveInterval & getInterval(unsigned Reg)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:132
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Definition: BitVector.h:923
bool less(const SISubtarget &ST, const GCNRegPressure &O, unsigned MaxOccupancy=std::numeric_limits< unsigned >::max()) const
unsigned getOccupancy(const SISubtarget &ST) const
IterT skipDebugInstructionsForward(IterT It, IterT End)
Increment It until it points to a non-debug instruction or to End and return the resulting iterator...
llvm_unreachable("Unknown RegBank!")
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
GCNRegPressure getRegPressure(const MachineRegisterInfo &MRI, Range &&LiveRegs)
Representation of each machine instruction.
Definition: MachineInstr.h:59
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
Definition: SmallVector.h:119
unsigned size() const
Definition: DenseMap.h:87
unsigned getSGPRNum() const
LaneBitmask getMaxLaneMaskForVReg(unsigned Reg) const
Returns a mask covering all bits that can appear in lane masks of subregisters of the virtual registe...
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
PSetIterator getPressureSets(unsigned RegUnit) const
Get an iterator over the pressure sets affected by the given physical or virtual register.
#define I(x, y, z)
Definition: MD5.cpp:58
unsigned getVGPRNum() const
iterator end()
Definition: DenseMap.h:73
bool hasInterval(unsigned Reg) const
LaneBitmask getLiveLaneMask(unsigned Reg, SlotIndex SI, const LiveIntervals &LIS, const MachineRegisterInfo &MRI)
const unsigned Kind
unsigned getReg() const
getReg - Returns the register number.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Definition: Value.h:73
static LLVM_ATTRIBUTE_UNUSED Printable PrintLaneMask(LaneBitmask LaneMask)
Create Printable object to print LaneBitmasks on a raw_ostream.
Definition: LaneBitmask.h:87
MachineInstr * getInstructionFromIndex(SlotIndex index) const
Returns the instruction associated with the given index.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44
IRTranslator LLVM IR MI
GCNRegPressure MaxPressure
auto find_if(R &&Range, UnaryPredicate P) -> decltype(std::begin(Range))
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly...
Definition: STLExtras.h:846
bool hasSubRanges() const
Returns true if subregister liveness information is available.
Definition: LiveInterval.h:751
SlotIndex - An opaque wrapper around machine indexes.
Definition: SlotIndexes.h:84
Printable PrintVRegOrUnit(unsigned VRegOrUnit, const TargetRegisterInfo *TRI)
Create Printable object to print virtual registers and physical registers on a raw_ostream.
void recede(const MachineInstr &MI)