LLVM 20.0.0git
LocalStackSlotAllocation.cpp
Go to the documentation of this file.
1//===- LocalStackSlotAllocation.cpp - Pre-allocate locals to stack slots --===//
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// This pass assigns local frame indices to stack slots relative to one another
10// and allocates additional base registers to access them when the target
11// estimates they are likely to be out of range of stack pointer and frame
12// pointer relative addressing.
13//
14//===----------------------------------------------------------------------===//
15
17#include "llvm/ADT/SetVector.h"
18#include "llvm/ADT/SmallSet.h"
20#include "llvm/ADT/Statistic.h"
32#include "llvm/Pass.h"
33#include "llvm/Support/Debug.h"
36#include <algorithm>
37#include <cassert>
38#include <cstdint>
39#include <tuple>
40
41using namespace llvm;
42
43#define DEBUG_TYPE "localstackalloc"
44
45STATISTIC(NumAllocations, "Number of frame indices allocated into local block");
46STATISTIC(NumBaseRegisters, "Number of virtual frame base registers allocated");
47STATISTIC(NumReplacements, "Number of frame indices references replaced");
48
49namespace {
50
51 class FrameRef {
52 MachineBasicBlock::iterator MI; // Instr referencing the frame
53 int64_t LocalOffset; // Local offset of the frame idx referenced
54 int FrameIdx; // The frame index
55
56 // Order reference instruction appears in program. Used to ensure
57 // deterministic order when multiple instructions may reference the same
58 // location.
59 unsigned Order;
60
61 public:
62 FrameRef(MachineInstr *I, int64_t Offset, int Idx, unsigned Ord) :
63 MI(I), LocalOffset(Offset), FrameIdx(Idx), Order(Ord) {}
64
65 bool operator<(const FrameRef &RHS) const {
66 return std::tie(LocalOffset, FrameIdx, Order) <
67 std::tie(RHS.LocalOffset, RHS.FrameIdx, RHS.Order);
68 }
69
71 int64_t getLocalOffset() const { return LocalOffset; }
72 int getFrameIndex() const { return FrameIdx; }
73 };
74
75 class LocalStackSlotImpl {
76 SmallVector<int64_t, 16> LocalOffsets;
77
78 /// StackObjSet - A set of stack object indexes
80
81 void AdjustStackOffset(MachineFrameInfo &MFI, int FrameIdx, int64_t &Offset,
82 bool StackGrowsDown, Align &MaxAlign);
83 void AssignProtectedObjSet(const StackObjSet &UnassignedObjs,
84 SmallSet<int, 16> &ProtectedObjs,
85 MachineFrameInfo &MFI, bool StackGrowsDown,
86 int64_t &Offset, Align &MaxAlign);
87 void calculateFrameObjectOffsets(MachineFunction &Fn);
88 bool insertFrameReferenceRegisters(MachineFunction &Fn);
89
90 public:
91 bool runOnMachineFunction(MachineFunction &MF);
92 };
93
94 class LocalStackSlotPass : public MachineFunctionPass {
95 public:
96 static char ID; // Pass identification, replacement for typeid
97
98 explicit LocalStackSlotPass() : MachineFunctionPass(ID) {
100 }
101
102 bool runOnMachineFunction(MachineFunction &MF) override {
103 return LocalStackSlotImpl().runOnMachineFunction(MF);
104 }
105
106 void getAnalysisUsage(AnalysisUsage &AU) const override {
107 AU.setPreservesCFG();
109 }
110 };
111
112} // end anonymous namespace
113
117 bool Changed = LocalStackSlotImpl().runOnMachineFunction(MF);
118 if (!Changed)
119 return PreservedAnalyses::all();
121 PA.preserveSet<CFGAnalyses>();
122 return PA;
123}
124
125char LocalStackSlotPass::ID = 0;
126
127char &llvm::LocalStackSlotAllocationID = LocalStackSlotPass::ID;
128INITIALIZE_PASS(LocalStackSlotPass, DEBUG_TYPE,
129 "Local Stack Slot Allocation", false, false)
130
131bool LocalStackSlotImpl::runOnMachineFunction(MachineFunction &MF) {
132 MachineFrameInfo &MFI = MF.getFrameInfo();
133 const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
134 unsigned LocalObjectCount = MFI.getObjectIndexEnd();
135
136 // If the target doesn't want/need this pass, or if there are no locals
137 // to consider, early exit.
138 if (LocalObjectCount == 0 || !TRI->requiresVirtualBaseRegisters(MF))
139 return false;
140
141 // Make sure we have enough space to store the local offsets.
142 LocalOffsets.resize(MFI.getObjectIndexEnd());
143
144 // Lay out the local blob.
145 calculateFrameObjectOffsets(MF);
146
147 // Insert virtual base registers to resolve frame index references.
148 bool UsedBaseRegs = insertFrameReferenceRegisters(MF);
149
150 // Tell MFI whether any base registers were allocated. PEI will only
151 // want to use the local block allocations from this pass if there were any.
152 // Otherwise, PEI can do a bit better job of getting the alignment right
153 // without a hole at the start since it knows the alignment of the stack
154 // at the start of local allocation, and this pass doesn't.
155 MFI.setUseLocalStackAllocationBlock(UsedBaseRegs);
156
157 return true;
158}
159
160/// AdjustStackOffset - Helper function used to adjust the stack frame offset.
161void LocalStackSlotImpl::AdjustStackOffset(MachineFrameInfo &MFI, int FrameIdx,
162 int64_t &Offset, bool StackGrowsDown,
163 Align &MaxAlign) {
164 // If the stack grows down, add the object size to find the lowest address.
165 if (StackGrowsDown)
166 Offset += MFI.getObjectSize(FrameIdx);
167
168 Align Alignment = MFI.getObjectAlign(FrameIdx);
169
170 // If the alignment of this object is greater than that of the stack, then
171 // increase the stack alignment to match.
172 MaxAlign = std::max(MaxAlign, Alignment);
173
174 // Adjust to alignment boundary.
175 Offset = alignTo(Offset, Alignment);
176
177 int64_t LocalOffset = StackGrowsDown ? -Offset : Offset;
178 LLVM_DEBUG(dbgs() << "Allocate FI(" << FrameIdx << ") to local offset "
179 << LocalOffset << "\n");
180 // Keep the offset available for base register allocation
181 LocalOffsets[FrameIdx] = LocalOffset;
182 // And tell MFI about it for PEI to use later
183 MFI.mapLocalFrameObject(FrameIdx, LocalOffset);
184
185 if (!StackGrowsDown)
186 Offset += MFI.getObjectSize(FrameIdx);
187
188 ++NumAllocations;
189}
190
191/// AssignProtectedObjSet - Helper function to assign large stack objects (i.e.,
192/// those required to be close to the Stack Protector) to stack offsets.
193void LocalStackSlotImpl::AssignProtectedObjSet(
194 const StackObjSet &UnassignedObjs, SmallSet<int, 16> &ProtectedObjs,
195 MachineFrameInfo &MFI, bool StackGrowsDown, int64_t &Offset,
196 Align &MaxAlign) {
197 for (int i : UnassignedObjs) {
198 AdjustStackOffset(MFI, i, Offset, StackGrowsDown, MaxAlign);
199 ProtectedObjs.insert(i);
200 }
201}
202
203/// calculateFrameObjectOffsets - Calculate actual frame offsets for all of the
204/// abstract stack objects.
205void LocalStackSlotImpl::calculateFrameObjectOffsets(MachineFunction &Fn) {
206 // Loop over all of the stack objects, assigning sequential addresses...
207 MachineFrameInfo &MFI = Fn.getFrameInfo();
209 bool StackGrowsDown =
211 int64_t Offset = 0;
212 Align MaxAlign;
213
214 // Make sure that the stack protector comes before the local variables on the
215 // stack.
216 SmallSet<int, 16> ProtectedObjs;
217 if (MFI.hasStackProtectorIndex()) {
218 int StackProtectorFI = MFI.getStackProtectorIndex();
219
220 // We need to make sure we didn't pre-allocate the stack protector when
221 // doing this.
222 // If we already have a stack protector, this will re-assign it to a slot
223 // that is **not** covering the protected objects.
224 assert(!MFI.isObjectPreAllocated(StackProtectorFI) &&
225 "Stack protector pre-allocated in LocalStackSlotAllocation");
226
227 StackObjSet LargeArrayObjs;
228 StackObjSet SmallArrayObjs;
229 StackObjSet AddrOfObjs;
230
231 // Only place the stack protector in the local stack area if the target
232 // allows it.
233 if (TFI.isStackIdSafeForLocalArea(MFI.getStackID(StackProtectorFI)))
234 AdjustStackOffset(MFI, StackProtectorFI, Offset, StackGrowsDown,
235 MaxAlign);
236
237 // Assign large stack objects first.
238 for (unsigned i = 0, e = MFI.getObjectIndexEnd(); i != e; ++i) {
239 if (MFI.isDeadObjectIndex(i))
240 continue;
241 if (StackProtectorFI == (int)i)
242 continue;
243 if (!TFI.isStackIdSafeForLocalArea(MFI.getStackID(i)))
244 continue;
245
246 switch (MFI.getObjectSSPLayout(i)) {
248 continue;
250 SmallArrayObjs.insert(i);
251 continue;
253 AddrOfObjs.insert(i);
254 continue;
256 LargeArrayObjs.insert(i);
257 continue;
258 }
259 llvm_unreachable("Unexpected SSPLayoutKind.");
260 }
261
262 AssignProtectedObjSet(LargeArrayObjs, ProtectedObjs, MFI, StackGrowsDown,
263 Offset, MaxAlign);
264 AssignProtectedObjSet(SmallArrayObjs, ProtectedObjs, MFI, StackGrowsDown,
265 Offset, MaxAlign);
266 AssignProtectedObjSet(AddrOfObjs, ProtectedObjs, MFI, StackGrowsDown,
267 Offset, MaxAlign);
268 }
269
270 // Then assign frame offsets to stack objects that are not used to spill
271 // callee saved registers.
272 for (unsigned i = 0, e = MFI.getObjectIndexEnd(); i != e; ++i) {
273 if (MFI.isDeadObjectIndex(i))
274 continue;
275 if (MFI.getStackProtectorIndex() == (int)i)
276 continue;
277 if (ProtectedObjs.count(i))
278 continue;
279 if (!TFI.isStackIdSafeForLocalArea(MFI.getStackID(i)))
280 continue;
281
282 AdjustStackOffset(MFI, i, Offset, StackGrowsDown, MaxAlign);
283 }
284
285 // Remember how big this blob of stack space is
287 MFI.setLocalFrameMaxAlign(MaxAlign);
288}
289
290static inline bool
291lookupCandidateBaseReg(unsigned BaseReg,
292 int64_t BaseOffset,
293 int64_t FrameSizeAdjust,
294 int64_t LocalFrameOffset,
295 const MachineInstr &MI,
296 const TargetRegisterInfo *TRI) {
297 // Check if the relative offset from the where the base register references
298 // to the target address is in range for the instruction.
299 int64_t Offset = FrameSizeAdjust + LocalFrameOffset - BaseOffset;
300 return TRI->isFrameOffsetLegal(&MI, BaseReg, Offset);
301}
302
303bool LocalStackSlotImpl::insertFrameReferenceRegisters(MachineFunction &Fn) {
304 // Scan the function's instructions looking for frame index references.
305 // For each, ask the target if it wants a virtual base register for it
306 // based on what we can tell it about where the local will end up in the
307 // stack frame. If it wants one, re-use a suitable one we've previously
308 // allocated, or if there isn't one that fits the bill, allocate a new one
309 // and ask the target to create a defining instruction for it.
310
311 MachineFrameInfo &MFI = Fn.getFrameInfo();
314 bool StackGrowsDown =
316
317 // Collect all of the instructions in the block that reference
318 // a frame index. Also store the frame index referenced to ease later
319 // lookup. (For any insn that has more than one FI reference, we arbitrarily
320 // choose the first one).
321 SmallVector<FrameRef, 64> FrameReferenceInsns;
322
323 unsigned Order = 0;
324
325 for (MachineBasicBlock &BB : Fn) {
326 for (MachineInstr &MI : BB) {
327 // Debug value, stackmap and patchpoint instructions can't be out of
328 // range, so they don't need any updates.
329 if (MI.isDebugInstr() || MI.getOpcode() == TargetOpcode::STATEPOINT ||
330 MI.getOpcode() == TargetOpcode::STACKMAP ||
331 MI.getOpcode() == TargetOpcode::PATCHPOINT)
332 continue;
333
334 // For now, allocate the base register(s) within the basic block
335 // where they're used, and don't try to keep them around outside
336 // of that. It may be beneficial to try sharing them more broadly
337 // than that, but the increased register pressure makes that a
338 // tricky thing to balance. Investigate if re-materializing these
339 // becomes an issue.
340 for (const MachineOperand &MO : MI.operands()) {
341 // Consider replacing all frame index operands that reference
342 // an object allocated in the local block.
343 if (MO.isFI()) {
344 // Don't try this with values not in the local block.
345 if (!MFI.isObjectPreAllocated(MO.getIndex()))
346 break;
347 int Idx = MO.getIndex();
348 int64_t LocalOffset = LocalOffsets[Idx];
349 if (!TRI->needsFrameBaseReg(&MI, LocalOffset))
350 break;
351 FrameReferenceInsns.push_back(FrameRef(&MI, LocalOffset, Idx, Order++));
352 break;
353 }
354 }
355 }
356 }
357
358 // Sort the frame references by local offset.
359 // Use frame index as a tie-breaker in case MI's have the same offset.
360 llvm::sort(FrameReferenceInsns);
361
362 MachineBasicBlock *Entry = &Fn.front();
363
364 Register BaseReg;
365 int64_t BaseOffset = 0;
366
367 // Loop through the frame references and allocate for them as necessary.
368 for (int ref = 0, e = FrameReferenceInsns.size(); ref < e ; ++ref) {
369 FrameRef &FR = FrameReferenceInsns[ref];
370 MachineInstr &MI = *FR.getMachineInstr();
371 int64_t LocalOffset = FR.getLocalOffset();
372 int FrameIdx = FR.getFrameIndex();
373 assert(MFI.isObjectPreAllocated(FrameIdx) &&
374 "Only pre-allocated locals expected!");
375
376 // We need to keep the references to the stack protector slot through frame
377 // index operands so that it gets resolved by PEI rather than this pass.
378 // This avoids accesses to the stack protector though virtual base
379 // registers, and forces PEI to address it using fp/sp/bp.
380 if (MFI.hasStackProtectorIndex() &&
381 FrameIdx == MFI.getStackProtectorIndex())
382 continue;
383
384 LLVM_DEBUG(dbgs() << "Considering: " << MI);
385
386 unsigned idx = 0;
387 for (unsigned f = MI.getNumOperands(); idx != f; ++idx) {
388 if (!MI.getOperand(idx).isFI())
389 continue;
390
391 if (FrameIdx == MI.getOperand(idx).getIndex())
392 break;
393 }
394
395 assert(idx < MI.getNumOperands() && "Cannot find FI operand");
396
397 int64_t Offset = 0;
398 int64_t FrameSizeAdjust = StackGrowsDown ? MFI.getLocalFrameSize() : 0;
399
400 LLVM_DEBUG(dbgs() << " Replacing FI in: " << MI);
401
402 // If we have a suitable base register available, use it; otherwise
403 // create a new one. Note that any offset encoded in the
404 // instruction itself will be taken into account by the target,
405 // so we don't have to adjust for it here when reusing a base
406 // register.
407 if (BaseReg.isValid() &&
408 lookupCandidateBaseReg(BaseReg, BaseOffset, FrameSizeAdjust,
409 LocalOffset, MI, TRI)) {
410 LLVM_DEBUG(dbgs() << " Reusing base register " << BaseReg << "\n");
411 // We found a register to reuse.
412 Offset = FrameSizeAdjust + LocalOffset - BaseOffset;
413 } else {
414 // No previously defined register was in range, so create a new one.
415 int64_t InstrOffset = TRI->getFrameIndexInstrOffset(&MI, idx);
416
417 int64_t CandBaseOffset = FrameSizeAdjust + LocalOffset + InstrOffset;
418
419 // We'd like to avoid creating single-use virtual base registers.
420 // Because the FrameRefs are in sorted order, and we've already
421 // processed all FrameRefs before this one, just check whether or not
422 // the next FrameRef will be able to reuse this new register. If not,
423 // then don't bother creating it.
424 if (ref + 1 >= e ||
426 BaseReg, CandBaseOffset, FrameSizeAdjust,
427 FrameReferenceInsns[ref + 1].getLocalOffset(),
428 *FrameReferenceInsns[ref + 1].getMachineInstr(), TRI))
429 continue;
430
431 // Save the base offset.
432 BaseOffset = CandBaseOffset;
433
434 // Tell the target to insert the instruction to initialize
435 // the base register.
436 // MachineBasicBlock::iterator InsertionPt = Entry->begin();
437 BaseReg = TRI->materializeFrameBaseRegister(Entry, FrameIdx, InstrOffset);
438
439 LLVM_DEBUG(dbgs() << " Materialized base register at frame local offset "
440 << LocalOffset + InstrOffset
441 << " into " << printReg(BaseReg, TRI) << '\n');
442
443 // The base register already includes any offset specified
444 // by the instruction, so account for that so it doesn't get
445 // applied twice.
446 Offset = -InstrOffset;
447
448 ++NumBaseRegisters;
449 }
450 assert(BaseReg && "Unable to allocate virtual base register!");
451
452 // Modify the instruction to use the new base register rather
453 // than the frame index operand.
454 TRI->resolveFrameIndex(MI, BaseReg, Offset);
455 LLVM_DEBUG(dbgs() << "Resolved: " << MI);
456
457 ++NumReplacements;
458 }
459
460 return BaseReg.isValid();
461}
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
#define LLVM_DEBUG(X)
Definition: Debug.h:101
static MachineInstr * getMachineInstr(MachineInstr *MI)
#define DEBUG_TYPE
IRTranslator LLVM IR MI
static bool lookupCandidateBaseReg(unsigned BaseReg, int64_t BaseOffset, int64_t FrameSizeAdjust, int64_t LocalFrameOffset, const MachineInstr &MI, const TargetRegisterInfo *TRI)
#define I(x, y, z)
Definition: MD5.cpp:58
unsigned const TargetRegisterInfo * TRI
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Definition: PassSupport.h:38
static void AssignProtectedObjSet(const StackObjSet &UnassignedObjs, SmallSet< int, 16 > &ProtectedObjs, MachineFrameInfo &MFI, bool StackGrowsDown, int64_t &Offset, Align &MaxAlign)
AssignProtectedObjSet - Helper function to assign large stack objects (i.e., those required to be clo...
static void AdjustStackOffset(MachineFrameInfo &MFI, int FrameIdx, bool StackGrowsDown, int64_t &Offset, Align &MaxAlign)
AdjustStackOffset - Helper function used to adjust the stack frame offset.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file implements a set that has insertion order iteration characteristics.
This file defines the SmallSet class.
This file defines the SmallVector class.
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:166
Value * RHS
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:253
Represent the analysis usage information of a pass.
void setPreservesCFG()
This function should be called by the pass, iff they do not:
Definition: Pass.cpp:256
Represents analyses that only rely on functions' control flow.
Definition: Analysis.h:72
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &)
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
SSPLayoutKind getObjectSSPLayout(int ObjectIdx) const
bool isObjectPreAllocated(int ObjectIdx) const
Return true if the object was pre-allocated into the local block.
void setUseLocalStackAllocationBlock(bool v)
setUseLocalStackAllocationBlock - Set whether the local allocation blob should be allocated together ...
void setLocalFrameSize(int64_t sz)
Set the size of the local object blob.
@ SSPLK_SmallArray
Array or nested array < SSP-buffer-size.
@ SSPLK_LargeArray
Array or nested array >= SSP-buffer-size.
@ SSPLK_AddrOf
The address of this allocation is exposed and triggered protection.
@ SSPLK_None
Did not trigger a stack protector.
void setLocalFrameMaxAlign(Align Alignment)
Required alignment of the local object blob, which is the strictest alignment of any object in it.
int getStackProtectorIndex() const
Return the index for the stack protector object.
Align getObjectAlign(int ObjectIdx) const
Return the alignment of the specified stack object.
void mapLocalFrameObject(int ObjectIndex, int64_t Offset)
Map a frame index into the local object block.
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
int64_t getLocalFrameSize() const
Get the size of the local object blob.
int getObjectIndexEnd() const
Return one past the maximum frame object index.
bool hasStackProtectorIndex() const
uint8_t getStackID(int ObjectIdx) const
bool isDeadObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a dead object.
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.
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Representation of each machine instruction.
Definition: MachineInstr.h:69
MachineOperand class - Representation of each machine instruction operand.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:111
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition: Analysis.h:117
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
constexpr bool isValid() const
Definition: Register.h:116
bool insert(const value_type &X)
Insert a new element into the SetVector.
Definition: SetVector.h:162
A SetVector that performs no allocations if smaller than a certain size.
Definition: SetVector.h:370
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
Definition: SmallSet.h:135
size_type count(const T &V) const
count - Return 1 if the element is in the set, 0 otherwise.
Definition: SmallSet.h:166
std::pair< const_iterator, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
Definition: SmallSet.h:179
size_t size() const
Definition: SmallVector.h:91
void push_back(const T &Elt)
Definition: SmallVector.h:426
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1209
Information about stack frame layout on the target.
virtual bool isStackIdSafeForLocalArea(unsigned StackId) const
This method returns whether or not it is safe for an object with the given stack id to be bundled int...
StackDirection getStackGrowthDirection() const
getStackGrowthDirection - Return the direction the stack grows
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
virtual const TargetFrameLowering * getFrameLowering() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ Entry
Definition: COFF.h:826
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:480
bool operator<(int64_t V1, const APSInt &V2)
Definition: APSInt.h:361
PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
void sort(IteratorTy Start, IteratorTy End)
Definition: STLExtras.h:1647
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:163
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition: Alignment.h:155
char & LocalStackSlotAllocationID
LocalStackSlotAllocation - This pass assigns local frame indices to stack slots relative to one anoth...
void initializeLocalStackSlotPassPass(PassRegistry &)
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.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39