LLVM 24.0.0git
GCNRewritePartialRegUses.cpp
Go to the documentation of this file.
1//===-------------- GCNRewritePartialRegUses.cpp --------------------------===//
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/// \file
9/// RenameIndependentSubregs pass leaves large partially used super registers,
10/// for example:
11/// undef %0.sub4:VReg_1024 = ...
12/// %0.sub5:VReg_1024 = ...
13/// %0.sub6:VReg_1024 = ...
14/// %0.sub7:VReg_1024 = ...
15/// use %0.sub4_sub5_sub6_sub7
16/// use %0.sub6_sub7
17///
18/// GCNRewritePartialRegUses goes right after RenameIndependentSubregs and
19/// rewrites such partially used super registers with registers of minimal size:
20/// undef %0.sub0:VReg_128 = ...
21/// %0.sub1:VReg_128 = ...
22/// %0.sub2:VReg_128 = ...
23/// %0.sub3:VReg_128 = ...
24/// use %0.sub0_sub1_sub2_sub3
25/// use %0.sub2_sub3
26///
27/// This allows to avoid subreg lanemasks tracking during register pressure
28/// calculation and creates more possibilities for the code unaware of lanemasks
29//===----------------------------------------------------------------------===//
30
32#include "AMDGPU.h"
34#include "SIRegisterInfo.h"
39#include "llvm/Pass.h"
40
41using namespace llvm;
42
43#define DEBUG_TYPE "rewrite-partial-reg-uses"
44
45namespace {
46
47class GCNRewritePartialRegUsesImpl {
49 const SIRegisterInfo *TRI;
50 LiveIntervals *LIS;
51
52 /// Rewrite partially used register Reg by shifting all its subregisters to
53 /// the right and replacing the original register with a register of minimal
54 /// size. Return true if the change has been made.
55 bool rewriteReg(Register Reg) const;
56
57 /// Map OldSubReg -> NewSubReg. Used as in/out container.
58 using SubRegMap = SmallDenseMap<unsigned, unsigned>;
59
60 /// Given register class RC and the set of used subregs as keys in the SubRegs
61 /// map return new register class and indexes of right-shifted subregs as
62 /// values in SubRegs map such that the resulting regclass would contain
63 /// registers of minimal size.
64 const TargetRegisterClass *getMinSizeReg(const TargetRegisterClass *RC,
65 SubRegMap &SubRegs) const;
66
67 /// Given regclass RC and pairs of [OldSubReg, NewSubReg] in SubRegs try to
68 /// find new regclass such that:
69 /// 1. It has subregs obtained by shifting each OldSubReg by RShift number
70 /// of bits to the right. Every "shifted" subreg should have the same
71 /// SubRegRC. If CoverSubregIdx is not zero it's a subreg that "covers"
72 /// all other subregs in pairs. Basically such subreg becomes a whole
73 /// register.
74 /// 2. Resulting register class contains registers of minimal size.
75 ///
76 /// SubRegs is map of OldSubReg -> NewSubReg and is used as in/out
77 /// parameter:
78 /// OldSubReg - input parameter,
79 /// NewSubReg - output, contains shifted subregs on return.
81 getRegClassWithShiftedSubregs(const TargetRegisterClass *RC, unsigned RShift,
82 unsigned CoverSubregIdx,
83 SubRegMap &SubRegs) const;
84
85 /// Update live intervals after rewriting OldReg to NewReg with SubRegs map
86 /// describing OldSubReg -> NewSubReg mapping.
87 void updateLiveIntervals(Register OldReg, Register NewReg,
88 SubRegMap &SubRegs) const;
89
90 /// Helper methods.
91
92 /// Find right-shifted by RShift amount version of the SubReg if it exists,
93 /// return 0 otherwise.
94 unsigned shiftSubReg(unsigned SubReg, unsigned RShift) const;
95
96 /// Find subreg index with a given Offset and Size, return 0 if there is no
97 /// such subregister index. The result is cached in SubRegs data-member.
98 unsigned getSubReg(unsigned Offset, unsigned Size) const;
99
100 /// Cache for getSubReg method: {Offset, Size} -> SubReg index.
101 mutable SmallDenseMap<std::pair<unsigned, unsigned>, unsigned> SubRegs;
102
103 /// Return bit mask that contains all register classes that are projected into
104 /// RC by SubRegIdx. The result is cached in SuperRegMasks data-member.
105 const uint32_t *getSuperRegClassMask(const TargetRegisterClass *RC,
106 unsigned SubRegIdx) const;
107
108 /// Cache for getSuperRegClassMask method: { RC, SubRegIdx } -> Class bitmask.
110 const uint32_t *>
111 SuperRegMasks;
112
113 /// Return bitmask containing all allocatable register classes with registers
114 /// aligned at AlignNumBits. The result is cached in
115 /// AllocatableAndAlignedRegClassMasks data-member.
116 const BitVector &
117 getAllocatableAndAlignedRegClassMask(unsigned AlignNumBits) const;
118
119 /// Cache for getAllocatableAndAlignedRegClassMask method:
120 /// AlignNumBits -> Class bitmask.
121 mutable SmallDenseMap<unsigned, BitVector> AllocatableAndAlignedRegClassMasks;
122
123public:
124 GCNRewritePartialRegUsesImpl(LiveIntervals *LS) : LIS(LS) {}
125 bool run(MachineFunction &MF);
126};
127
128class GCNRewritePartialRegUsesLegacy : public MachineFunctionPass {
129public:
130 static char ID;
131 GCNRewritePartialRegUsesLegacy() : MachineFunctionPass(ID) {}
132
133 StringRef getPassName() const override {
134 return "Rewrite Partial Register Uses";
135 }
136
137 void getAnalysisUsage(AnalysisUsage &AU) const override {
138 AU.setPreservesCFG();
142 }
143
144 bool runOnMachineFunction(MachineFunction &MF) override;
145};
146
147} // end anonymous namespace
148
149// TODO: move this to the tablegen and use binary search by Offset.
150unsigned GCNRewritePartialRegUsesImpl::getSubReg(unsigned Offset,
151 unsigned Size) const {
152 const auto [I, Inserted] = SubRegs.try_emplace({Offset, Size}, 0);
153 if (Inserted) {
154 for (unsigned Idx = 1, E = TRI->getNumSubRegIndices(); Idx < E; ++Idx) {
155 if (TRI->getSubRegIdxOffset(Idx) == Offset &&
156 TRI->getSubRegIdxSize(Idx) == Size) {
157 I->second = Idx;
158 break;
159 }
160 }
161 }
162 return I->second;
163}
164
165unsigned GCNRewritePartialRegUsesImpl::shiftSubReg(unsigned SubReg,
166 unsigned RShift) const {
167 unsigned Offset = TRI->getSubRegIdxOffset(SubReg) - RShift;
168 return getSubReg(Offset, TRI->getSubRegIdxSize(SubReg));
169}
170
171const uint32_t *GCNRewritePartialRegUsesImpl::getSuperRegClassMask(
172 const TargetRegisterClass *RC, unsigned SubRegIdx) const {
173 const auto [I, Inserted] =
174 SuperRegMasks.try_emplace({RC, SubRegIdx}, nullptr);
175 if (Inserted) {
176 for (SuperRegClassIterator RCI(RC); RCI.isValid(); ++RCI) {
177 if (RCI.getSubReg() == SubRegIdx) {
178 I->second = RCI.getMask();
179 break;
180 }
181 }
182 }
183 return I->second;
184}
185
186const BitVector &
187GCNRewritePartialRegUsesImpl::getAllocatableAndAlignedRegClassMask(
188 unsigned AlignNumBits) const {
189 const auto [I, Inserted] =
190 AllocatableAndAlignedRegClassMasks.try_emplace(AlignNumBits);
191 if (Inserted) {
192 BitVector &BV = I->second;
193 BV.resize(TRI->getNumRegClasses());
194 for (unsigned ClassID = 0; ClassID < TRI->getNumRegClasses(); ++ClassID) {
195 auto *RC = TRI->getRegClass(ClassID);
196 if (RC->isAllocatable() && TRI->isRegClassAligned(RC, AlignNumBits))
197 BV.set(ClassID);
198 }
199 }
200 return I->second;
201}
202
204GCNRewritePartialRegUsesImpl::getRegClassWithShiftedSubregs(
205 const TargetRegisterClass *RC, unsigned RShift, unsigned CoverSubregIdx,
206 SubRegMap &SubRegs) const {
207
208 unsigned RCAlign = TRI->getRegClassAlignmentNumBits(RC);
209 LLVM_DEBUG(dbgs() << " Shift " << RShift << ", reg align " << RCAlign
210 << '\n');
211
212 BitVector ClassMask(getAllocatableAndAlignedRegClassMask(RCAlign));
213 for (auto &[OldSubReg, NewSubReg] : SubRegs) {
214 LLVM_DEBUG(dbgs() << " " << TRI->getSubRegIndexName(OldSubReg) << ':');
215
216 auto *SubRegRC = TRI->getSubRegisterClass(RC, OldSubReg);
217 if (!SubRegRC) {
218 LLVM_DEBUG(dbgs() << "couldn't find target regclass\n");
219 return nullptr;
220 }
221 LLVM_DEBUG(dbgs() << TRI->getRegClassName(SubRegRC)
222 << (SubRegRC->isAllocatable() ? "" : " not alloc")
223 << " -> ");
224
225 if (OldSubReg == CoverSubregIdx) {
226 // Covering subreg will become a full register, RC should be allocatable.
227 assert(SubRegRC->isAllocatable());
228 NewSubReg = AMDGPU::NoSubRegister;
229 LLVM_DEBUG(dbgs() << "whole reg");
230 } else {
231 NewSubReg = shiftSubReg(OldSubReg, RShift);
232 if (!NewSubReg) {
233 LLVM_DEBUG(dbgs() << "none\n");
234 return nullptr;
235 }
236 LLVM_DEBUG(dbgs() << TRI->getSubRegIndexName(NewSubReg));
237 }
238
239 const uint32_t *Mask = NewSubReg ? getSuperRegClassMask(SubRegRC, NewSubReg)
240 : SubRegRC->getSubClassMask();
241 if (!Mask)
242 llvm_unreachable("no register class mask?");
243
244 ClassMask.clearBitsNotInMask(Mask);
245 // Don't try to early exit because checking if ClassMask has set bits isn't
246 // that cheap and we expect it to pass in most cases.
247 LLVM_DEBUG(dbgs() << ", num regclasses " << ClassMask.count() << '\n');
248 }
249
250 // ClassMask is the set of all register classes such that each class is
251 // allocatable, aligned, has all shifted subregs and each subreg has required
252 // register class (see SubRegRC above). Now select first (that is largest)
253 // register class with registers of minimal size.
254 const TargetRegisterClass *MinRC = nullptr;
255 unsigned MinNumBits = std::numeric_limits<unsigned>::max();
256 for (unsigned ClassID : ClassMask.set_bits()) {
257 auto *RC = TRI->getRegClass(ClassID);
258 unsigned NumBits = TRI->getRegSizeInBits(*RC);
259 if (NumBits < MinNumBits) {
260 MinNumBits = NumBits;
261 MinRC = RC;
262 }
263 }
264#ifndef NDEBUG
265 if (MinRC) {
266 assert(MinRC->isAllocatable() && TRI->isRegClassAligned(MinRC, RCAlign));
267 for (auto [OldSubReg, NewSubReg] : SubRegs)
268 // Check that all registers in MinRC support NewSubReg subregister.
269 assert(TRI->isSubRegValidForRegClass(MinRC, NewSubReg));
270 }
271#endif
272 // There might be zero RShift - in this case we just trying to find smaller
273 // register.
274 return (MinRC != RC || RShift != 0) ? MinRC : nullptr;
275}
276
278GCNRewritePartialRegUsesImpl::getMinSizeReg(const TargetRegisterClass *RC,
279 SubRegMap &SubRegs) const {
280 unsigned CoverSubreg = AMDGPU::NoSubRegister;
281 unsigned Offset = std::numeric_limits<unsigned>::max();
282 unsigned End = 0;
283 for (auto [SubReg, SRI] : SubRegs) {
284 unsigned SubRegOffset = TRI->getSubRegIdxOffset(SubReg);
285 unsigned SubRegEnd = SubRegOffset + TRI->getSubRegIdxSize(SubReg);
286 if (SubRegOffset < Offset) {
287 Offset = SubRegOffset;
288 CoverSubreg = AMDGPU::NoSubRegister;
289 }
290 if (SubRegEnd > End) {
291 End = SubRegEnd;
292 CoverSubreg = AMDGPU::NoSubRegister;
293 }
294 if (SubRegOffset == Offset && SubRegEnd == End)
295 CoverSubreg = SubReg;
296 }
297 // If covering subreg is found shift everything so the covering subreg would
298 // be in the rightmost position.
299 if (CoverSubreg != AMDGPU::NoSubRegister)
300 return getRegClassWithShiftedSubregs(RC, Offset, CoverSubreg, SubRegs);
301
302 // Otherwise find subreg with maximum required alignment and shift it and all
303 // other subregs to the rightmost possible position with respect to the
304 // alignment.
305 unsigned MaxAlign = 0;
306 for (auto [SubReg, SRI] : SubRegs)
307 MaxAlign = std::max(MaxAlign, TRI->getSubRegAlignmentNumBits(RC, SubReg));
308
309 unsigned FirstMaxAlignedSubRegOffset = std::numeric_limits<unsigned>::max();
310 for (auto [SubReg, SRI] : SubRegs) {
311 if (TRI->getSubRegAlignmentNumBits(RC, SubReg) != MaxAlign)
312 continue;
313 FirstMaxAlignedSubRegOffset =
314 std::min(FirstMaxAlignedSubRegOffset, TRI->getSubRegIdxOffset(SubReg));
315 if (FirstMaxAlignedSubRegOffset == Offset)
316 break;
317 }
318
319 unsigned NewOffsetOfMaxAlignedSubReg =
320 alignTo(FirstMaxAlignedSubRegOffset - Offset, MaxAlign);
321
322 if (NewOffsetOfMaxAlignedSubReg > FirstMaxAlignedSubRegOffset)
323 llvm_unreachable("misaligned subreg");
324
325 unsigned RShift = FirstMaxAlignedSubRegOffset - NewOffsetOfMaxAlignedSubReg;
326 return getRegClassWithShiftedSubregs(RC, RShift, 0, SubRegs);
327}
328
329// Only the subrange's lanemasks of the original interval need to be modified.
330// Subrange for a covering subreg becomes the main range.
331void GCNRewritePartialRegUsesImpl::updateLiveIntervals(
332 Register OldReg, Register NewReg, SubRegMap &SubRegs) const {
333 if (!LIS->hasInterval(OldReg))
334 return;
335
336 auto &OldLI = LIS->getInterval(OldReg);
337 auto &NewLI = LIS->createEmptyInterval(NewReg);
338
339 auto &Allocator = LIS->getVNInfoAllocator();
340 NewLI.setWeight(OldLI.weight());
341
342 for (auto &SR : OldLI.subranges()) {
343 auto I = find_if(SubRegs, [&](auto &P) {
344 return SR.LaneMask == TRI->getSubRegIndexLaneMask(P.first);
345 });
346
347 if (I == SubRegs.end()) {
348 // There might be a situation when subranges don't exactly match used
349 // subregs, for example:
350 // %120 [160r,1392r:0) 0@160r
351 // L000000000000C000 [160r,1392r:0) 0@160r
352 // L0000000000003000 [160r,1392r:0) 0@160r
353 // L0000000000000C00 [160r,1392r:0) 0@160r
354 // L0000000000000300 [160r,1392r:0) 0@160r
355 // L0000000000000003 [160r,1104r:0) 0@160r
356 // L000000000000000C [160r,1104r:0) 0@160r
357 // L0000000000000030 [160r,1104r:0) 0@160r
358 // L00000000000000C0 [160r,1104r:0) 0@160r
359 // but used subregs are:
360 // sub0_sub1_sub2_sub3_sub4_sub5_sub6_sub7, L000000000000FFFF
361 // sub0_sub1_sub2_sub3, L00000000000000FF
362 // sub4_sub5_sub6_sub7, L000000000000FF00
363 // In this example subregs sub0_sub1_sub2_sub3 and sub4_sub5_sub6_sub7
364 // have several subranges with the same lifetime. For such cases just
365 // recreate the interval.
366 LIS->removeInterval(OldReg);
367 LIS->removeInterval(NewReg);
369 return;
370 }
371
372 if (unsigned NewSubReg = I->second)
373 NewLI.createSubRangeFrom(Allocator,
374 TRI->getSubRegIndexLaneMask(NewSubReg), SR);
375 else // This is the covering subreg (0 index) - set it as main range.
376 NewLI.assign(SR, Allocator);
377
378 SubRegs.erase(I);
379 }
380 if (NewLI.empty())
381 NewLI.assign(OldLI, Allocator);
382 assert(NewLI.verify(MRI));
383 LIS->removeInterval(OldReg);
384}
385
386bool GCNRewritePartialRegUsesImpl::rewriteReg(Register Reg) const {
387
388 // Collect used subregs.
389 SubRegMap SubRegs;
390 for (MachineOperand &MO : MRI->reg_nodbg_operands(Reg)) {
391 if (MO.getSubReg() == AMDGPU::NoSubRegister)
392 return false; // Whole reg used.
393 SubRegs.try_emplace(MO.getSubReg());
394 }
395
396 if (SubRegs.empty())
397 return false;
398
399 auto *RC = MRI->getRegClass(Reg);
400 LLVM_DEBUG(dbgs() << "Try to rewrite partial reg " << printReg(Reg, TRI)
401 << ':' << TRI->getRegClassName(RC) << '\n');
402
403 auto *NewRC = getMinSizeReg(RC, SubRegs);
404 if (!NewRC) {
405 LLVM_DEBUG(dbgs() << " No improvement achieved\n");
406 return false;
407 }
408
409 Register NewReg = MRI->createVirtualRegister(NewRC);
410 LLVM_DEBUG(dbgs() << " Success " << printReg(Reg, TRI) << ':'
411 << TRI->getRegClassName(RC) << " -> "
412 << printReg(NewReg, TRI) << ':'
413 << TRI->getRegClassName(NewRC) << '\n');
414
415 for (auto &MO : make_early_inc_range(MRI->reg_operands(Reg))) {
416 MO.setReg(NewReg);
417 // Debug info can refer to the whole reg, just leave it as it is for now.
418 // TODO: create some DI shift expression?
419 if (MO.isDebug() && MO.getSubReg() == 0)
420 continue;
421 unsigned NewSubReg = SubRegs[MO.getSubReg()];
422 MO.setSubReg(NewSubReg);
423 if (NewSubReg == AMDGPU::NoSubRegister && MO.isDef())
424 MO.setIsUndef(false);
425 }
426
427 if (LIS)
428 updateLiveIntervals(Reg, NewReg, SubRegs);
429
430 return true;
431}
432
433bool GCNRewritePartialRegUsesImpl::run(MachineFunction &MF) {
434 MRI = &MF.getRegInfo();
435 TRI = static_cast<const SIRegisterInfo *>(MRI->getTargetRegisterInfo());
436 bool Changed = false;
437 for (size_t I = 0, E = MRI->getNumVirtRegs(); I < E; ++I) {
438 Changed |= rewriteReg(Register::index2VirtReg(I));
439 }
440 return Changed;
441}
442
443bool GCNRewritePartialRegUsesLegacy::runOnMachineFunction(MachineFunction &MF) {
444 LiveIntervalsWrapperPass *LISWrapper =
445 getAnalysisIfAvailable<LiveIntervalsWrapperPass>();
446 LiveIntervals *LIS = LISWrapper ? &LISWrapper->getLIS() : nullptr;
447 GCNRewritePartialRegUsesImpl Impl(LIS);
448 return Impl.run(MF);
449}
450
451PreservedAnalyses
454 auto *LIS = MFAM.getCachedResult<LiveIntervalsAnalysis>(MF);
455 if (!GCNRewritePartialRegUsesImpl(LIS).run(MF))
456 return PreservedAnalyses::all();
457
459 PA.preserveSet<CFGAnalyses>();
460 PA.preserve<LiveIntervalsAnalysis>();
461 PA.preserve<SlotIndexesAnalysis>();
462 return PA;
463}
464
465char GCNRewritePartialRegUsesLegacy::ID;
466
467char &llvm::GCNRewritePartialRegUsesID = GCNRewritePartialRegUsesLegacy::ID;
468
469INITIALIZE_PASS_BEGIN(GCNRewritePartialRegUsesLegacy, DEBUG_TYPE,
470 "Rewrite Partial Register Uses", false, false)
471INITIALIZE_PASS_END(GCNRewritePartialRegUsesLegacy, DEBUG_TYPE,
472 "Rewrite Partial Register Uses", false, false)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Provides AMDGPU specific target descriptions.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define DEBUG_TYPE
#define I(x, y, z)
Definition MD5.cpp:57
Register Reg
Register const TargetRegisterInfo * TRI
Promote Memory to Register
Definition Mem2Reg.cpp:110
#define P(N)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
Definition PassSupport.h:44
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
Definition PassSupport.h:39
MachineRegisterInfo & MRI
Basic Register Allocator
Interface definition for SIRegisterInfo.
#define LLVM_DEBUG(...)
Definition Debug.h:119
PassT::Result * getCachedResult(IRUnitT &IR) const
Get the cached result of an analysis pass for a given IR unit.
Represent the analysis usage information of a pass.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
Definition Pass.cpp:280
void resize(unsigned N, bool t=false)
Grow or shrink the bitvector.
Definition BitVector.h:356
BitVector & set()
Set all bits in the bitvector.
Definition BitVector.h:367
Represents analyses that only rely on functions' control flow.
Definition Analysis.h:73
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
bool hasInterval(Register Reg) const
VNInfo::Allocator & getVNInfoAllocator()
LiveInterval & getInterval(Register Reg)
void removeInterval(Register Reg)
Interval removal.
LiveInterval & createEmptyInterval(Register Reg)
Interval creation.
LiveInterval & createAndComputeVirtRegInterval(Register Reg)
bool isAllocatable() const
isAllocatable - Return true if this register class may be used to create virtual registers.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
iterator_range< reg_iterator > reg_operands(Register Reg) const
const TargetRegisterClass * getRegClass(Register Reg) const
Return the register class of the specified virtual register.
LLVM_ABI Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
const TargetRegisterInfo * getTargetRegisterInfo() const
iterator_range< reg_nodbg_iterator > reg_nodbg_operands(Register Reg) const
unsigned getNumVirtRegs() const
getNumVirtRegs - Return the number of virtual registers created.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition Analysis.h:118
Wrapper class representing virtual and physical registers.
Definition Register.h:20
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:577
char & GCNRewritePartialRegUsesID
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
Definition STLExtras.h:649
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition Debug.cpp:209
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition Alignment.h:149
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1788
@ End
Run the machine verifier once, at the end of the pipeline.
Definition CodeGen.h:320
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.
MCRegisterClass TargetRegisterClass
Definition FastISel.h:58