LLVM  14.0.0git
StackMaps.h
Go to the documentation of this file.
1 //===- StackMaps.h - StackMaps ----------------------------------*- 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 #ifndef LLVM_CODEGEN_STACKMAPS_H
10 #define LLVM_CODEGEN_STACKMAPS_H
11 
12 #include "llvm/ADT/MapVector.h"
13 #include "llvm/ADT/SmallVector.h"
15 #include "llvm/IR/CallingConv.h"
16 #include "llvm/MC/MCSymbol.h"
17 #include "llvm/Support/Debug.h"
18 #include <algorithm>
19 #include <cassert>
20 #include <cstdint>
21 #include <vector>
22 
23 namespace llvm {
24 
25 class AsmPrinter;
26 class MCExpr;
27 class MCStreamer;
28 class raw_ostream;
29 class TargetRegisterInfo;
30 
31 /// MI-level stackmap operands.
32 ///
33 /// MI stackmap operations take the form:
34 /// <id>, <numBytes>, live args...
36 public:
37  /// Enumerate the meta operands.
38  enum { IDPos, NBytesPos };
39 
40 private:
41  const MachineInstr* MI;
42 
43 public:
44  explicit StackMapOpers(const MachineInstr *MI);
45 
46  /// Return the ID for the given stackmap
47  uint64_t getID() const { return MI->getOperand(IDPos).getImm(); }
48 
49  /// Return the number of patchable bytes the given stackmap should emit.
51  return MI->getOperand(NBytesPos).getImm();
52  }
53 
54  /// Get the operand index of the variable list of non-argument operands.
55  /// These hold the "live state".
56  unsigned getVarIdx() const {
57  // Skip ID, nShadowBytes.
58  return 2;
59  }
60 };
61 
62 /// MI-level patchpoint operands.
63 ///
64 /// MI patchpoint operations take the form:
65 /// [<def>], <id>, <numBytes>, <target>, <numArgs>, <cc>, ...
66 ///
67 /// IR patchpoint intrinsics do not have the <cc> operand because calling
68 /// convention is part of the subclass data.
69 ///
70 /// SD patchpoint nodes do not have a def operand because it is part of the
71 /// SDValue.
72 ///
73 /// Patchpoints following the anyregcc convention are handled specially. For
74 /// these, the stack map also records the location of the return value and
75 /// arguments.
77 public:
78  /// Enumerate the meta operands.
80 
81 private:
82  const MachineInstr *MI;
83  bool HasDef;
84 
85  unsigned getMetaIdx(unsigned Pos = 0) const {
86  assert(Pos < MetaEnd && "Meta operand index out of range.");
87  return (HasDef ? 1 : 0) + Pos;
88  }
89 
90  const MachineOperand &getMetaOper(unsigned Pos) const {
91  return MI->getOperand(getMetaIdx(Pos));
92  }
93 
94 public:
95  explicit PatchPointOpers(const MachineInstr *MI);
96 
97  bool isAnyReg() const { return (getCallingConv() == CallingConv::AnyReg); }
98  bool hasDef() const { return HasDef; }
99 
100  /// Return the ID for the given patchpoint.
101  uint64_t getID() const { return getMetaOper(IDPos).getImm(); }
102 
103  /// Return the number of patchable bytes the given patchpoint should emit.
105  return getMetaOper(NBytesPos).getImm();
106  }
107 
108  /// Returns the target of the underlying call.
109  const MachineOperand &getCallTarget() const {
110  return getMetaOper(TargetPos);
111  }
112 
113  /// Returns the calling convention
115  return getMetaOper(CCPos).getImm();
116  }
117 
118  unsigned getArgIdx() const { return getMetaIdx() + MetaEnd; }
119 
120  /// Return the number of call arguments
122  return MI->getOperand(getMetaIdx(NArgPos)).getImm();
123  }
124 
125  /// Get the operand index of the variable list of non-argument operands.
126  /// These hold the "live state".
127  unsigned getVarIdx() const {
128  return getMetaIdx() + MetaEnd + getNumCallArgs();
129  }
130 
131  /// Get the index at which stack map locations will be recorded.
132  /// Arguments are not recorded unless the anyregcc convention is used.
133  unsigned getStackMapStartIdx() const {
134  if (isAnyReg())
135  return getArgIdx();
136  return getVarIdx();
137  }
138 
139  /// Get the next scratch register operand index.
140  unsigned getNextScratchIdx(unsigned StartIdx = 0) const;
141 };
142 
143 /// MI-level Statepoint operands
144 ///
145 /// Statepoint operands take the form:
146 /// <id>, <num patch bytes >, <num call arguments>, <call target>,
147 /// [call arguments...],
148 /// <StackMaps::ConstantOp>, <calling convention>,
149 /// <StackMaps::ConstantOp>, <statepoint flags>,
150 /// <StackMaps::ConstantOp>, <num deopt args>, [deopt args...],
151 /// <StackMaps::ConstantOp>, <num gc pointer args>, [gc pointer args...],
152 /// <StackMaps::ConstantOp>, <num gc allocas>, [gc allocas args...],
153 /// <StackMaps::ConstantOp>, <num entries in gc map>, [base/derived pairs]
154 /// base/derived pairs in gc map are logical indices into <gc pointer args>
155 /// section.
156 /// All gc pointers assigned to VRegs produce new value (in form of MI Def
157 /// operand) and are tied to it.
159  // TODO:: we should change the STATEPOINT representation so that CC and
160  // Flags should be part of meta operands, with args and deopt operands, and
161  // gc operands all prefixed by their length and a type code. This would be
162  // much more consistent.
163 
164  // These values are absolute offsets into the operands of the statepoint
165  // instruction.
166  enum { IDPos, NBytesPos, NCallArgsPos, CallTargetPos, MetaEnd };
167 
168  // These values are relative offsets from the start of the statepoint meta
169  // arguments (i.e. the end of the call arguments).
170  enum { CCOffset = 1, FlagsOffset = 3, NumDeoptOperandsOffset = 5 };
171 
172 public:
173  explicit StatepointOpers(const MachineInstr *MI) : MI(MI) {
174  NumDefs = MI->getNumDefs();
175  }
176 
177  /// Get index of statepoint ID operand.
178  unsigned getIDPos() const { return NumDefs + IDPos; }
179 
180  /// Get index of Num Patch Bytes operand.
181  unsigned getNBytesPos() const { return NumDefs + NBytesPos; }
182 
183  /// Get index of Num Call Arguments operand.
184  unsigned getNCallArgsPos() const { return NumDefs + NCallArgsPos; }
185 
186  /// Get starting index of non call related arguments
187  /// (calling convention, statepoint flags, vm state and gc state).
188  unsigned getVarIdx() const {
189  return MI->getOperand(NumDefs + NCallArgsPos).getImm() + MetaEnd + NumDefs;
190  }
191 
192  /// Get index of Calling Convention operand.
193  unsigned getCCIdx() const { return getVarIdx() + CCOffset; }
194 
195  /// Get index of Flags operand.
196  unsigned getFlagsIdx() const { return getVarIdx() + FlagsOffset; }
197 
198  /// Get index of Number Deopt Arguments operand.
199  unsigned getNumDeoptArgsIdx() const {
200  return getVarIdx() + NumDeoptOperandsOffset;
201  }
202 
203  /// Return the ID for the given statepoint.
204  uint64_t getID() const { return MI->getOperand(NumDefs + IDPos).getImm(); }
205 
206  /// Return the number of patchable bytes the given statepoint should emit.
208  return MI->getOperand(NumDefs + NBytesPos).getImm();
209  }
210 
211  /// Return the target of the underlying call.
212  const MachineOperand &getCallTarget() const {
213  return MI->getOperand(NumDefs + CallTargetPos);
214  }
215 
216  /// Return the calling convention.
218  return MI->getOperand(getCCIdx()).getImm();
219  }
220 
221  /// Return the statepoint flags.
222  uint64_t getFlags() const { return MI->getOperand(getFlagsIdx()).getImm(); }
223 
225  return MI->getOperand(getNumDeoptArgsIdx()).getImm();
226  }
227 
228  /// Get index of number of gc map entries.
229  unsigned getNumGcMapEntriesIdx();
230 
231  /// Get index of number of gc allocas.
232  unsigned getNumAllocaIdx();
233 
234  /// Get index of number of GC pointers.
235  unsigned getNumGCPtrIdx();
236 
237  /// Get index of first GC pointer operand of -1 if there are none.
238  int getFirstGCPtrIdx();
239 
240  /// Get vector of base/derived pairs from statepoint.
241  /// Elements are indices into GC Pointer operand list (logical).
242  /// Returns number of elements in GCMap.
243  unsigned
244  getGCPointerMap(SmallVectorImpl<std::pair<unsigned, unsigned>> &GCMap);
245 
246 private:
247  const MachineInstr *MI;
248  unsigned NumDefs;
249 };
250 
251 class StackMaps {
252 public:
253  struct Location {
261  };
263  unsigned Size = 0;
264  unsigned Reg = 0;
265  int64_t Offset = 0;
266 
267  Location() = default;
268  Location(LocationType Type, unsigned Size, unsigned Reg, int64_t Offset)
269  : Type(Type), Size(Size), Reg(Reg), Offset(Offset) {}
270  };
271 
272  struct LiveOutReg {
273  unsigned short Reg = 0;
274  unsigned short DwarfRegNum = 0;
275  unsigned short Size = 0;
276 
277  LiveOutReg() = default;
278  LiveOutReg(unsigned short Reg, unsigned short DwarfRegNum,
279  unsigned short Size)
281  };
282 
283  // OpTypes are used to encode information about the following logical
284  // operand (which may consist of several MachineOperands) for the
285  // OpParser.
286  using OpType = enum { DirectMemRefOp, IndirectMemRefOp, ConstantOp };
287 
288  StackMaps(AsmPrinter &AP);
289 
290  /// Get index of next meta operand.
291  /// Similar to parseOperand, but does not actually parses operand meaning.
292  static unsigned getNextMetaArgIdx(const MachineInstr *MI, unsigned CurIdx);
293 
294  void reset() {
295  CSInfos.clear();
296  ConstPool.clear();
297  FnInfos.clear();
298  }
299 
303 
304  struct FunctionInfo {
307 
308  FunctionInfo() = default;
310  };
311 
312  struct CallsiteInfo {
313  const MCExpr *CSOffsetExpr = nullptr;
317 
318  CallsiteInfo() = default;
322  LiveOuts(std::move(LiveOuts)) {}
323  };
324 
326  using CallsiteInfoList = std::vector<CallsiteInfo>;
327 
328  /// Generate a stackmap record for a stackmap instruction.
329  ///
330  /// MI must be a raw STACKMAP, not a PATCHPOINT.
331  void recordStackMap(const MCSymbol &L,
332  const MachineInstr &MI);
333 
334  /// Generate a stackmap record for a patchpoint instruction.
335  void recordPatchPoint(const MCSymbol &L,
336  const MachineInstr &MI);
337 
338  /// Generate a stackmap record for a statepoint instruction.
339  void recordStatepoint(const MCSymbol &L,
340  const MachineInstr &MI);
341 
342  /// If there is any stack map data, create a stack map section and serialize
343  /// the map info into it. This clears the stack map data structures
344  /// afterwards.
346 
347  /// Get call site info.
348  CallsiteInfoList &getCSInfos() { return CSInfos; }
349 
350  /// Get function info.
351  FnInfoMap &getFnInfos() { return FnInfos; }
352 
353 private:
354  static const char *WSMP;
355 
356  AsmPrinter &AP;
357  CallsiteInfoList CSInfos;
358  ConstantPool ConstPool;
359  FnInfoMap FnInfos;
360 
362  parseOperand(MachineInstr::const_mop_iterator MOI,
364  LiveOutVec &LiveOuts) const;
365 
366  /// Specialized parser of statepoint operands.
367  /// They do not directly correspond to StackMap record entries.
368  void parseStatepointOpers(const MachineInstr &MI,
371  LocationVec &Locations, LiveOutVec &LiveOuts);
372 
373  /// Create a live-out register record for the given register @p Reg.
374  LiveOutReg createLiveOutReg(unsigned Reg,
375  const TargetRegisterInfo *TRI) const;
376 
377  /// Parse the register live-out mask and return a vector of live-out
378  /// registers that need to be recorded in the stackmap.
379  LiveOutVec parseRegisterLiveOutMask(const uint32_t *Mask) const;
380 
381  /// Record the locations of the operands of the provided instruction in a
382  /// record keyed by the provided label. For instructions w/AnyReg calling
383  /// convention the return register is also recorded if requested. For
384  /// STACKMAP, and PATCHPOINT the label is expected to immediately *preceed*
385  /// lowering of the MI to MCInsts. For STATEPOINT, it expected to
386  /// immediately *follow*. It's not clear this difference was intentional,
387  /// but it exists today.
388  void recordStackMapOpers(const MCSymbol &L,
389  const MachineInstr &MI, uint64_t ID,
392  bool recordResult = false);
393 
394  /// Emit the stackmap header.
395  void emitStackmapHeader(MCStreamer &OS);
396 
397  /// Emit the function frame record for each function.
398  void emitFunctionFrameRecords(MCStreamer &OS);
399 
400  /// Emit the constant pool.
401  void emitConstantPoolEntries(MCStreamer &OS);
402 
403  /// Emit the callsite info for each stackmap/patchpoint intrinsic call.
404  void emitCallsiteEntries(MCStreamer &OS);
405 
406  void print(raw_ostream &OS);
407  void debug() { print(dbgs()); }
408 };
409 
410 } // end namespace llvm
411 
412 #endif // LLVM_CODEGEN_STACKMAPS_H
llvm::StackMaps::Location::Indirect
@ Indirect
Definition: StackMaps.h:258
llvm::StackMaps::OpType
enum { DirectMemRefOp, IndirectMemRefOp, ConstantOp } OpType
Definition: StackMaps.h:286
llvm::PatchPointOpers::getNumCallArgs
uint32_t getNumCallArgs() const
Return the number of call arguments.
Definition: StackMaps.h:121
llvm::PatchPointOpers::hasDef
bool hasDef() const
Definition: StackMaps.h:98
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:105
MachineInstr.h
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::StackMaps::CallsiteInfo::CallsiteInfo
CallsiteInfo(const MCExpr *CSOffsetExpr, uint64_t ID, LocationVec &&Locations, LiveOutVec &&LiveOuts)
Definition: StackMaps.h:319
llvm::StackMapOpers
MI-level stackmap operands.
Definition: StackMaps.h:35
Reg
unsigned Reg
Definition: MachineSink.cpp:1566
llvm::StackMaps::Location::Register
@ Register
Definition: StackMaps.h:256
llvm::StackMaps::Location::Location
Location(LocationType Type, unsigned Size, unsigned Reg, int64_t Offset)
Definition: StackMaps.h:268
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::StackMaps::recordStatepoint
void recordStatepoint(const MCSymbol &L, const MachineInstr &MI)
Generate a stackmap record for a statepoint instruction.
Definition: StackMaps.cpp:555
llvm::CallingConv::AnyReg
@ AnyReg
Definition: CallingConv.h:62
llvm::StackMaps::CallsiteInfo
Definition: StackMaps.h:312
llvm::MapVector::clear
void clear()
Definition: MapVector.h:88
llvm::SmallVector< Location, 8 >
llvm::StackMaps::Location::Offset
int64_t Offset
Definition: StackMaps.h:265
llvm::StackMaps::FunctionInfo::FunctionInfo
FunctionInfo()=default
MapVector.h
llvm::ConstantPool
Definition: ConstantPools.h:43
llvm::StatepointOpers::StatepointOpers
StatepointOpers(const MachineInstr *MI)
Definition: StackMaps.h:173
llvm::StackMaps::FunctionInfo::StackSize
uint64_t StackSize
Definition: StackMaps.h:305
llvm::TargetRegisterInfo
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Definition: TargetRegisterInfo.h:233
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::StatepointOpers::getNumGcMapEntriesIdx
unsigned getNumGcMapEntriesIdx()
Get index of number of gc map entries.
Definition: StackMaps.cpp:94
llvm::StackMaps::reset
void reset()
Definition: StackMaps.h:294
llvm::MapVector< uint64_t, uint64_t >
llvm::StatepointOpers::getNumPatchBytes
uint32_t getNumPatchBytes() const
Return the number of patchable bytes the given statepoint should emit.
Definition: StackMaps.h:207
llvm::StackMaps::CallsiteInfo::CallsiteInfo
CallsiteInfo()=default
llvm::StackMaps::getCSInfos
CallsiteInfoList & getCSInfos()
Get call site info.
Definition: StackMaps.h:348
llvm::StackMaps::CallsiteInfo::ID
uint64_t ID
Definition: StackMaps.h:314
llvm::PatchPointOpers::getCallTarget
const MachineOperand & getCallTarget() const
Returns the target of the underlying call.
Definition: StackMaps.h:109
llvm::PatchPointOpers::NArgPos
@ NArgPos
Definition: StackMaps.h:79
llvm::PatchPointOpers
MI-level patchpoint operands.
Definition: StackMaps.h:76
llvm::BitmaskEnumDetail::Mask
std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Definition: BitmaskEnum.h:80
TRI
unsigned const TargetRegisterInfo * TRI
Definition: MachineSink.cpp:1567
llvm::StackMaps
Definition: StackMaps.h:251
llvm::PatchPointOpers::getID
uint64_t getID() const
Return the ID for the given patchpoint.
Definition: StackMaps.h:101
llvm::StackMaps::recordStackMap
void recordStackMap(const MCSymbol &L, const MachineInstr &MI)
Generate a stackmap record for a stackmap instruction.
Definition: StackMaps.cpp:524
llvm::dbgs
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:163
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:199
llvm::StatepointOpers::getNumDeoptArgsIdx
unsigned getNumDeoptArgsIdx() const
Get index of Number Deopt Arguments operand.
Definition: StackMaps.h:199
llvm::StackMapOpers::IDPos
@ IDPos
Definition: StackMaps.h:38
llvm::StackMapOpers::getNumPatchBytes
uint32_t getNumPatchBytes() const
Return the number of patchable bytes the given stackmap should emit.
Definition: StackMaps.h:50
llvm::StackMaps::Location
Definition: StackMaps.h:253
llvm::MachineOperand::getImm
int64_t getImm() const
Definition: MachineOperand.h:537
llvm::StatepointOpers::getCallTarget
const MachineOperand & getCallTarget() const
Return the target of the underlying call.
Definition: StackMaps.h:212
llvm::StatepointOpers::getCallingConv
CallingConv::ID getCallingConv() const
Return the calling convention.
Definition: StackMaps.h:217
llvm::StatepointOpers::getGCPointerMap
unsigned getGCPointerMap(SmallVectorImpl< std::pair< unsigned, unsigned >> &GCMap)
Get vector of base/derived pairs from statepoint.
Definition: StackMaps.cpp:135
MCSymbol.h
llvm::MachineOperand
MachineOperand class - Representation of each machine instruction operand.
Definition: MachineOperand.h:49
llvm::StackMaps::Location::Size
unsigned Size
Definition: StackMaps.h:263
llvm::StackMaps::FunctionInfo::FunctionInfo
FunctionInfo(uint64_t StackSize)
Definition: StackMaps.h:309
llvm::StatepointOpers::getVarIdx
unsigned getVarIdx() const
Get starting index of non call related arguments (calling convention, statepoint flags,...
Definition: StackMaps.h:188
llvm::StackMaps::StackMaps
StackMaps(AsmPrinter &AP)
Definition: StackMaps.cpp:149
llvm::PatchPointOpers::PatchPointOpers
PatchPointOpers(const MachineInstr *MI)
Definition: StackMaps.cpp:62
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::StackMapOpers::NBytesPos
@ NBytesPos
Definition: StackMaps.h:38
llvm::StackMaps::LiveOutReg::Size
unsigned short Size
Definition: StackMaps.h:275
llvm::StatepointOpers::getFlagsIdx
unsigned getFlagsIdx() const
Get index of Flags operand.
Definition: StackMaps.h:196
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
llvm::StackMaps::LiveOutReg::LiveOutReg
LiveOutReg(unsigned short Reg, unsigned short DwarfRegNum, unsigned short Size)
Definition: StackMaps.h:278
llvm::PatchPointOpers::isAnyReg
bool isAnyReg() const
Definition: StackMaps.h:97
llvm::StatepointOpers::getNBytesPos
unsigned getNBytesPos() const
Get index of Num Patch Bytes operand.
Definition: StackMaps.h:181
llvm::PatchPointOpers::getNextScratchIdx
unsigned getNextScratchIdx(unsigned StartIdx=0) const
Get the next scratch register operand index.
Definition: StackMaps.cpp:77
llvm::StackMaps::LiveOutReg::Reg
unsigned short Reg
Definition: StackMaps.h:273
llvm::StatepointOpers::getNumAllocaIdx
unsigned getNumAllocaIdx()
Get index of number of gc allocas.
Definition: StackMaps.cpp:104
llvm::StackMapOpers::getVarIdx
unsigned getVarIdx() const
Get the operand index of the variable list of non-argument operands.
Definition: StackMaps.h:56
llvm::PatchPointOpers::getNumPatchBytes
uint32_t getNumPatchBytes() const
Return the number of patchable bytes the given patchpoint should emit.
Definition: StackMaps.h:104
llvm::PatchPointOpers::getVarIdx
unsigned getVarIdx() const
Get the operand index of the variable list of non-argument operands.
Definition: StackMaps.h:127
llvm::PatchPointOpers::MetaEnd
@ MetaEnd
Definition: StackMaps.h:79
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
uint64_t
llvm::StackMaps::Location::Constant
@ Constant
Definition: StackMaps.h:259
llvm::StackMaps::serializeToStackMapSection
void serializeToStackMapSection()
If there is any stack map data, create a stack map section and serialize the map info into it.
Definition: StackMaps.cpp:708
llvm::StackMaps::FunctionInfo::RecordCount
uint64_t RecordCount
Definition: StackMaps.h:306
llvm::StatepointOpers::getIDPos
unsigned getIDPos() const
Get index of statepoint ID operand.
Definition: StackMaps.h:178
llvm::StackMaps::LiveOutVec
SmallVector< LiveOutReg, 8 > LiveOutVec
Definition: StackMaps.h:301
llvm::StackMaps::CallsiteInfo::Locations
LocationVec Locations
Definition: StackMaps.h:315
llvm::StackMaps::FnInfoMap
MapVector< const MCSymbol *, FunctionInfo > FnInfoMap
Definition: StackMaps.h:325
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::StatepointOpers::getNCallArgsPos
unsigned getNCallArgsPos() const
Get index of Num Call Arguments operand.
Definition: StackMaps.h:184
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1609
llvm::StackMaps::getFnInfos
FnInfoMap & getFnInfos()
Get function info.
Definition: StackMaps.h:351
llvm::PatchPointOpers::getCallingConv
CallingConv::ID getCallingConv() const
Returns the calling convention.
Definition: StackMaps.h:114
llvm::StackMaps::getNextMetaArgIdx
static unsigned getNextMetaArgIdx(const MachineInstr *MI, unsigned CurIdx)
Get index of next meta operand.
Definition: StackMaps.cpp:154
llvm::PatchPointOpers::getStackMapStartIdx
unsigned getStackMapStartIdx() const
Get the index at which stack map locations will be recorded.
Definition: StackMaps.h:133
llvm::StackMaps::Location::Location
Location()=default
llvm::StackMaps::LiveOutReg::DwarfRegNum
unsigned short DwarfRegNum
Definition: StackMaps.h:274
llvm::StackMaps::LiveOutReg::LiveOutReg
LiveOutReg()=default
llvm::StatepointOpers::getFlags
uint64_t getFlags() const
Return the statepoint flags.
Definition: StackMaps.h:222
uint32_t
llvm::StackMapOpers::getID
uint64_t getID() const
Return the ID for the given stackmap.
Definition: StackMaps.h:47
llvm::StackMapOpers::StackMapOpers
StackMapOpers(const MachineInstr *MI)
Definition: StackMaps.cpp:56
llvm::StatepointOpers::getCCIdx
unsigned getCCIdx() const
Get index of Calling Convention operand.
Definition: StackMaps.h:193
llvm::PatchPointOpers::CCPos
@ CCPos
Definition: StackMaps.h:79
llvm::StatepointOpers::getFirstGCPtrIdx
int getFirstGCPtrIdx()
Get index of first GC pointer operand of -1 if there are none.
Definition: StackMaps.cpp:125
CallingConv.h
llvm::StackMaps::Location::Direct
@ Direct
Definition: StackMaps.h:257
llvm::StatepointOpers
MI-level Statepoint operands.
Definition: StackMaps.h:158
llvm::PatchPointOpers::NBytesPos
@ NBytesPos
Definition: StackMaps.h:79
std
Definition: BitVector.h:838
llvm::PatchPointOpers::getArgIdx
unsigned getArgIdx() const
Definition: StackMaps.h:118
llvm::StackMaps::Location::ConstantIndex
@ ConstantIndex
Definition: StackMaps.h:260
llvm::StackMaps::recordPatchPoint
void recordPatchPoint(const MCSymbol &L, const MachineInstr &MI)
Generate a stackmap record for a patchpoint instruction.
Definition: StackMaps.cpp:534
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:82
llvm::StatepointOpers::getNumDeoptArgs
uint64_t getNumDeoptArgs() const
Definition: StackMaps.h:224
llvm::StackMaps::Location::LocationType
LocationType
Definition: StackMaps.h:254
llvm::StackMaps::Location::Reg
unsigned Reg
Definition: StackMaps.h:264
llvm::StackMaps::CallsiteInfo::CSOffsetExpr
const MCExpr * CSOffsetExpr
Definition: StackMaps.h:313
SmallVector.h
llvm::PatchPointOpers::TargetPos
@ TargetPos
Definition: StackMaps.h:79
llvm::StackMaps::Location::Unprocessed
@ Unprocessed
Definition: StackMaps.h:255
llvm::StackMaps::CallsiteInfoList
std::vector< CallsiteInfo > CallsiteInfoList
Definition: StackMaps.h:326
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
llvm::StackMaps::CallsiteInfo::LiveOuts
LiveOutVec LiveOuts
Definition: StackMaps.h:316
llvm::StatepointOpers::getID
uint64_t getID() const
Return the ID for the given statepoint.
Definition: StackMaps.h:204
llvm::StackMaps::LocationVec
SmallVector< Location, 8 > LocationVec
Definition: StackMaps.h:300
llvm::StackMaps::FunctionInfo
Definition: StackMaps.h:304
llvm::PatchPointOpers::IDPos
@ IDPos
Definition: StackMaps.h:79
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
Debug.h
llvm::StatepointOpers::getNumGCPtrIdx
unsigned getNumGCPtrIdx()
Get index of number of GC pointers.
Definition: StackMaps.cpp:114
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:37
llvm::StackMaps::LiveOutReg
Definition: StackMaps.h:272