LLVM 22.0.0git
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
llvm::AssignGUIDPass Class Reference

Assign a GUID to functions as metadata. More...

#include "llvm/Analysis/CtxProfAnalysis.h"

Inheritance diagram for llvm::AssignGUIDPass:
[フレーム]
[legend]

Public Member Functions

  AssignGUIDPass ()=default
  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 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 LLVM_ABI const charGUIDMetadataName = "guid"

Detailed Description

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 200 of file CtxProfAnalysis.h.

Constructor & Destructor Documentation

◆  AssignGUIDPass()

llvm::AssignGUIDPass::AssignGUIDPass ( )
explicitdefault

References LLVM_ABI, and MAM.

Member Function Documentation

◆  getGUID()

GlobalValue::GUID AssignGUIDPass::getGUID ( const Function & F )
static

Definition at line 438 of file CtxProfAnalysis.cpp.

References assert(), llvm::cast(), F, GUIDMetadataName, and llvm::GlobalValue::isExternalLinkage().

Referenced by llvm::InlineFunction(), llvm::promoteCallWithIfThenElse(), llvm::CtxProfAnalysis::run(), llvm::JumpTableToSwitchPass::run(), and llvm::PGOCtxProfFlatteningPass::run().

◆  run()

PreservedAnalyses AssignGUIDPass::run ( Module & M,

Assign a GUID if one is not already assign, as a function metadata named GUIDMetadataName.

Definition at line 423 of file CtxProfAnalysis.cpp.

References F, llvm::MDNode::get(), GUIDMetadataName, MAM, and llvm::PreservedAnalyses::none().

Member Data Documentation

◆  GUIDMetadataName

const char * llvm::AssignGUIDPass::GUIDMetadataName = "guid"
static

Definition at line 207 of file CtxProfAnalysis.h.

Referenced by getGUID(), run(), and llvm::JumpTableToSwitchPass::run().


The documentation for this class was generated from the following files:

Generated on for LLVM by doxygen 1.14.0

AltStyle によって変換されたページ (->オリジナル) /