LLVM 20.0.0git
LiveRangeCalc.cpp
Go to the documentation of this file.
1//===- LiveRangeCalc.cpp - Calculate live ranges -------------------------===//
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// Implementation of the LiveRangeCalc class.
10//
11//===----------------------------------------------------------------------===//
12
14#include "llvm/ADT/BitVector.h"
15#include "llvm/ADT/STLExtras.h"
16#include "llvm/ADT/SetVector.h"
28#include <algorithm>
29#include <cassert>
30#include <iterator>
31#include <tuple>
32#include <utility>
33
34using namespace llvm;
35
36#define DEBUG_TYPE "regalloc"
37
38// Reserve an address that indicates a value that is known to be "undef".
39static VNInfo UndefVNI(0xbad, SlotIndex());
40
42 unsigned NumBlocks = MF->getNumBlockIDs();
43 Seen.clear();
44 Seen.resize(NumBlocks);
45 EntryInfos.clear();
46 Map.resize(NumBlocks);
47}
48
50 SlotIndexes *SI,
52 VNInfo::Allocator *VNIA) {
53 MF = mf;
54 MRI = &MF->getRegInfo();
55 Indexes = SI;
56 DomTree = MDT;
57 Alloc = VNIA;
59 LiveIn.clear();
60}
61
62void LiveRangeCalc::updateFromLiveIns() {
63 LiveRangeUpdater Updater;
64 for (const LiveInBlock &I : LiveIn) {
65 if (!I.DomNode)
66 continue;
67 MachineBasicBlock *MBB = I.DomNode->getBlock();
68 assert(I.Value && "No live-in value found");
69 SlotIndex Start, End;
70 std::tie(Start, End) = Indexes->getMBBRange(MBB);
71
72 if (I.Kill.isValid())
73 // Value is killed inside this block.
74 End = I.Kill;
75 else {
76 // The value is live-through, update LiveOut as well.
77 // Defer the Domtree lookup until it is needed.
78 assert(Seen.test(MBB->getNumber()));
79 Map[MBB] = LiveOutPair(I.Value, nullptr);
80 }
81 Updater.setDest(&I.LR);
82 Updater.add(Start, End, I.Value);
83 }
84 LiveIn.clear();
85}
86
87void LiveRangeCalc::extend(LiveRange &LR, SlotIndex Use, unsigned PhysReg,
88 ArrayRef<SlotIndex> Undefs) {
89 assert(Use.isValid() && "Invalid SlotIndex");
90 assert(Indexes && "Missing SlotIndexes");
91 assert(DomTree && "Missing dominator tree");
92
93 MachineBasicBlock *UseMBB = Indexes->getMBBFromIndex(Use.getPrevSlot());
94 assert(UseMBB && "No MBB at Use");
95
96 // Is there a def in the same MBB we can extend?
97 auto EP = LR.extendInBlock(Undefs, Indexes->getMBBStartIdx(UseMBB), Use);
98 if (EP.first != nullptr || EP.second)
99 return;
100
101 // Find the single reaching def, or determine if Use is jointly dominated by
102 // multiple values, and we may need to create even more phi-defs to preserve
103 // VNInfo SSA form. Perform a search for all predecessor blocks where we
104 // know the dominating VNInfo.
105 if (findReachingDefs(LR, *UseMBB, Use, PhysReg, Undefs))
106 return;
107
108 // When there were multiple different values, we may need new PHIs.
110}
111
112// This function is called by a client after using the low-level API to add
113// live-out and live-in blocks. The unique value optimization is not
114// available, SplitEditor::transferValues handles that case directly anyway.
116 assert(Indexes && "Missing SlotIndexes");
117 assert(DomTree && "Missing dominator tree");
118 updateSSA();
119 updateFromLiveIns();
120}
121
122bool LiveRangeCalc::isDefOnEntry(LiveRange &LR, ArrayRef<SlotIndex> Undefs,
123 MachineBasicBlock &MBB, BitVector &DefOnEntry,
124 BitVector &UndefOnEntry) {
125 unsigned BN = MBB.getNumber();
126 if (DefOnEntry[BN])
127 return true;
128 if (UndefOnEntry[BN])
129 return false;
130
131 auto MarkDefined = [BN, &DefOnEntry](MachineBasicBlock &B) -> bool {
132 for (MachineBasicBlock *S : B.successors())
133 DefOnEntry[S->getNumber()] = true;
134 DefOnEntry[BN] = true;
135 return true;
136 };
137
138 SetVector<unsigned> WorkList;
139 // Checking if the entry of MBB is reached by some def: add all predecessors
140 // that are potentially defined-on-exit to the work list.
142 WorkList.insert(P->getNumber());
143
144 for (unsigned i = 0; i != WorkList.size(); ++i) {
145 // Determine if the exit from the block is reached by some def.
146 unsigned N = WorkList[i];
148 if (Seen[N]) {
149 const LiveOutPair &LOB = Map[&B];
150 if (LOB.first != nullptr && LOB.first != &UndefVNI)
151 return MarkDefined(B);
152 }
153 SlotIndex Begin, End;
154 std::tie(Begin, End) = Indexes->getMBBRange(&B);
155 // Treat End as not belonging to B.
156 // If LR has a segment S that starts at the next block, i.e. [End, ...),
157 // std::upper_bound will return the segment following S. Instead,
158 // S should be treated as the first segment that does not overlap B.
159 LiveRange::iterator UB = upper_bound(LR, End.getPrevSlot());
160 if (UB != LR.begin()) {
161 LiveRange::Segment &Seg = *std::prev(UB);
162 if (Seg.end > Begin) {
163 // There is a segment that overlaps B. If the range is not explicitly
164 // undefined between the end of the segment and the end of the block,
165 // treat the block as defined on exit. If it is, go to the next block
166 // on the work list.
167 if (LR.isUndefIn(Undefs, Seg.end, End))
168 continue;
169 return MarkDefined(B);
170 }
171 }
172
173 // No segment overlaps with this block. If this block is not defined on
174 // entry, or it undefines the range, do not process its predecessors.
175 if (UndefOnEntry[N] || LR.isUndefIn(Undefs, Begin, End)) {
176 UndefOnEntry[N] = true;
177 continue;
178 }
179 if (DefOnEntry[N])
180 return MarkDefined(B);
181
182 // Still don't know: add all predecessors to the work list.
183 for (MachineBasicBlock *P : B.predecessors())
184 WorkList.insert(P->getNumber());
185 }
186
187 UndefOnEntry[BN] = true;
188 return false;
189}
190
191bool LiveRangeCalc::findReachingDefs(LiveRange &LR, MachineBasicBlock &UseMBB,
192 SlotIndex Use, unsigned PhysReg,
193 ArrayRef<SlotIndex> Undefs) {
194 unsigned UseMBBNum = UseMBB.getNumber();
195
196 // Block numbers where LR should be live-in.
197 SmallVector<unsigned, 16> WorkList(1, UseMBBNum);
198
199 // Remember if we have seen more than one value.
200 bool UniqueVNI = true;
201 VNInfo *TheVNI = nullptr;
202
203 bool FoundUndef = false;
204
205 // Using Seen as a visited set, perform a BFS for all reaching defs.
206 for (unsigned i = 0; i != WorkList.size(); ++i) {
207 MachineBasicBlock *MBB = MF->getBlockNumbered(WorkList[i]);
208
209#ifndef NDEBUG
210 if (MBB->pred_empty()) {
211 MBB->getParent()->verify();
212 errs() << "Use of " << printReg(PhysReg, MRI->getTargetRegisterInfo())
213 << " does not have a corresponding definition on every path:\n";
214 const MachineInstr *MI = Indexes->getInstructionFromIndex(Use);
215 if (MI != nullptr)
216 errs() << Use << " " << *MI;
217 report_fatal_error("Use not jointly dominated by defs.");
218 }
219
220 if (Register::isPhysicalRegister(PhysReg)) {
222 bool IsLiveIn = MBB->isLiveIn(PhysReg);
223 for (MCRegAliasIterator Alias(PhysReg, TRI, false); !IsLiveIn && Alias.isValid(); ++Alias)
224 IsLiveIn = MBB->isLiveIn(*Alias);
225 if (!IsLiveIn) {
226 MBB->getParent()->verify();
227 errs() << "The register " << printReg(PhysReg, TRI)
228 << " needs to be live in to " << printMBBReference(*MBB)
229 << ", but is missing from the live-in list.\n";
230 report_fatal_error("Invalid global physical register");
231 }
232 }
233#endif
234 FoundUndef |= MBB->pred_empty();
235
236 for (MachineBasicBlock *Pred : MBB->predecessors()) {
237 // Is this a known live-out block?
238 if (Seen.test(Pred->getNumber())) {
239 if (VNInfo *VNI = Map[Pred].first) {
240 if (TheVNI && TheVNI != VNI)
241 UniqueVNI = false;
242 TheVNI = VNI;
243 }
244 continue;
245 }
246
247 SlotIndex Start, End;
248 std::tie(Start, End) = Indexes->getMBBRange(Pred);
249
250 // First time we see Pred. Try to determine the live-out value, but set
251 // it as null if Pred is live-through with an unknown value.
252 auto EP = LR.extendInBlock(Undefs, Start, End);
253 VNInfo *VNI = EP.first;
254 FoundUndef |= EP.second;
255 setLiveOutValue(Pred, EP.second ? &UndefVNI : VNI);
256 if (VNI) {
257 if (TheVNI && TheVNI != VNI)
258 UniqueVNI = false;
259 TheVNI = VNI;
260 }
261 if (VNI || EP.second)
262 continue;
263
264 // No, we need a live-in value for Pred as well
265 if (Pred != &UseMBB)
266 WorkList.push_back(Pred->getNumber());
267 else
268 // Loopback to UseMBB, so value is really live through.
269 Use = SlotIndex();
270 }
271 }
272
273 LiveIn.clear();
274 FoundUndef |= (TheVNI == nullptr || TheVNI == &UndefVNI);
275 if (!Undefs.empty() && FoundUndef)
276 UniqueVNI = false;
277
278 // Both updateSSA() and LiveRangeUpdater benefit from ordered blocks, but
279 // neither require it. Skip the sorting overhead for small updates.
280 if (WorkList.size() > 4)
281 array_pod_sort(WorkList.begin(), WorkList.end());
282
283 // If a unique reaching def was found, blit in the live ranges immediately.
284 if (UniqueVNI) {
285 assert(TheVNI != nullptr && TheVNI != &UndefVNI);
286 LiveRangeUpdater Updater(&LR);
287 for (unsigned BN : WorkList) {
288 SlotIndex Start, End;
289 std::tie(Start, End) = Indexes->getMBBRange(BN);
290 // Trim the live range in UseMBB.
291 if (BN == UseMBBNum && Use.isValid())
292 End = Use;
293 else
294 Map[MF->getBlockNumbered(BN)] = LiveOutPair(TheVNI, nullptr);
295 Updater.add(Start, End, TheVNI);
296 }
297 return true;
298 }
299
300 // Prepare the defined/undefined bit vectors.
302 bool DidInsert;
303 std::tie(Entry, DidInsert) = EntryInfos.insert(
304 std::make_pair(&LR, std::make_pair(BitVector(), BitVector())));
305 if (DidInsert) {
306 // Initialize newly inserted entries.
307 unsigned N = MF->getNumBlockIDs();
308 Entry->second.first.resize(N);
309 Entry->second.second.resize(N);
310 }
311 BitVector &DefOnEntry = Entry->second.first;
312 BitVector &UndefOnEntry = Entry->second.second;
313
314 // Multiple values were found, so transfer the work list to the LiveIn array
315 // where UpdateSSA will use it as a work list.
316 LiveIn.reserve(WorkList.size());
317 for (unsigned BN : WorkList) {
319 if (!Undefs.empty() &&
320 !isDefOnEntry(LR, Undefs, *MBB, DefOnEntry, UndefOnEntry))
321 continue;
322 addLiveInBlock(LR, DomTree->getNode(MBB));
323 if (MBB == &UseMBB)
324 LiveIn.back().Kill = Use;
325 }
326
327 return false;
328}
329
330// This is essentially the same iterative algorithm that SSAUpdater uses,
331// except we already have a dominator tree, so we don't have to recompute it.
332void LiveRangeCalc::updateSSA() {
333 assert(Indexes && "Missing SlotIndexes");
334 assert(DomTree && "Missing dominator tree");
335
336 // Interate until convergence.
337 bool Changed;
338 do {
339 Changed = false;
340 // Propagate live-out values down the dominator tree, inserting phi-defs
341 // when necessary.
342 for (LiveInBlock &I : LiveIn) {
343 MachineDomTreeNode *Node = I.DomNode;
344 // Skip block if the live-in value has already been determined.
345 if (!Node)
346 continue;
347 MachineBasicBlock *MBB = Node->getBlock();
348 MachineDomTreeNode *IDom = Node->getIDom();
349 LiveOutPair IDomValue;
350
351 // We need a live-in value to a block with no immediate dominator?
352 // This is probably an unreachable block that has survived somehow.
353 bool needPHI = !IDom || !Seen.test(IDom->getBlock()->getNumber());
354
355 // IDom dominates all of our predecessors, but it may not be their
356 // immediate dominator. Check if any of them have live-out values that are
357 // properly dominated by IDom. If so, we need a phi-def here.
358 if (!needPHI) {
359 IDomValue = Map[IDom->getBlock()];
360
361 // Cache the DomTree node that defined the value.
362 if (IDomValue.first && IDomValue.first != &UndefVNI &&
363 !IDomValue.second) {
364 Map[IDom->getBlock()].second = IDomValue.second =
365 DomTree->getNode(Indexes->getMBBFromIndex(IDomValue.first->def));
366 }
367
368 for (MachineBasicBlock *Pred : MBB->predecessors()) {
369 LiveOutPair &Value = Map[Pred];
370 if (!Value.first || Value.first == IDomValue.first)
371 continue;
372 if (Value.first == &UndefVNI) {
373 needPHI = true;
374 break;
375 }
376
377 // Cache the DomTree node that defined the value.
378 if (!Value.second)
379 Value.second =
380 DomTree->getNode(Indexes->getMBBFromIndex(Value.first->def));
381
382 // This predecessor is carrying something other than IDomValue.
383 // It could be because IDomValue hasn't propagated yet, or it could be
384 // because MBB is in the dominance frontier of that value.
385 if (DomTree->dominates(IDom, Value.second)) {
386 needPHI = true;
387 break;
388 }
389 }
390 }
391
392 // The value may be live-through even if Kill is set, as can happen when
393 // we are called from extendRange. In that case LiveOutSeen is true, and
394 // LiveOut indicates a foreign or missing value.
395 LiveOutPair &LOP = Map[MBB];
396
397 // Create a phi-def if required.
398 if (needPHI) {
399 Changed = true;
400 assert(Alloc && "Need VNInfo allocator to create PHI-defs");
401 SlotIndex Start, End;
402 std::tie(Start, End) = Indexes->getMBBRange(MBB);
403 LiveRange &LR = I.LR;
404 VNInfo *VNI = LR.getNextValue(Start, *Alloc);
405 I.Value = VNI;
406 // This block is done, we know the final value.
407 I.DomNode = nullptr;
408
409 // Add liveness since updateFromLiveIns now skips this node.
410 if (I.Kill.isValid()) {
411 if (VNI)
412 LR.addSegment(LiveInterval::Segment(Start, I.Kill, VNI));
413 } else {
414 if (VNI)
415 LR.addSegment(LiveInterval::Segment(Start, End, VNI));
416 LOP = LiveOutPair(VNI, Node);
417 }
418 } else if (IDomValue.first && IDomValue.first != &UndefVNI) {
419 // No phi-def here. Remember incoming value.
420 I.Value = IDomValue.first;
421
422 // If the IDomValue is killed in the block, don't propagate through.
423 if (I.Kill.isValid())
424 continue;
425
426 // Propagate IDomValue if it isn't killed:
427 // MBB is live-out and doesn't define its own value.
428 if (LOP.first == IDomValue.first)
429 continue;
430 Changed = true;
431 LOP = IDomValue;
432 }
433 }
434 } while (Changed);
435}
436
439 const SlotIndexes &Indexes) {
440 const MachineFunction &MF = *MBB->getParent();
441 BitVector DefBlocks(MF.getNumBlockIDs());
442 for (SlotIndex I : Defs)
443 DefBlocks.set(Indexes.getMBBFromIndex(I)->getNumber());
444
445 SetVector<unsigned> PredQueue;
446 PredQueue.insert(MBB->getNumber());
447 for (unsigned i = 0; i != PredQueue.size(); ++i) {
448 unsigned BN = PredQueue[i];
449 if (DefBlocks[BN])
450 return true;
451 const MachineBasicBlock *B = MF.getBlockNumbered(BN);
452 for (const MachineBasicBlock *P : B->predecessors())
453 PredQueue.insert(P->getNumber());
454 }
455 return false;
456}
MachineBasicBlock & MBB
This file implements the BitVector class.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
bool End
Definition: ELF_riscv.cpp:480
IRTranslator LLVM IR MI
static VNInfo UndefVNI(0xbad, SlotIndex())
static VNInfo UndefVNI(0xbad, SlotIndex())
#define I(x, y, z)
Definition: MD5.cpp:58
unsigned const TargetRegisterInfo * TRI
#define P(N)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file contains some templates that are useful if you are working with the STL at all.
This file implements a set that has insertion order iteration characteristics.
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
bool empty() const
empty - Check if the array is empty.
Definition: ArrayRef.h:160
bool test(unsigned Idx) const
Definition: BitVector.h:461
void resize(unsigned N, bool t=false)
resize - Grow or shrink the bitvector.
Definition: BitVector.h:341
void clear()
clear - Removes all bits from the bitvector.
Definition: BitVector.h:335
BitVector & set()
Definition: BitVector.h:351
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:66
DenseMapIterator< KeyT, ValueT, KeyInfoT, BucketT > iterator
Definition: DenseMap.h:71
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Definition: DenseMap.h:211
Base class for the actual dominator tree node.
NodeT * getBlock() const
void resize(typename StorageT::size_type s)
Definition: IndexedMap.h:61
static LLVM_ATTRIBUTE_UNUSED bool isJointlyDominated(const MachineBasicBlock *MBB, ArrayRef< SlotIndex > Defs, const SlotIndexes &Indexes)
A diagnostic function to check if the end of the block MBB is jointly dominated by the blocks corresp...
void addLiveInBlock(LiveRange &LR, MachineDomTreeNode *DomNode, SlotIndex Kill=SlotIndex())
addLiveInBlock - Add a block with an unknown live-in value.
void resetLiveOutMap()
Reset Map and Seen fields.
void reset(const MachineFunction *mf, SlotIndexes *SI, MachineDominatorTree *MDT, VNInfo::Allocator *VNIA)
reset - Prepare caches for a new set of non-overlapping live ranges.
void extend(LiveRange &LR, SlotIndex Use, unsigned PhysReg, ArrayRef< SlotIndex > Undefs)
Extend the live range of LR to reach Use.
void calculateValues()
calculateValues - Calculate the value that will be live-in to each block added with addLiveInBlock.
void setLiveOutValue(MachineBasicBlock *MBB, VNInfo *VNI)
setLiveOutValue - Indicate that VNI is live out from MBB.
Helper class for performant LiveRange bulk updates.
Definition: LiveInterval.h:941
void setDest(LiveRange *lr)
Select a different destination live range.
Definition: LiveInterval.h:974
void add(LiveRange::Segment)
Add a segment to LR and coalesce when possible, just like LR.addSegment().
This class represents the liveness of a register, stack slot, etc.
Definition: LiveInterval.h:157
iterator addSegment(Segment S)
Add the specified Segment to this range, merging segments as appropriate.
std::pair< VNInfo *, bool > extendInBlock(ArrayRef< SlotIndex > Undefs, SlotIndex StartIdx, SlotIndex Kill)
Attempt to extend a value defined after StartIdx to include Use.
iterator begin()
Definition: LiveInterval.h:215
bool isUndefIn(ArrayRef< SlotIndex > Undefs, SlotIndex Begin, SlotIndex End) const
Returns true if there is an explicit "undef" between Begin End.
Definition: LiveInterval.h:608
VNInfo * getNextValue(SlotIndex Def, VNInfo::Allocator &VNInfoAllocator)
getNextValue - Create a new value number and return it.
Definition: LiveInterval.h:331
MCRegAliasIterator enumerates all registers aliasing Reg.
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
bool isLiveIn(MCPhysReg Reg, LaneBitmask LaneMask=LaneBitmask::getAll()) const
Return true if the specified register is in the live in set.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
iterator_range< pred_iterator > predecessors()
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
MachineDomTreeNode * getNode(MachineBasicBlock *BB) const
getNode - return the (Post)DominatorTree node for the specified basic block.
bool dominates(const MachineDomTreeNode *A, const MachineDomTreeNode *B) const
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
MachineBasicBlock * getBlockNumbered(unsigned N) const
getBlockNumbered - MachineBasicBlocks are automatically numbered when they are inserted into the mach...
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
bool verify(Pass *p=nullptr, const char *Banner=nullptr, bool AbortOnError=true) const
Run the current MachineFunction through the machine code verifier, useful for debugger use.
Representation of each machine instruction.
Definition: MachineInstr.h:69
const TargetRegisterInfo * getTargetRegisterInfo() const
static constexpr bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
Definition: Register.h:65
A vector that has set insertion semantics.
Definition: SetVector.h:57
size_type size() const
Determine the number of elements in the SetVector.
Definition: SetVector.h:98
iterator end()
Get an iterator to the end of the SetVector.
Definition: SetVector.h:113
iterator begin()
Get an iterator to the beginning of the SetVector.
Definition: SetVector.h:103
bool insert(const value_type &X)
Insert a new element into the SetVector.
Definition: SetVector.h:162
SlotIndex - An opaque wrapper around machine indexes.
Definition: SlotIndexes.h:65
SlotIndexes pass.
Definition: SlotIndexes.h:297
MachineBasicBlock * getMBBFromIndex(SlotIndex index) const
Returns the basic block which the given index falls in.
Definition: SlotIndexes.h:515
const std::pair< SlotIndex, SlotIndex > & getMBBRange(unsigned Num) const
Return the (start,end) range of the given basic block number.
Definition: SlotIndexes.h:449
SlotIndex getMBBStartIdx(unsigned Num) const
Returns the first index in the given basic block number.
Definition: SlotIndexes.h:460
MachineInstr * getInstructionFromIndex(SlotIndex index) const
Returns the instruction for the given index, or null if the given index has no instruction associated...
Definition: SlotIndexes.h:397
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1209
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
A Use represents the edge between a Value definition and its users.
Definition: Use.h:43
VNInfo - Value Number Information.
Definition: LiveInterval.h:53
LLVM Value Representation.
Definition: Value.h:74
@ Entry
Definition: COFF.h:826
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
auto upper_bound(R &&Range, T &&Value)
Provide wrappers to std::upper_bound which take ranges instead of having to pass begin/end explicitly...
Definition: STLExtras.h:1974
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:167
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
void array_pod_sort(IteratorTy Start, IteratorTy End)
array_pod_sort - This sorts an array with the specified start and end extent.
Definition: STLExtras.h:1607
Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
#define N
This represents a simple continuous liveness interval for a value.
Definition: LiveInterval.h:162