34 "pseudo-probe-verify-guid-existence-in-desc",
35 cl::desc(
"Verify whether GUID exists in the .pseudo_probe_desc."),
49 auto Name = InlinedAt->getSubprogramLinkageName();
54 uint64_t &CallerGuid = NameGuidMap[Name];
59 verifyGuidExistenceInDesc(CallerGuid, Name);
62 InlinedAt->getDiscriminator());
63 ReversedInlineStack.
emplace_back(CallerGuid, CallerProbeId);
64 InlinedAt = InlinedAt->getInlinedAt();
71 Discriminator =
DebugLoc->getDiscriminator();
73 "Discriminator should not be set in non-FSAFDO mode");
75 Asm->OutStreamer->emitPseudoProbe(
Guid, Index,
Type, Attr, Discriminator,
76 InlineStack, Asm->CurrentFnSym);
79 verifyGuidExistenceInDesc(
85void PseudoProbeHandler::verifyGuidExistenceInDesc(
uint64_t Guid,
92 for (
size_t I = DescGuidSet.
size(), E =
Desc->getNumOperands();
I != E; ++
I) {
95 DescGuidSet.
insert(
ID->getZExtValue());
100 <<
" does not exist in pseudo probe desc\n";
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Module.h This file contains the declarations for the Module class.
static cl::opt< bool > VerifyGuidExistence("pseudo-probe-verify-guid-existence-in-desc", cl::desc("Verify whether GUID exists in the .pseudo_probe_desc."), cl::Hidden, cl::init(false))
MachineFunction * MF
The current machine function.
static LLVM_ABI GUID getGUIDAssumingExternalLinkage(StringRef GlobalName)
Return a 64-bit global unique ID constructed from the name of a global symbol.
Module * getParent()
Get the module that this global value is contained inside of...
Function & getFunction()
Return the LLVM function that this machine code represents.
NamedMDNode * getNamedMetadata(StringRef Name) const
Return the first NamedMDNode in the module with the specified name.
void emitPseudoProbe(uint64_t Guid, uint64_t Index, uint64_t Type, uint64_t Attr, const DILocation *DebugLoc)
reference emplace_back(ArgTypes &&... Args)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
static LLVM_ABI raw_ostream & warning()
Convenience method for printing "warning: " to stderr.
std::pair< iterator, bool > insert(const ValueT &V)
bool contains(const_arg_type_t< ValueT > V) const
Check if the set contains the given element.
static StringRef getCanonicalCoroFnName(StringRef FnName, StringRef Attr="selected")
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
initializer< Ty > init(const Ty &Val)
std::enable_if_t< detail::IsValidPointer< X, Y >::value, X * > extract(Y &&MD)
Extract a Value from Metadata.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI cl::opt< bool > EnableFSDiscriminator
auto reverse(ContainerTy &&C)
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
constexpr const char * PseudoProbeDescMetadataName
static uint32_t extractProbeIndex(uint32_t Value)