LLVM: include/llvm/CodeGen/MachineFrameInfo.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CODEGEN_MACHINEFRAMEINFO_H
14#define LLVM_CODEGEN_MACHINEFRAMEINFO_H
15
21#include
22#include
23
24namespace llvm {
30
31
32
33
34
37 union {
40 };
41
42
43
44
45
46
47
48
49
50
51
52
53 bool Restored = true;
54
55
56 bool SpilledToReg = false;
57
58public:
60
61
68 SpilledToReg = false;
69 }
72 SpilledToReg = true;
73 }
77};
78
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
112public:
113
114
125
126private:
127
128 struct StackObject {
129
130
131 int64_t SPOffset;
132
133
134
136
137
139
140
141
142
143 bool isImmutable;
144
145
146
147 bool isSpillSlot;
148
149
150
151
152
153
154 bool isStatepointSpillSlot = false;
155
156
157
158 bool isCalleeSaved = false;
159
160
161
162
163
164
165
166
167
168
170
171
172
174
175
176
177 bool PreAllocated = false;
178
179
180
181
182
183 bool isAliased;
184
185
186 bool isZExt = false;
187
188
189 bool isSExt = false;
190
192
194 bool IsImmutable, bool IsSpillSlot, const AllocaInst *Alloca,
195 bool IsAliased, uint8_t StackID = 0)
196 : SPOffset(SPOffset), Size(Size), Alignment(Alignment),
197 isImmutable(IsImmutable), isSpillSlot(IsSpillSlot), StackID(StackID),
198 Alloca(Alloca), isAliased(IsAliased) {}
199 };
200
201
202 Align StackAlignment;
203
204
205
206
207
208
209
210
211
212
213
214
215 bool StackRealignable;
216
217
218 bool ForcedRealign;
219
220
221 std::vector Objects;
222
223
224
225
226 unsigned NumFixedObjects = 0;
227
228
229
230 bool HasVarSizedObjects = false;
231
232
233
234 bool FrameAddressTaken = false;
235
236
237
238 bool ReturnAddressTaken = false;
239
240
241
242 bool HasStackMap = false;
243
244
245
246 bool HasPatchPoint = false;
247
248
249
250
251
252 uint64_t StackSize = 0;
253
254
255
256
257
258
259
260
261
262
263 int64_t OffsetAdjustment = 0;
264
265
266
267
268
269
270
271
272 Align MaxAlignment;
273
274
275
276
277 bool AdjustsStack = false;
278
279
280 bool HasCalls = false;
281
282
283 int StackProtectorIdx = -1;
284
285
286 int FunctionContextIdx = -1;
287
288
289
290
291
292 uint64_t MaxCallFrameSize = ~UINT64_C(0);
293
294
295
296 unsigned CVBytesOfCalleeSavedRegisters = 0;
297
298
299
300
301
302 std::vector CSInfo;
303
304
305 bool CSIValid = false;
306
307
308
310
311
312 int64_t LocalFrameSize = 0;
313
314
315
316 Align LocalFrameMaxAlign;
317
318
319
320
321 bool UseLocalStackAllocationBlock = false;
322
323
324
325 bool HasOpaqueSPAdjustment = false;
326
327
328
329 bool HasCopyImplyingStackAdjustment = false;
330
331
332 bool HasVAStart = false;
333
334
335 bool HasMustTailInVarArgFunc = false;
336
337
338
339
340 bool HasTailCall = false;
341
342
344
346
347
348 uint64_t UnsafeStackSize = 0;
349
350public:
352 bool ForcedRealign)
353 : StackAlignment(StackAlignment),
354 StackRealignable(StackRealignable), ForcedRealign(ForcedRealign) {}
355
357
359
360
362
363
364
365
367
368
372
373
374
378
379
380
381
384
385
386
387
390
391
392
393
396
397
398
399
402
403
404
405
406
407
408
409
410
411
412
416
417
419
420
421 int getObjectIndexEnd() const { return (int)Objects.size()-NumFixedObjects; }
422
423
425
426
428
429
431 LocalFrameObjects.push_back(std::pair<int, int64_t>(ObjectIndex, Offset));
432 Objects[ObjectIndex + NumFixedObjects].PreAllocated = true;
433 }
434
435
437 assert (i >= 0 && (unsigned)i < LocalFrameObjects.size() &&
438 "Invalid local object reference!");
439 return LocalFrameObjects[i];
440 }
441
442
444
445
447
448
450
451
452
454 LocalFrameMaxAlign = Alignment;
455 }
456
457
459
460
461
463 return UseLocalStackAllocationBlock;
464 }
465
466
467
468
470 UseLocalStackAllocationBlock = v;
471 }
472
473
475 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
476 "Invalid Object Idx!");
477 return Objects[ObjectIdx+NumFixedObjects].PreAllocated;
478 }
479
480
482 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
483 "Invalid Object Idx!");
484 return Objects[ObjectIdx+NumFixedObjects].Size;
485 }
486
487
489 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
490 "Invalid Object Idx!");
491 Objects[ObjectIdx+NumFixedObjects].Size = Size;
492 }
493
494
496 assert(unsigned(ObjectIdx + NumFixedObjects) < Objects.size() &&
497 "Invalid Object Idx!");
498 return Objects[ObjectIdx + NumFixedObjects].Alignment;
499 }
500
501
507
512
517
518
520 assert(unsigned(ObjectIdx + NumFixedObjects) < Objects.size() &&
521 "Invalid Object Idx!");
522 Objects[ObjectIdx + NumFixedObjects].Alignment = Alignment;
523
524
528 }
529
530
531
533 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
534 "Invalid Object Idx!");
535 return Objects[ObjectIdx+NumFixedObjects].Alloca;
536 }
537
538
539
541 assert(unsigned(ObjectIdx + NumFixedObjects) < Objects.size() &&
542 "Invalid Object Idx!");
543 Objects[ObjectIdx + NumFixedObjects].Alloca = nullptr;
544 }
545
546
547
549 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
550 "Invalid Object Idx!");
552 "Getting frame offset for a dead object?");
553 return Objects[ObjectIdx+NumFixedObjects].SPOffset;
554 }
555
557 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
558 "Invalid Object Idx!");
559 return Objects[ObjectIdx+NumFixedObjects].isZExt;
560 }
561
563 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
564 "Invalid Object Idx!");
565 Objects[ObjectIdx+NumFixedObjects].isZExt = IsZExt;
566 }
567
569 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
570 "Invalid Object Idx!");
571 return Objects[ObjectIdx+NumFixedObjects].isSExt;
572 }
573
575 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
576 "Invalid Object Idx!");
577 Objects[ObjectIdx+NumFixedObjects].isSExt = IsSExt;
578 }
579
580
581
583 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
584 "Invalid Object Idx!");
586 "Setting frame offset for a dead object?");
587 Objects[ObjectIdx+NumFixedObjects].SPOffset = SPOffset;
588 }
589
591 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
592 "Invalid Object Idx!");
593 return (SSPLayoutKind)Objects[ObjectIdx+NumFixedObjects].SSPLayout;
594 }
595
597 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
598 "Invalid Object Idx!");
600 "Setting SSP layout for a dead object?");
601 Objects[ObjectIdx+NumFixedObjects].SSPLayout = Kind;
602 }
603
604
605
606
608
609
611
612
614
615
617
618
620
621
622
624
625
627
628
629
631 return ForcedRealign || MaxAlignment > StackAlignment;
632 }
633
634
635
636
639
640
641 bool hasCalls() const { return HasCalls; }
643
644
647
648
649
651 return HasCopyImplyingStackAdjustment;
652 }
654 HasCopyImplyingStackAdjustment = B;
655 }
656
657
660
661
664
665
668
669
670
671
672
673
674
675
676
679 std::vectorMachineBasicBlock::iterator *FrameSDOps = nullptr);
680
681
682
683
684
685
687
688
690 return 0;
691 return MaxCallFrameSize;
692 }
694 return MaxCallFrameSize != ~UINT64_C(0);
695 }
697
698
699
701 return CVBytesOfCalleeSavedRegisters;
702 }
704 CVBytesOfCalleeSavedRegisters = S;
705 }
706
707
708
709
710
712 bool IsImmutable, bool isAliased = false);
713
714
715
717 bool IsImmutable = false);
718
719
721 return ObjectIdx < 0 && (ObjectIdx >= -(int)NumFixedObjects);
722 }
723
724
725
727 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
728 "Invalid Object Idx!");
729 return Objects[ObjectIdx+NumFixedObjects].isAliased;
730 }
731
732
734 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
735 "Invalid Object Idx!");
736 Objects[ObjectIdx+NumFixedObjects].isAliased = IsAliased;
737 }
738
739
741
742 if (HasTailCall)
743 return false;
744 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
745 "Invalid Object Idx!");
746 return Objects[ObjectIdx+NumFixedObjects].isImmutable;
747 }
748
749
751 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
752 "Invalid Object Idx!");
753 Objects[ObjectIdx+NumFixedObjects].isImmutable = IsImmutable;
754 }
755
756
758 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
759 "Invalid Object Idx!");
760 return Objects[ObjectIdx+NumFixedObjects].isSpillSlot;
761 }
762
764 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
765 "Invalid Object Idx!");
766 return Objects[ObjectIdx+NumFixedObjects].isStatepointSpillSlot;
767 }
768
770 assert(unsigned(ObjectIdx + NumFixedObjects) < Objects.size() &&
771 "Invalid Object Idx!");
772 return Objects[ObjectIdx + NumFixedObjects].isCalleeSaved;
773 }
774
776 assert(unsigned(ObjectIdx + NumFixedObjects) < Objects.size() &&
777 "Invalid Object Idx!");
778 Objects[ObjectIdx + NumFixedObjects].isCalleeSaved = IsCalleeSaved;
779 }
780
781
783 return Objects[ObjectIdx+NumFixedObjects].StackID;
784 }
785
786
788 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
789 "Invalid Object Idx!");
790 Objects[ObjectIdx+NumFixedObjects].StackID = ID;
791
792
793 }
794
795
797 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
798 "Invalid Object Idx!");
799 return Objects[ObjectIdx+NumFixedObjects].Size == ~0ULL;
800 }
801
802
803
805 assert(unsigned(ObjectIdx + NumFixedObjects) < Objects.size() &&
806 "Invalid Object Idx!");
807 return Objects[ObjectIdx + NumFixedObjects].Size == 0;
808 }
809
811 assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
812 "Invalid Object Idx!");
813 Objects[ObjectIdx+NumFixedObjects].isStatepointSpillSlot = true;
815 }
816
817
818
820 bool isSpillSlot,
823
824
825
827
828
830
831 Objects[ObjectIdx+NumFixedObjects].Size = ~0ULL;
832 }
833
834
835
836
839
840
844
846
847
848
850 CSInfo = std::move(CSI);
851 }
852
853
855
857
859
861
863 SavePoints = std::move(NewSavePoints);
864 }
865
867 RestorePoints = std::move(NewRestorePoints);
868 }
869
872
875
876
877
878
879
880
881
882
883
885
886
887
889
890
892};
893
894}
895
896#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file defines the SmallVector class.
an instruction to allocate memory on the stack
void setFrameIdx(int FI)
Definition MachineFrameInfo.h:66
int FrameIdx
Definition MachineFrameInfo.h:38
int getFrameIdx() const
Definition MachineFrameInfo.h:63
bool isRestored() const
Definition MachineFrameInfo.h:74
CalleeSavedInfo(MCRegister R, int FI=0)
Definition MachineFrameInfo.h:59
void setRestored(bool R)
Definition MachineFrameInfo.h:75
bool isSpilledToReg() const
Definition MachineFrameInfo.h:76
void setReg(MCRegister R)
Definition MachineFrameInfo.h:65
MCRegister getReg() const
Definition MachineFrameInfo.h:62
unsigned DstReg
Definition MachineFrameInfo.h:39
MCRegister getDstReg() const
Definition MachineFrameInfo.h:64
void setDstReg(MCRegister SpillReg)
Definition MachineFrameInfo.h:70
Wrapper class representing physical registers. Should be passed by value.
constexpr unsigned id() const
bool needsSplitStackProlog() const
Return true if this function requires a split stack prolog, even if it uses no stack space.
Definition MachineFrameInfo.h:413
void setMaxCallFrameSize(uint64_t S)
Definition MachineFrameInfo.h:696
LLVM_ABI int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool IsImmutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
Definition MachineFrameInfo.h:366
void clearObjectAllocation(int ObjectIdx)
Remove the underlying Alloca of the specified stack object if it exists.
Definition MachineFrameInfo.h:540
void setObjectZExt(int ObjectIdx, bool IsZExt)
Definition MachineFrameInfo.h:562
void setIsImmutableObjectIndex(int ObjectIdx, bool IsImmutable)
Marks the immutability of an object.
Definition MachineFrameInfo.h:750
SSPLayoutKind getObjectSSPLayout(int ObjectIdx) const
Definition MachineFrameInfo.h:590
bool isObjectPreAllocated(int ObjectIdx) const
Return true if the object was pre-allocated into the local block.
Definition MachineFrameInfo.h:474
LLVM_ABI void computeMaxCallFrameSize(MachineFunction &MF, std::vector< MachineBasicBlock::iterator > *FrameSDOps=nullptr)
Computes the maximum size of a callframe.
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
Definition MachineFrameInfo.h:607
void setAdjustsStack(bool V)
Definition MachineFrameInfo.h:638
const AllocaInst * getObjectAllocation(int ObjectIdx) const
Return the underlying Alloca of the specified stack object if it exists.
Definition MachineFrameInfo.h:532
bool adjustsStack() const
Return true if this function adjusts the stack – e.g., when calling another function.
Definition MachineFrameInfo.h:637
LLVM_ABI int CreateStackObject(uint64_t Size, Align Alignment, bool isSpillSlot, const AllocaInst *Alloca=nullptr, uint8_t ID=0)
Create a new statically sized stack object, returning a nonnegative identifier to represent it.
LLVM_ABI void ensureMaxAlignment(Align Alignment)
Make sure the function is at least Align bytes aligned.
bool isReturnAddressTaken() const
This method may be called any time after instruction selection is complete to determine if there is a...
Definition MachineFrameInfo.h:388
MachineFrameInfo(Align StackAlignment, bool StackRealignable, bool ForcedRealign)
Definition MachineFrameInfo.h:351
int64_t getLocalFrameObjectCount() const
Return the number of objects allocated into the local object block.
Definition MachineFrameInfo.h:443
void setHasPatchPoint(bool s=true)
Definition MachineFrameInfo.h:401
bool hasCalls() const
Return true if the current function has any function calls.
Definition MachineFrameInfo.h:641
bool isFrameAddressTaken() const
This method may be called any time after instruction selection is complete to determine if there is a...
Definition MachineFrameInfo.h:382
std::vector< CalleeSavedInfo > & getCalleeSavedInfo()
Definition MachineFrameInfo.h:845
bool isScalableStackID(uint8_t StackID) const
Definition MachineFrameInfo.h:513
void setUseLocalStackAllocationBlock(bool v)
setUseLocalStackAllocationBlock - Set whether the local allocation blob should be allocated together ...
Definition MachineFrameInfo.h:469
Align getMaxAlign() const
Return the alignment in bytes that this function must be aligned to, which is greater than the defaul...
Definition MachineFrameInfo.h:623
Align getLocalFrameMaxAlign() const
Return the required alignment of the local object blob.
Definition MachineFrameInfo.h:458
void setLocalFrameSize(int64_t sz)
Set the size of the local object blob.
Definition MachineFrameInfo.h:446
void setObjectOffset(int ObjectIdx, int64_t SPOffset)
Set the stack frame offset of the specified object.
Definition MachineFrameInfo.h:582
SSPLayoutKind
Stack Smashing Protection (SSP) rules require that vulnerable stack allocations are located close the...
Definition MachineFrameInfo.h:115
@ SSPLK_SmallArray
Array or nested array < SSP-buffer-size.
Definition MachineFrameInfo.h:120
@ SSPLK_LargeArray
Array or nested array >= SSP-buffer-size.
Definition MachineFrameInfo.h:118
@ SSPLK_AddrOf
The address of this allocation is exposed and triggered protection.
Definition MachineFrameInfo.h:122
@ SSPLK_None
Did not trigger a stack protector.
Definition MachineFrameInfo.h:116
bool isCalleeSavedObjectIndex(int ObjectIdx) const
Definition MachineFrameInfo.h:769
void clearRestorePoints()
Definition MachineFrameInfo.h:871
void markAsStatepointSpillSlotObjectIndex(int ObjectIdx)
Definition MachineFrameInfo.h:810
std::pair< int, int64_t > getLocalFrameObjectMap(int i) const
Get the local offset mapping for a for an object.
Definition MachineFrameInfo.h:436
bool contributesToMaxAlignment(uint8_t StackID)
Should this stack ID be considered in MaxAlignment.
Definition MachineFrameInfo.h:502
void setFrameAddressIsTaken(bool T)
Definition MachineFrameInfo.h:383
uint64_t getMaxCallFrameSize() const
Return the maximum size of a call frame that must be allocated for an outgoing function call.
Definition MachineFrameInfo.h:686
bool shouldRealignStack() const
Return true if stack realignment is forced by function attributes or if the stack alignment.
Definition MachineFrameInfo.h:630
bool hasPatchPoint() const
This method may be called any time after instruction selection is complete to determine if there is a...
Definition MachineFrameInfo.h:400
void setHasStackMap(bool s=true)
Definition MachineFrameInfo.h:395
bool hasOpaqueSPAdjustment() const
Returns true if the function contains opaque dynamic stack adjustments.
Definition MachineFrameInfo.h:645
void setSavePoints(SaveRestorePoints NewSavePoints)
Definition MachineFrameInfo.h:862
bool hasScalableStackID(int ObjectIdx) const
Definition MachineFrameInfo.h:508
void clearSavePoints()
Definition MachineFrameInfo.h:870
void setObjectSExt(int ObjectIdx, bool IsSExt)
Definition MachineFrameInfo.h:574
void setObjectSSPLayout(int ObjectIdx, SSPLayoutKind Kind)
Definition MachineFrameInfo.h:596
bool getUseLocalStackAllocationBlock() const
Get whether the local allocation blob should be allocated together or let PEI allocate the locals in ...
Definition MachineFrameInfo.h:462
void setHasCalls(bool V)
Definition MachineFrameInfo.h:642
void setLocalFrameMaxAlign(Align Alignment)
Required alignment of the local object blob, which is the strictest alignment of any object in it.
Definition MachineFrameInfo.h:453
bool isImmutableObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to an immutable object.
Definition MachineFrameInfo.h:740
void setCVBytesOfCalleeSavedRegisters(unsigned S)
Definition MachineFrameInfo.h:703
int getStackProtectorIndex() const
Return the index for the stack protector object.
Definition MachineFrameInfo.h:369
int64_t getOffsetAdjustment() const
Return the correction for frame offsets.
Definition MachineFrameInfo.h:616
LLVM_ABI int CreateSpillStackObject(uint64_t Size, Align Alignment)
Create a new statically sized stack object that represents a spill slot, returning a nonnegative iden...
void setObjectSize(int ObjectIdx, int64_t Size)
Change the size of the specified stack object.
Definition MachineFrameInfo.h:488
LLVM_ABI uint64_t estimateStackSize(const MachineFunction &MF) const
Estimate and return the size of the stack frame.
void setStackID(int ObjectIdx, uint8_t ID)
Definition MachineFrameInfo.h:787
void setHasTailCall(bool V=true)
Definition MachineFrameInfo.h:667
bool hasTailCall() const
Returns true if the function contains a tail call.
Definition MachineFrameInfo.h:666
bool hasMustTailInVarArgFunc() const
Returns true if the function is variadic and contains a musttail call.
Definition MachineFrameInfo.h:662
void setStackProtectorIndex(int I)
Definition MachineFrameInfo.h:370
void setIsAliasedObjectIndex(int ObjectIdx, bool IsAliased)
Set "maybe pointed to by an LLVM IR value" for an object.
Definition MachineFrameInfo.h:733
void setCalleeSavedInfoValid(bool v)
Definition MachineFrameInfo.h:856
bool isStatepointSpillSlotObjectIndex(int ObjectIdx) const
Definition MachineFrameInfo.h:763
bool isCalleeSavedInfoValid() const
Has the callee saved info been calculated yet?
Definition MachineFrameInfo.h:854
void setReturnAddressIsTaken(bool s)
Definition MachineFrameInfo.h:389
Align getObjectAlign(int ObjectIdx) const
Return the alignment of the specified stack object.
Definition MachineFrameInfo.h:495
bool isObjectZExt(int ObjectIdx) const
Definition MachineFrameInfo.h:556
void mapLocalFrameObject(int ObjectIndex, int64_t Offset)
Map a frame index into the local object block.
Definition MachineFrameInfo.h:430
bool isSpillSlotObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a spill slot.
Definition MachineFrameInfo.h:757
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
Definition MachineFrameInfo.h:481
bool isMaxCallFrameSizeComputed() const
Definition MachineFrameInfo.h:693
void setHasOpaqueSPAdjustment(bool B)
Definition MachineFrameInfo.h:646
int64_t getLocalFrameSize() const
Get the size of the local object blob.
Definition MachineFrameInfo.h:449
bool isObjectSExt(int ObjectIdx) const
Definition MachineFrameInfo.h:568
LLVM_ABI BitVector getPristineRegs(const MachineFunction &MF) const
Return a set of physical registers that are pristine.
bool hasStackMap() const
This method may be called any time after instruction selection is complete to determine if there is a...
Definition MachineFrameInfo.h:394
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
Definition MachineFrameInfo.h:841
void RemoveStackObject(int ObjectIdx)
Remove or mark dead a statically sized stack object.
Definition MachineFrameInfo.h:829
void setCalleeSavedInfo(std::vector< CalleeSavedInfo > CSI)
Used by prolog/epilog inserter to set the function's callee saved information.
Definition MachineFrameInfo.h:849
void setHasCopyImplyingStackAdjustment(bool B)
Definition MachineFrameInfo.h:653
LLVM_ABI void print(const MachineFunction &MF, raw_ostream &OS) const
Used by the MachineFunction printer to print information about stack objects.
unsigned getNumObjects() const
Return the number of objects.
Definition MachineFrameInfo.h:427
bool hasVAStart() const
Returns true if the function calls the llvm.va_start intrinsic.
Definition MachineFrameInfo.h:658
unsigned getCVBytesOfCalleeSavedRegisters() const
Returns how many bytes of callee-saved registers the target pushed in the prologue.
Definition MachineFrameInfo.h:700
bool isVariableSizedObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a variable sized object.
Definition MachineFrameInfo.h:804
LLVM_ABI int CreateVariableSizedObject(Align Alignment, const AllocaInst *Alloca)
Notify the MachineFrameInfo object that a variable sized object has been created.
uint64_t getUnsafeStackSize() const
Definition MachineFrameInfo.h:873
LLVM_ABI void dump(const MachineFunction &MF) const
dump - Print the function to stderr.
int getObjectIndexEnd() const
Return one past the maximum frame object index.
Definition MachineFrameInfo.h:421
bool hasStackProtectorIndex() const
Definition MachineFrameInfo.h:371
void setRestorePoints(SaveRestorePoints NewRestorePoints)
Definition MachineFrameInfo.h:866
bool hasCopyImplyingStackAdjustment() const
Returns true if the function contains operations which will lower down to instructions which manipula...
Definition MachineFrameInfo.h:650
bool hasStackObjects() const
Return true if there are any stack objects in this function.
Definition MachineFrameInfo.h:361
LLVM_ABI int CreateFixedSpillStackObject(uint64_t Size, int64_t SPOffset, bool IsImmutable=false)
Create a spill slot at a fixed location on the stack.
MachineFrameInfo(const MachineFrameInfo &)=delete
bool isStackRealignable() const
Definition MachineFrameInfo.h:358
uint8_t getStackID(int ObjectIdx) const
Definition MachineFrameInfo.h:782
const SaveRestorePoints & getRestorePoints() const
Definition MachineFrameInfo.h:858
unsigned getNumFixedObjects() const
Return the number of fixed objects.
Definition MachineFrameInfo.h:424
void setIsCalleeSavedObjectIndex(int ObjectIdx, bool IsCalleeSaved)
Definition MachineFrameInfo.h:775
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
Definition MachineFrameInfo.h:548
bool hasFunctionContextIndex() const
Definition MachineFrameInfo.h:377
void setStackSize(uint64_t Size)
Set the size of the stack.
Definition MachineFrameInfo.h:610
void setHasVAStart(bool B)
Definition MachineFrameInfo.h:659
bool isFixedObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a fixed stack object.
Definition MachineFrameInfo.h:720
int getObjectIndexBegin() const
Return the minimum frame object index.
Definition MachineFrameInfo.h:418
const SaveRestorePoints & getSavePoints() const
Definition MachineFrameInfo.h:860
void setUnsafeStackSize(uint64_t Size)
Definition MachineFrameInfo.h:874
void setHasMustTailInVarArgFunc(bool B)
Definition MachineFrameInfo.h:663
void setObjectAlignment(int ObjectIdx, Align Alignment)
setObjectAlignment - Change the alignment of the specified stack object.
Definition MachineFrameInfo.h:519
bool isDeadObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a dead object.
Definition MachineFrameInfo.h:796
void setOffsetAdjustment(int64_t Adj)
Set the correction for frame offsets.
Definition MachineFrameInfo.h:619
int getFunctionContextIndex() const
Return the index for the function context object.
Definition MachineFrameInfo.h:375
bool isAliasedObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to an object that might be pointed to by an LLVM IR v...
Definition MachineFrameInfo.h:726
void setFunctionContextIndex(int I)
Definition MachineFrameInfo.h:376
This class implements an extremely fast bulk output stream that can only output to a stream.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ ScalablePredicateVector
This is an optimization pass for GlobalISel generic memory operations.
DenseMap< MachineBasicBlock *, std::vector< CalleeSavedInfo > > SaveRestorePoints
Definition MachineFrameInfo.h:79
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
This struct is a compact representation of a valid (non-zero power of two) alignment.