Go to the documentation of this file.
25 assert(isa<CallBase>(&Inst) && !isa<IntrinsicInst>(&Inst) &&
26 "Only call instructions should have pseudo probe encodes as their "
27 "Dwarf discriminators");
30 auto Discriminator = DIL->getDiscriminator();
49 if (
const auto *II = dyn_cast<PseudoProbeInst>(&Inst)) {
51 Probe.
Id = II->getIndex()->getZExtValue();
53 Probe.
Attr = II->getAttributes()->getZExtValue();
54 Probe.
Factor = II->getFactor()->getZExtValue() /
59 if (isa<CallBase>(&Inst) && !isa<IntrinsicInst>(&Inst))
66 assert(Factor >= 0 && Factor <= 1 &&
67 "Distribution factor must be in [0, 1.0]");
68 if (
auto *II = dyn_cast<PseudoProbeInst>(&Inst)) {
73 auto OrigFactor = II->getFactor()->getZExtValue();
74 if (IntFactor != OrigFactor)
75 II->replaceUsesOfWith(II->getFactor(),
Builder.getInt64(IntFactor));
76 }
else if (isa<CallBase>(&Inst) && !isa<IntrinsicInst>(&Inst)) {
79 auto Discriminator = DIL->getDiscriminator();
93 Index,
Type, Attr, IntFactor);
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)
Optional< PseudoProbe > extractProbeFromDiscriminator(const Instruction &Inst)
Optional< PseudoProbe > extractProbe(const Instruction &Inst)
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.