LLVM 20.0.0git
|
Assign a GUID to functions as metadata. More...
#include "llvm/Analysis/CtxProfAnalysis.h"
Public Member Functions | |
AssignGUIDPass ()=default | |
PreservedAnalyses | run (Module &M, ModuleAnalysisManager &MAM) |
Assign a GUID if one is not already assign, as a function metadata named GUIDMetadataName . | |
Public Member Functions inherited from llvm::PassInfoMixin< AssignGUIDPass > | |
void | printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) |
Static Public Member Functions | |
static uint64_t | getGUID (const Function &F) |
Static Public Member Functions inherited from llvm::PassInfoMixin< AssignGUIDPass > | |
static StringRef | name () |
Gets the name of the pass we are mixed into. | |
Static Public Attributes | |
static const char * | GUIDMetadataName = "guid" |
Assign a GUID to functions as metadata.
GUID calculation takes linkage into account, which may change especially through and after thinlto. By pre-computing and assigning as metadata, this mechanism is resilient to such changes (as well as name changes e.g. suffix ".llvm." additions).
Definition at line 111 of file CtxProfAnalysis.h.
|
explicitdefault |
|
static |
Definition at line 85 of file CtxProfAnalysis.cpp.
References assert(), F, llvm::GlobalValue::getGUID(), GUIDMetadataName, and llvm::GlobalValue::isExternalLinkage().
Referenced by llvm::CtxProfAnalysis::run().
PreservedAnalyses AssignGUIDPass::run | ( | Module & | M, |
ModuleAnalysisManager & | MAM | ||
) |
Assign a GUID if one is not already assign, as a function metadata named GUIDMetadataName
.
Definition at line 70 of file CtxProfAnalysis.cpp.
References F, llvm::MDNode::get(), GUIDMetadataName, and llvm::PreservedAnalyses::none().
Definition at line 118 of file CtxProfAnalysis.h.