Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
LiveRangeEdit.cpp
Go to the documentation of this file.
1//===-- LiveRangeEdit.cpp - Basic tools for editing a register live range -===//
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// The LiveRangeEdit class represents changes done to a virtual register when it
10// is spilled or split.
11//===----------------------------------------------------------------------===//
12
14#include "llvm/ADT/Statistic.h"
20#include "llvm/Support/Debug.h"
22
23using namespace llvm;
24
25#define DEBUG_TYPE "regalloc"
26
27STATISTIC(NumDCEDeleted, "Number of instructions deleted by DCE");
28STATISTIC(NumDCEFoldedLoads, "Number of single use loads folded after DCE");
29STATISTIC(NumFracRanges, "Number of live ranges fractured by DCE");
30STATISTIC(NumReMaterialization, "Number of instructions rematerialized");
31
32void LiveRangeEdit::Delegate::anchor() { }
33
34LiveInterval &LiveRangeEdit::createEmptyIntervalFrom(Register OldReg,
35 bool createSubRanges) {
36 Register VReg = MRI.cloneVirtualRegister(OldReg);
37 if (VRM)
38 VRM->setIsSplitFromReg(VReg, VRM->getOriginal(OldReg));
39
40 LiveInterval &LI = LIS.createEmptyInterval(VReg);
41 if (Parent && !Parent->isSpillable())
43 if (createSubRanges) {
44 // Create empty subranges if the OldReg's interval has them. Do not create
45 // the main range here---it will be constructed later after the subranges
46 // have been finalized.
47 LiveInterval &OldLI = LIS.getInterval(OldReg);
48 VNInfo::Allocator &Alloc = LIS.getVNInfoAllocator();
49 for (LiveInterval::SubRange &S : OldLI.subranges())
50 LI.createSubRange(Alloc, S.LaneMask);
51 }
52 return LI;
53}
54
56 Register VReg = MRI.cloneVirtualRegister(OldReg);
57 if (VRM) {
58 VRM->setIsSplitFromReg(VReg, VRM->getOriginal(OldReg));
59 }
60 // FIXME: Getting the interval here actually computes it.
61 // In theory, this may not be what we want, but in practice
62 // the createEmptyIntervalFrom API is used when this is not
63 // the case. Generally speaking we just want to annotate the
64 // LiveInterval when it gets created but we cannot do that at
65 // the moment.
66 if (Parent && !Parent->isSpillable())
67 LIS.getInterval(VReg).markNotSpillable();
68 return VReg;
69}
70
71void LiveRangeEdit::scanRemattable() {
72 for (VNInfo *VNI : getParent().valnos) {
73 if (VNI->isUnused())
74 continue;
75 Register Original = VRM->getOriginal(getReg());
76 LiveInterval &OrigLI = LIS.getInterval(Original);
77 VNInfo *OrigVNI = OrigLI.getVNInfoAt(VNI->def);
78 if (!OrigVNI)
79 continue;
81 if (!DefMI)
82 continue;
83 if (TII.isReMaterializable(*DefMI))
84 Remattable.insert(OrigVNI);
85 }
86 ScannedRemattable = true;
87}
88
90 if (!ScannedRemattable)
91 scanRemattable();
92 return !Remattable.empty();
93}
94
96 SlotIndex UseIdx) {
97 assert(ScannedRemattable && "Call anyRematerializable first");
98
99 // Use scanRemattable info.
100 if (!Remattable.count(OrigVNI))
101 return false;
102
103 // No defining instruction provided.
104 assert(RM.OrigMI && "No defining instruction for remattable value");
105
106 // Verify that all used registers are available with the same values.
107 if (!VirtRegAuxInfo::allUsesAvailableAt(RM.OrigMI, UseIdx, LIS, MRI, TII))
108 return false;
109
110 return true;
111}
112
115 Register DestReg, const Remat &RM,
116 const TargetRegisterInfo &tri,
117 bool Late, unsigned SubIdx,
118 MachineInstr *ReplaceIndexMI) {
119 assert(RM.OrigMI && "Invalid remat");
120 TII.reMaterialize(MBB, MI, DestReg, SubIdx, *RM.OrigMI, tri);
121 // DestReg of the cloned instruction cannot be Dead. Set isDead of DestReg
122 // to false anyway in case the isDead flag of RM.OrigMI's dest register
123 // is true.
124 (*--MI).clearRegisterDeads(DestReg);
125 Rematted.insert(RM.ParentVNI);
126 ++NumReMaterialization;
127
128 bool EarlyClobber = MI->getOperand(0).isEarlyClobber();
129 if (ReplaceIndexMI)
130 return LIS.ReplaceMachineInstrInMaps(*ReplaceIndexMI, *MI)
131 .getRegSlot(EarlyClobber);
132 return LIS.getSlotIndexes()->insertMachineInstrInMaps(*MI, Late).getRegSlot(
133 EarlyClobber);
134}
135
137 if (TheDelegate && TheDelegate->LRE_CanEraseVirtReg(Reg))
138 LIS.removeInterval(Reg);
139}
140
141bool LiveRangeEdit::foldAsLoad(LiveInterval *LI,
143 MachineInstr *DefMI = nullptr, *UseMI = nullptr;
144
145 // Check that there is a single def and a single use.
146 for (MachineOperand &MO : MRI.reg_nodbg_operands(LI->reg())) {
147 MachineInstr *MI = MO.getParent();
148 if (MO.isDef()) {
149 if (DefMI && DefMI != MI)
150 return false;
151 if (!MI->canFoldAsLoad())
152 return false;
153 DefMI = MI;
154 } else if (!MO.isUndef()) {
155 if (UseMI && UseMI != MI)
156 return false;
157 // FIXME: Targets don't know how to fold subreg uses.
158 if (MO.getSubReg())
159 return false;
160 UseMI = MI;
161 }
162 }
163 if (!DefMI || !UseMI)
164 return false;
165
166 // Since we're moving the DefMI load, make sure we're not extending any live
167 // ranges.
169 DefMI, LIS.getInstructionIndex(*UseMI), LIS, MRI, TII))
170 return false;
171
172 // We also need to make sure it is safe to move the load.
173 // Assume there are stores between DefMI and UseMI.
174 bool SawStore = true;
175 if (!DefMI->isSafeToMove(SawStore))
176 return false;
177
178 LLVM_DEBUG(dbgs() << "Try to fold single def: " << *DefMI
179 << " into single use: " << *UseMI);
180
181 SmallVector<unsigned, 8> Ops;
182 if (UseMI->readsWritesVirtualRegister(LI->reg(), &Ops).second)
183 return false;
184
185 MachineInstr *FoldMI = TII.foldMemoryOperand(*UseMI, Ops, *DefMI, &LIS);
186 if (!FoldMI)
187 return false;
188 LLVM_DEBUG(dbgs() << " folded: " << *FoldMI);
189 LIS.ReplaceMachineInstrInMaps(*UseMI, *FoldMI);
190 // Update the call info.
194 DefMI->addRegisterDead(LI->reg(), nullptr);
195 Dead.push_back(DefMI);
196 ++NumDCEFoldedLoads;
197 return true;
198}
199
200bool LiveRangeEdit::useIsKill(const LiveInterval &LI,
201 const MachineOperand &MO) const {
202 const MachineInstr &MI = *MO.getParent();
203 SlotIndex Idx = LIS.getInstructionIndex(MI).getRegSlot();
204 if (LI.Query(Idx).isKill())
205 return true;
206 const TargetRegisterInfo &TRI = *MRI.getTargetRegisterInfo();
207 unsigned SubReg = MO.getSubReg();
208 LaneBitmask LaneMask = TRI.getSubRegIndexLaneMask(SubReg);
209 for (const LiveInterval::SubRange &S : LI.subranges()) {
210 if ((S.LaneMask & LaneMask).any() && S.Query(Idx).isKill())
211 return true;
212 }
213 return false;
214}
215
216/// Find all live intervals that need to shrink, then remove the instruction.
217void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink) {
218 assert(MI->allDefsAreDead() && "Def isn't really dead");
219 SlotIndex Idx = LIS.getInstructionIndex(*MI).getRegSlot();
220
221 // Never delete a bundled instruction.
222 if (MI->isBundled()) {
223 // TODO: Handle deleting copy bundles
224 LLVM_DEBUG(dbgs() << "Won't delete dead bundled inst: " << Idx << '\t'
225 << *MI);
226 return;
227 }
228
229 // Never delete inline asm.
230 if (MI->isInlineAsm()) {
231 LLVM_DEBUG(dbgs() << "Won't delete: " << Idx << '\t' << *MI);
232 return;
233 }
234
235 // Use the same criteria as DeadMachineInstructionElim.
236 bool SawStore = false;
237 if (!MI->isSafeToMove(SawStore)) {
238 LLVM_DEBUG(dbgs() << "Can't delete: " << Idx << '\t' << *MI);
239 return;
240 }
241
242 LLVM_DEBUG(dbgs() << "Deleting dead def " << Idx << '\t' << *MI);
243
244 // Collect virtual registers to be erased after MI is gone.
245 SmallVector<Register, 8> RegsToErase;
246 bool ReadsPhysRegs = false;
247 bool isOrigDef = false;
248 Register Dest;
249 unsigned DestSubReg;
250 // Only optimize rematerialize case when the instruction has one def, since
251 // otherwise we could leave some dead defs in the code. This case is
252 // extremely rare.
253 if (VRM && MI->getOperand(0).isReg() && MI->getOperand(0).isDef() &&
254 MI->getDesc().getNumDefs() == 1) {
255 Dest = MI->getOperand(0).getReg();
256 DestSubReg = MI->getOperand(0).getSubReg();
257 Register Original = VRM->getOriginal(Dest);
258 LiveInterval &OrigLI = LIS.getInterval(Original);
259 VNInfo *OrigVNI = OrigLI.getVNInfoAt(Idx);
260 // The original live-range may have been shrunk to
261 // an empty live-range. It happens when it is dead, but
262 // we still keep it around to be able to rematerialize
263 // other values that depend on it.
264 if (OrigVNI)
265 isOrigDef = SlotIndex::isSameInstr(OrigVNI->def, Idx);
266 }
267
268 bool HasLiveVRegUses = false;
269
270 // Check for live intervals that may shrink
271 for (const MachineOperand &MO : MI->operands()) {
272 if (!MO.isReg())
273 continue;
274 Register Reg = MO.getReg();
275 if (!Reg.isVirtual()) {
276 // Check if MI reads any unreserved physregs.
277 if (Reg && MO.readsReg() && !MRI.isReserved(Reg))
278 ReadsPhysRegs = true;
279 else if (MO.isDef())
280 LIS.removePhysRegDefAt(Reg.asMCReg(), Idx);
281 continue;
282 }
283 LiveInterval &LI = LIS.getInterval(Reg);
284
285 // Shrink read registers, unless it is likely to be expensive and
286 // unlikely to change anything. We typically don't want to shrink the
287 // PIC base register that has lots of uses everywhere.
288 // Always shrink COPY uses that probably come from live range splitting.
289 if ((MI->readsVirtualRegister(Reg) &&
290 (MO.isDef() || TII.isCopyInstr(*MI))) ||
291 (MO.readsReg() && (MRI.hasOneNonDBGUse(Reg) || useIsKill(LI, MO))))
292 ToShrink.insert(&LI);
293 else if (MO.readsReg())
294 HasLiveVRegUses = true;
295
296 // Remove defined value.
297 if (MO.isDef()) {
298 if (TheDelegate && LI.getVNInfoAt(Idx) != nullptr)
299 TheDelegate->LRE_WillShrinkVirtReg(LI.reg());
300 LIS.removeVRegDefAt(LI, Idx);
301 if (LI.empty())
302 RegsToErase.push_back(Reg);
303 }
304 }
305
306 // Currently, we don't support DCE of physreg live ranges. If MI reads
307 // any unreserved physregs, don't erase the instruction, but turn it into
308 // a KILL instead. This way, the physreg live ranges don't end up
309 // dangling.
310 // FIXME: It would be better to have something like shrinkToUses() for
311 // physregs. That could potentially enable more DCE and it would free up
312 // the physreg. It would not happen often, though.
313 if (ReadsPhysRegs) {
314 MI->setDesc(TII.get(TargetOpcode::KILL));
315 // Remove all operands that aren't physregs.
316 for (unsigned i = MI->getNumOperands(); i; --i) {
317 const MachineOperand &MO = MI->getOperand(i-1);
318 if (MO.isReg() && MO.getReg().isPhysical())
319 continue;
320 MI->removeOperand(i-1);
321 }
322 MI->dropMemRefs(*MI->getMF());
323 LLVM_DEBUG(dbgs() << "Converted physregs to:\t" << *MI);
324 } else {
325 // If the dest of MI is an original reg and MI is reMaterializable,
326 // don't delete the inst. Replace the dest with a new reg, and keep
327 // the inst for remat of other siblings. The inst is saved in
328 // LiveRangeEdit::DeadRemats and will be deleted after all the
329 // allocations of the func are done.
330 // However, immediately delete instructions which have unshrunk virtual
331 // register uses. That may provoke RA to split an interval at the KILL
332 // and later result in an invalid live segment end.
333 if (isOrigDef && DeadRemats && !HasLiveVRegUses &&
334 TII.isReMaterializable(*MI)) {
335 LiveInterval &NewLI = createEmptyIntervalFrom(Dest, false);
336 VNInfo::Allocator &Alloc = LIS.getVNInfoAllocator();
337 VNInfo *VNI = NewLI.getNextValue(Idx, Alloc);
338 NewLI.addSegment(LiveInterval::Segment(Idx, Idx.getDeadSlot(), VNI));
339
340 if (DestSubReg) {
341 const TargetRegisterInfo *TRI = MRI.getTargetRegisterInfo();
342 auto *SR = NewLI.createSubRange(
343 Alloc, TRI->getSubRegIndexLaneMask(DestSubReg));
344 SR->addSegment(LiveInterval::Segment(Idx, Idx.getDeadSlot(),
345 SR->getNextValue(Idx, Alloc)));
346 }
347
348 pop_back();
349 DeadRemats->insert(MI);
350 const TargetRegisterInfo &TRI = *MRI.getTargetRegisterInfo();
351 MI->substituteRegister(Dest, NewLI.reg(), 0, TRI);
352 assert(MI->registerDefIsDead(NewLI.reg(), &TRI));
353 } else {
354 if (TheDelegate)
355 TheDelegate->LRE_WillEraseInstruction(MI);
356 LIS.RemoveMachineInstrFromMaps(*MI);
357 MI->eraseFromParent();
358 ++NumDCEDeleted;
359 }
360 }
361
362 // Erase any virtregs that are now empty and unused. There may be <undef>
363 // uses around. Keep the empty live range in that case.
364 for (Register Reg : RegsToErase) {
365 if (LIS.hasInterval(Reg) && MRI.reg_nodbg_empty(Reg)) {
366 ToShrink.remove(&LIS.getInterval(Reg));
368 }
369 }
370}
371
373 ArrayRef<Register> RegsBeingSpilled) {
374 ToShrinkSet ToShrink;
375
376 for (;;) {
377 // Erase all dead defs.
378 while (!Dead.empty())
379 eliminateDeadDef(Dead.pop_back_val(), ToShrink);
380
381 if (ToShrink.empty())
382 break;
383
384 // Shrink just one live interval. Then delete new dead defs.
385 LiveInterval *LI = ToShrink.pop_back_val();
386 if (foldAsLoad(LI, Dead))
387 continue;
388 Register VReg = LI->reg();
389 if (TheDelegate)
390 TheDelegate->LRE_WillShrinkVirtReg(VReg);
391 if (!LIS.shrinkToUses(LI, &Dead))
392 continue;
393
394 // Don't create new intervals for a register being spilled.
395 // The new intervals would have to be spilled anyway so its not worth it.
396 // Also they currently aren't spilled so creating them and not spilling
397 // them results in incorrect code.
398 if (llvm::is_contained(RegsBeingSpilled, VReg))
399 continue;
400
401 // LI may have been separated, create new intervals.
402 LI->RenumberValues();
404 LIS.splitSeparateComponents(*LI, SplitLIs);
405 if (!SplitLIs.empty())
406 ++NumFracRanges;
407
408 Register Original = VRM ? VRM->getOriginal(VReg) : Register();
409 for (const LiveInterval *SplitLI : SplitLIs) {
410 // If LI is an original interval that hasn't been split yet, make the new
411 // intervals their own originals instead of referring to LI. The original
412 // interval must contain all the split products, and LI doesn't.
413 if (Original != VReg && Original != 0)
414 VRM->setIsSplitFromReg(SplitLI->reg(), Original);
415 if (TheDelegate)
416 TheDelegate->LRE_DidCloneVirtReg(SplitLI->reg(), VReg);
417 }
418 }
419}
420
421// Keep track of new virtual registers created via
422// MachineRegisterInfo::createVirtualRegister.
423void
424LiveRangeEdit::MRI_NoteNewVirtualRegister(Register VReg) {
425 if (VRM)
426 VRM->grow();
427
428 NewRegs.push_back(VReg);
429}
430
432 VirtRegAuxInfo &VRAI) {
433 for (unsigned I = 0, Size = size(); I < Size; ++I) {
434 LiveInterval &LI = LIS.getInterval(get(I));
435 if (MRI.recomputeRegClass(LI.reg()))
436 LLVM_DEBUG({
438 dbgs() << "Inflated " << printReg(LI.reg()) << " to "
439 << TRI->getRegClassName(MRI.getRegClass(LI.reg())) << '\n';
440 });
442 }
443}
unsigned SubReg
unsigned const MachineRegisterInfo * MRI
MachineInstrBuilder & UseMI
MachineInstrBuilder MachineInstrBuilder & DefMI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock & MBB
const HexagonInstrInfo * TII
IRTranslator LLVM IR MI
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
#define I(x, y, z)
Definition MD5.cpp:58
Register Reg
Register const TargetRegisterInfo * TRI
Promote Memory to Register
Definition Mem2Reg.cpp:110
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
Definition Statistic.h:171
#define LLVM_DEBUG(...)
Definition Debug.h:114
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:41
LiveInterval - This class represents the liveness of a register, or stack slot.
void markNotSpillable()
markNotSpillable - Mark interval as not spillable
Register reg() const
iterator_range< subrange_iterator > subranges()
SubRange * createSubRange(BumpPtrAllocator &Allocator, LaneBitmask LaneMask)
Creates a new empty subregister live range.
MachineInstr * getInstructionFromIndex(SlotIndex index) const
Returns the instruction associated with the given index.
LiveInterval & getInterval(Register Reg)
bool isKill() const
Return true if the live-in value is killed by this instruction.
void eraseVirtReg(Register Reg)
eraseVirtReg - Notify the delegate that Reg is no longer in use, and try to erase it from LIS.
unsigned size() const
bool canRematerializeAt(Remat &RM, VNInfo *OrigVNI, SlotIndex UseIdx)
canRematerializeAt - Determine if ParentVNI can be rematerialized at UseIdx.
Register get(unsigned idx) const
Register createFrom(Register OldReg)
createFrom - Create a new virtual register based on OldReg.
void calculateRegClassAndHint(MachineFunction &, VirtRegAuxInfo &)
calculateRegClassAndHint - Recompute register class and hint for each new register.
const LiveInterval & getParent() const
Register getReg() const
SlotIndex rematerializeAt(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, Register DestReg, const Remat &RM, const TargetRegisterInfo &, bool Late=false, unsigned SubIdx=0, MachineInstr *ReplaceIndexMI=nullptr)
rematerializeAt - Rematerialize RM.ParentVNI into DestReg by inserting an instruction into MBB before...
void eliminateDeadDefs(SmallVectorImpl< MachineInstr * > &Dead, ArrayRef< Register > RegsBeingSpilled={})
eliminateDeadDefs - Try to delete machine instructions that are now dead (allDefsAreDead returns true...
void pop_back()
pop_back - It allows LiveRangeEdit users to drop new registers.
bool anyRematerializable()
anyRematerializable - Return true if any parent values may be rematerializable.
LLVM_ABI iterator addSegment(Segment S)
Add the specified Segment to this range, merging segments as appropriate.
bool empty() const
LLVM_ABI void RenumberValues()
RenumberValues - Renumber all values in order of appearance and remove unused values.
LiveQueryResult Query(SlotIndex Idx) const
Query Liveness at Idx.
VNInfo * getNextValue(SlotIndex Def, VNInfo::Allocator &VNInfoAllocator)
getNextValue - Create a new value number and return it.
VNInfo * getVNInfoAt(SlotIndex Idx) const
getVNInfoAt - Return the VNInfo that is live at Idx, or NULL.
MachineInstrBundleIterator< MachineInstr > iterator
void moveAdditionalCallInfo(const MachineInstr *Old, const MachineInstr *New)
Move the call site info from Old to \New call site info.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Representation of each machine instruction.
LLVM_ABI std::pair< bool, bool > readsWritesVirtualRegister(Register Reg, SmallVectorImpl< unsigned > *Ops=nullptr) const
Return a pair of bools (reads, writes) indicating if this instruction reads or writes Reg.
LLVM_ABI bool isSafeToMove(bool &SawStore) const
Return true if it is safe to move this instruction.
LLVM_ABI const MachineFunction * getMF() const
Return the function that contains the basic block that this instruction belongs to.
LLVM_ABI void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
LLVM_ABI bool shouldUpdateAdditionalCallInfo() const
Return true if copying, moving, or erasing this instruction requires updating additional call info (s...
LLVM_ABI bool addRegisterDead(Register Reg, const TargetRegisterInfo *RegInfo, bool AddIfNotFound=false)
We have determined MI defined a register without a use.
MachineOperand class - Representation of each machine instruction operand.
unsigned getSubReg() const
bool readsReg() const
readsReg - Returns true if this operand reads the previous value of its register.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
Register getReg() const
getReg - Returns the register number.
Wrapper class representing virtual and physical registers.
Definition Register.h:19
MCRegister asMCReg() const
Utility to check-convert this value to a MCRegister.
Definition Register.h:102
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
Definition Register.h:74
constexpr bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
Definition Register.h:78
bool empty() const
Determine if the SetVector is empty or not.
Definition SetVector.h:99
value_type pop_back_val()
Definition SetVector.h:278
SlotIndex - An opaque wrapper around machine indexes.
Definition SlotIndexes.h:66
static bool isSameInstr(SlotIndex A, SlotIndex B)
isSameInstr - Return true if A and B refer to the same instruction.
SlotIndex getDeadSlot() const
Returns the dead def kill slot for the current instruction.
SlotIndex getRegSlot(bool EC=false) const
Returns the register use/def slot in the current instruction for a normal or early-clobber def.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual const TargetRegisterInfo * getRegisterInfo() const =0
Return the target's register information.
VNInfo - Value Number Information.
BumpPtrAllocator Allocator
SlotIndex def
The index of the defining instruction.
Calculate auxiliary information for a virtual register such as its spill weight and allocation hint.
static bool allUsesAvailableAt(const MachineInstr *MI, SlotIndex UseIdx, const LiveIntervals &LIS, const MachineRegisterInfo &MRI, const TargetInstrInfo &TII)
void calculateSpillWeightAndHint(LiveInterval &LI)
(re)compute li's spill weight and allocation hint.
Register getOriginal(Register VirtReg) const
getOriginal - Return the original virtual register that VirtReg descends from through splitting.
Definition VirtRegMap.h:155
LLVM_ABI void grow()
@ Dead
Unused definition.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition Debug.cpp:207
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition STLExtras.h:1877
LLVM_ABI 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.
Remat - Information needed to rematerialize at a specific location.