diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/llvm-project/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp b/contrib/llvm-project/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp index 0a6f69bc73d5..e10b3c56ae14 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp @@ -45,6 +45,7 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Utils/Cloning.h" #include <sstream> +#include <unordered_map> #include <vector> using namespace llvm; using namespace llvm::memprof; @@ -577,7 +578,7 @@ class ModuleCallsiteContextGraph public: ModuleCallsiteContextGraph( Module &M, - function_ref<OptimizationRemarkEmitter &(Function *)> OREGetter); + llvm::function_ref<OptimizationRemarkEmitter &(Function *)> OREGetter); private: friend CallsiteContextGraph<ModuleCallsiteContextGraph, Function, @@ -605,7 +606,7 @@ private: unsigned CloneNo) const; const Module &Mod; - function_ref<OptimizationRemarkEmitter &(Function *)> OREGetter; + llvm::function_ref<OptimizationRemarkEmitter &(Function *)> OREGetter; }; /// Represents a call in the summary index graph, which can either be an @@ -640,7 +641,7 @@ class IndexCallsiteContextGraph public: IndexCallsiteContextGraph( ModuleSummaryIndex &Index, - function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)> + llvm::function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)> isPrevailing); ~IndexCallsiteContextGraph() { @@ -686,7 +687,7 @@ private: std::map<const FunctionSummary *, ValueInfo> FSToVIMap; const ModuleSummaryIndex &Index; - function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)> + llvm::function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)> isPrevailing; // Saves/owns the callsite info structures synthesized for missing tail call @@ -1523,7 +1524,8 @@ CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::getStackIdsWithContextNodes( } ModuleCallsiteContextGraph::ModuleCallsiteContextGraph( - Module &M, function_ref<OptimizationRemarkEmitter &(Function *)> OREGetter) + Module &M, + llvm::function_ref<OptimizationRemarkEmitter &(Function *)> OREGetter) : Mod(M), OREGetter(OREGetter) { for (auto &F : M) { std::vector<CallInfo> CallsWithMetadata; @@ -1582,7 +1584,7 @@ ModuleCallsiteContextGraph::ModuleCallsiteContextGraph( IndexCallsiteContextGraph::IndexCallsiteContextGraph( ModuleSummaryIndex &Index, - function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)> + llvm::function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)> isPrevailing) : Index(Index), isPrevailing(isPrevailing) { for (auto &I : Index) { @@ -3622,7 +3624,7 @@ bool CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::process() { bool MemProfContextDisambiguation::processModule( Module &M, - function_ref<OptimizationRemarkEmitter &(Function *)> OREGetter) { + llvm::function_ref<OptimizationRemarkEmitter &(Function *)> OREGetter) { // If we have an import summary, then the cloning decisions were made during // the thin link on the index. Apply them and return. @@ -3689,7 +3691,7 @@ PreservedAnalyses MemProfContextDisambiguation::run(Module &M, void MemProfContextDisambiguation::run( ModuleSummaryIndex &Index, - function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)> + llvm::function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)> isPrevailing) { // TODO: If/when other types of memprof cloning are enabled beyond just for // hot and cold, we will need to change this to individually control the |