LLVM: include/llvm/CodeGen/MachineFunction.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
18#define LLVM_CODEGEN_MACHINEFUNCTION_H
19
36#include
37#include
38#include
39#include
40#include
41#include
42#include
43
44namespace llvm {
45
48class DataLayout;
50struct DenormalMode;
51class DIExpression;
52class DILocalVariable;
53class DILocation;
55class GISelChangeObserver;
56class GlobalValue;
57class TargetMachine;
58class MachineConstantPool;
59class MachineFrameInfo;
60class MachineFunction;
61class MachineJumpTableInfo;
62class MachineRegisterInfo;
63class MCContext;
64class MCInstrDesc;
66class MCSection;
68class PseudoSourceValueManager;
69class raw_ostream;
70class SlotIndexes;
71class StringRef;
72class TargetRegisterClass;
73class TargetSubtargetInfo;
74struct WasmEHFuncInfo;
75struct WinEHFuncInfo;
76
79};
80
84
85 template
87 assert(this == &OldList && "never transfer MBBs between functions");
88 }
89};
90
91
92
93
98};
99
100
101
102
103
106
107
108
109
110
111 template <typename FuncInfoTy, typename SubtargetTy = TargetSubtargetInfo>
113 const SubtargetTy *STI) {
114 return new (Allocator.Allocate()) FuncInfoTy(F, STI);
115 }
116
117 template
119 return new (Allocator.Allocate()) Ty(MFI);
120 }
121
122
123
124
125
129 const {
130 return nullptr;
131 }
132};
133
134
135
136
138
139
140
141
142
143public:
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
201 };
202
204 return Properties[static_cast<unsigned>(P)];
205 }
206
208 Properties.set(static_cast<unsigned>(P));
209 return *this;
210 }
211
213 Properties.reset(static_cast<unsigned>(P));
214 return *this;
215 }
216
217
219 Properties.reset();
220 return *this;
221 }
222
224 Properties |= MFP.Properties;
225 return *this;
226 }
227
229 Properties &= ~MFP.Properties;
230 return *this;
231 }
232
233
234
236 return (Properties | ~V.Properties).all();
237 }
238
239
241
242private:
244};
245
247
249
250
252};
253
254
262
265};
266
272
273
275
276
277
279
280
282
283
285
286
288
289
291
292
293
294
296
297
298
300
301
302
303
304 std::vector<MachineBasicBlock*> MBBNumbering;
305
306
307
308 unsigned MBBNumberingEpoch = 0;
309
310
312
313
315
316
318
319
321
322
325
326
327
328
329 unsigned FunctionNumber;
330
331
333
334
335
336
337
338
339 bool ExposesReturnsTwice = false;
340
341
342 bool HasInlineAsm = false;
343
344
345 bool HasWinCFI = false;
346
347
348
350
351
352 std::unique_ptr PSVManager;
353
354
355
356 std::vector FrameInstructions;
357
358
359
360 std::vector<MCSymbol *> LongjmpTargets;
361
362
363
364 std::vector<MCSymbol *> CatchretTargets;
365
366
367
368
369
370 std::vector LandingPads;
371
372
374
375
377
378
380
381
382 std::vector<std::pair<MCSymbol *, MDNode *>> CodeViewAnnotations;
383
384 bool CallsEHReturn = false;
385 bool CallsUnwindInit = false;
386 bool HasEHCatchret = false;
387 bool HasEHScopes = false;
388 bool HasEHFunclets = false;
389 bool HasFakeUses = false;
390 bool IsOutlined = false;
391
392
393 unsigned NextBBID = 0;
394
395
397
398
399 std::vector<const GlobalValue *> TypeInfos;
400
401
402 std::vector FilterIds;
403
404
405 std::vector FilterEnds;
406
407 EHPersonality PersonalityTypeCache = EHPersonality::Unknown;
408
409
410
411
412
413
414
415
416 void clear();
417
418
419
420 void init();
421
422public:
423
424
425
426
428 std::variant<int, MCRegister> Address;
429
430 public:
434
437 : Address(Slot), Var(Var), Expr(Expr), Loc(Loc) {}
438
441 : Address(EntryValReg), Var(Var), Expr(Expr), Loc(Loc) {}
442
443
445
446
448 return std::holds_alternative(Address);
449 }
450
451
452
454
455
456
458 return std::get(Address);
459 }
460
461
462
464 assert(inStackSlot());
466 }
467 };
468
470 virtual void anchor();
471
472 public:
474
476
478
479
481 }
482 };
483
484
485
486
487
492 assert(Arg < (1 << 16) && "Arg out of range");
493 }
494 };
495
497
499 };
500
504 };
505
506private:
507 Delegate *TheDelegate = nullptr;
509
511
513
514
515
517
519
520
522
523
527
528public:
529
531
534
535
536
537
538 unsigned DebugInstrNumberingCount = 0;
539
540
541
542 void setDebugInstrNumberingCount(unsigned Num);
543
544
546
547
548
549
550
551
552
553
554
555
557 public:
561
564 : Src(Src), Dest(Dest), Subreg(Subreg) {}
565
566
567
569 return Src < Other.Src;
570 }
571 };
572
573
574
575
576
578
579
580
581
582
583
585 public:
591 };
592
593
594
596
597
598
599 bool UseDebugInstrRef = false;
600
601
602
604 unsigned SubReg = 0);
605
606
607
608
609
610
611
612
613
615 unsigned MaxOperand = UINT_MAX);
616
617
618
619
620
621
622
623
624
625
626
627
631
633
634
635
636
637
638
639 void finalizeDebugInstrRefs();
640
641
642
643 bool shouldUseDebugInstrRef() const;
644
645
646
647 bool useDebugInstrRef() const;
648
649
650 void setUseDebugInstrRef(bool UseInstrRef);
651
652
653
655
658 unsigned FunctionNum);
662
663
665 clear();
666 init();
667 }
668
669
671 assert(TheDelegate == delegate &&
672 "Only the current delegate can perform reset!");
673 TheDelegate = nullptr;
674 }
675
676
677
679 assert(delegate && !TheDelegate &&
680 "Attempted to set delegate to null, or to change it without "
681 "first resetting it!");
682
683 TheDelegate = delegate;
684 }
685
687
689
691
692
694
695
697
699
700
701 const DataLayout &getDataLayout() const;
702
703
705
706
708
709
711
712
714
715
717 return (BBSectionsType == BasicBlockSection::All ||
718 BBSectionsType == BasicBlockSection::List ||
719 BBSectionsType == BasicBlockSection::Preset);
720 }
721
723
724
725
726 void assignBeginEndSections();
727
728
730
731
732
734
735
736
737
739 return *static_cast<const STC *>(STI);
740 }
741
742
745
746
747
748
751
752
753
754
755
758
759
760
762
763
764
767
768
769
770
773
774
775
776
779
780
782
783
785
786
788 if (Alignment < A)
789 Alignment = A;
790 }
791
792
793
794
796 return ExposesReturnsTwice;
797 }
798
799
800
802 ExposesReturnsTwice = B;
803 }
804
805
807 return HasInlineAsm;
808 }
809
810
812 HasInlineAsm = B;
813 }
814
816 return HasWinCFI;
817 }
819
820
821 bool needsFrameMoves() const;
822
823
826
827
828
829
830 template
832 return static_cast<Ty*>(MFInfo);
833 }
834
835 template
837 return static_cast<const Ty *>(MFInfo);
838 }
839
840 template Ty *cloneInfo(const Ty &Old) {
842 MFInfo = Ty::template create(Allocator, Old);
843 return static_cast<Ty *>(MFInfo);
844 }
845
846
848
852 assert(!MFInfo && "new function already has MachineFunctionInfo");
853 if (!OrigMF.MFInfo)
854 return nullptr;
855 return OrigMF.MFInfo->clone(Allocator, *this, Src2DstMBB);
856 }
857
858
859
861
862
863
864
865
867 assert(N < MBBNumbering.size() && "Illegal block number");
868 assert(MBBNumbering[N] && "Block was removed from the machine function!");
869 return MBBNumbering[N];
870 }
871
872
873 bool shouldSplitStack() const;
874
875
876 unsigned getNumBlockIDs() const { return (unsigned)MBBNumbering.size(); }
877
878
879
880
882
883
884
885
886
887
889
890
891
893
894
895
897
898
899
900
901
902
904
905
906
907
908
909
910 void viewCFGOnly() const;
911
912
913 void dump() const;
914
915
916
917
918 bool verify(Pass *p = nullptr, const char *Banner = nullptr,
919 raw_ostream *OS = nullptr, bool AbortOnError = true) const;
920
921
922
923
925 const char *Banner = nullptr, raw_ostream *OS = nullptr,
926 bool AbortOnError = true) const;
927
928
933
934
937 return &MachineFunction::BasicBlocks;
938 }
939
940
941
943
944
945
946
951
956
957 unsigned size() const { return (unsigned)BasicBlocks.size();}
958 bool empty() const { return BasicBlocks.empty(); }
963
968 }
970 BasicBlocks.splice(InsertPt, BasicBlocks, MBBI);
971 }
973 BasicBlocks.splice(InsertPt, BasicBlocks, MBB);
974 }
976 BasicBlocks.splice(InsertPt, BasicBlocks, MBBI, MBBE);
977 }
978
983
984 template
986 BasicBlocks.sort(comp);
987 }
988
989
995 }
996
997
998
999
1000
1001
1003 MBBNumbering.push_back(MBB);
1004 return (unsigned)MBBNumbering.size()-1;
1005 }
1006
1007
1008
1009
1011 assert(N < MBBNumbering.size() && "Illegal basic block #");
1012 MBBNumbering[N] = nullptr;
1013 }
1014
1015
1016
1018 bool NoImplicit = false);
1019
1020
1021
1022
1023
1024
1025
1026
1028
1029
1030
1031
1032
1033
1038
1039
1041
1042
1043
1044
1046 CreateMachineBasicBlock(const BasicBlock *BB = nullptr,
1047 std::optional BBID = std::nullopt);
1048
1049
1051
1052
1053
1054
1059 AtomicOrdering Ordering = AtomicOrdering::NotAtomic,
1060 AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic);
1065 AtomicOrdering Ordering = AtomicOrdering::NotAtomic,
1066 AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic);
1071 AtomicOrdering Ordering = AtomicOrdering::NotAtomic,
1072 AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic) {
1074 BaseAlignment, AAInfo, Ranges, SSID, Ordering,
1075 FailureOrdering);
1076 }
1077
1078
1079
1080
1081
1088 .hasValue() ? LLT()
1089 : Size.isScalable()
1090 ? LLT::scalable_vector(1, 8 * Size.getValue().getKnownMinValue())
1091 : LLT::scalar(8 * Size.getValue().getKnownMinValue()));
1092 }
1096 }
1097
1098
1099
1100
1101
1107 LLT Ty);
1112 }
1113
1114
1115
1116
1119
1120
1121
1122
1125
1127
1128
1129
1132 }
1133
1134
1135
1136
1138 OperandRecycler.deallocate(Cap, Array);
1139 }
1140
1141
1142 uint32_t *allocateRegMask();
1143
1145
1146
1147
1148
1149
1150 MachineInstr::ExtraInfo *createMIExtraInfo(
1152 MCSymbol *PostInstrSymbol = nullptr, MDNode *HeapAllocMarker = nullptr,
1154 MDNode *MMRAs = nullptr);
1155
1156
1157 const char *createExternalSymbolName(StringRef Name);
1158
1159
1160
1161
1162
1163
1164
1166 bool isLinkerPrivate = false) const;
1167
1168
1169
1170 MCSymbol *getPICBaseSymbol() const;
1171
1172
1173
1174
1176 return FrameInstructions;
1177 }
1178
1179 [[nodiscard]] unsigned addFrameInst(const MCCFIInstruction &Inst);
1180
1181
1182
1183
1185 return LongjmpTargets;
1186 }
1187
1188
1189
1191
1192
1193
1195 return CatchretTargets;
1196 }
1197
1198
1199
1201 CatchretTargets.push_back(Target);
1202 }
1203
1204
1205
1207 return CalledGlobalsInfo.lookup(MI);
1208 }
1209
1210
1212 assert(MI && "MI must not be null");
1213 assert(Details.Callee && "Global must not be null");
1214 CalledGlobalsInfo.insert({MI, Details});
1215 }
1216
1217
1220 }
1221
1222
1223
1224
1227
1230
1233
1236
1239
1242
1245
1246
1248
1249
1251 return LandingPads;
1252 }
1253
1254
1255
1258
1259
1260
1261
1263
1264
1265 unsigned getTypeIDFor(const GlobalValue *TI);
1266
1267
1269
1270
1272
1273
1275 return !WasmLPadToIndexMap.empty();
1276 }
1277
1278
1280 WasmLPadToIndexMap[LPad] = Index;
1281 }
1282
1283
1285 return WasmLPadToIndexMap.count(LPad);
1286 }
1287
1288
1290 assert(hasWasmLandingPadIndex(LPad));
1291 return WasmLPadToIndexMap.lookup(LPad);
1292 }
1293
1295 return !LPadToCallSiteMap.empty();
1296 }
1297
1298
1300 assert(hasCallSiteLandingPad(Sym) &&
1301 "missing call site number for landing pad!");
1302 return LPadToCallSiteMap[Sym];
1303 }
1304
1305
1307 return !LPadToCallSiteMap[Sym].empty();
1308 }
1309
1311 return !CallSiteMap.empty();
1312 }
1313
1314
1316 CallSiteMap[BeginLabel] = Site;
1317 }
1318
1319
1321 assert(hasCallSiteBeginLabel(BeginLabel) &&
1322 "Missing call site number for EH_LABEL!");
1323 return CallSiteMap.lookup(BeginLabel);
1324 }
1325
1326
1328 return CallSiteMap.count(BeginLabel);
1329 }
1330
1331
1333 CodeViewAnnotations.push_back({Label, MD});
1334 }
1335
1337 return CodeViewAnnotations;
1338 }
1339
1340
1341 const std::vector<const GlobalValue *> &getTypeInfos() const {
1342 return TypeInfos;
1343 }
1344
1345
1346
1348 return FilterIds;
1349 }
1350
1351
1352
1353
1354
1357 VariableDbgInfos.emplace_back(Var, Expr, Slot, Loc);
1358 }
1359
1360
1361
1365 }
1366
1369 return VariableDbgInfos;
1370 }
1371
1372
1373
1375 return make_filter_range(getVariableDbgInfo(), [](auto &VarInfo) {
1376 return VarInfo.inStackSlot();
1377 });
1378 }
1379
1380
1381
1383 return make_filter_range(getVariableDbgInfo(), [](const auto &VarInfo) {
1384 return VarInfo.inStackSlot();
1385 });
1386 }
1387
1388
1389
1391 return make_filter_range(getVariableDbgInfo(), [](const auto &VarInfo) {
1392 return VarInfo.inEntryValueRegister();
1393 });
1394 }
1395
1396
1399 bool Inserted =
1401 (void)Inserted;
1402 assert(Inserted && "Call site info not unique");
1403 }
1404
1406 return CallSitesInfo;
1407 }
1408
1409
1410
1411
1412
1413
1414 void eraseAdditionalCallInfo(const MachineInstr *MI);
1415
1416
1417
1419
1420
1421
1422
1424
1426 return ++DebugInstrNumberingCount;
1427 }
1428};
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1442
1443
1445
1448 }
1449
1452 }
1453
1455
1457 return F->getNumBlockIDs();
1458 }
1460 return F->getBlockNumberEpoch();
1461 }
1462};
1466
1467
1469
1472 }
1473
1476 }
1477
1479 return F->size();
1480 }
1481
1483 return F->getNumBlockIDs();
1484 }
1486 return F->getBlockNumberEpoch();
1487 }
1488};
1489
1490
1491
1492
1493
1494
1498 return &G.Graph->front();
1499 }
1500
1502 return F->getNumBlockIDs();
1503 }
1505 return F->getBlockNumberEpoch();
1506 }
1507};
1511 return &G.Graph->front();
1512 }
1513
1515 return F->getNumBlockIDs();
1516 }
1518 return F->getBlockNumberEpoch();
1519 }
1520};
1521
1523 const MachineFunction &MF);
1524
1525}
1526
1527#endif
aarch64 AArch64 CCMP Pass
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
This file defines the BumpPtrAllocator interface.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
Atomic ordering constants.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static void viewCFG(Function &F, const BlockFrequencyInfo *BFI, const BranchProbabilityInfo *BPI, uint64_t MaxFreq, bool CFGOnly=false)
static unsigned InstrCount
This file defines the DenseMap class.
std::optional< std::vector< StOtherPiece > > Other
This file defines the little GraphTraits template class that should be specialized by classes that...
static uint64_t estimateFunctionSizeInBytes(const LoongArchInstrInfo *TII, const MachineFunction &MF)
static unsigned addLiveIn(MachineFunction &MF, unsigned PReg, const TargetRegisterClass *RC)
static StringRef getName(Value *V)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
static MachineMemOperand * getMachineMemOperand(MachineFunction &MF, FrameIndexSDNode &FI)
The size of an allocated array is represented by a Capacity instance.
Recycle small arrays allocated from a BumpPtrAllocator.
T * allocate(Capacity Cap, AllocatorType &Allocator)
Allocate an array of at least the requested capacity.
void deallocate(Capacity Cap, T *Ptr)
Deallocate an array with the specified Capacity.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
LLVM Basic Block Representation.
The address of a basic block.
Allocate memory in an ever growing pool, as if by bump-pointer.
A parsed version of the target data layout string in and methods for querying it.
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&...Args)
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Abstract class that contains various methods for clients to notify about changes.
Context object for machine code objects.
Describe properties that are true of each instruction in the target description file.
Wrapper class representing physical registers. Should be passed by value.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Properties which a MachineFunction may have at a given point in time.
MachineFunctionProperties & reset()
Reset all the properties.
MachineFunctionProperties & set(const MachineFunctionProperties &MFP)
void print(raw_ostream &OS) const
Print the MachineFunctionProperties in human-readable form.
bool verifyRequiredProperties(const MachineFunctionProperties &V) const
MachineFunctionProperties & reset(const MachineFunctionProperties &MFP)
MachineFunctionProperties & set(Property P)
bool hasProperty(Property P) const
MachineFunctionProperties & reset(Property P)
Location of a PHI instruction that is also a debug-info variable value, for the duration of register ...
DebugPHIRegallocPos(MachineBasicBlock *MBB, Register Reg, unsigned SubReg)
Register Reg
VReg where the control-flow-merge happens.
unsigned SubReg
Optional subreg qualifier within Reg.
MachineBasicBlock * MBB
Block where this PHI was originally located.
Replacement definition for a debug instruction reference.
bool operator<(const DebugSubstitution &Other) const
Order only by source instruction / operand pair: there should never be duplicate entries for the same...
DebugInstrOperandPair Dest
Replacement instruction / operand pair.
DebugInstrOperandPair Src
Source instruction / operand pair.
DebugSubstitution(const DebugInstrOperandPair &Src, const DebugInstrOperandPair &Dest, unsigned Subreg)
unsigned Subreg
Qualifier for which part of Dest is read.
virtual void MF_HandleChangeDesc(MachineInstr &MI, const MCInstrDesc &TID)
Callback before changing MCInstrDesc.
virtual void MF_HandleRemoval(MachineInstr &MI)=0
Callback before a removal. This should not modify the MI directly.
virtual void MF_HandleInsertion(MachineInstr &MI)=0
Callback after an insertion. This should not modify the MI directly.
virtual ~Delegate()=default
Description of the location of a variable whose Address is valid and unchanging during function execu...
bool inStackSlot() const
Return true if this variable is in a stack slot.
void updateStackSlot(int NewSlot)
Updates the stack slot of this variable, assuming inStackSlot() is true.
MCRegister getEntryValueRegister() const
Returns the MCRegister of this variable, assuming inEntryValueRegister() is true.
bool inEntryValueRegister() const
Return true if this variable is in the entry value of a register.
const DILocalVariable * Var
VariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, int Slot, const DILocation *Loc)
int getStackSlot() const
Returns the stack slot of this variable, assuming inStackSlot() is true.
const DIExpression * Expr
VariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, MCRegister EntryValReg, const DILocation *Loc)
unsigned getInstructionCount() const
Return the number of MachineInstrs in this MachineFunction.
auto getEntryValueVariableDbgInfo() const
Returns the collection of variables for which we have debug info and that have been assigned an entry...
void setBBSectionsType(BasicBlockSection V)
MachineJumpTableInfo * getJumpTableInfo()
const WinEHFuncInfo * getWinEHFuncInfo() const
getWinEHFuncInfo - Return information about how the current function uses Windows exception handling.
void setCallsUnwindInit(bool b)
unsigned addToMBBNumbering(MachineBasicBlock *MBB)
Adds the MBB to the internal numbering.
void addLongjmpTarget(MCSymbol *Target)
Add the specified symbol to the list of valid longjmp targets for Windows Control Flow Guard.
const MachineConstantPool * getConstantPool() const
const MachineFrameInfo & getFrameInfo() const
void setHasEHFunclets(bool V)
std::pair< unsigned, unsigned > DebugInstrOperandPair
Pair of instruction number and operand number.
ArrayRecycler< MachineOperand >::Capacity OperandCapacity
void setExposesReturnsTwice(bool B)
setCallsSetJmp - Set a flag that indicates if there's a call to a "returns twice" function.
void removeFromMBBNumbering(unsigned N)
removeFromMBBNumbering - Remove the specific machine basic block from our tracker,...
SmallVector< DebugSubstitution, 8 > DebugValueSubstitutions
Debug value substitutions: a collection of DebugSubstitution objects, recording changes in where a va...
unsigned getFunctionNumber() const
getFunctionNumber - Return a unique ID for the current function.
void setHasInlineAsm(bool B)
Set a flag that indicates that the function contains inline assembly.
bool hasAnyCallSiteLabel() const
CalledGlobalInfo tryGetCalledGlobal(const MachineInstr *MI) const
Tries to get the global and target flags for a call site, if the instruction is a call to a global.
PseudoSourceValueManager & getPSVManager() const
void setCallSiteBeginLabel(MCSymbol *BeginLabel, unsigned Site)
Map the begin label for a call site.
void setHasWinCFI(bool v)
void setWasmLandingPadIndex(const MachineBasicBlock *LPad, unsigned Index)
Map the landing pad to its index. Used for Wasm exception handling.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const std::vector< MCCFIInstruction > & getFrameInstructions() const
Returns a reference to a list of cfi instructions in the function's prologue.
unsigned getNewDebugInstrNum()
void setHasEHCatchret(bool V)
MachineFunction & operator=(const MachineFunction &)=delete
bool hasInlineAsm() const
Returns true if the function contains any inline assembly.
void setCallsEHReturn(bool b)
bool hasEHCatchret() const
BasicBlockListType::reverse_iterator reverse_iterator
void setAlignment(Align A)
setAlignment - Set the alignment of the function.
WinEHFuncInfo * getWinEHFuncInfo()
bool exposesReturnsTwice() const
exposesReturnsTwice - Returns true if the function calls setjmp or any other similar functions with a...
MachineFunctionProperties & getProperties()
GISelChangeObserver * getObserver() const
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
void deallocateOperandArray(OperandCapacity Cap, MachineOperand *Array)
Dellocate an array of MachineOperands and recycle the memory.
void setSection(MCSection *S)
Indicates the Section this function belongs to.
bool callsUnwindInit() const
MachineMemOperand * getMachineMemOperand(const MachineMemOperand *MMO, int64_t Offset, uint64_t Size)
void push_front(MachineBasicBlock *MBB)
const std::vector< unsigned > & getFilterIds() const
Return a reference to the typeids encoding filters used in the current function.
const std::vector< const GlobalValue * > & getTypeInfos() const
Return a reference to the C++ typeinfo for the current function.
auto getInStackSlotVariableDbgInfo() const
Returns the collection of variables for which we have debug info and that have been assigned a stack ...
bool hasAnyWasmLandingPadIndex() const
Return if there is any wasm exception handling.
const CallSiteInfoMap & getCallSitesInfo() const
void ensureAlignment(Align A)
ensureAlignment - Make sure the function is at least A bytes aligned.
void push_back(MachineBasicBlock *MBB)
reverse_iterator rbegin()
void setHasFakeUses(bool V)
bool hasBBSections() const
Returns true if this function has basic block sections enabled.
MCContext & getContext() const
bool callsEHReturn() const
void setVariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, MCRegister Reg, const DILocation *Loc)
Collect information used to emit debugging information of a variable in the entry value of a register...
const Function & getFunction() const
Return the LLVM function that this machine code represents.
MachineOperand * allocateOperandArray(OperandCapacity Cap)
Allocate an array of MachineOperands.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
MachineBasicBlock * getBlockNumbered(unsigned N) const
getBlockNumbered - MachineBasicBlocks are automatically numbered when they are inserted into the mach...
auto getInStackSlotVariableDbgInfo()
Returns the collection of variables for which we have debug info and that have been assigned a stack ...
Align getAlignment() const
getAlignment - Return the alignment of the function.
void splice(iterator InsertPt, iterator MBBI, iterator MBBE)
void addCatchretTarget(MCSymbol *Target)
Add the specified symbol to the list of valid catchret targets for Windows EHCont Guard.
unsigned getWasmLandingPadIndex(const MachineBasicBlock *LPad) const
Get the index in wasm EH for a given landing pad.
const_iterator end() const
static const unsigned int DebugOperandMemNumber
A reserved operand number representing the instructions memory operand, for instructions that have a ...
void setObserver(GISelChangeObserver *O)
unsigned getBlockNumberEpoch() const
Return the numbering "epoch" of block numbers, incremented after each numbering.
void resetDelegate(Delegate *delegate)
Reset the currently registered delegate - otherwise assert.
void addCodeViewAnnotation(MCSymbol *Label, MDNode *MD)
Record annotations associated with a particular label.
Function & getFunction()
Return the LLVM function that this machine code represents.
MachineMemOperand * getMachineMemOperand(const MachineMemOperand *MMO, const MachinePointerInfo &PtrInfo, uint64_t Size)
void erase(MachineBasicBlock *MBBI)
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
const_iterator begin() const
void remove(MachineBasicBlock *MBBI)
void setIsOutlined(bool V)
const std::vector< MCSymbol * > & getLongjmpTargets() const
Returns a reference to a list of symbols immediately following calls to _setjmp in the function.
const std::vector< LandingPadInfo > & getLandingPads() const
Return a reference to the landing pad info for the current function.
MCSection * getSection() const
Returns the Section this function belongs to.
const VariableDbgInfoMapTy & getVariableDbgInfo() const
const MachineBasicBlock & back() const
const_reverse_iterator rbegin() const
const STC & getSubtarget() const
getSubtarget - This method returns a pointer to the specified type of TargetSubtargetInfo.
BasicBlockListType::const_reverse_iterator const_reverse_iterator
unsigned getCallSiteBeginLabel(MCSymbol *BeginLabel) const
Get the call site number for a begin label.
void remove(iterator MBBI)
VariableDbgInfoMapTy & getVariableDbgInfo()
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
const MachineRegisterInfo & getRegInfo() const
const WasmEHFuncInfo * getWasmEHFuncInfo() const
getWasmEHFuncInfo - Return information about how the current function uses Wasm exception handling.
bool hasCallSiteBeginLabel(MCSymbol *BeginLabel) const
Return true if the begin label has a call site number associated with it.
void splice(iterator InsertPt, MachineBasicBlock *MBB)
void addCallSiteInfo(const MachineInstr *CallI, CallSiteInfo &&CallInfo)
Start tracking the arguments passed to the call CallI.
static BasicBlockListType MachineFunction::* getSublistAccess(MachineBasicBlock *)
Support for MachineBasicBlock::getNextNode().
bool hasWasmLandingPadIndex(const MachineBasicBlock *LPad) const
Returns true if the landing pad has an associate index in wasm EH.
const MachineFunctionProperties & getProperties() const
Get the function properties.
Ty * cloneInfo(const Ty &Old)
const std::vector< MCSymbol * > & getCatchretTargets() const
Returns a reference to a list of symbols that we have catchrets.
bool hasCallSiteLandingPad(MCSymbol *Sym)
Return true if the landing pad Eh symbol has an associated call site.
void setVariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, int Slot, const DILocation *Loc)
Collect information used to emit debugging information of a variable in a stack slot.
void setDelegate(Delegate *delegate)
Set the delegate.
void reset()
Reset the instance as if it was just created.
DenseMap< unsigned, DebugPHIRegallocPos > DebugPHIPositions
Map of debug instruction numbers to the position of their PHI instructions during register allocation...
const MachineBasicBlock & front() const
void setHasEHScopes(bool V)
MachineMemOperand * getMachineMemOperand(const MachineMemOperand *MMO, int64_t Offset, LocationSize Size)
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags F, uint64_t Size, Align BaseAlignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
const Ty * getInfo() const
bool hasEHFunclets() const
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
const_reverse_iterator rend() const
bool hasAnyCallSiteLandingPad() const
WasmEHFuncInfo * getWasmEHFuncInfo()
void splice(iterator InsertPt, iterator MBBI)
auto getCalledGlobals() const
Iterates over the full set of call sites and their associated globals.
void addCalledGlobal(const MachineInstr *MI, CalledGlobalInfo Details)
Notes the global and target flags for a call site.
void erase(iterator MBBI)
ArrayRef< std::pair< MCSymbol *, MDNode * > > getCodeViewAnnotations() const
VariableDbgInfoMapTy VariableDbgInfos
MachineFunction(const MachineFunction &)=delete
void insert(iterator MBBI, MachineBasicBlock *MBB)
MachineBasicBlock & back()
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
BasicBlockListType::const_iterator const_iterator
MachineFunctionInfo * cloneInfoFrom(const MachineFunction &OrigMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB)
MachineBasicBlock & front()
SmallVectorImpl< unsigned > & getCallSiteLandingPad(MCSymbol *Sym)
Get the call site indexes for a landing pad EH symbol.
Representation of each machine instruction.
bool isCandidateForAdditionalCallInfo(QueryType Type=IgnoreBundle) const
Return true if this is a call instruction that may have an additional information associated with it.
A description of a memory reference used in the backend.
Flags
Flags values. These may be or'd together.
MachineOperand class - Representation of each machine instruction operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Pass interface - Implemented by all 'passes'.
Manages creation of pseudo source values.
Recycler - This class manages a linked-list of deallocated nodes and facilitates reusing deallocated ...
Wrapper class representing virtual and physical registers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
reference emplace_back(ArgTypes &&... Args)
std::reverse_iterator< const_iterator > const_reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Primary interface to the complete machine description for the target machine.
TargetSubtargetInfo - Generic base class for all target subtargets.
Target - Wrapper for Target specific information.
void splice(iterator where, iplist_impl &L2)
void push_back(pointer val)
iterator erase(iterator where)
pointer remove(iterator &IT)
void push_front(pointer val)
iterator insert(iterator where, pointer New)
An intrusive list with ownership and callbacks specified/controlled by ilist_traits,...
This class implements an extremely fast bulk output stream that can only output to a stream.
This file defines classes to implement an intrusive doubly linked list class (i.e.
@ Cold
Attempts to make code in the caller as efficient as possible under the assumption that the call is no...
@ BasicBlock
Various leaf nodes.
This is an optimization pass for GlobalISel generic memory operations.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
MachineFunctionDataHotness
void verifyMachineFunction(const std::string &Banner, const MachineFunction &MF)
iterator_range< filter_iterator< detail::IterOfRange< RangeT >, PredicateT > > make_filter_range(RangeT &&Range, PredicateT Pred)
Convenience function that takes a range of elements and a predicate, and return a new filter_iterator...
AtomicOrdering
Atomic ordering for LLVM's memory model.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
This struct is a compact representation of a valid (non-zero power of two) alignment.
Represent subnormal handling kind for floating point instruction inputs and outputs.
static unsigned getNumberEpoch(MachineFunction *F)
static unsigned getMaxNumber(MachineFunction *F)
static NodeRef getEntryNode(Inverse< MachineFunction * > G)
static unsigned getNumberEpoch(const MachineFunction *F)
static unsigned getMaxNumber(const MachineFunction *F)
static NodeRef getEntryNode(Inverse< const MachineFunction * > G)
static unsigned getNumberEpoch(MachineFunction *F)
static unsigned size(MachineFunction *F)
static nodes_iterator nodes_begin(MachineFunction *F)
static unsigned getMaxNumber(MachineFunction *F)
static nodes_iterator nodes_end(MachineFunction *F)
static NodeRef getEntryNode(MachineFunction *F)
static nodes_iterator nodes_begin(const MachineFunction *F)
static nodes_iterator nodes_end(const MachineFunction *F)
static unsigned size(const MachineFunction *F)
static unsigned getMaxNumber(const MachineFunction *F)
static NodeRef getEntryNode(const MachineFunction *F)
static unsigned getNumberEpoch(const MachineFunction *F)
This structure is used to retain landing pad info for the current function.
SmallVector< MCSymbol *, 1 > EndLabels
MCSymbol * LandingPadLabel
SmallVector< SEHHandler, 1 > SEHHandlers
LandingPadInfo(MachineBasicBlock *MBB)
MachineBasicBlock * LandingPadBlock
SmallVector< MCSymbol *, 1 > BeginLabels
std::vector< int > TypeIds
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
static FuncInfoTy * create(BumpPtrAllocator &Allocator, const Function &F, const SubtargetTy *STI)
Factory function: default behavior is to call new using the supplied allocator.
virtual ~MachineFunctionInfo()
virtual MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
static Ty * create(BumpPtrAllocator &Allocator, const Ty &MFI)
Structure used to represent pair of argument number after call lowering and register used to transfer...
ArgRegPair(Register R, unsigned Arg)
SmallVector< ArgRegPair, 1 > ArgRegPairs
Vector of call argument and its forwarding register.
const GlobalValue * Callee
This class contains a discriminated union of information about pointers in memory operands,...
const BlockAddress * RecoverBA
Address of block to recover at. Null for a finally handler.
const Function * FilterOrFinally
Filter or finally function. Null indicates a catch-all.
Use delete by default for iplist and ilist.
static void deleteNode(NodeTy *V)
void transferNodesFromList(ilist_callback_traits &OldList, Iterator, Iterator)
Callbacks do nothing by default in iplist and ilist.
void removeNodeFromList(NodeTy *)
void addNodeToList(NodeTy *)
Template traits for intrusive list.