-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[ctxprof][nfc] Make computeImportForFunction
a member of ModuleImportsManager
#134011
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
mtrofin
merged 1 commit into
main
from
users/mtrofin/04-01-_ctxprof_nfc_make_computeimportforfunction_a_member_of_moduleimportsmanager_
Apr 3, 2025
Merged
[ctxprof][nfc] Make computeImportForFunction
a member of ModuleImportsManager
#134011
mtrofin
merged 1 commit into
main
from
users/mtrofin/04-01-_ctxprof_nfc_make_computeimportforfunction_a_member_of_moduleimportsmanager_
Apr 3, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Apr 2, 2025
@llvm/pr-subscribers-llvm-transforms @llvm/pr-subscribers-lto Author: Mircea Trofin (mtrofin) ChangesFull diff: https://github.com/llvm/llvm-project/pull/134011.diff 1 Files Affected:
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
|
68b499f
to
1081208
Compare
96bf973
to
1f5b366
Compare
kazutakahirata
approved these changes
Apr 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
1f5b366
to
1b0c0a4
Compare
Base automatically changed from
users/mtrofin/04-01-_ctxprof_option_to_move_a_whole_tree_to_its_own_module
to
main
April 3, 2025 01:15
1081208
to
7a534bf
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.