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