Skip to content

[MemProf][NFC] Explicitly specify llvm version of function_ref #77783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ class ModuleCallsiteContextGraph
public:
ModuleCallsiteContextGraph(
Module &M,
function_ref<OptimizationRemarkEmitter &(Function *)> OREGetter);
llvm::function_ref<OptimizationRemarkEmitter &(Function *)> OREGetter);

private:
friend CallsiteContextGraph<ModuleCallsiteContextGraph, Function,
Expand Down Expand Up @@ -605,7 +605,7 @@ class ModuleCallsiteContextGraph
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
Expand Down Expand Up @@ -640,7 +640,7 @@ class IndexCallsiteContextGraph
public:
IndexCallsiteContextGraph(
ModuleSummaryIndex &Index,
function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
llvm::function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
isPrevailing);

~IndexCallsiteContextGraph() {
Expand Down Expand Up @@ -686,7 +686,7 @@ class IndexCallsiteContextGraph
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
Expand Down Expand Up @@ -1523,7 +1523,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;
Expand Down Expand Up @@ -1582,7 +1583,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) {
Expand Down Expand Up @@ -3622,7 +3623,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.
Expand Down Expand Up @@ -3689,7 +3690,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
Expand Down