33 std::vector<Metadata *> Nodes;
35 for (
auto E : Counts) {
57 CalledF->hasDLLImportStorageClass())
59 uint64_t &Count = Counts[std::make_pair(
F, CalledF)];
63 (void)(
bool)Symtab.
create(M, InLTO);
67 if (
F.isDeclaration() || !
F.getEntryCount())
74 std::optional<uint64_t> BBCount = BFI.getBlockProfileCount(&BB);
85 for (
const auto &VD : ValueData)
static bool addModuleFlags(Module &M, MapVector< std::pair< Function *, Function * >, uint64_t > &Counts)
static bool runCGProfilePass(Module &M, FunctionAnalysisManager &FAM, bool InLTO)
This file provides the interface for LLVM's Call Graph Profile pass.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
This file implements a map that provides insertion order iteration.
Module.h This file contains the declarations for the Module class.
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Analysis pass which computes BlockFrequencyInfo.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
bool isIndirectCall() const
Return true if the callsite is an indirect call.
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...
A symbol table used for function [IR]PGO name look-up with keys (such as pointers,...
Function * getFunction(uint64_t FuncMD5Hash)
Return function from the name's md5 hash. Return nullptr if not found.
Error create(object::SectionRef &Section)
Create InstrProfSymtab from an object file section which contains function PGO names.
This is an important class for using LLVM in a threaded context.
ConstantAsMetadata * createConstant(Constant *C)
Return the given constant as metadata.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Return a distinct node.
This class implements a map that also provides access to all stored values in a deterministic order.
A Module instance is used to store all the information related to an LLVM module.
@ Append
Appends the two values, which are required to be metadata nodes.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Analysis pass providing the TargetTransformInfo.
static IntegerType * getInt64Ty(LLVMContext &C)
This is an optimization pass for GlobalISel generic memory operations.
SmallVector< InstrProfValueData, 4 > getValueProfDataFromInst(const Instruction &Inst, InstrProfValueKind ValueKind, uint32_t MaxNumValueData, uint64_t &TotalC, bool GetNoICPValue=false)
Extract the value profile data from Inst and returns them if Inst is annotated with value profile dat...
std::enable_if_t< std::is_unsigned_v< T >, T > SaturatingAdd(T X, T Y, bool *ResultOverflowed=nullptr)
Add two unsigned integers, X and Y, of type T.