13#ifndef LLVM_IR_PSEUDOPROBE_H
14#define LLVM_IR_PSEUDOPROBE_H
39 std::numeric_limits<uint64_t>::max();
57 std::optional<uint32_t> DwarfBaseDiscriminator) {
58 assert(
Index <= 0xFFFF &&
"Probe index too big to encode, exceeding 2^16");
59 assert(
Type <= 0x3 &&
"Probe type too big to encode, exceeding 3");
62 "Probe distribution factor too big to encode, exceeding 100");
68 if (
Index <= 0x1FFF && DwarfBaseDiscriminator &&
69 *DwarfBaseDiscriminator <= 0x7)
70 V |= (1 << 28) | (*DwarfBaseDiscriminator << 16);
76 return (
Value >> 3) & 0x1FFF;
77 return (
Value >> 3) & 0xFFFF;
82 return (
Value >> 16) & 0x7;
87 return Value & 0x10000000;
91 return (
Value >> 26) & 0x3;
95 return (
Value >> 29) & 0x7;
99 return (
Value >> 19) & 0x7F;
112 : FunctionGUID(GUID), FunctionHash(Hash) {}
136std::optional<PseudoProbe>
extractProbe(
const Instruction &Inst);
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
PseudoProbeDescriptor(uint64_t GUID, uint64_t Hash)
uint64_t getFunctionGUID() const
uint64_t getFunctionHash() const
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.
static bool isSentinelProbe(uint32_t Flags)
static constexpr uint64_t PseudoProbeFullDistributionFactor
void setProbeDistributionFactor(Instruction &Inst, float Factor)
std::optional< PseudoProbe > extractProbe(const Instruction &Inst)
static bool hasDiscriminator(uint32_t Flags)
constexpr const char * PseudoProbeDescMetadataName
static uint32_t extractProbeFactor(uint32_t Value)
static constexpr uint8_t FullDistributionFactor
static uint32_t extractProbeIndex(uint32_t Value)
static uint32_t packProbeData(uint32_t Index, uint32_t Type, uint32_t Flags, uint32_t Factor, std::optional< uint32_t > DwarfBaseDiscriminator)
static bool isDwarfBaseDiscriminatorEncoded(uint32_t Value)
static uint32_t extractProbeAttributes(uint32_t Value)
static std::optional< uint32_t > extractDwarfBaseDiscriminator(uint32_t Value)
static uint32_t extractProbeType(uint32_t Value)