diff --git a/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h b/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h --- a/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h +++ b/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h @@ -146,7 +146,6 @@ /// not try to remove the object file in LTOCodeGenerator's destructor as we /// don't who (LTOCodeGenerator or the output file) will last longer. bool compile_to_file(const char **Name, bool DisableVerify, - bool DisableInline, bool DisableGVNLoadPRE, bool DisableVectorization); /// As with compile_to_file(), this function compiles the merged module into @@ -155,15 +154,13 @@ /// to the caller. This function should delete the intermediate file once /// its content is brought to memory. Return NULL if the compilation was not /// successful. - std::unique_ptr compile(bool DisableVerify, bool DisableInline, - bool DisableGVNLoadPRE, + std::unique_ptr compile(bool DisableVerify, bool DisableVectorization); /// Optimizes the merged module. Returns true on success. /// /// Calls \a verifyMergedModuleOnce(). - bool optimize(bool DisableVerify, bool DisableInline, bool DisableGVNLoadPRE, - bool DisableVectorization); + bool optimize(bool DisableVerify, bool DisableVectorization); /// Compiles the merged optimized module into a single output file. It brings /// the output to a buffer, and returns the buffer to the caller. Return NULL diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp --- a/llvm/lib/LTO/LTOCodeGenerator.cpp +++ b/llvm/lib/LTO/LTOCodeGenerator.cpp @@ -327,21 +327,16 @@ } bool LTOCodeGenerator::compile_to_file(const char **Name, bool DisableVerify, - bool DisableInline, - bool DisableGVNLoadPRE, bool DisableVectorization) { - if (!optimize(DisableVerify, DisableInline, DisableGVNLoadPRE, - DisableVectorization)) + if (!optimize(DisableVerify, DisableVectorization)) return false; return compileOptimizedToFile(Name); } std::unique_ptr -LTOCodeGenerator::compile(bool DisableVerify, bool DisableInline, - bool DisableGVNLoadPRE, bool DisableVectorization) { - if (!optimize(DisableVerify, DisableInline, DisableGVNLoadPRE, - DisableVectorization)) +LTOCodeGenerator::compile(bool DisableVerify, bool DisableVectorization) { + if (!optimize(DisableVerify, DisableVectorization)) return nullptr; return compileOptimized(); @@ -534,9 +529,7 @@ } /// Optimize merged modules using various IPO passes -bool LTOCodeGenerator::optimize(bool DisableVerify, bool DisableInline, - bool DisableGVNLoadPRE, - bool DisableVectorization) { +bool LTOCodeGenerator::optimize(bool DisableVerify, bool DisableVectorization) { if (!this->determineTarget()) return false; @@ -585,11 +578,9 @@ Triple TargetTriple(TargetMach->getTargetTriple()); PassManagerBuilder PMB; - PMB.DisableGVNLoadPRE = DisableGVNLoadPRE; PMB.LoopVectorize = !DisableVectorization; PMB.SLPVectorize = !DisableVectorization; - if (!DisableInline) - PMB.Inliner = createFunctionInliningPass(); + PMB.Inliner = createFunctionInliningPass(); PMB.LibraryInfo = new TargetLibraryInfoImpl(TargetTriple); if (Freestanding) PMB.LibraryInfo->disableAllFunctions(); diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp --- a/llvm/tools/llvm-lto/llvm-lto.cpp +++ b/llvm/tools/llvm-lto/llvm-lto.cpp @@ -78,13 +78,6 @@ "disable-verify", cl::init(false), cl::desc("Do not run the verifier during the optimization pipeline")); -static cl::opt DisableInline("disable-inlining", cl::init(false), - cl::desc("Do not run the inliner pass")); - -static cl::opt - DisableGVNLoadPRE("disable-gvn-loadpre", cl::init(false), - cl::desc("Do not run the GVN load PRE pass")); - static cl::opt DisableLTOVectorization( "disable-lto-vectorization", cl::init(false), cl::desc("Do not run loop or slp vectorization during LTO")); @@ -1042,8 +1035,7 @@ error("writing linked module failed."); } - if (!CodeGen.optimize(DisableVerify, DisableInline, DisableGVNLoadPRE, - DisableLTOVectorization)) { + if (!CodeGen.optimize(DisableVerify, DisableLTOVectorization)) { // Diagnostic messages should have been printed by the handler. error("error optimizing the code"); } @@ -1084,8 +1076,8 @@ error(": -save-merged-module must be specified with -o"); const char *OutputName = nullptr; - if (!CodeGen.compile_to_file(&OutputName, DisableVerify, DisableInline, - DisableGVNLoadPRE, DisableLTOVectorization)) + if (!CodeGen.compile_to_file(&OutputName, DisableVerify, + DisableLTOVectorization)) error("error compiling the code"); // Diagnostic messages should have been printed by the handler. diff --git a/llvm/tools/lto/lto.cpp b/llvm/tools/lto/lto.cpp --- a/llvm/tools/lto/lto.cpp +++ b/llvm/tools/lto/lto.cpp @@ -41,14 +41,6 @@ cl::ZeroOrMore, cl::init('2')); -static cl::opt -DisableInline("disable-inlining", cl::init(false), - cl::desc("Do not run the inliner pass")); - -static cl::opt -DisableGVNLoadPRE("disable-gvn-loadpre", cl::init(false), - cl::desc("Do not run the GVN load PRE pass")); - static cl::opt DisableLTOVectorization( "disable-lto-vectorization", cl::init(false), cl::desc("Do not run loop or slp vectorization during LTO")); @@ -448,9 +440,7 @@ const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) { maybeParseOptions(cg); LibLTOCodeGenerator *CG = unwrap(cg); - CG->NativeObjectFile = - CG->compile(DisableVerify, DisableInline, DisableGVNLoadPRE, - DisableLTOVectorization); + CG->NativeObjectFile = CG->compile(DisableVerify, DisableLTOVectorization); if (!CG->NativeObjectFile) return nullptr; *length = CG->NativeObjectFile->getBufferSize(); @@ -459,8 +449,7 @@ bool lto_codegen_optimize(lto_code_gen_t cg) { maybeParseOptions(cg); - return !unwrap(cg)->optimize(DisableVerify, DisableInline, DisableGVNLoadPRE, - DisableLTOVectorization); + return !unwrap(cg)->optimize(DisableVerify, DisableLTOVectorization); } const void *lto_codegen_compile_optimized(lto_code_gen_t cg, size_t *length) { @@ -475,9 +464,8 @@ bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) { maybeParseOptions(cg); - return !unwrap(cg)->compile_to_file( - name, DisableVerify, DisableInline, DisableGVNLoadPRE, - DisableLTOVectorization); + return !unwrap(cg)->compile_to_file(name, DisableVerify, + DisableLTOVectorization); } void lto_codegen_debug_options(lto_code_gen_t cg, const char *opt) {