10 #ifndef LLVM_CODEGEN_STACKMAPS_H 11 #define LLVM_CODEGEN_STACKMAPS_H 30 class TargetRegisterInfo;
86 unsigned getMetaIdx(
unsigned Pos = 0)
const {
87 assert(Pos < MetaEnd &&
"Meta operand index out of range.");
88 return (HasDef ? 1 : 0) + Pos;
99 bool hasDef()
const {
return HasDef; }
102 uint64_t
getID()
const {
return getMetaOper(
IDPos).getImm(); }
111 return getMetaOper(TargetPos);
116 return getMetaOper(CCPos).getImm();
119 unsigned getArgIdx()
const {
return getMetaIdx() + MetaEnd; }
129 return getMetaIdx() + MetaEnd + getNumCallArgs();
141 unsigned getNextScratchIdx(
unsigned StartIdx = 0)
const;
167 enum { CCOffset = 1, FlagsOffset = 3, NumDeoptOperandsOffset = 5 };
174 return MI->getOperand(NCallArgsPos).getImm() + MetaEnd;
187 return MI->getOperand(CallTargetPos);
212 : Type(Type), Size(Size), Reg(Reg), Offset(Offset) {}
217 unsigned short DwarfRegNum = 0;
223 : Reg(Reg), DwarfRegNum(DwarfRegNum), Size(Size) {}
229 using OpType =
enum { DirectMemRefOp, IndirectMemRefOp, ConstantOp };
253 void serializeToStackMapSection();
256 static const char *WSMP;
262 struct FunctionInfo {
263 uint64_t StackSize = 0;
264 uint64_t RecordCount = 1;
266 FunctionInfo() =
default;
267 explicit FunctionInfo(uint64_t StackSize) : StackSize(StackSize) {}
270 struct CallsiteInfo {
271 const MCExpr *CSOffsetExpr =
nullptr;
276 CallsiteInfo() =
default;
277 CallsiteInfo(
const MCExpr *CSOffsetExpr, uint64_t ID,
279 : CSOffsetExpr(CSOffsetExpr),
ID(ID), Locations(std::move(Locations)),
280 LiveOuts(std::move(LiveOuts)) {}
284 using CallsiteInfoList = std::vector<CallsiteInfo>;
287 CallsiteInfoList CSInfos;
312 bool recordResult =
false);
318 void emitFunctionFrameRecords(
MCStreamer &OS);
332 #endif // LLVM_CODEGEN_STACKMAPS_H
Compute iterated dominance frontiers using a linear time algorithm.
StatepointOpers(const MachineInstr *MI)
unsigned const TargetRegisterInfo * TRI
Location(LocationType Type, unsigned Size, unsigned Reg, int64_t Offset)
unsigned getVarIdx() const
Get starting index of non call related arguments (calling convention, statepoint flags, vm state and gc state).
Base class for the full range of assembler expressions which are needed for parsing.
unsigned getStackMapStartIdx() const
Get the index at which stack map locations will be recorded.
uint64_t getID() const
Return the ID for the given stackmap.
Streaming machine code generation interface.
const MachineOperand & getCallTarget() const
Returns the target of the underlying call.
The instances of the Type class are immutable: once they are created, they are never changed...
LiveOutReg(unsigned short Reg, unsigned short DwarfRegNum, unsigned short Size)
This class is intended to be used as a driving class for all asm writers.
unsigned getVarIdx() const
Get the operand index of the variable list of non-argument operands.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
MI-level patchpoint operands.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
uint32_t getNumPatchBytes() const
Return the number of patchable bytes the given stackmap should emit.
StackMapOpers(const MachineInstr *MI)
MachineOperand class - Representation of each machine instruction operand.
unsigned getVarIdx() const
Get the operand index of the variable list of non-argument operands.
enum { DirectMemRefOp, IndirectMemRefOp, ConstantOp } OpType
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Representation of each machine instruction.
MI-level stackmap operands.
uint32_t getNumCallArgs() const
Return the number of call arguments.
MI-level Statepoint operands.
unsigned getArgIdx() const
uint32_t getNumPatchBytes() const
Return the number of patchable bytes the given patchpoint should emit.
uint64_t getID() const
Return the ID for the given patchpoint.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
uint32_t getNumPatchBytes() const
Return the number of patchable bytes the given statepoint should emit.
uint64_t getID() const
Return the ID for the given statepoint.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
This class implements an extremely fast bulk output stream that can only output to a stream...
const MachineOperand & getCallTarget() const
Returns the target of the underlying call.
CallingConv::ID getCallingConv() const
Returns the calling convention.
const MachineOperand & getOperand(unsigned i) const