[llvm] r290222 - IPO: Remove the ModuleSummary argument to the FunctionImport pass. NFCI.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 20 16:50:13 PST 2016
Author: pcc
Date: Tue Dec 20 18:50:12 2016
New Revision: 290222
URL: http://llvm.org/viewvc/llvm-project?rev=290222&view=rev
Log:
IPO: Remove the ModuleSummary argument to the FunctionImport pass. NFCI.
No existing client is passing a non-null value here. This will come back
in a slightly different form as part of the type identifier summary work.
Differential Revision: https://reviews.llvm.org/D28006
Modified:
llvm/trunk/include/llvm/Transforms/IPO.h
llvm/trunk/include/llvm/Transforms/IPO/FunctionImport.h
llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h
llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp
llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
Modified: llvm/trunk/include/llvm/Transforms/IPO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO.h?rev=290222&r1=290221&r2=290222&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO.h Tue Dec 20 18:50:12 2016
@@ -95,7 +95,7 @@ ModulePass *createGVExtractionPass(std::
//===----------------------------------------------------------------------===//
/// This pass performs iterative function importing from other modules.
-Pass *createFunctionImportPass(const ModuleSummaryIndex *Index = nullptr);
+Pass *createFunctionImportPass();
//===----------------------------------------------------------------------===//
/// createFunctionInliningPass - Return a new pass object that uses a heuristic
Modified: llvm/trunk/include/llvm/Transforms/IPO/FunctionImport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/FunctionImport.h?rev=290222&r1=290221&r2=290222&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/FunctionImport.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO/FunctionImport.h Tue Dec 20 18:50:12 2016
@@ -71,12 +71,7 @@ private:
/// The function importing pass
class FunctionImportPass : public PassInfoMixin<FunctionImportPass> {
public:
- FunctionImportPass(const ModuleSummaryIndex *Index = nullptr)
- : Index(Index) {}
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
-
-private:
- const ModuleSummaryIndex *Index;
};
/// Compute all the imports and exports for every module in the Index.
Modified: llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h?rev=290222&r1=290221&r2=290222&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO/PassManagerBuilder.h Tue Dec 20 18:50:12 2016
@@ -124,9 +124,6 @@ public:
/// added to the per-module passes.
Pass *Inliner;
- /// The module summary index to use for function importing.
- const ModuleSummaryIndex *ModuleSummary;
-
bool DisableTailCalls;
bool DisableUnitAtATime;
bool DisableUnrollLoops;
Modified: llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp?rev=290222&r1=290221&r2=290222&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp Tue Dec 20 18:50:12 2016
@@ -731,24 +731,17 @@ static cl::opt<std::string>
SummaryFile("summary-file",
cl::desc("The summary file to use for function importing."));
-static bool doImportingForModule(Module &M, const ModuleSummaryIndex *Index) {
- if (SummaryFile.empty() && !Index)
- report_fatal_error("error: -function-import requires -summary-file or "
- "file from frontend\n");
- std::unique_ptr<ModuleSummaryIndex> IndexPtr;
- if (!SummaryFile.empty()) {
- if (Index)
- report_fatal_error("error: -summary-file and index from frontend\n");
- Expected<std::unique_ptr<ModuleSummaryIndex>> IndexPtrOrErr =
- getModuleSummaryIndexForFile(SummaryFile);
- if (!IndexPtrOrErr) {
- logAllUnhandledErrors(IndexPtrOrErr.takeError(), errs(),
- "Error loading file '" + SummaryFile + "': ");
- return false;
- }
- IndexPtr = std::move(*IndexPtrOrErr);
- Index = IndexPtr.get();
+static bool doImportingForModule(Module &M) {
+ if (SummaryFile.empty())
+ report_fatal_error("error: -function-import requires -summary-file\n");
+ Expected<std::unique_ptr<ModuleSummaryIndex>> IndexPtrOrErr =
+ getModuleSummaryIndexForFile(SummaryFile);
+ if (!IndexPtrOrErr) {
+ logAllUnhandledErrors(IndexPtrOrErr.takeError(), errs(),
+ "Error loading file '" + SummaryFile + "': ");
+ return false;
}
+ std::unique_ptr<ModuleSummaryIndex> Index = std::move(*IndexPtrOrErr);
// First step is collecting the import list.
FunctionImporter::ImportMapTy ImportList;
@@ -794,10 +787,6 @@ static bool doImportingForModule(Module
namespace {
/// Pass that performs cross-module function import provided a summary file.
class FunctionImportLegacyPass : public ModulePass {
- /// Optional module summary index to use for importing, otherwise
- /// the summary-file option must be specified.
- const ModuleSummaryIndex *Index;
-
public:
/// Pass identification, replacement for typeid
static char ID;
@@ -805,21 +794,20 @@ public:
/// Specify pass name for debug output
StringRef getPassName() const override { return "Function Importing"; }
- explicit FunctionImportLegacyPass(const ModuleSummaryIndex *Index = nullptr)
- : ModulePass(ID), Index(Index) {}
+ explicit FunctionImportLegacyPass() : ModulePass(ID) {}
bool runOnModule(Module &M) override {
if (skipModule(M))
return false;
- return doImportingForModule(M, Index);
+ return doImportingForModule(M);
}
};
} // anonymous namespace
PreservedAnalyses FunctionImportPass::run(Module &M,
ModuleAnalysisManager &AM) {
- if (!doImportingForModule(M, Index))
+ if (!doImportingForModule(M))
return PreservedAnalyses::all();
return PreservedAnalyses::none();
@@ -830,7 +818,7 @@ INITIALIZE_PASS(FunctionImportLegacyPass
"Summary Based Function Import", false, false)
namespace llvm {
-Pass *createFunctionImportPass(const ModuleSummaryIndex *Index = nullptr) {
- return new FunctionImportLegacyPass(Index);
+Pass *createFunctionImportPass() {
+ return new FunctionImportLegacyPass();
}
}
Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=290222&r1=290221&r2=290222&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Tue Dec 20 18:50:12 2016
@@ -155,7 +155,6 @@ PassManagerBuilder::PassManagerBuilder()
SizeLevel = 0;
LibraryInfo = nullptr;
Inliner = nullptr;
- ModuleSummary = nullptr;
DisableUnitAtATime = false;
DisableUnrollLoops = false;
BBVectorize = RunBBVectorization;
@@ -670,9 +669,6 @@ void PassManagerBuilder::addLTOOptimizat
// Provide AliasAnalysis services for optimizations.
addInitialAliasAnalysisPasses(PM);
- if (ModuleSummary)
- PM.add(createFunctionImportPass(ModuleSummary));
-
// Allow forcing function attributes as a debugging and tuning aid.
PM.add(createForceFunctionAttrsLegacyPass());
@@ -832,9 +828,6 @@ void PassManagerBuilder::populateThinLTO
if (VerifyInput)
PM.add(createVerifierPass());
- if (ModuleSummary)
- PM.add(createFunctionImportPass(ModuleSummary));
-
populateModulePassManager(PM);
if (VerifyOutput)
More information about the llvm-commits
mailing list