Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
MachineFunction.h
Go to the documentation of this file.
1//===- llvm/CodeGen/MachineFunction.h ---------------------------*- C++ -*-===//
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// Collect native machine code for a function. This class contains a list of
10// MachineBasicBlock instances that make up the current compiled function.
11//
12// This class also contains pointers to various classes which hold
13// target-specific information about the generated code.
14//
15//===----------------------------------------------------------------------===//
16
17#ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
18#define LLVM_CODEGEN_MACHINEFUNCTION_H
19
20#include "llvm/ADT/ArrayRef.h"
21#include "llvm/ADT/DenseMap.h"
22#include "llvm/ADT/GraphTraits.h"
23#include "llvm/ADT/SmallVector.h"
24#include "llvm/ADT/ilist.h"
25#include "llvm/ADT/iterator.h"
26#include "llvm/CodeGen/MachineBasicBlock.h"
27#include "llvm/CodeGen/MachineInstr.h"
28#include "llvm/CodeGen/MachineMemOperand.h"
29#include "llvm/IR/EHPersonalities.h"
30#include "llvm/Support/Allocator.h"
31#include "llvm/Support/ArrayRecycler.h"
32#include "llvm/Support/AtomicOrdering.h"
33#include "llvm/Support/Compiler.h"
34#include "llvm/Support/Recycler.h"
35#include "llvm/Target/TargetOptions.h"
36#include <bitset>
37#include <cassert>
38#include <cstdint>
39#include <memory>
40#include <utility>
41#include <variant>
42#include <vector>
43
44namespacellvm {
45
46classBasicBlock;
47classBlockAddress;
48classDataLayout;
49classDebugLoc;
50structDenormalMode;
51classDIExpression;
52classDILocalVariable;
53classDILocation;
54classFunction;
55classGISelChangeObserver;
56classGlobalValue;
57classTargetMachine;
58classMachineConstantPool;
59classMachineFrameInfo;
60classMachineFunction;
61classMachineJumpTableInfo;
62classMachineRegisterInfo;
63classMCContext;
64classMCInstrDesc;
65classMCSymbol;
66classMCSection;
67classPass;
68classPseudoSourceValueManager;
69classraw_ostream;
70classSlotIndexes;
71classStringRef;
72classTargetRegisterClass;
73classTargetSubtargetInfo;
74structWasmEHFuncInfo;
75structWinEHFuncInfo;
76
77template <>structilist_alloc_traits<MachineBasicBlock> {
78voiddeleteNode(MachineBasicBlock *MBB);
79};
80
81template <>structilist_callback_traits<MachineBasicBlock> {
82voidaddNodeToList(MachineBasicBlock*N);
83voidremoveNodeFromList(MachineBasicBlock*N);
84
85template <class Iterator>
86voidtransferNodesFromList(ilist_callback_traits &OldList, Iterator, Iterator) {
87assert(this == &OldList &&"never transfer MBBs between functions");
88 }
89};
90
91// The hotness of static data tracked by a MachineFunction and not represented
92// as a global object in the module IR / MIR. Typical examples are
93// MachineJumpTableInfo and MachineConstantPool.
94enum classMachineFunctionDataHotness {
95Unknown,
96Cold,
97Hot,
98};
99
100/// MachineFunctionInfo - This class can be derived from and used by targets to
101/// hold private target-specific information for each MachineFunction. Objects
102/// of type are accessed/created with MF::getInfo and destroyed when the
103/// MachineFunction is destroyed.
104structMachineFunctionInfo {
105virtual~MachineFunctionInfo();
106
107 /// Factory function: default behavior is to call new using the
108 /// supplied allocator.
109 ///
110 /// This function can be overridden in a derive class.
111template <typename FuncInfoTy,typename SubtargetTy = TargetSubtargetInfo>
112static FuncInfoTy *create(BumpPtrAllocator &Allocator,constFunction &F,
113const SubtargetTy *STI) {
114returnnew (Allocator.Allocate<FuncInfoTy>()) FuncInfoTy(F, STI);
115 }
116
117template <typename Ty>
118static Ty *create(BumpPtrAllocator &Allocator,const Ty &MFI) {
119returnnew (Allocator.Allocate<Ty>()) Ty(MFI);
120 }
121
122 /// Make a functionally equivalent copy of this MachineFunctionInfo in \p MF.
123 /// This requires remapping MachineBasicBlock references from the original
124 /// parent to values in the new function. Targets may assume that virtual
125 /// register and frame index values are preserved in the new function.
126virtualMachineFunctionInfo *
127clone(BumpPtrAllocator &Allocator,MachineFunction &DestMF,
128constDenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB)
129 const{
130returnnullptr;
131 }
132};
133
134/// Properties which a MachineFunction may have at a given point in time.
135/// Each of these has checking code in the MachineVerifier, and passes can
136/// require that a property be set.
137classMachineFunctionProperties {
138// Possible TODO: Allow targets to extend this (perhaps by allowing the
139// constructor to specify the size of the bit vector)
140// Possible TODO: Allow requiring the negative (e.g. VRegsAllocated could be
141// stated as the negative of "has vregs"
142
143public:
144// The properties are stated in "positive" form; i.e. a pass could require
145// that the property hold, but not that it does not hold.
146
147// Property descriptions:
148// IsSSA: True when the machine function is in SSA form and virtual registers
149// have a single def.
150// NoPHIs: The machine function does not contain any PHI instruction.
151// TracksLiveness: True when tracking register liveness accurately.
152// While this property is set, register liveness information in basic block
153// live-in lists and machine instruction operands (e.g. implicit defs) is
154// accurate, kill flags are conservatively accurate (kill flag correctly
155// indicates the last use of a register, an operand without kill flag may or
156// may not be the last use of a register). This means it can be used to
157// change the code in ways that affect the values in registers, for example
158// by the register scavenger.
159// When this property is cleared at a very late time, liveness is no longer
160// reliable.
161// NoVRegs: The machine function does not use any virtual registers.
162// Legalized: In GlobalISel: the MachineLegalizer ran and all pre-isel generic
163// instructions have been legalized; i.e., all instructions are now one of:
164// - generic and always legal (e.g., COPY)
165// - target-specific
166// - legal pre-isel generic instructions.
167// RegBankSelected: In GlobalISel: the RegBankSelect pass ran and all generic
168// virtual registers have been assigned to a register bank.
169// Selected: In GlobalISel: the InstructionSelect pass ran and all pre-isel
170// generic instructions have been eliminated; i.e., all instructions are now
171// target-specific or non-pre-isel generic instructions (e.g., COPY).
172// Since only pre-isel generic instructions can have generic virtual register
173// operands, this also means that all generic virtual registers have been
174// constrained to virtual registers (assigned to register classes) and that
175// all sizes attached to them have been eliminated.
176// TiedOpsRewritten: The twoaddressinstruction pass will set this flag, it
177// means that tied-def have been rewritten to meet the RegConstraint.
178// FailsVerification: Means that the function is not expected to pass machine
179// verification. This can be set by passes that introduce known problems that
180// have not been fixed yet.
181// TracksDebugUserValues: Without this property enabled, debug instructions
182// such as DBG_VALUE are allowed to reference virtual registers even if those
183// registers do not have a definition. With the property enabled virtual
184// registers must only be used if they have a definition. This property
185// allows earlier passes in the pipeline to skip updates of `DBG_VALUE`
186// instructions to save compile time.
187enum classProperty :unsigned {
188IsSSA,
189NoPHIs,
190TracksLiveness,
191NoVRegs,
192FailedISel,
193Legalized,
194RegBankSelected,
195Selected,
196TiedOpsRewritten,
197FailsVerification,
198FailedRegAlloc,
199TracksDebugUserValues,
200LastProperty =TracksDebugUserValues,
201 };
202
203boolhasProperty(PropertyP) const{
204return Properties[static_cast<unsigned>(P)];
205 }
206
207MachineFunctionProperties &set(PropertyP) {
208 Properties.set(static_cast<unsigned>(P));
209return *this;
210 }
211
212MachineFunctionProperties &reset(PropertyP) {
213 Properties.reset(static_cast<unsigned>(P));
214return *this;
215 }
216
217 /// Reset all the properties.
218MachineFunctionProperties &reset() {
219 Properties.reset();
220return *this;
221 }
222
223MachineFunctionProperties &set(constMachineFunctionProperties &MFP) {
224 Properties |= MFP.Properties;
225return *this;
226 }
227
228MachineFunctionProperties &reset(constMachineFunctionProperties &MFP) {
229 Properties &= ~MFP.Properties;
230return *this;
231 }
232
233// Returns true if all properties set in V (i.e. required by a pass) are set
234// in this.
235boolverifyRequiredProperties(constMachineFunctionProperties &V) const{
236return (Properties | ~V.Properties).all();
237 }
238
239 /// Print the MachineFunctionProperties in human-readable form.
240voidprint(raw_ostream &OS)const;
241
242private:
243 std::bitset<static_cast<unsigned>(Property::LastProperty) + 1> Properties;
244};
245
246structSEHHandler {
247 /// Filter or finally function. Null indicates a catch-all.
248constFunction *FilterOrFinally;
249
250 /// Address of block to recover at. Null for a finally handler.
251constBlockAddress *RecoverBA;
252};
253
254/// This structure is used to retain landing pad info for the current function.
255structLandingPadInfo {
256MachineBasicBlock *LandingPadBlock;// Landing pad block.
257SmallVector<MCSymbol *, 1>BeginLabels;// Labels prior to invoke.
258SmallVector<MCSymbol *, 1>EndLabels;// Labels after invoke.
259SmallVector<SEHHandler, 1>SEHHandlers;// SEH handlers active at this lpad.
260MCSymbol *LandingPadLabel =nullptr;// Label at beginning of landing pad.
261 std::vector<int>TypeIds;// List of type ids (filters negative).
262
263explicitLandingPadInfo(MachineBasicBlock *MBB)
264 :LandingPadBlock(MBB) {}
265};
266
267classLLVM_ABIMachineFunction {
268Function &F;
269constTargetMachine &Target;
270constTargetSubtargetInfo *STI;
271MCContext &Ctx;
272
273// RegInfo - Information about each register in use in the function.
274MachineRegisterInfo *RegInfo;
275
276// Used to keep track of target-specific per-machine-function information for
277// the target implementation.
278MachineFunctionInfo *MFInfo;
279
280// Keep track of objects allocated on the stack.
281MachineFrameInfo *FrameInfo;
282
283// Keep track of constants which are spilled to memory
284MachineConstantPool *ConstantPool;
285
286// Keep track of jump tables for switch instructions
287MachineJumpTableInfo *JumpTableInfo;
288
289// Keep track of the function section.
290MCSection *Section =nullptr;
291
292// Catchpad unwind destination info for wasm EH.
293// Keeps track of Wasm exception handling related data. This will be null for
294// functions that aren't using a wasm EH personality.
295WasmEHFuncInfo *WasmEHInfo =nullptr;
296
297// Keeps track of Windows exception handling related data. This will be null
298// for functions that aren't using a funclet-based EH personality.
299WinEHFuncInfo *WinEHInfo =nullptr;
300
301// Function-level unique numbering for MachineBasicBlocks. When a
302// MachineBasicBlock is inserted into a MachineFunction is it automatically
303// numbered and this vector keeps track of the mapping from ID's to MBB's.
304 std::vector<MachineBasicBlock*> MBBNumbering;
305
306// MBBNumbering epoch, incremented after renumbering to detect use of old
307// block numbers.
308unsigned MBBNumberingEpoch = 0;
309
310// Pool-allocate MachineFunction-lifetime and IR objects.
311BumpPtrAllocatorAllocator;
312
313// Allocation management for instructions in function.
314Recycler<MachineInstr> InstructionRecycler;
315
316// Allocation management for operand arrays on instructions.
317ArrayRecycler<MachineOperand> OperandRecycler;
318
319// Allocation management for basic blocks in function.
320Recycler<MachineBasicBlock> BasicBlockRecycler;
321
322// List of machine basic blocks in function
323usingBasicBlockListType =ilist<MachineBasicBlock>;
324BasicBlockListType BasicBlocks;
325
326 /// FunctionNumber - This provides a unique ID for each function emitted in
327 /// this translation unit.
328 ///
329unsigned FunctionNumber;
330
331 /// Alignment - The alignment of the function.
332Align Alignment;
333
334 /// ExposesReturnsTwice - True if the function calls setjmp or related
335 /// functions with attribute "returns twice", but doesn't have
336 /// the attribute itself.
337 /// This is used to limit optimizations which cannot reason
338 /// about the control flow of such functions.
339bool ExposesReturnsTwice =false;
340
341 /// True if the function includes any inline assembly.
342bool HasInlineAsm =false;
343
344 /// True if any WinCFI instruction have been emitted in this function.
345bool HasWinCFI =false;
346
347 /// Current high-level properties of the IR of the function (e.g. is in SSA
348 /// form or whether registers have been allocated)
349MachineFunctionProperties Properties;
350
351// Allocation management for pseudo source values.
352 std::unique_ptr<PseudoSourceValueManager> PSVManager;
353
354 /// List of moves done by a function's prolog. Used to construct frame maps
355 /// by debug and exception handling consumers.
356 std::vector<MCCFIInstruction> FrameInstructions;
357
358 /// List of basic blocks immediately following calls to _setjmp. Used to
359 /// construct a table of valid longjmp targets for Windows Control Flow Guard.
360 std::vector<MCSymbol *> LongjmpTargets;
361
362 /// List of basic blocks that are the target of catchrets. Used to construct
363 /// a table of valid targets for Windows EHCont Guard.
364 std::vector<MCSymbol *> CatchretTargets;
365
366 /// \name Exception Handling
367 /// \{
368
369 /// List of LandingPadInfo describing the landing pad information.
370 std::vector<LandingPadInfo> LandingPads;
371
372 /// Map a landing pad's EH symbol to the call site indexes.
373DenseMap<MCSymbol*, SmallVector<unsigned, 4>> LPadToCallSiteMap;
374
375 /// Map a landing pad to its index.
376DenseMap<const MachineBasicBlock *, unsigned> WasmLPadToIndexMap;
377
378 /// Map of invoke call site index values to associated begin EH_LABEL.
379DenseMap<MCSymbol*, unsigned> CallSiteMap;
380
381 /// CodeView label annotations.
382 std::vector<std::pair<MCSymbol *, MDNode *>> CodeViewAnnotations;
383
384bool CallsEHReturn =false;
385bool CallsUnwindInit =false;
386bool HasEHCatchret =false;
387bool HasEHScopes =false;
388bool HasEHFunclets =false;
389bool HasFakeUses =false;
390bool IsOutlined =false;
391
392 /// BBID to assign to the next basic block of this function.
393unsigned NextBBID = 0;
394
395 /// Section Type for basic blocks, only relevant with basic block sections.
396BasicBlockSection BBSectionsType = BasicBlockSection::None;
397
398 /// List of C++ TypeInfo used.
399 std::vector<const GlobalValue *> TypeInfos;
400
401 /// List of typeids encoding filters used.
402 std::vector<unsigned> FilterIds;
403
404 /// List of the indices in FilterIds corresponding to filter terminators.
405 std::vector<unsigned> FilterEnds;
406
407EHPersonality PersonalityTypeCache = EHPersonality::Unknown;
408
409 /// \}
410
411 /// Clear all the members of this MachineFunction, but the ones used to
412 /// initialize again the MachineFunction. More specifically, this deallocates
413 /// all the dynamically allocated objects and get rids of all the XXXInfo data
414 /// structure, but keeps unchanged the references to Fn, Target, and
415 /// FunctionNumber.
416void clear();
417 /// Allocate and initialize the different members.
418 /// In particular, the XXXInfo data structure.
419 /// \pre Fn, Target, and FunctionNumber are properly set.
420void init();
421
422public:
423 /// Description of the location of a variable whose Address is valid and
424 /// unchanging during function execution. The Address may be:
425 /// * A stack index, which can be negative for fixed stack objects.
426 /// * A MCRegister, whose entry value contains the address of the variable.
427classVariableDbgInfo {
428 std::variant<int, MCRegister>Address;
429
430public:
431constDILocalVariable *Var;
432constDIExpression *Expr;
433constDILocation *Loc;
434
435VariableDbgInfo(constDILocalVariable *Var,constDIExpression *Expr,
436int Slot,constDILocation *Loc)
437 :Address(Slot), Var(Var), Expr(Expr), Loc(Loc) {}
438
439VariableDbgInfo(constDILocalVariable *Var,constDIExpression *Expr,
440MCRegister EntryValReg,constDILocation *Loc)
441 :Address(EntryValReg), Var(Var), Expr(Expr), Loc(Loc) {}
442
443 /// Return true if this variable is in a stack slot.
444boolinStackSlot() const{return std::holds_alternative<int>(Address); }
445
446 /// Return true if this variable is in the entry value of a register.
447boolinEntryValueRegister() const{
448return std::holds_alternative<MCRegister>(Address);
449 }
450
451 /// Returns the stack slot of this variable, assuming `inStackSlot()` is
452 /// true.
453intgetStackSlot() const{return std::get<int>(Address); }
454
455 /// Returns the MCRegister of this variable, assuming
456 /// `inEntryValueRegister()` is true.
457MCRegistergetEntryValueRegister() const{
458return std::get<MCRegister>(Address);
459 }
460
461 /// Updates the stack slot of this variable, assuming `inStackSlot()` is
462 /// true.
463voidupdateStackSlot(int NewSlot) {
464assert(inStackSlot());
465Address = NewSlot;
466 }
467 };
468
469classDelegate {
470virtualvoid anchor();
471
472public:
473virtual~Delegate() =default;
474 /// Callback after an insertion. This should not modify the MI directly.
475virtualvoidMF_HandleInsertion(MachineInstr &MI) = 0;
476 /// Callback before a removal. This should not modify the MI directly.
477virtualvoidMF_HandleRemoval(MachineInstr &MI) = 0;
478 /// Callback before changing MCInstrDesc. This should not modify the MI
479 /// directly.
480virtualvoidMF_HandleChangeDesc(MachineInstr &MI,constMCInstrDesc &TID) {
481 }
482 };
483
484 /// Structure used to represent pair of argument number after call lowering
485 /// and register used to transfer that argument.
486 /// For now we support only cases when argument is transferred through one
487 /// register.
488structArgRegPair {
489RegisterReg;
490uint16_tArgNo;
491ArgRegPair(Register R,unsigned Arg) :Reg(R), ArgNo(Arg) {
492assert(Arg < (1 << 16) &&"Arg out of range");
493 }
494 };
495
496structCallSiteInfo {
497 /// Vector of call argument and its forwarding register.
498SmallVector<ArgRegPair, 1>ArgRegPairs;
499 };
500
501structCalledGlobalInfo {
502constGlobalValue *Callee;
503unsignedTargetFlags;
504 };
505
506private:
507Delegate *TheDelegate =nullptr;
508GISelChangeObserver *Observer =nullptr;
509
510usingCallSiteInfoMap =DenseMap<const MachineInstr *, CallSiteInfo>;
511 /// Map a call instruction to call site arguments forwarding info.
512CallSiteInfoMap CallSitesInfo;
513
514 /// A helper function that returns call site info for a give call
515 /// instruction if debug entry value support is enabled.
516CallSiteInfoMap::iterator getCallSiteInfo(constMachineInstr *MI);
517
518usingCalledGlobalsMap =DenseMap<const MachineInstr *, CalledGlobalInfo>;
519 /// Mapping of call instruction to the global value and target flags that it
520 /// calls, if applicable.
521CalledGlobalsMap CalledGlobalsInfo;
522
523// Callbacks for insertion and removal.
524void handleInsertion(MachineInstr &MI);
525void handleRemoval(MachineInstr &MI);
526friendstructilist_traits<MachineInstr>;
527
528public:
529// Need to be accessed from MachineInstr::setDesc.
530void handleChangeDesc(MachineInstr &MI,constMCInstrDesc &TID);
531
532usingVariableDbgInfoMapTy =SmallVector<VariableDbgInfo, 4>;
533VariableDbgInfoMapTyVariableDbgInfos;
534
535 /// A count of how many instructions in the function have had numbers
536 /// assigned to them. Used for debug value tracking, to determine the
537 /// next instruction number.
538unsigned DebugInstrNumberingCount = 0;
539
540 /// Set value of DebugInstrNumberingCount field. Avoid using this unless
541 /// you're deserializing this data.
542void setDebugInstrNumberingCount(unsigned Num);
543
544 /// Pair of instruction number and operand number.
545usingDebugInstrOperandPair = std::pair<unsigned, unsigned>;
546
547 /// Replacement definition for a debug instruction reference. Made up of a
548 /// source instruction / operand pair, destination pair, and a qualifying
549 /// subregister indicating what bits in the operand make up the substitution.
550// For example, a debug user
551 /// of %1:
552 /// %0:gr32 = someinst, debug-instr-number 1
553 /// %1:gr16 = %0.some_16_bit_subreg, debug-instr-number 2
554 /// Would receive the substitution {{2, 0}, {1, 0}, $subreg}, where $subreg is
555 /// the subregister number for some_16_bit_subreg.
556classDebugSubstitution {
557public:
558DebugInstrOperandPairSrc;///< Source instruction / operand pair.
559DebugInstrOperandPairDest;///< Replacement instruction / operand pair.
560unsignedSubreg;///< Qualifier for which part of Dest is read.
561
562DebugSubstitution(constDebugInstrOperandPair &Src,
563constDebugInstrOperandPair &Dest,unsigned Subreg)
564 : Src(Src), Dest(Dest), Subreg(Subreg) {}
565
566 /// Order only by source instruction / operand pair: there should never
567 /// be duplicate entries for the same source in any collection.
568booloperator<(constDebugSubstitution &Other) const{
569return Src <Other.Src;
570 }
571 };
572
573 /// Debug value substitutions: a collection of DebugSubstitution objects,
574 /// recording changes in where a value is defined. For example, when one
575 /// instruction is substituted for another. Keeping a record allows recovery
576 /// of variable locations after compilation finishes.
577SmallVector<DebugSubstitution, 8>DebugValueSubstitutions;
578
579 /// Location of a PHI instruction that is also a debug-info variable value,
580 /// for the duration of register allocation. Loaded by the PHI-elimination
581 /// pass, and emitted as DBG_PHI instructions during VirtRegRewriter, with
582 /// maintenance applied by intermediate passes that edit registers (such as
583 /// coalescing and the allocator passes).
584classDebugPHIRegallocPos {
585public:
586MachineBasicBlock *MBB;///< Block where this PHI was originally located.
587RegisterReg;///< VReg where the control-flow-merge happens.
588unsignedSubReg;///< Optional subreg qualifier within Reg.
589DebugPHIRegallocPos(MachineBasicBlock *MBB,RegisterReg,unsignedSubReg)
590 :MBB(MBB),Reg(Reg),SubReg(SubReg) {}
591 };
592
593 /// Map of debug instruction numbers to the position of their PHI instructions
594 /// during register allocation. See DebugPHIRegallocPos.
595DenseMap<unsigned, DebugPHIRegallocPos>DebugPHIPositions;
596
597 /// Flag for whether this function contains DBG_VALUEs (false) or
598 /// DBG_INSTR_REF (true).
599bool UseDebugInstrRef =false;
600
601 /// Create a substitution between one <instr,operand> value to a different,
602 /// new value.
603void makeDebugValueSubstitution(DebugInstrOperandPair,DebugInstrOperandPair,
604unsignedSubReg = 0);
605
606 /// Create substitutions for any tracked values in \p Old, to point at
607 /// \p New. Needed when we re-create an instruction during optimization,
608 /// which has the same signature (i.e., def operands in the same place) but
609 /// a modified instruction type, flags, or otherwise. An example: X86 moves
610 /// are sometimes transformed into equivalent LEAs.
611 /// If the two instructions are not the same opcode, limit which operands to
612 /// examine for substitutions to the first N operands by setting
613 /// \p MaxOperand.
614void substituteDebugValuesForInst(constMachineInstr &Old,MachineInstr &New,
615unsigned MaxOperand = UINT_MAX);
616
617 /// Find the underlying defining instruction / operand for a COPY instruction
618 /// while in SSA form. Copies do not actually define values -- they move them
619 /// between registers. Labelling a COPY-like instruction with an instruction
620 /// number is to be avoided as it makes value numbers non-unique later in
621 /// compilation. This method follows the definition chain for any sequence of
622 /// COPY-like instructions to find whatever non-COPY-like instruction defines
623 /// the copied value; or for parameters, creates a DBG_PHI on entry.
624 /// May insert instructions into the entry block!
625 /// \p MI The copy-like instruction to salvage.
626 /// \p DbgPHICache A container to cache already-solved COPYs.
627 /// \returns An instruction/operand pair identifying the defining value.
628DebugInstrOperandPair
629 salvageCopySSA(MachineInstr &MI,
630DenseMap<Register, DebugInstrOperandPair> &DbgPHICache);
631
632DebugInstrOperandPair salvageCopySSAImpl(MachineInstr &MI);
633
634 /// Finalise any partially emitted debug instructions. These are DBG_INSTR_REF
635 /// instructions where we only knew the vreg of the value they use, not the
636 /// instruction that defines that vreg. Once isel finishes, we should have
637 /// enough information for every DBG_INSTR_REF to point at an instruction
638 /// (or DBG_PHI).
639void finalizeDebugInstrRefs();
640
641 /// Determine whether, in the current machine configuration, we should use
642 /// instruction referencing or not.
643bool shouldUseDebugInstrRef()const;
644
645 /// Returns true if the function's variable locations are tracked with
646 /// instruction referencing.
647bool useDebugInstrRef()const;
648
649 /// Set whether this function will use instruction referencing or not.
650void setUseDebugInstrRef(bool UseInstrRef);
651
652 /// A reserved operand number representing the instructions memory operand,
653 /// for instructions that have a stack spill fused into them.
654conststaticunsignedintDebugOperandMemNumber;
655
656MachineFunction(Function &F,constTargetMachine &Target,
657constTargetSubtargetInfo &STI,MCContext &Ctx,
658unsigned FunctionNum);
659MachineFunction(constMachineFunction &) =delete;
660MachineFunction &operator=(constMachineFunction &) =delete;
661~MachineFunction();
662
663 /// Reset the instance as if it was just created.
664voidreset() {
665 clear();
666 init();
667 }
668
669 /// Reset the currently registered delegate - otherwise assert.
670voidresetDelegate(Delegate *delegate) {
671assert(TheDelegate == delegate &&
672"Only the current delegate can perform reset!");
673 TheDelegate =nullptr;
674 }
675
676 /// Set the delegate. resetDelegate must be called before attempting
677 /// to set.
678voidsetDelegate(Delegate *delegate) {
679assert(delegate && !TheDelegate &&
680"Attempted to set delegate to null, or to change it without "
681"first resetting it!");
682
683 TheDelegate = delegate;
684 }
685
686voidsetObserver(GISelChangeObserver *O) { Observer = O; }
687
688GISelChangeObserver *getObserver() const{return Observer; }
689
690MCContext &getContext() const{return Ctx; }
691
692 /// Returns the Section this function belongs to.
693MCSection *getSection() const{return Section; }
694
695 /// Indicates the Section this function belongs to.
696voidsetSection(MCSection *S) { Section = S; }
697
698PseudoSourceValueManager &getPSVManager() const{return *PSVManager; }
699
700 /// Return the DataLayout attached to the Module associated to this MF.
701constDataLayout &getDataLayout()const;
702
703 /// Return the LLVM function that this machine code represents
704Function &getFunction() {returnF; }
705
706 /// Return the LLVM function that this machine code represents
707constFunction &getFunction() const{returnF; }
708
709 /// getName - Return the name of the corresponding LLVM function.
710StringRefgetName()const;
711
712 /// getFunctionNumber - Return a unique ID for the current function.
713unsignedgetFunctionNumber() const{return FunctionNumber; }
714
715 /// Returns true if this function has basic block sections enabled.
716boolhasBBSections() const{
717return (BBSectionsType == BasicBlockSection::All ||
718 BBSectionsType == BasicBlockSection::List ||
719 BBSectionsType == BasicBlockSection::Preset);
720 }
721
722voidsetBBSectionsType(BasicBlockSection V) { BBSectionsType = V; }
723
724 /// Assign IsBeginSection IsEndSection fields for basic blocks in this
725 /// function.
726void assignBeginEndSections();
727
728 /// getTarget - Return the target machine this machine code is compiled with
729constTargetMachine &getTarget() const{returnTarget; }
730
731 /// getSubtarget - Return the subtarget for which this machine code is being
732 /// compiled.
733constTargetSubtargetInfo &getSubtarget() const{return *STI; }
734
735 /// getSubtarget - This method returns a pointer to the specified type of
736 /// TargetSubtargetInfo. In debug builds, it verifies that the object being
737 /// returned is of the correct type.
738template<typename STC>const STC &getSubtarget() const{
739return *static_cast<constSTC *>(STI);
740 }
741
742 /// getRegInfo - Return information about the registers currently in use.
743MachineRegisterInfo &getRegInfo() {return *RegInfo; }
744constMachineRegisterInfo &getRegInfo() const{return *RegInfo; }
745
746 /// getFrameInfo - Return the frame info object for the current function.
747 /// This object contains information about objects allocated on the stack
748 /// frame of the current function in an abstract way.
749MachineFrameInfo &getFrameInfo() {return *FrameInfo; }
750constMachineFrameInfo &getFrameInfo() const{return *FrameInfo; }
751
752 /// getJumpTableInfo - Return the jump table info object for the current
753 /// function. This object contains information about jump tables in the
754 /// current function. If the current function has no jump tables, this will
755 /// return null.
756constMachineJumpTableInfo *getJumpTableInfo() const{return JumpTableInfo; }
757MachineJumpTableInfo *getJumpTableInfo() {return JumpTableInfo; }
758
759 /// getOrCreateJumpTableInfo - Get the JumpTableInfo for this function, if it
760 /// does already exist, allocate one.
761MachineJumpTableInfo *getOrCreateJumpTableInfo(unsigned JTEntryKind);
762
763 /// getConstantPool - Return the constant pool object for the current
764 /// function.
765MachineConstantPool *getConstantPool() {returnConstantPool; }
766constMachineConstantPool *getConstantPool() const{returnConstantPool; }
767
768 /// getWasmEHFuncInfo - Return information about how the current function uses
769 /// Wasm exception handling. Returns null for functions that don't use wasm
770 /// exception handling.
771constWasmEHFuncInfo *getWasmEHFuncInfo() const{return WasmEHInfo; }
772WasmEHFuncInfo *getWasmEHFuncInfo() {return WasmEHInfo; }
773
774 /// getWinEHFuncInfo - Return information about how the current function uses
775 /// Windows exception handling. Returns null for functions that don't use
776 /// funclets for exception handling.
777constWinEHFuncInfo *getWinEHFuncInfo() const{return WinEHInfo; }
778WinEHFuncInfo *getWinEHFuncInfo() {return WinEHInfo; }
779
780 /// getAlignment - Return the alignment of the function.
781AligngetAlignment() const{return Alignment; }
782
783 /// setAlignment - Set the alignment of the function.
784voidsetAlignment(AlignA) { Alignment =A; }
785
786 /// ensureAlignment - Make sure the function is at least A bytes aligned.
787voidensureAlignment(AlignA) {
788if (Alignment <A)
789 Alignment =A;
790 }
791
792 /// exposesReturnsTwice - Returns true if the function calls setjmp or
793 /// any other similar functions with attribute "returns twice" without
794 /// having the attribute itself.
795boolexposesReturnsTwice() const{
796return ExposesReturnsTwice;
797 }
798
799 /// setCallsSetJmp - Set a flag that indicates if there's a call to
800 /// a "returns twice" function.
801voidsetExposesReturnsTwice(boolB) {
802 ExposesReturnsTwice =B;
803 }
804
805 /// Returns true if the function contains any inline assembly.
806boolhasInlineAsm() const{
807return HasInlineAsm;
808 }
809
810 /// Set a flag that indicates that the function contains inline assembly.
811voidsetHasInlineAsm(boolB) {
812 HasInlineAsm =B;
813 }
814
815boolhasWinCFI() const{
816return HasWinCFI;
817 }
818voidsetHasWinCFI(bool v) { HasWinCFI = v; }
819
820 /// True if this function needs frame moves for debug or exceptions.
821bool needsFrameMoves()const;
822
823 /// Get the function properties
824constMachineFunctionProperties &getProperties() const{return Properties; }
825MachineFunctionProperties &getProperties() {return Properties; }
826
827 /// getInfo - Keep track of various per-function pieces of information for
828 /// backends that would like to do so.
829 ///
830template<typename Ty>
831 Ty *getInfo() {
832returnstatic_cast<Ty*>(MFInfo);
833 }
834
835template<typename Ty>
836const Ty *getInfo() const{
837returnstatic_cast<constTy *>(MFInfo);
838 }
839
840template <typename Ty> Ty *cloneInfo(const Ty &Old) {
841assert(!MFInfo);
842 MFInfo = Ty::template create<Ty>(Allocator, Old);
843returnstatic_cast<Ty *>(MFInfo);
844 }
845
846 /// Initialize the target specific MachineFunctionInfo
847void initTargetMachineFunctionInfo(constTargetSubtargetInfo &STI);
848
849MachineFunctionInfo *cloneInfoFrom(
850constMachineFunction &OrigMF,
851constDenseMap<MachineBasicBlock *, MachineBasicBlock *> &Src2DstMBB) {
852assert(!MFInfo &&"new function already has MachineFunctionInfo");
853if (!OrigMF.MFInfo)
854returnnullptr;
855return OrigMF.MFInfo->clone(Allocator, *this, Src2DstMBB);
856 }
857
858 /// Returns the denormal handling type for the default rounding mode of the
859 /// function.
860DenormalMode getDenormalMode(constfltSemantics &FPType)const;
861
862 /// getBlockNumbered - MachineBasicBlocks are automatically numbered when they
863 /// are inserted into the machine function. The block number for a machine
864 /// basic block can be found by using the MBB::getNumber method, this method
865 /// provides the inverse mapping.
866MachineBasicBlock *getBlockNumbered(unsignedN) const{
867assert(N < MBBNumbering.size() &&"Illegal block number");
868assert(MBBNumbering[N] &&"Block was removed from the machine function!");
869return MBBNumbering[N];
870 }
871
872 /// Should we be emitting segmented stack stuff for the function
873bool shouldSplitStack()const;
874
875 /// getNumBlockIDs - Return the number of MBB ID's allocated.
876unsignedgetNumBlockIDs() const{return (unsigned)MBBNumbering.size(); }
877
878 /// Return the numbering "epoch" of block numbers, incremented after each
879 /// numbering. Intended for asserting that no renumbering was performed when
880 /// used by, e.g., preserved analyses.
881unsignedgetBlockNumberEpoch() const{return MBBNumberingEpoch; }
882
883 /// RenumberBlocks - This discards all of the MachineBasicBlock numbers and
884 /// recomputes them. This guarantees that the MBB numbers are sequential,
885 /// dense, and match the ordering of the blocks within the function. If a
886 /// specific MachineBasicBlock is specified, only that block and those after
887 /// it are renumbered.
888void RenumberBlocks(MachineBasicBlock *MBBFrom =nullptr);
889
890 /// Return an estimate of the function's code size,
891 /// taking into account block and function alignment
892 int64_testimateFunctionSizeInBytes();
893
894 /// print - Print out the MachineFunction in a format suitable for debugging
895 /// to the specified stream.
896voidprint(raw_ostream &OS,constSlotIndexes* =nullptr)const;
897
898 /// viewCFG - This function is meant for use from the debugger. You can just
899 /// say 'call F->viewCFG()' and a ghostview window should pop up from the
900 /// program, displaying the CFG of the current function with the code for each
901 /// basic block inside. This depends on there being a 'dot' and 'gv' program
902 /// in your path.
903voidviewCFG()const;
904
905 /// viewCFGOnly - This function is meant for use from the debugger. It works
906 /// just like viewCFG, but it does not include the contents of basic blocks
907 /// into the nodes, just the label. If you are only interested in the CFG
908 /// this can make the graph smaller.
909 ///
910void viewCFGOnly()const;
911
912 /// dump - Print the current MachineFunction to cerr, useful for debugger use.
913voiddump()const;
914
915 /// Run the current MachineFunction through the machine code verifier, useful
916 /// for debugger use.
917 /// \returns true if no problems were found.
918boolverify(Pass *p =nullptr,constchar *Banner =nullptr,
919raw_ostream *OS =nullptr,bool AbortOnError =true)const;
920
921 /// Run the current MachineFunction through the machine code verifier, useful
922 /// for debugger use.
923 /// \returns true if no problems were found.
924boolverify(LiveIntervals *LiveInts,SlotIndexes *Indexes,
925constchar *Banner =nullptr,raw_ostream *OS =nullptr,
926bool AbortOnError =true)const;
927
928// Provide accessors for the MachineBasicBlock list...
929usingiterator =BasicBlockListType::iterator;
930usingconst_iterator =BasicBlockListType::const_iterator;
931usingconst_reverse_iterator =BasicBlockListType::const_reverse_iterator;
932usingreverse_iterator =BasicBlockListType::reverse_iterator;
933
934 /// Support for MachineBasicBlock::getNextNode().
935staticBasicBlockListTypeMachineFunction::*
936getSublistAccess(MachineBasicBlock *) {
937return &MachineFunction::BasicBlocks;
938 }
939
940 /// addLiveIn - Add the specified physical register as a live-in value and
941 /// create a corresponding virtual register for it.
942RegisteraddLiveIn(MCRegister PReg,constTargetRegisterClass *RC);
943
944//===--------------------------------------------------------------------===//
945// BasicBlock accessor functions.
946//
947iteratorbegin() {return BasicBlocks.begin(); }
948const_iteratorbegin() const{return BasicBlocks.begin(); }
949iteratorend () {return BasicBlocks.end(); }
950const_iteratorend () const{return BasicBlocks.end(); }
951
952reverse_iteratorrbegin() {return BasicBlocks.rbegin(); }
953const_reverse_iteratorrbegin() const{return BasicBlocks.rbegin(); }
954reverse_iteratorrend () {return BasicBlocks.rend(); }
955const_reverse_iteratorrend () const{return BasicBlocks.rend(); }
956
957unsignedsize() const{return (unsigned)BasicBlocks.size();}
958boolempty() const{return BasicBlocks.empty(); }
959constMachineBasicBlock &front() const{return BasicBlocks.front(); }
960MachineBasicBlock &front() {return BasicBlocks.front(); }
961constMachineBasicBlock &back() const{return BasicBlocks.back(); }
962MachineBasicBlock &back() {return BasicBlocks.back(); }
963
964voidpush_back (MachineBasicBlock *MBB) { BasicBlocks.push_back (MBB); }
965voidpush_front(MachineBasicBlock *MBB) { BasicBlocks.push_front(MBB); }
966voidinsert(iteratorMBBI,MachineBasicBlock *MBB) {
967 BasicBlocks.insert(MBBI,MBB);
968 }
969voidsplice(iterator InsertPt,iteratorMBBI) {
970 BasicBlocks.splice(InsertPt, BasicBlocks,MBBI);
971 }
972voidsplice(iterator InsertPt,MachineBasicBlock *MBB) {
973 BasicBlocks.splice(InsertPt, BasicBlocks,MBB);
974 }
975voidsplice(iterator InsertPt,iteratorMBBI,iterator MBBE) {
976 BasicBlocks.splice(InsertPt, BasicBlocks,MBBI, MBBE);
977 }
978
979voidremove(iteratorMBBI) { BasicBlocks.remove(MBBI); }
980voidremove(MachineBasicBlock *MBBI) { BasicBlocks.remove(MBBI); }
981voiderase(iteratorMBBI) { BasicBlocks.erase(MBBI); }
982voiderase(MachineBasicBlock *MBBI) { BasicBlocks.erase(MBBI); }
983
984template <typename Comp>
985voidsort(Comp comp) {
986 BasicBlocks.sort(comp);
987 }
988
989 /// Return the number of \p MachineInstrs in this \p MachineFunction.
990unsignedgetInstructionCount() const{
991unsignedInstrCount = 0;
992for (constMachineBasicBlock &MBB : BasicBlocks)
993InstrCount +=MBB.size();
994returnInstrCount;
995 }
996
997//===--------------------------------------------------------------------===//
998// Internal functions used to automatically number MachineBasicBlocks
999
1000 /// Adds the MBB to the internal numbering. Returns the unique number
1001 /// assigned to the MBB.
1002unsignedaddToMBBNumbering(MachineBasicBlock *MBB) {
1003 MBBNumbering.push_back(MBB);
1004return (unsigned)MBBNumbering.size()-1;
1005 }
1006
1007 /// removeFromMBBNumbering - Remove the specific machine basic block from our
1008 /// tracker, this is only really to be used by the MachineBasicBlock
1009 /// implementation.
1010voidremoveFromMBBNumbering(unsignedN) {
1011assert(N < MBBNumbering.size() &&"Illegal basic block #");
1012 MBBNumbering[N] =nullptr;
1013 }
1014
1015 /// CreateMachineInstr - Allocate a new MachineInstr. Use this instead
1016 /// of `new MachineInstr'.
1017MachineInstr *CreateMachineInstr(constMCInstrDesc &MCID,DebugLocDL,
1018bool NoImplicit =false);
1019
1020 /// Create a new MachineInstr which is a copy of \p Orig, identical in all
1021 /// ways except the instruction has no parent, prev, or next. Bundling flags
1022 /// are reset.
1023 ///
1024 /// Note: Clones a single instruction, not whole instruction bundles.
1025 /// Does not perform target specific adjustments; consider using
1026 /// TargetInstrInfo::duplicate() instead.
1027MachineInstr *CloneMachineInstr(constMachineInstr *Orig);
1028
1029 /// Clones instruction or the whole instruction bundle \p Orig and insert
1030 /// into \p MBB before \p InsertBefore.
1031 ///
1032 /// Note: Does not perform target specific adjustments; consider using
1033 /// TargetInstrInfo::duplicate() instead.
1034MachineInstr &
1035 cloneMachineInstrBundle(MachineBasicBlock &MBB,
1036MachineBasicBlock::iterator InsertBefore,
1037constMachineInstr &Orig);
1038
1039 /// DeleteMachineInstr - Delete the given MachineInstr.
1040void deleteMachineInstr(MachineInstr *MI);
1041
1042 /// CreateMachineBasicBlock - Allocate a new MachineBasicBlock. Use this
1043 /// instead of `new MachineBasicBlock'. Sets `MachineBasicBlock::BBID` if
1044 /// basic-block-sections is enabled for the function.
1045MachineBasicBlock *
1046 CreateMachineBasicBlock(constBasicBlock *BB =nullptr,
1047 std::optional<UniqueBBID> BBID = std::nullopt);
1048
1049 /// DeleteMachineBasicBlock - Delete the given MachineBasicBlock.
1050void deleteMachineBasicBlock(MachineBasicBlock *MBB);
1051
1052 /// getMachineMemOperand - Allocate a new MachineMemOperand.
1053 /// MachineMemOperands are owned by the MachineFunction and need not be
1054 /// explicitly deallocated.
1055MachineMemOperand *getMachineMemOperand(
1056MachinePointerInfo PtrInfo,MachineMemOperand::Flags f,LLT MemTy,
1057Align base_alignment,constAAMDNodes &AAInfo =AAMDNodes(),
1058constMDNode *Ranges =nullptr,SyncScope::ID SSID = SyncScope::System,
1059AtomicOrdering Ordering = AtomicOrdering::NotAtomic,
1060AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic);
1061MachineMemOperand *getMachineMemOperand(
1062MachinePointerInfo PtrInfo,MachineMemOperand::FlagsF,LocationSizeSize,
1063Align BaseAlignment,constAAMDNodes &AAInfo =AAMDNodes(),
1064constMDNode *Ranges =nullptr,SyncScope::ID SSID = SyncScope::System,
1065AtomicOrdering Ordering = AtomicOrdering::NotAtomic,
1066AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic);
1067MachineMemOperand *getMachineMemOperand(
1068MachinePointerInfo PtrInfo,MachineMemOperand::FlagsF,uint64_tSize,
1069Align BaseAlignment,constAAMDNodes &AAInfo =AAMDNodes(),
1070constMDNode *Ranges =nullptr,SyncScope::ID SSID = SyncScope::System,
1071AtomicOrdering Ordering = AtomicOrdering::NotAtomic,
1072AtomicOrdering FailureOrdering = AtomicOrdering::NotAtomic) {
1073returngetMachineMemOperand(PtrInfo,F, LocationSize::precise(Size),
1074 BaseAlignment, AAInfo, Ranges, SSID, Ordering,
1075 FailureOrdering);
1076 }
1077
1078 /// getMachineMemOperand - Allocate a new MachineMemOperand by copying
1079 /// an existing one, adjusting by an offset and using the given size.
1080 /// MachineMemOperands are owned by the MachineFunction and need not be
1081 /// explicitly deallocated.
1082MachineMemOperand *getMachineMemOperand(constMachineMemOperand *MMO,
1083 int64_tOffset,LLT Ty);
1084MachineMemOperand *getMachineMemOperand(constMachineMemOperand *MMO,
1085 int64_tOffset,LocationSizeSize) {
1086returngetMachineMemOperand(
1087 MMO,Offset,
1088 !Size.hasValue() ?LLT()
1089 :Size.isScalable()
1090 ? LLT::scalable_vector(1, 8 *Size.getValue().getKnownMinValue())
1091 : LLT::scalar(8 *Size.getValue().getKnownMinValue()));
1092 }
1093MachineMemOperand *getMachineMemOperand(constMachineMemOperand *MMO,
1094 int64_tOffset,uint64_tSize) {
1095returngetMachineMemOperand(MMO,Offset, LocationSize::precise(Size));
1096 }
1097
1098 /// getMachineMemOperand - Allocate a new MachineMemOperand by copying
1099 /// an existing one, replacing only the MachinePointerInfo and size.
1100 /// MachineMemOperands are owned by the MachineFunction and need not be
1101 /// explicitly deallocated.
1102MachineMemOperand *getMachineMemOperand(constMachineMemOperand *MMO,
1103constMachinePointerInfo &PtrInfo,
1104LocationSizeSize);
1105MachineMemOperand *getMachineMemOperand(constMachineMemOperand *MMO,
1106constMachinePointerInfo &PtrInfo,
1107LLT Ty);
1108MachineMemOperand *getMachineMemOperand(constMachineMemOperand *MMO,
1109constMachinePointerInfo &PtrInfo,
1110uint64_tSize) {
1111returngetMachineMemOperand(MMO, PtrInfo, LocationSize::precise(Size));
1112 }
1113
1114 /// Allocate a new MachineMemOperand by copying an existing one,
1115 /// replacing only AliasAnalysis information. MachineMemOperands are owned
1116 /// by the MachineFunction and need not be explicitly deallocated.
1117MachineMemOperand *getMachineMemOperand(constMachineMemOperand *MMO,
1118constAAMDNodes &AAInfo);
1119
1120 /// Allocate a new MachineMemOperand by copying an existing one,
1121 /// replacing the flags. MachineMemOperands are owned
1122 /// by the MachineFunction and need not be explicitly deallocated.
1123MachineMemOperand *getMachineMemOperand(constMachineMemOperand *MMO,
1124MachineMemOperand::Flags Flags);
1125
1126usingOperandCapacity =ArrayRecycler<MachineOperand>::Capacity;
1127
1128 /// Allocate an array of MachineOperands. This is only intended for use by
1129 /// internal MachineInstr functions.
1130MachineOperand *allocateOperandArray(OperandCapacity Cap) {
1131return OperandRecycler.allocate(Cap,Allocator);
1132 }
1133
1134 /// Dellocate an array of MachineOperands and recycle the memory. This is
1135 /// only intended for use by internal MachineInstr functions.
1136 /// Cap must be the same capacity that was used to allocate the array.
1137voiddeallocateOperandArray(OperandCapacity Cap,MachineOperand *Array) {
1138 OperandRecycler.deallocate(Cap, Array);
1139 }
1140
1141 /// Allocate and initialize a register mask with @p NumRegister bits.
1142uint32_t *allocateRegMask();
1143
1144ArrayRef<int> allocateShuffleMask(ArrayRef<int> Mask);
1145
1146 /// Allocate and construct an extra info structure for a `MachineInstr`.
1147 ///
1148 /// This is allocated on the function's allocator and so lives the life of
1149 /// the function.
1150 MachineInstr::ExtraInfo *createMIExtraInfo(
1151ArrayRef<MachineMemOperand *> MMOs,MCSymbol *PreInstrSymbol =nullptr,
1152MCSymbol *PostInstrSymbol =nullptr,MDNode *HeapAllocMarker =nullptr,
1153MDNode *PCSections =nullptr,uint32_t CFIType = 0,
1154MDNode *MMRAs =nullptr);
1155
1156 /// Allocate a string and populate it with the given external symbol name.
1157constchar *createExternalSymbolName(StringRefName);
1158
1159//===--------------------------------------------------------------------===//
1160// Label Manipulation.
1161
1162 /// getJTISymbol - Return the MCSymbol for the specified non-empty jump table.
1163 /// If isLinkerPrivate is specified, an 'l' label is returned, otherwise a
1164 /// normal 'L' label is returned.
1165MCSymbol *getJTISymbol(unsigned JTI,MCContext &Ctx,
1166bool isLinkerPrivate =false)const;
1167
1168 /// getPICBaseSymbol - Return a function-local symbol to represent the PIC
1169 /// base.
1170MCSymbol *getPICBaseSymbol()const;
1171
1172 /// Returns a reference to a list of cfi instructions in the function's
1173 /// prologue. Used to construct frame maps for debug and exception handling
1174 /// comsumers.
1175const std::vector<MCCFIInstruction> &getFrameInstructions() const{
1176return FrameInstructions;
1177 }
1178
1179 [[nodiscard]]unsigned addFrameInst(constMCCFIInstruction &Inst);
1180
1181 /// Returns a reference to a list of symbols immediately following calls to
1182 /// _setjmp in the function. Used to construct the longjmp target table used
1183 /// by Windows Control Flow Guard.
1184const std::vector<MCSymbol *> &getLongjmpTargets() const{
1185return LongjmpTargets;
1186 }
1187
1188 /// Add the specified symbol to the list of valid longjmp targets for Windows
1189 /// Control Flow Guard.
1190voidaddLongjmpTarget(MCSymbol *Target) { LongjmpTargets.push_back(Target); }
1191
1192 /// Returns a reference to a list of symbols that we have catchrets.
1193 /// Used to construct the catchret target table used by Windows EHCont Guard.
1194const std::vector<MCSymbol *> &getCatchretTargets() const{
1195return CatchretTargets;
1196 }
1197
1198 /// Add the specified symbol to the list of valid catchret targets for Windows
1199 /// EHCont Guard.
1200voidaddCatchretTarget(MCSymbol *Target) {
1201 CatchretTargets.push_back(Target);
1202 }
1203
1204 /// Tries to get the global and target flags for a call site, if the
1205 /// instruction is a call to a global.
1206CalledGlobalInfotryGetCalledGlobal(constMachineInstr *MI) const{
1207return CalledGlobalsInfo.lookup(MI);
1208 }
1209
1210 /// Notes the global and target flags for a call site.
1211voidaddCalledGlobal(constMachineInstr *MI,CalledGlobalInfo Details) {
1212assert(MI &&"MI must not be null");
1213assert(Details.Callee &&"Global must not be null");
1214 CalledGlobalsInfo.insert({MI, Details});
1215 }
1216
1217 /// Iterates over the full set of call sites and their associated globals.
1218autogetCalledGlobals() const{
1219returnllvm::make_range(CalledGlobalsInfo.begin(), CalledGlobalsInfo.end());
1220 }
1221
1222 /// \name Exception Handling
1223 /// \{
1224
1225boolcallsEHReturn() const{return CallsEHReturn; }
1226voidsetCallsEHReturn(bool b) { CallsEHReturn = b; }
1227
1228boolcallsUnwindInit() const{return CallsUnwindInit; }
1229voidsetCallsUnwindInit(bool b) { CallsUnwindInit = b; }
1230
1231boolhasEHCatchret() const{return HasEHCatchret; }
1232voidsetHasEHCatchret(bool V) { HasEHCatchret = V; }
1233
1234boolhasEHScopes() const{return HasEHScopes; }
1235voidsetHasEHScopes(bool V) { HasEHScopes = V; }
1236
1237boolhasEHFunclets() const{return HasEHFunclets; }
1238voidsetHasEHFunclets(bool V) { HasEHFunclets = V; }
1239
1240boolhasFakeUses() const{return HasFakeUses; }
1241voidsetHasFakeUses(bool V) { HasFakeUses = V; }
1242
1243boolisOutlined() const{return IsOutlined; }
1244voidsetIsOutlined(bool V) { IsOutlined = V; }
1245
1246 /// Find or create an LandingPadInfo for the specified MachineBasicBlock.
1247LandingPadInfo &getOrCreateLandingPadInfo(MachineBasicBlock *LandingPad);
1248
1249 /// Return a reference to the landing pad info for the current function.
1250const std::vector<LandingPadInfo> &getLandingPads() const{
1251return LandingPads;
1252 }
1253
1254 /// Provide the begin and end labels of an invoke style call and associate it
1255 /// with a try landing pad block.
1256void addInvoke(MachineBasicBlock *LandingPad,
1257MCSymbol *BeginLabel,MCSymbol *EndLabel);
1258
1259 /// Add a new panding pad, and extract the exception handling information from
1260 /// the landingpad instruction. Returns the label ID for the landing pad
1261 /// entry.
1262MCSymbol *addLandingPad(MachineBasicBlock *LandingPad);
1263
1264 /// Return the type id for the specified typeinfo. This is function wide.
1265unsigned getTypeIDFor(constGlobalValue *TI);
1266
1267 /// Return the id of the filter encoded by TyIds. This is function wide.
1268int getFilterIDFor(ArrayRef<unsigned> TyIds);
1269
1270 /// Map the landing pad's EH symbol to the call site indexes.
1271void setCallSiteLandingPad(MCSymbol *Sym,ArrayRef<unsigned> Sites);
1272
1273 /// Return if there is any wasm exception handling.
1274boolhasAnyWasmLandingPadIndex() const{
1275return !WasmLPadToIndexMap.empty();
1276 }
1277
1278 /// Map the landing pad to its index. Used for Wasm exception handling.
1279voidsetWasmLandingPadIndex(constMachineBasicBlock *LPad,unsignedIndex) {
1280 WasmLPadToIndexMap[LPad] =Index;
1281 }
1282
1283 /// Returns true if the landing pad has an associate index in wasm EH.
1284boolhasWasmLandingPadIndex(constMachineBasicBlock *LPad) const{
1285return WasmLPadToIndexMap.count(LPad);
1286 }
1287
1288 /// Get the index in wasm EH for a given landing pad.
1289unsignedgetWasmLandingPadIndex(constMachineBasicBlock *LPad) const{
1290assert(hasWasmLandingPadIndex(LPad));
1291return WasmLPadToIndexMap.lookup(LPad);
1292 }
1293
1294boolhasAnyCallSiteLandingPad() const{
1295return !LPadToCallSiteMap.empty();
1296 }
1297
1298 /// Get the call site indexes for a landing pad EH symbol.
1299SmallVectorImpl<unsigned> &getCallSiteLandingPad(MCSymbol *Sym) {
1300assert(hasCallSiteLandingPad(Sym) &&
1301"missing call site number for landing pad!");
1302return LPadToCallSiteMap[Sym];
1303 }
1304
1305 /// Return true if the landing pad Eh symbol has an associated call site.
1306boolhasCallSiteLandingPad(MCSymbol *Sym) {
1307return !LPadToCallSiteMap[Sym].empty();
1308 }
1309
1310boolhasAnyCallSiteLabel() const{
1311return !CallSiteMap.empty();
1312 }
1313
1314 /// Map the begin label for a call site.
1315voidsetCallSiteBeginLabel(MCSymbol *BeginLabel,unsigned Site) {
1316 CallSiteMap[BeginLabel] = Site;
1317 }
1318
1319 /// Get the call site number for a begin label.
1320unsignedgetCallSiteBeginLabel(MCSymbol *BeginLabel) const{
1321assert(hasCallSiteBeginLabel(BeginLabel) &&
1322"Missing call site number for EH_LABEL!");
1323return CallSiteMap.lookup(BeginLabel);
1324 }
1325
1326 /// Return true if the begin label has a call site number associated with it.
1327boolhasCallSiteBeginLabel(MCSymbol *BeginLabel) const{
1328return CallSiteMap.count(BeginLabel);
1329 }
1330
1331 /// Record annotations associated with a particular label.
1332voidaddCodeViewAnnotation(MCSymbol *Label,MDNode *MD) {
1333 CodeViewAnnotations.push_back({Label, MD});
1334 }
1335
1336ArrayRef<std::pair<MCSymbol *, MDNode *>>getCodeViewAnnotations() const{
1337return CodeViewAnnotations;
1338 }
1339
1340 /// Return a reference to the C++ typeinfo for the current function.
1341const std::vector<const GlobalValue *> &getTypeInfos() const{
1342return TypeInfos;
1343 }
1344
1345 /// Return a reference to the typeids encoding filters used in the current
1346 /// function.
1347const std::vector<unsigned> &getFilterIds() const{
1348return FilterIds;
1349 }
1350
1351 /// \}
1352
1353 /// Collect information used to emit debugging information of a variable in a
1354 /// stack slot.
1355voidsetVariableDbgInfo(constDILocalVariable *Var,constDIExpression *Expr,
1356int Slot,constDILocation *Loc) {
1357 VariableDbgInfos.emplace_back(Var, Expr, Slot, Loc);
1358 }
1359
1360 /// Collect information used to emit debugging information of a variable in
1361 /// the entry value of a register.
1362voidsetVariableDbgInfo(constDILocalVariable *Var,constDIExpression *Expr,
1363MCRegisterReg,constDILocation *Loc) {
1364 VariableDbgInfos.emplace_back(Var, Expr,Reg, Loc);
1365 }
1366
1367VariableDbgInfoMapTy &getVariableDbgInfo() {return VariableDbgInfos; }
1368constVariableDbgInfoMapTy &getVariableDbgInfo() const{
1369return VariableDbgInfos;
1370 }
1371
1372 /// Returns the collection of variables for which we have debug info and that
1373 /// have been assigned a stack slot.
1374autogetInStackSlotVariableDbgInfo() {
1375returnmake_filter_range(getVariableDbgInfo(), [](auto &VarInfo) {
1376return VarInfo.inStackSlot();
1377 });
1378 }
1379
1380 /// Returns the collection of variables for which we have debug info and that
1381 /// have been assigned a stack slot.
1382autogetInStackSlotVariableDbgInfo() const{
1383returnmake_filter_range(getVariableDbgInfo(), [](constauto &VarInfo) {
1384return VarInfo.inStackSlot();
1385 });
1386 }
1387
1388 /// Returns the collection of variables for which we have debug info and that
1389 /// have been assigned an entry value register.
1390autogetEntryValueVariableDbgInfo() const{
1391returnmake_filter_range(getVariableDbgInfo(), [](constauto &VarInfo) {
1392return VarInfo.inEntryValueRegister();
1393 });
1394 }
1395
1396 /// Start tracking the arguments passed to the call \p CallI.
1397voidaddCallSiteInfo(constMachineInstr *CallI,CallSiteInfo &&CallInfo) {
1398assert(CallI->isCandidateForAdditionalCallInfo());
1399bool Inserted =
1400 CallSitesInfo.try_emplace(CallI, std::move(CallInfo)).second;
1401 (void)Inserted;
1402assert(Inserted &&"Call site info not unique");
1403 }
1404
1405constCallSiteInfoMap &getCallSitesInfo() const{
1406return CallSitesInfo;
1407 }
1408
1409 /// Following functions update call site info. They should be called before
1410 /// removing, replacing or copying call instruction.
1411
1412 /// Erase the call site info for \p MI. It is used to remove a call
1413 /// instruction from the instruction stream.
1414void eraseAdditionalCallInfo(constMachineInstr *MI);
1415 /// Copy the call site info from \p Old to \ New. Its usage is when we are
1416 /// making a copy of the instruction that will be inserted at different point
1417 /// of the instruction stream.
1418void copyAdditionalCallInfo(constMachineInstr *Old,constMachineInstr *New);
1419
1420 /// Move the call site info from \p Old to \New call site info. This function
1421 /// is used when we are replacing one call instruction with another one to
1422 /// the same callee.
1423void moveAdditionalCallInfo(constMachineInstr *Old,constMachineInstr *New);
1424
1425unsignedgetNewDebugInstrNum() {
1426return ++DebugInstrNumberingCount;
1427 }
1428};
1429
1430//===--------------------------------------------------------------------===//
1431// GraphTraits specializations for function basic block graphs (CFGs)
1432//===--------------------------------------------------------------------===//
1433
1434// Provide specializations of GraphTraits to be able to treat a
1435// machine function as a graph of machine basic blocks... these are
1436// the same as the machine basic block iterators, except that the root
1437// node is implicitly the first node of the function.
1438//
1439template <>structGraphTraits<MachineFunction*> :
1440publicGraphTraits<MachineBasicBlock*> {
1441staticNodeRefgetEntryNode(MachineFunction *F) {return &F->front(); }
1442
1443// nodes_iterator/begin/end - Allow iteration over all nodes in the graph
1444usingnodes_iterator =pointer_iterator<MachineFunction::iterator>;
1445
1446staticnodes_iteratornodes_begin(MachineFunction *F) {
1447returnnodes_iterator(F->begin());
1448 }
1449
1450staticnodes_iteratornodes_end(MachineFunction *F) {
1451returnnodes_iterator(F->end());
1452 }
1453
1454staticunsignedsize (MachineFunction *F) {returnF->size(); }
1455
1456staticunsignedgetMaxNumber(MachineFunction *F) {
1457returnF->getNumBlockIDs();
1458 }
1459staticunsignedgetNumberEpoch(MachineFunction *F) {
1460returnF->getBlockNumberEpoch();
1461 }
1462};
1463template <>structGraphTraits<constMachineFunction*> :
1464publicGraphTraits<const MachineBasicBlock*> {
1465staticNodeRefgetEntryNode(constMachineFunction *F) {return &F->front(); }
1466
1467// nodes_iterator/begin/end - Allow iteration over all nodes in the graph
1468usingnodes_iterator =pointer_iterator<MachineFunction::const_iterator>;
1469
1470staticnodes_iteratornodes_begin(constMachineFunction *F) {
1471returnnodes_iterator(F->begin());
1472 }
1473
1474staticnodes_iteratornodes_end (constMachineFunction *F) {
1475returnnodes_iterator(F->end());
1476 }
1477
1478staticunsignedsize (constMachineFunction *F) {
1479returnF->size();
1480 }
1481
1482staticunsignedgetMaxNumber(constMachineFunction *F) {
1483returnF->getNumBlockIDs();
1484 }
1485staticunsignedgetNumberEpoch(constMachineFunction *F) {
1486returnF->getBlockNumberEpoch();
1487 }
1488};
1489
1490// Provide specializations of GraphTraits to be able to treat a function as a
1491// graph of basic blocks... and to walk it in inverse order. Inverse order for
1492// a function is considered to be when traversing the predecessor edges of a BB
1493// instead of the successor edges.
1494//
1495template <>structGraphTraits<Inverse<MachineFunction*>> :
1496publicGraphTraits<Inverse<MachineBasicBlock*>> {
1497staticNodeRefgetEntryNode(Inverse<MachineFunction *>G) {
1498return &G.Graph->front();
1499 }
1500
1501staticunsignedgetMaxNumber(MachineFunction *F) {
1502returnF->getNumBlockIDs();
1503 }
1504staticunsignedgetNumberEpoch(MachineFunction *F) {
1505returnF->getBlockNumberEpoch();
1506 }
1507};
1508template <>structGraphTraits<Inverse<constMachineFunction*>> :
1509publicGraphTraits<Inverse<const MachineBasicBlock*>> {
1510staticNodeRefgetEntryNode(Inverse<const MachineFunction *>G) {
1511return &G.Graph->front();
1512 }
1513
1514staticunsignedgetMaxNumber(constMachineFunction *F) {
1515returnF->getNumBlockIDs();
1516 }
1517staticunsignedgetNumberEpoch(constMachineFunction *F) {
1518returnF->getBlockNumberEpoch();
1519 }
1520};
1521
1522voidverifyMachineFunction(const std::string &Banner,
1523const MachineFunction &MF);
1524
1525}// end namespace llvm
1526
1527#endif// LLVM_CODEGEN_MACHINEFUNCTION_H
SubReg
unsigned SubReg
Definition:AArch64AdvSIMDScalarPass.cpp:104
Pass
aarch64 AArch64 CCMP Pass
Definition:AArch64ConditionalCompares.cpp:800
const
aarch64 promote const
Definition:AArch64PromoteConstant.cpp:230
MBB
MachineBasicBlock & MBB
Definition:ARMSLSHardening.cpp:71
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition:ARMSLSHardening.cpp:73
MBBI
MachineBasicBlock MachineBasicBlock::iterator MBBI
Definition:ARMSLSHardening.cpp:72
Allocator.h
This file defines the BumpPtrAllocator interface.
print
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
Definition:ArchiveWriter.cpp:205
ArrayRecycler.h
ArrayRef.h
AtomicOrdering.h
Atomic ordering constants.
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
A
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
viewCFG
static void viewCFG(Function &F, const BlockFrequencyInfo *BFI, const BranchProbabilityInfo *BPI, uint64_t MaxFreq, bool CFGOnly=false)
Definition:CFGPrinter.cpp:82
Compiler.h
InstrCount
static unsigned InstrCount
Definition:DFAPacketizer.cpp:51
DenseMap.h
This file defines the DenseMap class.
EHPersonalities.h
Name
std::string Name
Definition:ELFObjHandler.cpp:77
Index
uint32_t Index
Definition:ELFObjHandler.cpp:83
Size
uint64_t Size
Definition:ELFObjHandler.cpp:81
Other
std::optional< std::vector< StOtherPiece > > Other
Definition:ELFYAML.cpp:1315
Offset
uint64_t Offset
Definition:ELF_riscv.cpp:478
Sym
Symbol * Sym
Definition:ELF_riscv.cpp:479
GraphTraits.h
This file defines the little GraphTraits<X> template class that should be specialized by classes that...
MI
IRTranslator LLVM IR MI
Definition:IRTranslator.cpp:112
estimateFunctionSizeInBytes
static uint64_t estimateFunctionSizeInBytes(const LoongArchInstrInfo *TII, const MachineFunction &MF)
Definition:LoongArchFrameLowering.cpp:122
F
#define F(x, y, z)
Definition:MD5.cpp:55
G
#define G(x, y, z)
Definition:MD5.cpp:56
MachineBasicBlock.h
MachineInstr.h
MachineMemOperand.h
Reg
unsigned Reg
Definition:MachineSink.cpp:2028
addLiveIn
static unsigned addLiveIn(MachineFunction &MF, unsigned PReg, const TargetRegisterClass *RC)
Definition:MipsISelLowering.cpp:1323
P
#define P(N)
verify
ppc ctr loops verify
Definition:PPCCTRLoopsVerify.cpp:72
getName
static StringRef getName(Value *V)
Definition:ProvenanceAnalysisEvaluator.cpp:20
Recycler.h
Allocator
Basic Register Allocator
Definition:RegAllocBasic.cpp:146
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Address
@ Address
Definition:SPIRVEmitNonSemanticDI.cpp:68
OS
raw_pwrite_stream & OS
Definition:SampleProfWriter.cpp:51
SmallVector.h
This file defines the SmallVector class.
getMachineMemOperand
static MachineMemOperand * getMachineMemOperand(MachineFunction &MF, FrameIndexSDNode &FI)
Definition:StatepointLowering.cpp:358
TargetOptions.h
T
llvm::ArrayRecycler::Capacity
The size of an allocated array is represented by a Capacity instance.
Definition:ArrayRecycler.h:71
llvm::ArrayRecycler
Recycle small arrays allocated from a BumpPtrAllocator.
Definition:ArrayRecycler.h:28
llvm::ArrayRecycler::allocate
T * allocate(Capacity Cap, AllocatorType &Allocator)
Allocate an array of at least the requested capacity.
Definition:ArrayRecycler.h:125
llvm::ArrayRecycler::deallocate
void deallocate(Capacity Cap, T *Ptr)
Deallocate an array with the specified Capacity.
Definition:ArrayRecycler.h:137
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition:ArrayRef.h:41
llvm::BasicBlock
LLVM Basic Block Representation.
Definition:BasicBlock.h:61
llvm::BlockAddress
The address of a basic block.
Definition:Constants.h:893
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition:Allocator.h:66
llvm::CallInfo
Definition:GVNHoist.cpp:213
llvm::ConstantPool
Definition:ConstantPools.h:43
llvm::DIExpression
DWARF expression.
Definition:DebugInfoMetadata.h:2763
llvm::DILocalVariable
Local variable.
Definition:DebugInfoMetadata.h:3460
llvm::DILocation
Debug location.
Definition:DebugInfoMetadata.h:1988
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it.
Definition:DataLayout.h:63
llvm::DebugLoc
A debug info location.
Definition:DebugLoc.h:33
llvm::DenseMapBase::lookup
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...
Definition:DenseMap.h:194
llvm::DenseMapBase::try_emplace
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&...Args)
Definition:DenseMap.h:226
llvm::DenseMapBase::empty
bool empty() const
Definition:DenseMap.h:98
llvm::DenseMapBase::begin
iterator begin()
Definition:DenseMap.h:75
llvm::DenseMapBase::count
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
Definition:DenseMap.h:152
llvm::DenseMapBase::end
iterator end()
Definition:DenseMap.h:84
llvm::DenseMapBase::insert
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Definition:DenseMap.h:211
llvm::DenseMapIterator
Definition:DenseMap.h:1189
llvm::DenseMap
Definition:DenseMap.h:727
llvm::Function
Definition:Function.h:63
llvm::GISelChangeObserver
Abstract class that contains various methods for clients to notify about changes.
Definition:GISelChangeObserver.h:29
llvm::GlobalValue
Definition:GlobalValue.h:48
llvm::LLT
Definition:LowLevelType.h:39
llvm::LiveIntervals
Definition:LiveIntervals.h:55
llvm::LocationSize
Definition:MemoryLocation.h:68
llvm::MCCFIInstruction
Definition:MCDwarf.h:499
llvm::MCContext
Context object for machine code objects.
Definition:MCContext.h:83
llvm::MCInstrDesc
Describe properties that are true of each instruction in the target description file.
Definition:MCInstrDesc.h:198
llvm::MCRegister
Wrapper class representing physical registers. Should be passed by value.
Definition:MCRegister.h:33
llvm::MCSection
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition:MCSection.h:36
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition:MCSymbol.h:41
llvm::MDNode
Metadata node.
Definition:Metadata.h:1073
llvm::MachineBasicBlock
Definition:MachineBasicBlock.h:125
llvm::MachineConstantPool
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
Definition:MachineConstantPool.h:117
llvm::MachineFrameInfo
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Definition:MachineFrameInfo.h:106
llvm::MachineFunctionProperties
Properties which a MachineFunction may have at a given point in time.
Definition:MachineFunction.h:137
llvm::MachineFunctionProperties::reset
MachineFunctionProperties & reset()
Reset all the properties.
Definition:MachineFunction.h:218
llvm::MachineFunctionProperties::set
MachineFunctionProperties & set(const MachineFunctionProperties &MFP)
Definition:MachineFunction.h:223
llvm::MachineFunctionProperties::print
void print(raw_ostream &OS) const
Print the MachineFunctionProperties in human-readable form.
Definition:MachineFunction.cpp:136
llvm::MachineFunctionProperties::verifyRequiredProperties
bool verifyRequiredProperties(const MachineFunctionProperties &V) const
Definition:MachineFunction.h:235
llvm::MachineFunctionProperties::reset
MachineFunctionProperties & reset(const MachineFunctionProperties &MFP)
Definition:MachineFunction.h:228
llvm::MachineFunctionProperties::set
MachineFunctionProperties & set(Property P)
Definition:MachineFunction.h:207
llvm::MachineFunctionProperties::hasProperty
bool hasProperty(Property P) const
Definition:MachineFunction.h:203
llvm::MachineFunctionProperties::Property
Property
Definition:MachineFunction.h:187
llvm::MachineFunctionProperties::Property::TracksLiveness
@ TracksLiveness
llvm::MachineFunctionProperties::Property::FailsVerification
@ FailsVerification
llvm::MachineFunctionProperties::Property::RegBankSelected
@ RegBankSelected
llvm::MachineFunctionProperties::Property::TiedOpsRewritten
@ TiedOpsRewritten
llvm::MachineFunctionProperties::Property::IsSSA
@ IsSSA
llvm::MachineFunctionProperties::Property::NoVRegs
@ NoVRegs
llvm::MachineFunctionProperties::Property::TracksDebugUserValues
@ TracksDebugUserValues
llvm::MachineFunctionProperties::Property::NoPHIs
@ NoPHIs
llvm::MachineFunctionProperties::Property::FailedISel
@ FailedISel
llvm::MachineFunctionProperties::Property::FailedRegAlloc
@ FailedRegAlloc
llvm::MachineFunctionProperties::Property::Selected
@ Selected
llvm::MachineFunctionProperties::Property::LastProperty
@ LastProperty
llvm::MachineFunctionProperties::Property::Legalized
@ Legalized
llvm::MachineFunctionProperties::reset
MachineFunctionProperties & reset(Property P)
Definition:MachineFunction.h:212
llvm::MachineFunction::DebugPHIRegallocPos
Location of a PHI instruction that is also a debug-info variable value, for the duration of register ...
Definition:MachineFunction.h:584
llvm::MachineFunction::DebugPHIRegallocPos::DebugPHIRegallocPos
DebugPHIRegallocPos(MachineBasicBlock *MBB, Register Reg, unsigned SubReg)
Definition:MachineFunction.h:589
llvm::MachineFunction::DebugPHIRegallocPos::Reg
Register Reg
VReg where the control-flow-merge happens.
Definition:MachineFunction.h:587
llvm::MachineFunction::DebugPHIRegallocPos::SubReg
unsigned SubReg
Optional subreg qualifier within Reg.
Definition:MachineFunction.h:588
llvm::MachineFunction::DebugPHIRegallocPos::MBB
MachineBasicBlock * MBB
Block where this PHI was originally located.
Definition:MachineFunction.h:586
llvm::MachineFunction::DebugSubstitution
Replacement definition for a debug instruction reference.
Definition:MachineFunction.h:556
llvm::MachineFunction::DebugSubstitution::operator<
bool operator<(const DebugSubstitution &Other) const
Order only by source instruction / operand pair: there should never be duplicate entries for the same...
Definition:MachineFunction.h:568
llvm::MachineFunction::DebugSubstitution::Dest
DebugInstrOperandPair Dest
Replacement instruction / operand pair.
Definition:MachineFunction.h:559
llvm::MachineFunction::DebugSubstitution::Src
DebugInstrOperandPair Src
Source instruction / operand pair.
Definition:MachineFunction.h:558
llvm::MachineFunction::DebugSubstitution::DebugSubstitution
DebugSubstitution(const DebugInstrOperandPair &Src, const DebugInstrOperandPair &Dest, unsigned Subreg)
Definition:MachineFunction.h:562
llvm::MachineFunction::DebugSubstitution::Subreg
unsigned Subreg
Qualifier for which part of Dest is read.
Definition:MachineFunction.h:560
llvm::MachineFunction::Delegate
Definition:MachineFunction.h:469
llvm::MachineFunction::Delegate::MF_HandleChangeDesc
virtual void MF_HandleChangeDesc(MachineInstr &MI, const MCInstrDesc &TID)
Callback before changing MCInstrDesc.
Definition:MachineFunction.h:480
llvm::MachineFunction::Delegate::MF_HandleRemoval
virtual void MF_HandleRemoval(MachineInstr &MI)=0
Callback before a removal. This should not modify the MI directly.
llvm::MachineFunction::Delegate::MF_HandleInsertion
virtual void MF_HandleInsertion(MachineInstr &MI)=0
Callback after an insertion. This should not modify the MI directly.
llvm::MachineFunction::Delegate::~Delegate
virtual ~Delegate()=default
llvm::MachineFunction::VariableDbgInfo
Description of the location of a variable whose Address is valid and unchanging during function execu...
Definition:MachineFunction.h:427
llvm::MachineFunction::VariableDbgInfo::inStackSlot
bool inStackSlot() const
Return true if this variable is in a stack slot.
Definition:MachineFunction.h:444
llvm::MachineFunction::VariableDbgInfo::Loc
const DILocation * Loc
Definition:MachineFunction.h:433
llvm::MachineFunction::VariableDbgInfo::updateStackSlot
void updateStackSlot(int NewSlot)
Updates the stack slot of this variable, assuming inStackSlot() is true.
Definition:MachineFunction.h:463
llvm::MachineFunction::VariableDbgInfo::getEntryValueRegister
MCRegister getEntryValueRegister() const
Returns the MCRegister of this variable, assuming inEntryValueRegister() is true.
Definition:MachineFunction.h:457
llvm::MachineFunction::VariableDbgInfo::inEntryValueRegister
bool inEntryValueRegister() const
Return true if this variable is in the entry value of a register.
Definition:MachineFunction.h:447
llvm::MachineFunction::VariableDbgInfo::Var
const DILocalVariable * Var
Definition:MachineFunction.h:431
llvm::MachineFunction::VariableDbgInfo::VariableDbgInfo
VariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, int Slot, const DILocation *Loc)
Definition:MachineFunction.h:435
llvm::MachineFunction::VariableDbgInfo::getStackSlot
int getStackSlot() const
Returns the stack slot of this variable, assuming inStackSlot() is true.
Definition:MachineFunction.h:453
llvm::MachineFunction::VariableDbgInfo::Expr
const DIExpression * Expr
Definition:MachineFunction.h:432
llvm::MachineFunction::VariableDbgInfo::VariableDbgInfo
VariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, MCRegister EntryValReg, const DILocation *Loc)
Definition:MachineFunction.h:439
llvm::MachineFunction
Definition:MachineFunction.h:267
llvm::MachineFunction::getInstructionCount
unsigned getInstructionCount() const
Return the number of MachineInstrs in this MachineFunction.
Definition:MachineFunction.h:990
llvm::MachineFunction::getEntryValueVariableDbgInfo
auto getEntryValueVariableDbgInfo() const
Returns the collection of variables for which we have debug info and that have been assigned an entry...
Definition:MachineFunction.h:1390
llvm::MachineFunction::setBBSectionsType
void setBBSectionsType(BasicBlockSection V)
Definition:MachineFunction.h:722
llvm::MachineFunction::getJumpTableInfo
MachineJumpTableInfo * getJumpTableInfo()
Definition:MachineFunction.h:757
llvm::MachineFunction::getWinEHFuncInfo
const WinEHFuncInfo * getWinEHFuncInfo() const
getWinEHFuncInfo - Return information about how the current function uses Windows exception handling.
Definition:MachineFunction.h:777
llvm::MachineFunction::setCallsUnwindInit
void setCallsUnwindInit(bool b)
Definition:MachineFunction.h:1229
llvm::MachineFunction::addToMBBNumbering
unsigned addToMBBNumbering(MachineBasicBlock *MBB)
Adds the MBB to the internal numbering.
Definition:MachineFunction.h:1002
llvm::MachineFunction::addLongjmpTarget
void addLongjmpTarget(MCSymbol *Target)
Add the specified symbol to the list of valid longjmp targets for Windows Control Flow Guard.
Definition:MachineFunction.h:1190
llvm::MachineFunction::getConstantPool
const MachineConstantPool * getConstantPool() const
Definition:MachineFunction.h:766
llvm::MachineFunction::getFrameInfo
const MachineFrameInfo & getFrameInfo() const
Definition:MachineFunction.h:750
llvm::MachineFunction::setHasEHFunclets
void setHasEHFunclets(bool V)
Definition:MachineFunction.h:1238
llvm::MachineFunction::DebugInstrOperandPair
std::pair< unsigned, unsigned > DebugInstrOperandPair
Pair of instruction number and operand number.
Definition:MachineFunction.h:545
llvm::MachineFunction::OperandCapacity
ArrayRecycler< MachineOperand >::Capacity OperandCapacity
Definition:MachineFunction.h:1126
llvm::MachineFunction::setExposesReturnsTwice
void setExposesReturnsTwice(bool B)
setCallsSetJmp - Set a flag that indicates if there's a call to a "returns twice" function.
Definition:MachineFunction.h:801
llvm::MachineFunction::removeFromMBBNumbering
void removeFromMBBNumbering(unsigned N)
removeFromMBBNumbering - Remove the specific machine basic block from our tracker,...
Definition:MachineFunction.h:1010
llvm::MachineFunction::DebugValueSubstitutions
SmallVector< DebugSubstitution, 8 > DebugValueSubstitutions
Debug value substitutions: a collection of DebugSubstitution objects, recording changes in where a va...
Definition:MachineFunction.h:577
llvm::MachineFunction::getFunctionNumber
unsigned getFunctionNumber() const
getFunctionNumber - Return a unique ID for the current function.
Definition:MachineFunction.h:713
llvm::MachineFunction::setHasInlineAsm
void setHasInlineAsm(bool B)
Set a flag that indicates that the function contains inline assembly.
Definition:MachineFunction.h:811
llvm::MachineFunction::hasAnyCallSiteLabel
bool hasAnyCallSiteLabel() const
Definition:MachineFunction.h:1310
llvm::MachineFunction::tryGetCalledGlobal
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.
Definition:MachineFunction.h:1206
llvm::MachineFunction::getPSVManager
PseudoSourceValueManager & getPSVManager() const
Definition:MachineFunction.h:698
llvm::MachineFunction::setCallSiteBeginLabel
void setCallSiteBeginLabel(MCSymbol *BeginLabel, unsigned Site)
Map the begin label for a call site.
Definition:MachineFunction.h:1315
llvm::MachineFunction::setHasWinCFI
void setHasWinCFI(bool v)
Definition:MachineFunction.h:818
llvm::MachineFunction::setWasmLandingPadIndex
void setWasmLandingPadIndex(const MachineBasicBlock *LPad, unsigned Index)
Map the landing pad to its index. Used for Wasm exception handling.
Definition:MachineFunction.h:1279
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition:MachineFunction.h:733
llvm::MachineFunction::getFrameInstructions
const std::vector< MCCFIInstruction > & getFrameInstructions() const
Returns a reference to a list of cfi instructions in the function's prologue.
Definition:MachineFunction.h:1175
llvm::MachineFunction::getNewDebugInstrNum
unsigned getNewDebugInstrNum()
Definition:MachineFunction.h:1425
llvm::MachineFunction::setHasEHCatchret
void setHasEHCatchret(bool V)
Definition:MachineFunction.h:1232
llvm::MachineFunction::operator=
MachineFunction & operator=(const MachineFunction &)=delete
llvm::MachineFunction::hasInlineAsm
bool hasInlineAsm() const
Returns true if the function contains any inline assembly.
Definition:MachineFunction.h:806
llvm::MachineFunction::setCallsEHReturn
void setCallsEHReturn(bool b)
Definition:MachineFunction.h:1226
llvm::MachineFunction::hasEHCatchret
bool hasEHCatchret() const
Definition:MachineFunction.h:1231
llvm::MachineFunction::reverse_iterator
BasicBlockListType::reverse_iterator reverse_iterator
Definition:MachineFunction.h:932
llvm::MachineFunction::hasWinCFI
bool hasWinCFI() const
Definition:MachineFunction.h:815
llvm::MachineFunction::setAlignment
void setAlignment(Align A)
setAlignment - Set the alignment of the function.
Definition:MachineFunction.h:784
llvm::MachineFunction::getWinEHFuncInfo
WinEHFuncInfo * getWinEHFuncInfo()
Definition:MachineFunction.h:778
llvm::MachineFunction::exposesReturnsTwice
bool exposesReturnsTwice() const
exposesReturnsTwice - Returns true if the function calls setjmp or any other similar functions with a...
Definition:MachineFunction.h:795
llvm::MachineFunction::getProperties
MachineFunctionProperties & getProperties()
Definition:MachineFunction.h:825
llvm::MachineFunction::getObserver
GISelChangeObserver * getObserver() const
Definition:MachineFunction.h:688
llvm::MachineFunction::getFrameInfo
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Definition:MachineFunction.h:749
llvm::MachineFunction::deallocateOperandArray
void deallocateOperandArray(OperandCapacity Cap, MachineOperand *Array)
Dellocate an array of MachineOperands and recycle the memory.
Definition:MachineFunction.h:1137
llvm::MachineFunction::setSection
void setSection(MCSection *S)
Indicates the Section this function belongs to.
Definition:MachineFunction.h:696
llvm::MachineFunction::callsUnwindInit
bool callsUnwindInit() const
Definition:MachineFunction.h:1228
llvm::MachineFunction::getMachineMemOperand
MachineMemOperand * getMachineMemOperand(const MachineMemOperand *MMO, int64_t Offset, uint64_t Size)
Definition:MachineFunction.h:1093
llvm::MachineFunction::push_front
void push_front(MachineBasicBlock *MBB)
Definition:MachineFunction.h:965
llvm::MachineFunction::getFilterIds
const std::vector< unsigned > & getFilterIds() const
Return a reference to the typeids encoding filters used in the current function.
Definition:MachineFunction.h:1347
llvm::MachineFunction::getTypeInfos
const std::vector< const GlobalValue * > & getTypeInfos() const
Return a reference to the C++ typeinfo for the current function.
Definition:MachineFunction.h:1341
llvm::MachineFunction::getInStackSlotVariableDbgInfo
auto getInStackSlotVariableDbgInfo() const
Returns the collection of variables for which we have debug info and that have been assigned a stack ...
Definition:MachineFunction.h:1382
llvm::MachineFunction::hasAnyWasmLandingPadIndex
bool hasAnyWasmLandingPadIndex() const
Return if there is any wasm exception handling.
Definition:MachineFunction.h:1274
llvm::MachineFunction::getCallSitesInfo
const CallSiteInfoMap & getCallSitesInfo() const
Definition:MachineFunction.h:1405
llvm::MachineFunction::ensureAlignment
void ensureAlignment(Align A)
ensureAlignment - Make sure the function is at least A bytes aligned.
Definition:MachineFunction.h:787
llvm::MachineFunction::push_back
void push_back(MachineBasicBlock *MBB)
Definition:MachineFunction.h:964
llvm::MachineFunction::rbegin
reverse_iterator rbegin()
Definition:MachineFunction.h:952
llvm::MachineFunction::setHasFakeUses
void setHasFakeUses(bool V)
Definition:MachineFunction.h:1241
llvm::MachineFunction::hasBBSections
bool hasBBSections() const
Returns true if this function has basic block sections enabled.
Definition:MachineFunction.h:716
llvm::MachineFunction::getContext
MCContext & getContext() const
Definition:MachineFunction.h:690
llvm::MachineFunction::callsEHReturn
bool callsEHReturn() const
Definition:MachineFunction.h:1225
llvm::MachineFunction::setVariableDbgInfo
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...
Definition:MachineFunction.h:1362
llvm::MachineFunction::getFunction
const Function & getFunction() const
Return the LLVM function that this machine code represents.
Definition:MachineFunction.h:707
llvm::MachineFunction::allocateOperandArray
MachineOperand * allocateOperandArray(OperandCapacity Cap)
Allocate an array of MachineOperands.
Definition:MachineFunction.h:1130
llvm::MachineFunction::size
unsigned size() const
Definition:MachineFunction.h:957
llvm::MachineFunction::getRegInfo
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Definition:MachineFunction.h:743
llvm::MachineFunction::getBlockNumbered
MachineBasicBlock * getBlockNumbered(unsigned N) const
getBlockNumbered - MachineBasicBlocks are automatically numbered when they are inserted into the mach...
Definition:MachineFunction.h:866
llvm::MachineFunction::rend
reverse_iterator rend()
Definition:MachineFunction.h:954
llvm::MachineFunction::getInStackSlotVariableDbgInfo
auto getInStackSlotVariableDbgInfo()
Returns the collection of variables for which we have debug info and that have been assigned a stack ...
Definition:MachineFunction.h:1374
llvm::MachineFunction::getAlignment
Align getAlignment() const
getAlignment - Return the alignment of the function.
Definition:MachineFunction.h:781
llvm::MachineFunction::splice
void splice(iterator InsertPt, iterator MBBI, iterator MBBE)
Definition:MachineFunction.h:975
llvm::MachineFunction::addCatchretTarget
void addCatchretTarget(MCSymbol *Target)
Add the specified symbol to the list of valid catchret targets for Windows EHCont Guard.
Definition:MachineFunction.h:1200
llvm::MachineFunction::getWasmLandingPadIndex
unsigned getWasmLandingPadIndex(const MachineBasicBlock *LPad) const
Get the index in wasm EH for a given landing pad.
Definition:MachineFunction.h:1289
llvm::MachineFunction::end
const_iterator end() const
Definition:MachineFunction.h:950
llvm::MachineFunction::DebugOperandMemNumber
static const unsigned int DebugOperandMemNumber
A reserved operand number representing the instructions memory operand, for instructions that have a ...
Definition:MachineFunction.h:654
llvm::MachineFunction::setObserver
void setObserver(GISelChangeObserver *O)
Definition:MachineFunction.h:686
llvm::MachineFunction::getBlockNumberEpoch
unsigned getBlockNumberEpoch() const
Return the numbering "epoch" of block numbers, incremented after each numbering.
Definition:MachineFunction.h:881
llvm::MachineFunction::resetDelegate
void resetDelegate(Delegate *delegate)
Reset the currently registered delegate - otherwise assert.
Definition:MachineFunction.h:670
llvm::MachineFunction::addCodeViewAnnotation
void addCodeViewAnnotation(MCSymbol *Label, MDNode *MD)
Record annotations associated with a particular label.
Definition:MachineFunction.h:1332
llvm::MachineFunction::getFunction
Function & getFunction()
Return the LLVM function that this machine code represents.
Definition:MachineFunction.h:704
llvm::MachineFunction::getMachineMemOperand
MachineMemOperand * getMachineMemOperand(const MachineMemOperand *MMO, const MachinePointerInfo &PtrInfo, uint64_t Size)
Definition:MachineFunction.h:1108
llvm::MachineFunction::end
iterator end()
Definition:MachineFunction.h:949
llvm::MachineFunction::erase
void erase(MachineBasicBlock *MBBI)
Definition:MachineFunction.h:982
llvm::MachineFunction::getNumBlockIDs
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
Definition:MachineFunction.h:876
llvm::MachineFunction::begin
const_iterator begin() const
Definition:MachineFunction.h:948
llvm::MachineFunction::remove
void remove(MachineBasicBlock *MBBI)
Definition:MachineFunction.h:980
llvm::MachineFunction::setIsOutlined
void setIsOutlined(bool V)
Definition:MachineFunction.h:1244
llvm::MachineFunction::getLongjmpTargets
const std::vector< MCSymbol * > & getLongjmpTargets() const
Returns a reference to a list of symbols immediately following calls to _setjmp in the function.
Definition:MachineFunction.h:1184
llvm::MachineFunction::getLandingPads
const std::vector< LandingPadInfo > & getLandingPads() const
Return a reference to the landing pad info for the current function.
Definition:MachineFunction.h:1250
llvm::MachineFunction::getSection
MCSection * getSection() const
Returns the Section this function belongs to.
Definition:MachineFunction.h:693
llvm::MachineFunction::getVariableDbgInfo
const VariableDbgInfoMapTy & getVariableDbgInfo() const
Definition:MachineFunction.h:1368
llvm::MachineFunction::isOutlined
bool isOutlined() const
Definition:MachineFunction.h:1243
llvm::MachineFunction::back
const MachineBasicBlock & back() const
Definition:MachineFunction.h:961
llvm::MachineFunction::rbegin
const_reverse_iterator rbegin() const
Definition:MachineFunction.h:953
llvm::MachineFunction::getSubtarget
const STC & getSubtarget() const
getSubtarget - This method returns a pointer to the specified type of TargetSubtargetInfo.
Definition:MachineFunction.h:738
llvm::MachineFunction::begin
iterator begin()
Definition:MachineFunction.h:947
llvm::MachineFunction::const_reverse_iterator
BasicBlockListType::const_reverse_iterator const_reverse_iterator
Definition:MachineFunction.h:931
llvm::MachineFunction::getCallSiteBeginLabel
unsigned getCallSiteBeginLabel(MCSymbol *BeginLabel) const
Get the call site number for a begin label.
Definition:MachineFunction.h:1320
llvm::MachineFunction::remove
void remove(iterator MBBI)
Definition:MachineFunction.h:979
llvm::MachineFunction::getVariableDbgInfo
VariableDbgInfoMapTy & getVariableDbgInfo()
Definition:MachineFunction.h:1367
llvm::MachineFunction::getInfo
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Definition:MachineFunction.h:831
llvm::MachineFunction::getConstantPool
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
Definition:MachineFunction.h:765
llvm::MachineFunction::getRegInfo
const MachineRegisterInfo & getRegInfo() const
Definition:MachineFunction.h:744
llvm::MachineFunction::getWasmEHFuncInfo
const WasmEHFuncInfo * getWasmEHFuncInfo() const
getWasmEHFuncInfo - Return information about how the current function uses Wasm exception handling.
Definition:MachineFunction.h:771
llvm::MachineFunction::hasCallSiteBeginLabel
bool hasCallSiteBeginLabel(MCSymbol *BeginLabel) const
Return true if the begin label has a call site number associated with it.
Definition:MachineFunction.h:1327
llvm::MachineFunction::splice
void splice(iterator InsertPt, MachineBasicBlock *MBB)
Definition:MachineFunction.h:972
llvm::MachineFunction::addCallSiteInfo
void addCallSiteInfo(const MachineInstr *CallI, CallSiteInfo &&CallInfo)
Start tracking the arguments passed to the call CallI.
Definition:MachineFunction.h:1397
llvm::MachineFunction::getSublistAccess
static BasicBlockListType MachineFunction::* getSublistAccess(MachineBasicBlock *)
Support for MachineBasicBlock::getNextNode().
Definition:MachineFunction.h:936
llvm::MachineFunction::sort
void sort(Comp comp)
Definition:MachineFunction.h:985
llvm::MachineFunction::hasWasmLandingPadIndex
bool hasWasmLandingPadIndex(const MachineBasicBlock *LPad) const
Returns true if the landing pad has an associate index in wasm EH.
Definition:MachineFunction.h:1284
llvm::MachineFunction::getProperties
const MachineFunctionProperties & getProperties() const
Get the function properties.
Definition:MachineFunction.h:824
llvm::MachineFunction::cloneInfo
Ty * cloneInfo(const Ty &Old)
Definition:MachineFunction.h:840
llvm::MachineFunction::getCatchretTargets
const std::vector< MCSymbol * > & getCatchretTargets() const
Returns a reference to a list of symbols that we have catchrets.
Definition:MachineFunction.h:1194
llvm::MachineFunction::hasCallSiteLandingPad
bool hasCallSiteLandingPad(MCSymbol *Sym)
Return true if the landing pad Eh symbol has an associated call site.
Definition:MachineFunction.h:1306
llvm::MachineFunction::setVariableDbgInfo
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.
Definition:MachineFunction.h:1355
llvm::MachineFunction::setDelegate
void setDelegate(Delegate *delegate)
Set the delegate.
Definition:MachineFunction.h:678
llvm::MachineFunction::reset
void reset()
Reset the instance as if it was just created.
Definition:MachineFunction.h:664
llvm::MachineFunction::DebugPHIPositions
DenseMap< unsigned, DebugPHIRegallocPos > DebugPHIPositions
Map of debug instruction numbers to the position of their PHI instructions during register allocation...
Definition:MachineFunction.h:595
llvm::MachineFunction::front
const MachineBasicBlock & front() const
Definition:MachineFunction.h:959
llvm::MachineFunction::setHasEHScopes
void setHasEHScopes(bool V)
Definition:MachineFunction.h:1235
llvm::MachineFunction::getMachineMemOperand
MachineMemOperand * getMachineMemOperand(const MachineMemOperand *MMO, int64_t Offset, LocationSize Size)
Definition:MachineFunction.h:1084
llvm::MachineFunction::empty
bool empty() const
Definition:MachineFunction.h:958
llvm::MachineFunction::getMachineMemOperand
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)
Definition:MachineFunction.h:1067
llvm::MachineFunction::getInfo
const Ty * getInfo() const
Definition:MachineFunction.h:836
llvm::MachineFunction::hasEHFunclets
bool hasEHFunclets() const
Definition:MachineFunction.h:1237
llvm::MachineFunction::getJumpTableInfo
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
Definition:MachineFunction.h:756
llvm::MachineFunction::rend
const_reverse_iterator rend() const
Definition:MachineFunction.h:955
llvm::MachineFunction::hasAnyCallSiteLandingPad
bool hasAnyCallSiteLandingPad() const
Definition:MachineFunction.h:1294
llvm::MachineFunction::hasFakeUses
bool hasFakeUses() const
Definition:MachineFunction.h:1240
llvm::MachineFunction::getWasmEHFuncInfo
WasmEHFuncInfo * getWasmEHFuncInfo()
Definition:MachineFunction.h:772
llvm::MachineFunction::splice
void splice(iterator InsertPt, iterator MBBI)
Definition:MachineFunction.h:969
llvm::MachineFunction::getCalledGlobals
auto getCalledGlobals() const
Iterates over the full set of call sites and their associated globals.
Definition:MachineFunction.h:1218
llvm::MachineFunction::addCalledGlobal
void addCalledGlobal(const MachineInstr *MI, CalledGlobalInfo Details)
Notes the global and target flags for a call site.
Definition:MachineFunction.h:1211
llvm::MachineFunction::erase
void erase(iterator MBBI)
Definition:MachineFunction.h:981
llvm::MachineFunction::hasEHScopes
bool hasEHScopes() const
Definition:MachineFunction.h:1234
llvm::MachineFunction::getCodeViewAnnotations
ArrayRef< std::pair< MCSymbol *, MDNode * > > getCodeViewAnnotations() const
Definition:MachineFunction.h:1336
llvm::MachineFunction::VariableDbgInfos
VariableDbgInfoMapTy VariableDbgInfos
Definition:MachineFunction.h:533
llvm::MachineFunction::MachineFunction
MachineFunction(const MachineFunction &)=delete
llvm::MachineFunction::insert
void insert(iterator MBBI, MachineBasicBlock *MBB)
Definition:MachineFunction.h:966
llvm::MachineFunction::back
MachineBasicBlock & back()
Definition:MachineFunction.h:962
llvm::MachineFunction::getTarget
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Definition:MachineFunction.h:729
llvm::MachineFunction::const_iterator
BasicBlockListType::const_iterator const_iterator
Definition:MachineFunction.h:930
llvm::MachineFunction::cloneInfoFrom
MachineFunctionInfo * cloneInfoFrom(const MachineFunction &OrigMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB)
Definition:MachineFunction.h:849
llvm::MachineFunction::front
MachineBasicBlock & front()
Definition:MachineFunction.h:960
llvm::MachineFunction::getCallSiteLandingPad
SmallVectorImpl< unsigned > & getCallSiteLandingPad(MCSymbol *Sym)
Get the call site indexes for a landing pad EH symbol.
Definition:MachineFunction.h:1299
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::MachineInstr
Representation of each machine instruction.
Definition:MachineInstr.h:71
llvm::MachineInstr::isCandidateForAdditionalCallInfo
bool isCandidateForAdditionalCallInfo(QueryType Type=IgnoreBundle) const
Return true if this is a call instruction that may have an additional information associated with it.
Definition:MachineInstr.cpp:777
llvm::MachineJumpTableInfo
Definition:MachineJumpTableInfo.h:46
llvm::MachineMemOperand
A description of a memory reference used in the backend.
Definition:MachineMemOperand.h:129
llvm::MachineMemOperand::Flags
Flags
Flags values. These may be or'd together.
Definition:MachineMemOperand.h:132
llvm::MachineOperand
MachineOperand class - Representation of each machine instruction operand.
Definition:MachineOperand.h:48
llvm::MachineRegisterInfo
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Definition:MachineRegisterInfo.h:51
llvm::Pass
Pass interface - Implemented by all 'passes'.
Definition:Pass.h:94
llvm::PseudoSourceValueManager
Manages creation of pseudo source values.
Definition:PseudoSourceValueManager.h:27
llvm::Recycler
Recycler - This class manages a linked-list of deallocated nodes and facilitates reusing deallocated ...
Definition:Recycler.h:34
llvm::Register
Wrapper class representing virtual and physical registers.
Definition:Register.h:19
llvm::SlotIndexes
SlotIndexes pass.
Definition:SlotIndexes.h:297
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition:SmallVector.h:573
llvm::SmallVectorImpl::emplace_back
reference emplace_back(ArgTypes &&... Args)
Definition:SmallVector.h:937
llvm::SmallVectorTemplateCommon::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition:SmallVector.h:254
llvm::SmallVectorTemplateCommon::iterator
T * iterator
Definition:SmallVector.h:251
llvm::SmallVectorTemplateCommon::const_iterator
const T * const_iterator
Definition:SmallVector.h:252
llvm::SmallVectorTemplateCommon::reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
Definition:SmallVector.h:255
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition:SmallVector.h:1196
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition:TargetMachine.h:77
llvm::TargetRegisterClass
Definition:TargetRegisterInfo.h:44
llvm::TargetSubtargetInfo
TargetSubtargetInfo - Generic base class for all target subtargets.
Definition:TargetSubtargetInfo.h:63
llvm::Target
Target - Wrapper for Target specific information.
Definition:TargetRegistry.h:144
llvm::iplist_impl::splice
void splice(iterator where, iplist_impl &L2)
Definition:ilist.h:266
llvm::iplist_impl::push_back
void push_back(pointer val)
Definition:ilist.h:250
llvm::iplist_impl::erase
iterator erase(iterator where)
Definition:ilist.h:204
llvm::iplist_impl::remove
pointer remove(iterator &IT)
Definition:ilist.h:188
llvm::iplist_impl::push_front
void push_front(pointer val)
Definition:ilist.h:249
llvm::iplist_impl::insert
iterator insert(iterator where, pointer New)
Definition:ilist.h:165
llvm::iplist
An intrusive list with ownership and callbacks specified/controlled by ilist_traits,...
Definition:ilist.h:328
llvm::pointer_iterator
Definition:iterator.h:348
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition:raw_ostream.h:52
uint16_t
uint32_t
uint64_t
uint8_t
ilist.h
This file defines classes to implement an intrusive doubly linked list class (i.e.
iterator.h
llvm::CallingConv::Cold
@ Cold
Attempts to make code in the caller as efficient as possible under the assumption that the call is no...
Definition:CallingConv.h:47
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition:ISDOpcodes.h:71
llvm::ISD::MCSymbol
@ MCSymbol
Definition:ISDOpcodes.h:178
llvm::ISD::BlockAddress
@ BlockAddress
Definition:ISDOpcodes.h:84
llvm::SyncScope::ID
uint8_t ID
Definition:LLVMContext.h:46
llvm::codeview::PublicSymFlags::Function
@ Function
llvm::dwarf_linker::DebugSectionKind::DebugLoc
@ DebugLoc
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::dump
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
Definition:SparseBitVector.h:877
llvm::CGDataKind::Unknown
@ Unknown
llvm::make_range
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Definition:iterator_range.h:77
llvm::MachineFunctionDataHotness
MachineFunctionDataHotness
Definition:MachineFunction.h:94
llvm::MachineFunctionDataHotness::Hot
@ Hot
llvm::EHPersonality
EHPersonality
Definition:EHPersonalities.h:21
llvm::verifyMachineFunction
void verifyMachineFunction(const std::string &Banner, const MachineFunction &MF)
Definition:MachineVerifier.cpp:419
llvm::make_filter_range
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...
Definition:STLExtras.h:573
llvm::AtomicOrdering
AtomicOrdering
Atomic ordering for LLVM's memory model.
Definition:AtomicOrdering.h:56
llvm::BasicBlockSection
BasicBlockSection
Definition:TargetOptions.h:61
N
#define N
RegInfo
Definition:AMDGPUAsmParser.cpp:2770
llvm::AAMDNodes
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
Definition:Metadata.h:764
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition:Alignment.h:39
llvm::DenormalMode
Represent subnormal handling kind for floating point instruction inputs and outputs.
Definition:FloatingPointMode.h:70
llvm::GraphTraits< Inverse< MachineFunction * > >::getNumberEpoch
static unsigned getNumberEpoch(MachineFunction *F)
Definition:MachineFunction.h:1504
llvm::GraphTraits< Inverse< MachineFunction * > >::getMaxNumber
static unsigned getMaxNumber(MachineFunction *F)
Definition:MachineFunction.h:1501
llvm::GraphTraits< Inverse< MachineFunction * > >::getEntryNode
static NodeRef getEntryNode(Inverse< MachineFunction * > G)
Definition:MachineFunction.h:1497
llvm::GraphTraits< Inverse< const MachineFunction * > >::getNumberEpoch
static unsigned getNumberEpoch(const MachineFunction *F)
Definition:MachineFunction.h:1517
llvm::GraphTraits< Inverse< const MachineFunction * > >::getMaxNumber
static unsigned getMaxNumber(const MachineFunction *F)
Definition:MachineFunction.h:1514
llvm::GraphTraits< Inverse< const MachineFunction * > >::getEntryNode
static NodeRef getEntryNode(Inverse< const MachineFunction * > G)
Definition:MachineFunction.h:1510
llvm::GraphTraits< MachineFunction * >::getNumberEpoch
static unsigned getNumberEpoch(MachineFunction *F)
Definition:MachineFunction.h:1459
llvm::GraphTraits< MachineFunction * >::size
static unsigned size(MachineFunction *F)
Definition:MachineFunction.h:1454
llvm::GraphTraits< MachineFunction * >::nodes_begin
static nodes_iterator nodes_begin(MachineFunction *F)
Definition:MachineFunction.h:1446
llvm::GraphTraits< MachineFunction * >::getMaxNumber
static unsigned getMaxNumber(MachineFunction *F)
Definition:MachineFunction.h:1456
llvm::GraphTraits< MachineFunction * >::nodes_end
static nodes_iterator nodes_end(MachineFunction *F)
Definition:MachineFunction.h:1450
llvm::GraphTraits< MachineFunction * >::getEntryNode
static NodeRef getEntryNode(MachineFunction *F)
Definition:MachineFunction.h:1441
llvm::GraphTraits< const MachineFunction * >::nodes_begin
static nodes_iterator nodes_begin(const MachineFunction *F)
Definition:MachineFunction.h:1470
llvm::GraphTraits< const MachineFunction * >::nodes_end
static nodes_iterator nodes_end(const MachineFunction *F)
Definition:MachineFunction.h:1474
llvm::GraphTraits< const MachineFunction * >::size
static unsigned size(const MachineFunction *F)
Definition:MachineFunction.h:1478
llvm::GraphTraits< const MachineFunction * >::getMaxNumber
static unsigned getMaxNumber(const MachineFunction *F)
Definition:MachineFunction.h:1482
llvm::GraphTraits< const MachineFunction * >::getEntryNode
static NodeRef getEntryNode(const MachineFunction *F)
Definition:MachineFunction.h:1465
llvm::GraphTraits< const MachineFunction * >::getNumberEpoch
static unsigned getNumberEpoch(const MachineFunction *F)
Definition:MachineFunction.h:1485
llvm::GraphTraits
Definition:GraphTraits.h:38
llvm::Inverse
Definition:GraphTraits.h:123
llvm::LandingPadInfo
This structure is used to retain landing pad info for the current function.
Definition:MachineFunction.h:255
llvm::LandingPadInfo::EndLabels
SmallVector< MCSymbol *, 1 > EndLabels
Definition:MachineFunction.h:258
llvm::LandingPadInfo::LandingPadLabel
MCSymbol * LandingPadLabel
Definition:MachineFunction.h:260
llvm::LandingPadInfo::SEHHandlers
SmallVector< SEHHandler, 1 > SEHHandlers
Definition:MachineFunction.h:259
llvm::LandingPadInfo::LandingPadInfo
LandingPadInfo(MachineBasicBlock *MBB)
Definition:MachineFunction.h:263
llvm::LandingPadInfo::LandingPadBlock
MachineBasicBlock * LandingPadBlock
Definition:MachineFunction.h:256
llvm::LandingPadInfo::BeginLabels
SmallVector< MCSymbol *, 1 > BeginLabels
Definition:MachineFunction.h:257
llvm::LandingPadInfo::TypeIds
std::vector< int > TypeIds
Definition:MachineFunction.h:261
llvm::MachineFunctionInfo
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
Definition:MachineFunction.h:104
llvm::MachineFunctionInfo::create
static FuncInfoTy * create(BumpPtrAllocator &Allocator, const Function &F, const SubtargetTy *STI)
Factory function: default behavior is to call new using the supplied allocator.
Definition:MachineFunction.h:112
llvm::MachineFunctionInfo::~MachineFunctionInfo
virtual ~MachineFunctionInfo()
llvm::MachineFunctionInfo::clone
virtual MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
Definition:MachineFunction.h:127
llvm::MachineFunctionInfo::create
static Ty * create(BumpPtrAllocator &Allocator, const Ty &MFI)
Definition:MachineFunction.h:118
llvm::MachineFunction::ArgRegPair
Structure used to represent pair of argument number after call lowering and register used to transfer...
Definition:MachineFunction.h:488
llvm::MachineFunction::ArgRegPair::Reg
Register Reg
Definition:MachineFunction.h:489
llvm::MachineFunction::ArgRegPair::ArgNo
uint16_t ArgNo
Definition:MachineFunction.h:490
llvm::MachineFunction::ArgRegPair::ArgRegPair
ArgRegPair(Register R, unsigned Arg)
Definition:MachineFunction.h:491
llvm::MachineFunction::CallSiteInfo
Definition:MachineFunction.h:496
llvm::MachineFunction::CallSiteInfo::ArgRegPairs
SmallVector< ArgRegPair, 1 > ArgRegPairs
Vector of call argument and its forwarding register.
Definition:MachineFunction.h:498
llvm::MachineFunction::CalledGlobalInfo
Definition:MachineFunction.h:501
llvm::MachineFunction::CalledGlobalInfo::Callee
const GlobalValue * Callee
Definition:MachineFunction.h:502
llvm::MachineFunction::CalledGlobalInfo::TargetFlags
unsigned TargetFlags
Definition:MachineFunction.h:503
llvm::MachinePointerInfo
This class contains a discriminated union of information about pointers in memory operands,...
Definition:MachineMemOperand.h:41
llvm::SEHHandler
Definition:MachineFunction.h:246
llvm::SEHHandler::RecoverBA
const BlockAddress * RecoverBA
Address of block to recover at. Null for a finally handler.
Definition:MachineFunction.h:251
llvm::SEHHandler::FilterOrFinally
const Function * FilterOrFinally
Filter or finally function. Null indicates a catch-all.
Definition:MachineFunction.h:248
llvm::WasmEHFuncInfo
Definition:WasmEHFuncInfo.h:32
llvm::WinEHFuncInfo
Definition:WinEHFuncInfo.h:90
llvm::fltSemantics
Definition:APFloat.cpp:103
llvm::ilist_alloc_traits
Use delete by default for iplist and ilist.
Definition:ilist.h:41
llvm::ilist_alloc_traits::deleteNode
static void deleteNode(NodeTy *V)
Definition:ilist.h:42
llvm::ilist_callback_traits< MachineBasicBlock >::transferNodesFromList
void transferNodesFromList(ilist_callback_traits &OldList, Iterator, Iterator)
Definition:MachineFunction.h:86
llvm::ilist_callback_traits
Callbacks do nothing by default in iplist and ilist.
Definition:ilist.h:65
llvm::ilist_callback_traits::removeNodeFromList
void removeNodeFromList(NodeTy *)
Definition:ilist.h:67
llvm::ilist_callback_traits::addNodeToList
void addNodeToList(NodeTy *)
Definition:ilist.h:66
llvm::ilist_traits
Template traits for intrusive list.
Definition:ilist.h:90

Generated on Fri Jul 18 2025 09:12:33 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp