Go to the documentation of this file.
24 std::optional<PseudoProbe>
26 assert(isa<CallBase>(&Inst) && !isa<IntrinsicInst>(&Inst) &&
27 "Only call instructions should have pseudo probe encodes as their "
28 "Dwarf discriminators");
31 auto Discriminator = DIL->getDiscriminator();
50 if (
const auto *II = dyn_cast<PseudoProbeInst>(&Inst)) {
52 Probe.
Id = II->getIndex()->getZExtValue();
54 Probe.
Attr = II->getAttributes()->getZExtValue();
55 Probe.
Factor = II->getFactor()->getZExtValue() /
60 if (isa<CallBase>(&Inst) && !isa<IntrinsicInst>(&Inst))
67 assert(Factor >= 0 && Factor <= 1 &&
68 "Distribution factor must be in [0, 1.0]");
69 if (
auto *II = dyn_cast<PseudoProbeInst>(&Inst)) {
74 auto OrigFactor = II->getFactor()->getZExtValue();
75 if (IntFactor != OrigFactor)
76 II->replaceUsesOfWith(II->getFactor(),
Builder.getInt64(IntFactor));
77 }
else if (isa<CallBase>(&Inst) && !isa<IntrinsicInst>(&Inst)) {
80 auto Discriminator = DIL->getDiscriminator();
constexpr static uint64_t PseudoProbeFullDistributionFactor
static uint32_t extractProbeAttributes(uint32_t Value)
This is an optimization pass for GlobalISel generic memory operations.
constexpr static uint8_t FullDistributionFactor
static bool isPseudoProbeDiscriminator(unsigned Discriminator)
static uint32_t extractProbeType(uint32_t Value)
The instances of the Type class are immutable: once they are created, they are never changed.
const DILocation * cloneWithDiscriminator(unsigned Discriminator) const
Returns a new DILocation with updated Discriminator.
static uint32_t extractProbeFactor(uint32_t Value)
static uint32_t packProbeData(uint32_t Index, uint32_t Type, uint32_t Flags, uint32_t Factor)
void setProbeDistributionFactor(Instruction &Inst, float Factor)
void setDebugLoc(DebugLoc Loc)
Set the debug location information for this instruction.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static uint32_t extractProbeIndex(uint32_t Value)
std::optional< PseudoProbe > extractProbe(const Instruction &Inst)
std::optional< PseudoProbe > extractProbeFromDiscriminator(const Instruction &Inst)
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.