[llvm-branch-commits] [llvm] [ctxprof][nfc] Make `computeImportForFunction` a member of `ModuleImportsManager` (PR #134011)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Apr 2 08:44:02 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lto
Author: Mircea Trofin (mtrofin)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/134011.diff
1 Files Affected:
- (modified) llvm/lib/Transforms/IPO/FunctionImport.cpp (+14-12)
``````````diff
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index faa052bb4d5b6..ae3b45a11996e 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -497,6 +497,13 @@ static const char *getFailureName(FunctionImporter::ImportFailureReason Reason);
/// Determine the list of imports and exports for each module.
class ModuleImportsManager {
+ void computeImportForFunction(
+ const FunctionSummary &Summary, unsigned Threshold,
+ const GVSummaryMapTy &DefinedGVSummaries,
+ SmallVectorImpl<EdgeInfo> &Worklist, GlobalsImporter &GVImporter,
+ FunctionImporter::ImportMapTy &ImportList,
+ FunctionImporter::ImportThresholdsTy &ImportThresholds);
+
protected:
function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
IsPrevailing;
@@ -851,14 +858,11 @@ getFailureName(FunctionImporter::ImportFailureReason Reason) {
/// Compute the list of functions to import for a given caller. Mark these
/// imported functions and the symbols they reference in their source module as
/// exported from their source module.
-static void computeImportForFunction(
- const FunctionSummary &Summary, const ModuleSummaryIndex &Index,
- const unsigned Threshold, const GVSummaryMapTy &DefinedGVSummaries,
- function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
- isPrevailing,
+void ModuleImportsManager::computeImportForFunction(
+ const FunctionSummary &Summary, const unsigned Threshold,
+ const GVSummaryMapTy &DefinedGVSummaries,
SmallVectorImpl<EdgeInfo> &Worklist, GlobalsImporter &GVImporter,
FunctionImporter::ImportMapTy &ImportList,
- DenseMap<StringRef, FunctionImporter::ExportSetTy> *ExportLists,
FunctionImporter::ImportThresholdsTy &ImportThresholds) {
GVImporter.onImportingSummary(Summary);
static int ImportCount = 0;
@@ -1063,9 +1067,8 @@ void ModuleImportsManager::computeImportForModule(
// Skip import for global variables
continue;
LLVM_DEBUG(dbgs() << "Initialize import for " << VI << "\n");
- computeImportForFunction(*FuncSummary, Index, ImportInstrLimit,
- DefinedGVSummaries, IsPrevailing, Worklist, GVI,
- ImportList, ExportLists, ImportThresholds);
+ computeImportForFunction(*FuncSummary, ImportInstrLimit, DefinedGVSummaries,
+ Worklist, GVI, ImportList, ImportThresholds);
}
// Process the newly imported functions and add callees to the worklist.
@@ -1075,9 +1078,8 @@ void ModuleImportsManager::computeImportForModule(
auto Threshold = std::get<1>(GVInfo);
if (auto *FS = dyn_cast<FunctionSummary>(Summary))
- computeImportForFunction(*FS, Index, Threshold, DefinedGVSummaries,
- IsPrevailing, Worklist, GVI, ImportList,
- ExportLists, ImportThresholds);
+ computeImportForFunction(*FS, Threshold, DefinedGVSummaries, Worklist,
+ GVI, ImportList, ImportThresholds);
}
// Print stats about functions considered but rejected for importing
``````````
</details>
https://github.com/llvm/llvm-project/pull/134011
More information about the llvm-branch-commits
mailing list