17#ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
18#define LLVM_CODEGEN_MACHINEFUNCTION_H
85 template <
class Iterator>
87 assert(
this == &OldList &&
"never transfer MBBs between functions");
111 template <
typename FuncInfoTy,
typename SubtargetTy = TargetSubtargetInfo>
113 const SubtargetTy *STI) {
114 return new (
Allocator.Allocate<FuncInfoTy>()) FuncInfoTy(
F, STI);
117 template <
typename Ty>
119 return new (
Allocator.Allocate<Ty>()) Ty(MFI);
204 return Properties[
static_cast<unsigned>(
P)];
208 Properties.
set(
static_cast<unsigned>(
P));
213 Properties.
reset(
static_cast<unsigned>(
P));
218#define PPACCESSORS(X) \
219 bool has##X() const { return hasProperty(Property::X); } \
220 MachineFunctionProperties &set##X(void) { return set(Property::X); } \
221 MachineFunctionProperties &reset##X(void) { return reset(Property::X); }
243 Properties |= MFP.Properties;
248 Properties &= ~MFP.Properties;
255 return (Properties | ~V.Properties).all();
323 std::vector<MachineBasicBlock*> MBBNumbering;
327 unsigned MBBNumberingEpoch = 0;
343 BasicBlockListType BasicBlocks;
348 unsigned FunctionNumber;
358 bool ExposesReturnsTwice =
false;
361 bool HasInlineAsm =
false;
364 bool HasWinCFI =
false;
371 std::unique_ptr<PseudoSourceValueManager> PSVManager;
375 std::vector<MCCFIInstruction> FrameInstructions;
379 std::vector<MCSymbol *> LongjmpTargets;
383 std::vector<MCSymbol *> EHContTargets;
389 std::vector<LandingPadInfo> LandingPads;
401 std::vector<std::pair<MCSymbol *, MDNode *>> CodeViewAnnotations;
403 bool CallsEHReturn =
false;
404 bool CallsUnwindInit =
false;
405 bool HasEHContTarget =
false;
406 bool HasEHScopes =
false;
407 bool HasEHFunclets =
false;
408 bool HasFakeUses =
false;
409 bool IsOutlined =
false;
412 unsigned NextBBID = 0;
418 std::vector<const GlobalValue *> TypeInfos;
421 std::vector<unsigned> FilterIds;
424 std::vector<unsigned> FilterEnds;
447 std::variant<int, MCRegister> Address;
463 bool inStackSlot()
const {
return std::holds_alternative<int>(Address); }
467 return std::holds_alternative<MCRegister>(Address);
477 return std::get<MCRegister>(Address);
489 virtual void anchor();
511 assert(Arg < (1 << 16) &&
"Arg out of range");
550 CalledGlobalsMap CalledGlobalsInfo;
644 unsigned MaxOperand = UINT_MAX);
687 unsigned FunctionNum);
700 assert(TheDelegate == delegate &&
701 "Only the current delegate can perform reset!");
702 TheDelegate =
nullptr;
708 assert(delegate && !TheDelegate &&
709 "Attempted to set delegate to null, or to change it without "
710 "first resetting it!");
712 TheDelegate = delegate;
755 void assignBeginEndSections();
768 return static_cast<const STC &
>(STI);
825 return ExposesReturnsTwice;
831 ExposesReturnsTwice =
B;
850 bool needsFrameMoves()
const;
859 template<
typename Ty>
861 return static_cast<Ty*
>(MFInfo);
864 template<
typename Ty>
866 return static_cast<const Ty *
>(MFInfo);
871 MFInfo = Ty::template create<Ty>(Allocator, Old);
872 return static_cast<Ty *
>(MFInfo);
881 assert(!MFInfo &&
"new function already has MachineFunctionInfo");
884 return OrigMF.MFInfo->
clone(Allocator, *
this, Src2DstMBB);
896 assert(
N < MBBNumbering.size() &&
"Illegal block number");
897 assert(MBBNumbering[
N] &&
"Block was removed from the machine function!");
898 return MBBNumbering[
N];
902 bool shouldSplitStack()
const;
939 void viewCFGOnly()
const;
947 bool verify(
Pass *p =
nullptr,
const char *Banner =
nullptr,
948 raw_ostream *OS =
nullptr,
bool AbortOnError =
true)
const;
954 const char *Banner =
nullptr,
raw_ostream *OS =
nullptr,
955 bool AbortOnError =
true)
const;
962 const char *Banner =
nullptr,
raw_ostream *OS =
nullptr,
963 bool AbortOnError =
true)
const;
974 return &MachineFunction::BasicBlocks;
994 unsigned size()
const {
return (
unsigned)BasicBlocks.size();}
995 bool empty()
const {
return BasicBlocks.empty(); }
1004 BasicBlocks.insert(
MBBI,
MBB);
1007 BasicBlocks.splice(InsertPt, BasicBlocks,
MBBI);
1010 BasicBlocks.splice(InsertPt, BasicBlocks,
MBB);
1013 BasicBlocks.splice(InsertPt, BasicBlocks,
MBBI, MBBE);
1021 template <
typename Comp>
1023 BasicBlocks.sort(comp);
1040 MBBNumbering.push_back(
MBB);
1041 return (
unsigned)MBBNumbering.size()-1;
1048 assert(
N < MBBNumbering.size() &&
"Illegal basic block #");
1049 MBBNumbering[
N] =
nullptr;
1055 bool NoImplicit =
false);
1083 CreateMachineBasicBlock(
const BasicBlock *BB =
nullptr,
1084 std::optional<UniqueBBID> BBID = std::nullopt);
1111 BaseAlignment, AAInfo, Ranges, SSID, Ordering,
1121 BaseAlignment, AAInfo, Ranges, SSID, Ordering,
1187 return OperandRecycler.allocate(Cap, Allocator);
1194 OperandRecycler.deallocate(Cap, Array);
1206 MachineInstr::ExtraInfo *createMIExtraInfo(
1208 MCSymbol *PostInstrSymbol =
nullptr,
MDNode *HeapAllocMarker =
nullptr,
1210 MDNode *MMRAs =
nullptr);
1213 const char *createExternalSymbolName(
StringRef Name);
1222 bool isLinkerPrivate =
false)
const;
1226 MCSymbol *getPICBaseSymbol()
const;
1232 return FrameInstructions;
1241 return LongjmpTargets;
1251 return EHContTargets;
1261 return CalledGlobalsInfo.lookup(
MI);
1266 assert(
MI &&
"MI must not be null");
1268 CalledGlobalsInfo.insert({
MI, Details});
1273 return llvm::make_range(CalledGlobalsInfo.begin(), CalledGlobalsInfo.end());
1329 return !WasmLPadToIndexMap.empty();
1334 WasmLPadToIndexMap[LPad] = Index;
1339 return WasmLPadToIndexMap.count(LPad);
1345 return WasmLPadToIndexMap.lookup(LPad);
1349 return !LPadToCallSiteMap.empty();
1355 "missing call site number for landing pad!");
1356 return LPadToCallSiteMap[Sym];
1361 return !LPadToCallSiteMap[Sym].empty();
1365 return !CallSiteMap.empty();
1370 CallSiteMap[BeginLabel] = Site;
1376 "Missing call site number for EH_LABEL!");
1377 return CallSiteMap.lookup(BeginLabel);
1382 return CallSiteMap.count(BeginLabel);
1387 CodeViewAnnotations.push_back({Label, MD});
1391 return CodeViewAnnotations;
1430 return VarInfo.inStackSlot();
1438 return VarInfo.inStackSlot();
1446 return VarInfo.inEntryValueRegister();
1454 CallSitesInfo.try_emplace(CallI, std::move(
CallInfo)).second;
1456 assert(Inserted &&
"Call site info not unique");
1460 return CallSitesInfo;
1511 return F->getNumBlockIDs();
1514 return F->getBlockNumberEpoch();
1537 return F->getNumBlockIDs();
1540 return F->getBlockNumberEpoch();
1552 return &
G.Graph->front();
1556 return F->getNumBlockIDs();
1559 return F->getBlockNumberEpoch();
1565 return &
G.Graph->front();
1569 return F->getNumBlockIDs();
1572 return F->getBlockNumberEpoch();
1577 const MachineFunction &MF);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
This file defines the BumpPtrAllocator interface.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
Atomic ordering constants.
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static void viewCFG(Function &F, const BlockFrequencyInfo *BFI, const BranchProbabilityInfo *BPI, uint64_t MaxFreq, bool CFGOnly=false)
static unsigned InstrCount
This file defines the DenseMap class.
This file defines the little GraphTraits<X> template class that should be specialized by classes that...
static uint64_t estimateFunctionSizeInBytes(const LoongArchInstrInfo *TII, const MachineFunction &MF)
static unsigned addLiveIn(MachineFunction &MF, unsigned PReg, const TargetRegisterClass *RC)
static StringRef getName(Value *V)
This file defines the SmallVector class.
static MachineMemOperand * getMachineMemOperand(MachineFunction &MF, FrameIndexSDNode &FI)
The size of an allocated array is represented by a Capacity instance.
Recycle small arrays allocated from a BumpPtrAllocator.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
LLVM Basic Block Representation.
The address of a basic block.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
A parsed version of the target data layout string in and methods for querying it.
DenseMapIterator< KeyT, ValueT, KeyInfoT, BucketT > iterator
Abstract class that contains various methods for clients to notify about changes.
static constexpr LLT scalable_vector(unsigned MinNumElements, unsigned ScalarSizeInBits)
Get a low-level scalable vector of some number of elements and element width.
static constexpr LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
static LocationSize precise(uint64_t Value)
Context object for machine code objects.
Describe properties that are true of each instruction in the target description file.
Wrapper class representing physical registers. Should be passed by value.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
MachineInstrBundleIterator< MachineInstr > iterator
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Properties which a MachineFunction may have at a given point in time.
MachineFunctionProperties & set(const MachineFunctionProperties &MFP)
LLVM_ABI void print(raw_ostream &OS) const
Print the MachineFunctionProperties in human-readable form.
bool verifyRequiredProperties(const MachineFunctionProperties &V) const
MachineFunctionProperties & reset(const MachineFunctionProperties &MFP)
MachineFunctionProperties & set(Property P)
bool hasProperty(Property P) const
MachineFunctionProperties & reset(Property P)
DebugPHIRegallocPos(MachineBasicBlock *MBB, Register Reg, unsigned SubReg)
Register Reg
VReg where the control-flow-merge happens.
unsigned SubReg
Optional subreg qualifier within Reg.
MachineBasicBlock * MBB
Block where this PHI was originally located.
bool operator<(const DebugSubstitution &Other) const
Order only by source instruction / operand pair: there should never be duplicate entries for the same...
DebugInstrOperandPair Dest
Replacement instruction / operand pair.
DebugInstrOperandPair Src
Source instruction / operand pair.
DebugSubstitution(const DebugInstrOperandPair &Src, const DebugInstrOperandPair &Dest, unsigned Subreg)
unsigned Subreg
Qualifier for which part of Dest is read.
virtual void MF_HandleChangeDesc(MachineInstr &MI, const MCInstrDesc &TID)
Callback before changing MCInstrDesc.
virtual void MF_HandleRemoval(MachineInstr &MI)=0
Callback before a removal. This should not modify the MI directly.
virtual void MF_HandleInsertion(MachineInstr &MI)=0
Callback after an insertion. This should not modify the MI directly.
virtual ~Delegate()=default
bool inStackSlot() const
Return true if this variable is in a stack slot.
void updateStackSlot(int NewSlot)
Updates the stack slot of this variable, assuming inStackSlot() is true.
MCRegister getEntryValueRegister() const
Returns the MCRegister of this variable, assuming inEntryValueRegister() is true.
bool inEntryValueRegister() const
Return true if this variable is in the entry value of a register.
const DILocalVariable * Var
VariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, int Slot, const DILocation *Loc)
int getStackSlot() const
Returns the stack slot of this variable, assuming inStackSlot() is true.
const DIExpression * Expr
VariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, MCRegister EntryValReg, const DILocation *Loc)
unsigned getInstructionCount() const
Return the number of MachineInstrs in this MachineFunction.
auto getEntryValueVariableDbgInfo() const
Returns the collection of variables for which we have debug info and that have been assigned an entry...
void setBBSectionsType(BasicBlockSection V)
MachineJumpTableInfo * getJumpTableInfo()
const WinEHFuncInfo * getWinEHFuncInfo() const
getWinEHFuncInfo - Return information about how the current function uses Windows exception handling.
void setCallsUnwindInit(bool b)
unsigned addToMBBNumbering(MachineBasicBlock *MBB)
Adds the MBB to the internal numbering.
void addLongjmpTarget(MCSymbol *Target)
Add the specified symbol to the list of valid longjmp targets for Windows Control Flow Guard.
const MachineConstantPool * getConstantPool() const
const MachineFrameInfo & getFrameInfo() const
void setHasEHFunclets(bool V)
bool UseDebugInstrRef
Flag for whether this function contains DBG_VALUEs (false) or DBG_INSTR_REF (true).
std::pair< unsigned, unsigned > DebugInstrOperandPair
Pair of instruction number and operand number.
ArrayRecycler< MachineOperand >::Capacity OperandCapacity
void addEHContTarget(MCSymbol *Target)
Add the specified symbol to the list of targets for Windows EH Continuation Guard.
bool useDebugInstrRef() const
Returns true if the function's variable locations are tracked with instruction referencing.
void setExposesReturnsTwice(bool B)
setCallsSetJmp - Set a flag that indicates if there's a call to a "returns twice" function.
void removeFromMBBNumbering(unsigned N)
removeFromMBBNumbering - Remove the specific machine basic block from our tracker,...
SmallVector< DebugSubstitution, 8 > DebugValueSubstitutions
Debug value substitutions: a collection of DebugSubstitution objects, recording changes in where a va...
unsigned getFunctionNumber() const
getFunctionNumber - Return a unique ID for the current function.
void setHasInlineAsm(bool B)
Set a flag that indicates that the function contains inline assembly.
bool hasAnyCallSiteLabel() const
CalledGlobalInfo tryGetCalledGlobal(const MachineInstr *MI) const
Tries to get the global and target flags for a call site, if the instruction is a call to a global.
PseudoSourceValueManager & getPSVManager() const
void substituteDebugValuesForInst(const MachineInstr &Old, MachineInstr &New, unsigned MaxOperand=UINT_MAX)
Create substitutions for any tracked values in Old, to point at New.
void setCallSiteBeginLabel(MCSymbol *BeginLabel, unsigned Site)
Map the begin label for a call site.
void setHasWinCFI(bool v)
void setWasmLandingPadIndex(const MachineBasicBlock *LPad, unsigned Index)
Map the landing pad to its index. Used for Wasm exception handling.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const std::vector< MCCFIInstruction > & getFrameInstructions() const
Returns a reference to a list of cfi instructions in the function's prologue.
unsigned getNewDebugInstrNum()
DenseMap< const MachineInstr *, CallSiteInfo > CallSiteInfoMap
MachineFunction & operator=(const MachineFunction &)=delete
bool hasInlineAsm() const
Returns true if the function contains any inline assembly.
void setCallsEHReturn(bool b)
void makeDebugValueSubstitution(DebugInstrOperandPair, DebugInstrOperandPair, unsigned SubReg=0)
Create a substitution between one <instr,operand> value to a different, new value.
MachineFunction(Function &F, const TargetMachine &Target, const TargetSubtargetInfo &STI, MCContext &Ctx, unsigned FunctionNum)
BasicBlockListType::reverse_iterator reverse_iterator
void setAlignment(Align A)
setAlignment - Set the alignment of the function.
WinEHFuncInfo * getWinEHFuncInfo()
bool exposesReturnsTwice() const
exposesReturnsTwice - Returns true if the function calls setjmp or any other similar functions with a...
MachineFunctionProperties & getProperties()
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags F, TypeSize Size, Align BaseAlignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
GISelChangeObserver * getObserver() const
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
const std::vector< MCSymbol * > & getEHContTargets() const
Returns a reference to a list of symbols that are targets for Windows EH Continuation Guard.
void finalizeDebugInstrRefs()
Finalise any partially emitted debug instructions.
void deallocateOperandArray(OperandCapacity Cap, MachineOperand *Array)
Dellocate an array of MachineOperands and recycle the memory.
void setSection(MCSection *S)
Indicates the Section this function belongs to.
bool callsUnwindInit() const
MachineMemOperand * getMachineMemOperand(const MachineMemOperand *MMO, int64_t Offset, uint64_t Size)
void push_front(MachineBasicBlock *MBB)
const std::vector< unsigned > & getFilterIds() const
Return a reference to the typeids encoding filters used in the current function.
const std::vector< const GlobalValue * > & getTypeInfos() const
Return a reference to the C++ typeinfo for the current function.
auto getInStackSlotVariableDbgInfo() const
Returns the collection of variables for which we have debug info and that have been assigned a stack ...
bool hasAnyWasmLandingPadIndex() const
Return if there is any wasm exception handling.
const CallSiteInfoMap & getCallSitesInfo() const
void ensureAlignment(Align A)
ensureAlignment - Make sure the function is at least A bytes aligned.
void push_back(MachineBasicBlock *MBB)
reverse_iterator rbegin()
void setHasFakeUses(bool V)
void setUseDebugInstrRef(bool UseInstrRef)
Set whether this function will use instruction referencing or not.
bool hasBBSections() const
Returns true if this function has basic block sections enabled.
MCContext & getContext() const
bool callsEHReturn() const
void setVariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, MCRegister Reg, const DILocation *Loc)
Collect information used to emit debugging information of a variable in the entry value of a register...
const Function & getFunction() const
Return the LLVM function that this machine code represents.
MachineOperand * allocateOperandArray(OperandCapacity Cap)
Allocate an array of MachineOperands.
MachineMemOperand * getMachineMemOperand(const MachineMemOperand *MMO, const MachinePointerInfo &PtrInfo, TypeSize Size)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
MachineBasicBlock * getBlockNumbered(unsigned N) const
getBlockNumbered - MachineBasicBlocks are automatically numbered when they are inserted into the mach...
unsigned DebugInstrNumberingCount
A count of how many instructions in the function have had numbers assigned to them.
auto getInStackSlotVariableDbgInfo()
Returns the collection of variables for which we have debug info and that have been assigned a stack ...
Align getAlignment() const
getAlignment - Return the alignment of the function.
void splice(iterator InsertPt, iterator MBBI, iterator MBBE)
void handleChangeDesc(MachineInstr &MI, const MCInstrDesc &TID)
unsigned getWasmLandingPadIndex(const MachineBasicBlock *LPad) const
Get the index in wasm EH for a given landing pad.
const_iterator end() const
static const unsigned int DebugOperandMemNumber
A reserved operand number representing the instructions memory operand, for instructions that have a ...
void setObserver(GISelChangeObserver *O)
unsigned getBlockNumberEpoch() const
Return the numbering "epoch" of block numbers, incremented after each numbering.
void resetDelegate(Delegate *delegate)
Reset the currently registered delegate - otherwise assert.
void addCodeViewAnnotation(MCSymbol *Label, MDNode *MD)
Record annotations associated with a particular label.
Function & getFunction()
Return the LLVM function that this machine code represents.
MachineMemOperand * getMachineMemOperand(const MachineMemOperand *MMO, const MachinePointerInfo &PtrInfo, uint64_t Size)
void erase(MachineBasicBlock *MBBI)
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
const_iterator begin() const
void remove(MachineBasicBlock *MBBI)
void setIsOutlined(bool V)
const std::vector< MCSymbol * > & getLongjmpTargets() const
Returns a reference to a list of symbols immediately following calls to _setjmp in the function.
DebugInstrOperandPair salvageCopySSAImpl(MachineInstr &MI)
const std::vector< LandingPadInfo > & getLandingPads() const
Return a reference to the landing pad info for the current function.
MCSection * getSection() const
Returns the Section this function belongs to.
const VariableDbgInfoMapTy & getVariableDbgInfo() const
const MachineBasicBlock & back() const
BasicBlockListType::iterator iterator
void setDebugInstrNumberingCount(unsigned Num)
Set value of DebugInstrNumberingCount field.
const_reverse_iterator rbegin() const
const STC & getSubtarget() const
getSubtarget - This method returns a pointer to the specified type of TargetSubtargetInfo.
BasicBlockListType::const_reverse_iterator const_reverse_iterator
unsigned getCallSiteBeginLabel(MCSymbol *BeginLabel) const
Get the call site number for a begin label.
void remove(iterator MBBI)
VariableDbgInfoMapTy & getVariableDbgInfo()
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
const MachineRegisterInfo & getRegInfo() const
const WasmEHFuncInfo * getWasmEHFuncInfo() const
getWasmEHFuncInfo - Return information about how the current function uses Wasm exception handling.
bool hasCallSiteBeginLabel(MCSymbol *BeginLabel) const
Return true if the begin label has a call site number associated with it.
void splice(iterator InsertPt, MachineBasicBlock *MBB)
void addCallSiteInfo(const MachineInstr *CallI, CallSiteInfo &&CallInfo)
Start tracking the arguments passed to the call CallI.
static BasicBlockListType MachineFunction::* getSublistAccess(MachineBasicBlock *)
Support for MachineBasicBlock::getNextNode().
bool hasWasmLandingPadIndex(const MachineBasicBlock *LPad) const
Returns true if the landing pad has an associate index in wasm EH.
bool shouldUseDebugInstrRef() const
Determine whether, in the current machine configuration, we should use instruction referencing or not...
const MachineFunctionProperties & getProperties() const
Get the function properties.
Ty * cloneInfo(const Ty &Old)
bool hasCallSiteLandingPad(MCSymbol *Sym)
Return true if the landing pad Eh symbol has an associated call site.
void setVariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, int Slot, const DILocation *Loc)
Collect information used to emit debugging information of a variable in a stack slot.
void setDelegate(Delegate *delegate)
Set the delegate.
void reset()
Reset the instance as if it was just created.
DenseMap< unsigned, DebugPHIRegallocPos > DebugPHIPositions
Map of debug instruction numbers to the position of their PHI instructions during register allocation...
const MachineBasicBlock & front() const
void setHasEHScopes(bool V)
MachineMemOperand * getMachineMemOperand(const MachineMemOperand *MMO, int64_t Offset, LocationSize Size)
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags F, uint64_t Size, Align BaseAlignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
const Ty * getInfo() const
bool hasEHFunclets() const
MachineMemOperand * getMachineMemOperand(const MachineMemOperand *MMO, int64_t Offset, TypeSize Size)
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
const_reverse_iterator rend() const
void setHasEHContTarget(bool V)
bool hasAnyCallSiteLandingPad() const
WasmEHFuncInfo * getWasmEHFuncInfo()
void splice(iterator InsertPt, iterator MBBI)
SmallVector< VariableDbgInfo, 4 > VariableDbgInfoMapTy
auto getCalledGlobals() const
Iterates over the full set of call sites and their associated globals.
bool hasEHContTarget() const
void addCalledGlobal(const MachineInstr *MI, CalledGlobalInfo Details)
Notes the global and target flags for a call site.
void erase(iterator MBBI)
ArrayRef< std::pair< MCSymbol *, MDNode * > > getCodeViewAnnotations() const
VariableDbgInfoMapTy VariableDbgInfos
MachineFunction(const MachineFunction &)=delete
void insert(iterator MBBI, MachineBasicBlock *MBB)
MachineBasicBlock & back()
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
DebugInstrOperandPair salvageCopySSA(MachineInstr &MI, DenseMap< Register, DebugInstrOperandPair > &DbgPHICache)
Find the underlying defining instruction / operand for a COPY instruction while in SSA form.
BasicBlockListType::const_iterator const_iterator
MachineFunctionInfo * cloneInfoFrom(const MachineFunction &OrigMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB)
MachineBasicBlock & front()
SmallVectorImpl< unsigned > & getCallSiteLandingPad(MCSymbol *Sym)
Get the call site indexes for a landing pad EH symbol.
Representation of each machine instruction.
LLVM_ABI bool isCandidateForAdditionalCallInfo(QueryType Type=IgnoreBundle) const
Return true if this is a call instruction that may have an additional information associated with it.
A description of a memory reference used in the backend.
Flags
Flags values. These may be or'd together.
MachineOperand class - Representation of each machine instruction operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Pass interface - Implemented by all 'passes'.
Manages creation of pseudo source values.
Recycler - This class manages a linked-list of deallocated nodes and facilitates reusing deallocated ...
Wrapper class representing virtual and physical registers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Primary interface to the complete machine description for the target machine.
TargetSubtargetInfo - Generic base class for all target subtargets.
base_list_type::const_reverse_iterator const_reverse_iterator
base_list_type::reverse_iterator reverse_iterator
base_list_type::const_iterator const_iterator
base_list_type::iterator iterator
This class implements an extremely fast bulk output stream that can only output to a stream.
This file defines classes to implement an intrusive doubly linked list class (i.e.
@ Cold
Attempts to make code in the caller as efficient as possible under the assumption that the call is no...
@ System
Synchronized with respect to all concurrently executing threads.
This is an optimization pass for GlobalISel generic memory operations.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
MachineFunctionDataHotness
iplist< T, Options... > ilist
LLVM_ABI void verifyMachineFunction(const std::string &Banner, const MachineFunction &MF)
iterator_range< filter_iterator< detail::IterOfRange< RangeT >, PredicateT > > make_filter_range(RangeT &&Range, PredicateT Pred)
Convenience function that takes a range of elements and a predicate, and return a new filter_iterator...
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
AtomicOrdering
Atomic ordering for LLVM's memory model.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
This struct is a compact representation of a valid (non-zero power of two) alignment.
Represent subnormal handling kind for floating point instruction inputs and outputs.
static unsigned getNumberEpoch(MachineFunction *F)
static unsigned getMaxNumber(MachineFunction *F)
static NodeRef getEntryNode(Inverse< MachineFunction * > G)
static unsigned getNumberEpoch(const MachineFunction *F)
static unsigned getMaxNumber(const MachineFunction *F)
static NodeRef getEntryNode(Inverse< const MachineFunction * > G)
static unsigned getNumberEpoch(MachineFunction *F)
pointer_iterator< MachineFunction::iterator > nodes_iterator
static unsigned size(MachineFunction *F)
static nodes_iterator nodes_begin(MachineFunction *F)
static unsigned getMaxNumber(MachineFunction *F)
static nodes_iterator nodes_end(MachineFunction *F)
static NodeRef getEntryNode(MachineFunction *F)
static nodes_iterator nodes_begin(const MachineFunction *F)
pointer_iterator< MachineFunction::const_iterator > nodes_iterator
static nodes_iterator nodes_end(const MachineFunction *F)
static unsigned size(const MachineFunction *F)
static unsigned getMaxNumber(const MachineFunction *F)
static NodeRef getEntryNode(const MachineFunction *F)
static unsigned getNumberEpoch(const MachineFunction *F)
typename MachineFunction *::UnknownGraphTypeError NodeRef
This structure is used to retain landing pad info for the current function.
SmallVector< MCSymbol *, 1 > EndLabels
MCSymbol * LandingPadLabel
SmallVector< SEHHandler, 1 > SEHHandlers
LandingPadInfo(MachineBasicBlock *MBB)
MachineBasicBlock * LandingPadBlock
SmallVector< MCSymbol *, 1 > BeginLabels
std::vector< int > TypeIds
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
static FuncInfoTy * create(BumpPtrAllocator &Allocator, const Function &F, const SubtargetTy *STI)
Factory function: default behavior is to call new using the supplied allocator.
virtual ~MachineFunctionInfo()
virtual MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
static Ty * create(BumpPtrAllocator &Allocator, const Ty &MFI)
ArgRegPair(Register R, unsigned Arg)
SmallVector< ConstantInt *, 4 > CalleeTypeIds
Callee type ids.
SmallVector< ArgRegPair, 1 > ArgRegPairs
Vector of call argument and its forwarding register.
const GlobalValue * Callee
This class contains a discriminated union of information about pointers in memory operands,...
const BlockAddress * RecoverBA
Address of block to recover at. Null for a finally handler.
const Function * FilterOrFinally
Filter or finally function. Null indicates a catch-all.
LLVM_ABI void deleteNode(MachineBasicBlock *MBB)
Use delete by default for iplist and ilist.
void transferNodesFromList(ilist_callback_traits &OldList, Iterator, Iterator)
LLVM_ABI void removeNodeFromList(MachineBasicBlock *N)
LLVM_ABI void addNodeToList(MachineBasicBlock *N)
Callbacks do nothing by default in iplist and ilist.
Template traits for intrusive list.