enum class PseudoProbeType { Block = 0, IndirectCall, DirectCall };
-enum class PseudoProbeAttributes {
- Reserved = 0x1, // Reserved for future use.
-};
-
// The saturated distrution factor representing 100% for block probes.
constexpr static uint64_t PseudoProbeFullDistributionFactor =
std::numeric_limits<uint64_t>::max();
}
}
-void addPseudoProbeAttribute(PseudoProbeInst &Inst,
- PseudoProbeAttributes Attr) {
- IRBuilder<> Builder(&Inst);
- uint32_t OldAttr = Inst.getAttributes()->getZExtValue();
- uint32_t NewAttr = OldAttr | (uint32_t)Attr;
- if (OldAttr != NewAttr)
- Inst.replaceUsesOfWith(Inst.getAttributes(), Builder.getInt32(NewAttr));
-}
} // namespace llvm