24std::optional<PseudoProbe>
27 auto Discriminator = DIL->getDiscriminator();
46std::optional<PseudoProbe>
49 "Only call instructions should have pseudo probe encodes as their "
50 "Dwarf discriminators");
59 Probe.
Id =
II->getIndex()->getZExtValue();
61 Probe.
Attr =
II->getAttributes()->getZExtValue();
62 Probe.
Factor =
II->getFactor()->getZExtValue() /
77 assert(Factor >= 0 && Factor <= 1 &&
78 "Distribution factor must be in [0, 1.0]");
84 auto OrigFactor =
II->getFactor()->getZExtValue();
85 if (IntFactor != OrigFactor)
86 II->replaceUsesOfWith(
II->getFactor(), Builder.getInt64(IntFactor));
90 auto Discriminator = DIL->getDiscriminator();
98 auto DwarfBaseDiscriminator =
107 Index,
Type, Attr, IntFactor, DwarfBaseDiscriminator);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
uint64_t IntrinsicInst * II
static bool isPseudoProbeDiscriminator(unsigned Discriminator)
const DILocation * cloneWithDiscriminator(unsigned Discriminator) const
Returns a new DILocation with updated Discriminator.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.
void setDebugLoc(DebugLoc Loc)
Set the debug location information for this instruction.
The instances of the Type class are immutable: once they are created, they are never changed.
This is an optimization pass for GlobalISel generic memory operations.
static constexpr uint64_t PseudoProbeFullDistributionFactor
std::optional< PseudoProbe > extractProbeFromDiscriminator(const DILocation *DIL)
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI void setProbeDistributionFactor(Instruction &Inst, float Factor)
LLVM_ABI std::optional< PseudoProbe > extractProbe(const Instruction &Inst)
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
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 uint32_t extractProbeAttributes(uint32_t Value)
static std::optional< uint32_t > extractDwarfBaseDiscriminator(uint32_t Value)
static uint32_t extractProbeType(uint32_t Value)