1//===- ModuleSummaryAnalysis.h - Module summary index builder ---*- C++ -*-===// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7//===----------------------------------------------------------------------===// 9/// This is the interface to build a ModuleSummaryIndex for a module. 11//===----------------------------------------------------------------------===// 13#ifndef LLVM_ANALYSIS_MODULESUMMARYANALYSIS_H 14#define LLVM_ANALYSIS_MODULESUMMARYANALYSIS_H 24classBlockFrequencyInfo;
27classProfileSummaryInfo;
30/// Direct function to compute a \c ModuleSummaryIndex from a given module. 32/// If operating within a pass manager which has defined ways to compute the \c 33/// BlockFrequencyInfo for a given function, that can be provided via 34/// a std::function callback. Otherwise, this routine will manually construct 38 std::function<BlockFrequencyInfo *(
const Function &
F)> GetBFICallback,
39 ProfileSummaryInfo *PSI,
40 std::function<
const StackSafetyInfo *(
const Function &
F)> GetSSICallback =
41 [](
const Function &
F) ->
const StackSafetyInfo * {
returnnullptr; });
43/// Analysis pass to provide the ModuleSummaryIndex object. 56/// Legacy wrapper pass to provide the ModuleSummaryIndex object. 58 std::optional<ModuleSummaryIndex> Index;
65 /// Get the index built by pass 74//===--------------------------------------------------------------------===// 76// createModuleSummaryIndexWrapperPass - This pass builds a ModuleSummaryIndex 77// object for the module, to be written to bitcode or LLVM assembly. 81/// Legacy wrapper pass to provide the ModuleSummaryIndex object. 94//===--------------------------------------------------------------------===// 96// ImmutableModuleSummaryIndexWrapperPass - This pass wrap provided 97// ModuleSummaryIndex object for the module, to be used by other passes. 102/// Returns true if the instruction could have memprof metadata, used to ensure 103/// consistency between summary analysis and the ThinLTO backend processing. 106}
// end namespace llvm 108#endif// LLVM_ANALYSIS_MODULESUMMARYANALYSIS_H This header defines various interfaces for pass management in LLVM.
Machine Check Debug Module
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
A container for analyses that lazily runs them and caches their results.
Represent the analysis usage information of a pass.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Legacy wrapper pass to provide the ModuleSummaryIndex object.
const ModuleSummaryIndex * getIndex() const
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
ImmutablePass class - This class is used to provide information that does not need to be run.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Analysis pass to provide the ModuleSummaryIndex object.
Result run(Module &M, ModuleAnalysisManager &AM)
Legacy wrapper pass to provide the ModuleSummaryIndex object.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
bool doFinalization(Module &M) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
ModuleSummaryIndexWrapperPass()
bool runOnModule(Module &M) override
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
ModuleSummaryIndex & getIndex()
Get the index built by pass.
const ModuleSummaryIndex & getIndex() const
Class to hold module path string table and global value map, and encapsulate methods for operating on...
A Module instance is used to store all the information related to an LLVM module.
This is an optimization pass for GlobalISel generic memory operations.
ModuleSummaryIndex buildModuleSummaryIndex(const Module &M, std::function< BlockFrequencyInfo *(const Function &F)> GetBFICallback, ProfileSummaryInfo *PSI, std::function< const StackSafetyInfo *(const Function &F)> GetSSICallback=[](const Function &F) -> const StackSafetyInfo *{ return nullptr;})
Direct function to compute a ModuleSummaryIndex from a given module.
ModulePass * createModuleSummaryIndexWrapperPass()
ImmutablePass * createImmutableModuleSummaryIndexWrapperPass(const ModuleSummaryIndex *Index)
bool mayHaveMemprofSummary(const CallBase *CB)
Returns true if the instruction could have memprof metadata, used to ensure consistency between summa...
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...