summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h4
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp6
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp9
-rw-r--r--llvm/test/Other/link-opts.ll13
-rw-r--r--llvm/tools/bugpoint/bugpoint.cpp3
-rw-r--r--llvm/tools/opt/opt.cpp7
6 files changed, 7 insertions, 35 deletions
diff --git a/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h b/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h
index 50877d01370..71b2426a52b 100644
--- a/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h
+++ b/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h
@@ -144,8 +144,8 @@ public:
/// populateModulePassManager - This sets up the primary pass manager.
void populateModulePassManager(PassManagerBase &MPM);
- void populateLTOPassManager(PassManagerBase &PM, bool Internalize,
- bool RunInliner, bool DisableGVNLoadPRE = false);
+ void populateLTOPassManager(PassManagerBase &PM, bool RunInliner,
+ bool DisableGVNLoadPRE);
};
/// Registers a function for adding a standard set of passes. This should be
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index fe179cf1ac6..a51b1c9df8b 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -475,10 +475,8 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,
// keeps only main if it exists and does nothing for libraries. Instead
// we create the pass ourselves with the symbol list provided by the linker.
if (!DisableOpt)
- PassManagerBuilder().populateLTOPassManager(passes,
- /*Internalize=*/false,
- !DisableInline,
- DisableGVNLoadPRE);
+ PassManagerBuilder().populateLTOPassManager(passes, !DisableInline,
+ DisableGVNLoadPRE);
// Make sure everything is still good.
passes.add(createVerifierPass());
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 98477b5d71f..3d846b01d3a 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -284,18 +284,11 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
}
void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,
- bool Internalize,
bool RunInliner,
bool DisableGVNLoadPRE) {
// Provide AliasAnalysis services for optimizations.
addInitialAliasAnalysisPasses(PM);
- // Now that composite has been compiled, scan through the module, looking
- // for a main function. If main is defined, mark all other functions
- // internal.
- if (Internalize)
- PM.add(createInternalizePass("main"));
-
// Propagate constants at call sites into the functions they call. This
// opens opportunities for globalopt (and inlining) by substituting function
// pointers passed as arguments to direct uses of functions.
@@ -461,5 +454,5 @@ void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB,
LLVMBool RunInliner) {
PassManagerBuilder *Builder = unwrap(PMB);
PassManagerBase *LPM = unwrap(PM);
- Builder->populateLTOPassManager(*LPM, Internalize != 0, RunInliner != 0);
+ Builder->populateLTOPassManager(*LPM, RunInliner != 0, false);
}
diff --git a/llvm/test/Other/link-opts.ll b/llvm/test/Other/link-opts.ll
deleted file mode 100644
index 8e58ac8a568..00000000000
--- a/llvm/test/Other/link-opts.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-;RUN: opt -S -std-link-opts < %s | FileCheck %s
-; Simple test to check that -std-link-opts keeps only the main function.
-
-; CHECK-NOT: define
-; CHECK: define void @main
-; CHECK-NOT: define
-define void @main() {
- ret void
-}
-
-define void @foo() {
- ret void
-}
diff --git a/llvm/tools/bugpoint/bugpoint.cpp b/llvm/tools/bugpoint/bugpoint.cpp
index c7dae0f45b6..cbecc359970 100644
--- a/llvm/tools/bugpoint/bugpoint.cpp
+++ b/llvm/tools/bugpoint/bugpoint.cpp
@@ -179,8 +179,7 @@ int main(int argc, char **argv) {
if (StandardLinkOpts) {
PassManagerBuilder Builder;
- Builder.populateLTOPassManager(PM, /*Internalize=*/true,
- /*RunInliner=*/true);
+ Builder.populateLTOPassManager(PM, /*RunInliner=*/true, false);
}
if (OptLevelO1 || OptLevelO2 || OptLevelO3) {
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 6ba6340040b..1ff795d67d2 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -109,10 +109,6 @@ DisableOptimizations("disable-opt",
cl::desc("Do not run any optimization passes"));
static cl::opt<bool>
-DisableInternalize("disable-internalize",
- cl::desc("Do not mark all symbols as internal"));
-
-static cl::opt<bool>
StandardCompileOpts("std-compile-opts",
cl::desc("Include the standard compile time optimizations"));
@@ -271,8 +267,7 @@ static void AddStandardLinkPasses(PassManagerBase &PM) {
if (DisableOptimizations) return;
PassManagerBuilder Builder;
- Builder.populateLTOPassManager(PM, /*Internalize=*/ !DisableInternalize,
- /*RunInliner=*/ !DisableInline);
+ Builder.populateLTOPassManager(PM, /*RunInliner=*/!DisableInline, false);
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud