From 2f8f1d34e39546223c960932a5ede83fa400b3f8 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 16 Oct 2014 20:00:02 +0000 Subject: [PATCH] Delete -std-compile-opts. These days -std-compile-opts was just a silly alias for -O3. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219951 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/CommandGuide/opt.rst | 23 ++-------- docs/HowToSubmitABug.rst | 2 +- lib/Target/README.txt | 44 +++++++++---------- test/Analysis/BasicAA/2008-04-15-Byval.ll | 2 +- ...-02-05-FunctionLocalMetadataBecomesNull.ll | 2 +- test/CodeGen/PowerPC/ppcf128-1.ll | 2 +- test/CodeGen/Thumb2/2009-12-01-LoopIVUsers.ll | 2 +- test/CodeGen/X86/asm-block-labels.ll | 2 +- test/CodeGen/X86/dllimport-x86_64.ll | 2 +- test/CodeGen/X86/dllimport.ll | 2 +- test/CodeGen/X86/nancvt.ll | 2 +- test/Feature/weak_constant.ll | 2 +- .../2007-10-19-InlineAsmDirectives.ll | 2 +- .../InstCombine/2007-10-10-EliminateMemCpy.ll | 2 +- .../Mem2Reg/2007-08-27-VolatileLoadsStores.ll | 2 +- tools/bugpoint/bugpoint.cpp | 10 ----- tools/opt/opt.cpp | 43 +----------------- utils/findmisopt | 4 +- 18 files changed, 43 insertions(+), 107 deletions(-) diff --git a/docs/CommandGuide/opt.rst b/docs/CommandGuide/opt.rst index ad5b62cf6e5..3a050f7d815 100644 --- a/docs/CommandGuide/opt.rst +++ b/docs/CommandGuide/opt.rst @@ -62,27 +62,14 @@ OPTIONS available. The order in which the options occur on the command line are the order in which they are executed (within pass constraints). -.. option:: -std-compile-opts - - This is short hand for a standard list of *compile time optimization* passes. - It might be useful for other front end compilers as well. To discover the - full set of options available, use the following command: - - .. code-block:: sh - - llvm-as < /dev/null | opt -std-compile-opts -disable-output -debug-pass=Arguments - .. option:: -disable-inlining - This option is only meaningful when :option:`-std-compile-opts` is given. It - simply removes the inlining pass from the standard list. + This option simply removes the inlining pass from the standard list. .. option:: -disable-opt - This option is only meaningful when :option:`-std-compile-opts` is given. It - disables most, but not all, of the :option:`-std-compile-opts`. The ones that - remain are :option:`-verify`, :option:`-lower-setjmp`, and - :option:`-funcresolve`. + This option is only meaningful when :option:`-std-link-opts` is given. It + disables most passes. .. option:: -strip-debug @@ -95,9 +82,7 @@ OPTIONS This option causes opt to add a verify pass after every pass otherwise specified on the command line (including :option:`-verify`). This is useful for cases where it is suspected that a pass is creating an invalid module but - it is not clear which pass is doing it. The combination of - :option:`-std-compile-opts` and :option:`-verify-each` can quickly track down - this kind of problem. + it is not clear which pass is doing it. .. option:: -stats diff --git a/docs/HowToSubmitABug.rst b/docs/HowToSubmitABug.rst index 702dc0c6112..9f997d2757d 100644 --- a/docs/HowToSubmitABug.rst +++ b/docs/HowToSubmitABug.rst @@ -89,7 +89,7 @@ Then run: .. code-block:: bash - opt -std-compile-opts -debug-pass=Arguments foo.bc -disable-output + opt -O3 -debug-pass=Arguments foo.bc -disable-output This command should do two things: it should print out a list of passes, and then it should crash in the same way as clang. If it doesn't crash, please diff --git a/lib/Target/README.txt b/lib/Target/README.txt index bf8d465d0ae..0fa56e66747 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -733,7 +733,7 @@ f (unsigned long a, unsigned long b, unsigned long c) return ((a & (c - 1)) != 0) | ((b & (c - 1)) != 0); } Both should combine to ((a|b) & (c-1)) != 0. Currently not optimized with -"clang -emit-llvm-bc | opt -std-compile-opts". +"clang -emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// @@ -746,7 +746,7 @@ void clear_pmd_range(unsigned long start, unsigned long end) } The expression should optimize to something like "!((start|end)&~PMD_MASK). Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". +-emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// @@ -765,7 +765,7 @@ int f(int x, int y) return (abs(x)) >= 0; } This should optimize to x == INT_MIN. (With -fwrapv.) Currently not -optimized with "clang -emit-llvm-bc | opt -std-compile-opts". +optimized with "clang -emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// @@ -803,117 +803,117 @@ rshift_gt (unsigned int a) All should simplify to a single comparison. All of these are currently not optimized with "clang -emit-llvm-bc | opt --std-compile-opts". +-O3". //===---------------------------------------------------------------------===// From GCC Bug 32605: int c(int* x) {return (char*)x+2 == (char*)x;} Should combine to 0. Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts" (although llc can optimize it). +-emit-llvm-bc | opt -O3" (although llc can optimize it). //===---------------------------------------------------------------------===// int a(unsigned b) {return ((b << 31) | (b << 30)) >> 31;} Should be combined to "((b >> 1) | b) & 1". Currently not optimized -with "clang -emit-llvm-bc | opt -std-compile-opts". +with "clang -emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// unsigned a(unsigned x, unsigned y) { return x | (y & 1) | (y & 2);} Should combine to "x | (y & 3)". Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". +-emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// int a(int a, int b, int c) {return (~a & c) | ((c|a) & b);} Should fold to "(~a & c) | (a & b)". Currently not optimized with -"clang -emit-llvm-bc | opt -std-compile-opts". +"clang -emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// int a(int a,int b) {return (~(a|b))|a;} Should fold to "a|~b". Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". +-emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// int a(int a, int b) {return (a&&b) || (a&&!b);} Should fold to "a". Currently not optimized with "clang -emit-llvm-bc -| opt -std-compile-opts". +| opt -O3". //===---------------------------------------------------------------------===// int a(int a, int b, int c) {return (a&&b) || (!a&&c);} Should fold to "a ? b : c", or at least something sane. Currently not -optimized with "clang -emit-llvm-bc | opt -std-compile-opts". +optimized with "clang -emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// int a(int a, int b, int c) {return (a&&b) || (a&&c) || (a&&b&&c);} Should fold to a && (b || c). Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". +-emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// int a(int x) {return x | ((x & 8) ^ 8);} Should combine to x | 8. Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". +-emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// int a(int x) {return x ^ ((x & 8) ^ 8);} Should also combine to x | 8. Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". +-emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// int a(int x) {return ((x | -9) ^ 8) & x;} Should combine to x & -9. Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". +-emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// unsigned a(unsigned a) {return a * 0x11111111 >> 28 & 1;} Should combine to "a * 0x88888888 >> 31". Currently not optimized -with "clang -emit-llvm-bc | opt -std-compile-opts". +with "clang -emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// unsigned a(char* x) {if ((*x & 32) == 0) return b();} There's an unnecessary zext in the generated code with "clang --emit-llvm-bc | opt -std-compile-opts". +-emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// unsigned a(unsigned long long x) {return 40 * (x >> 1);} Should combine to "20 * (((unsigned)x) & -2)". Currently not -optimized with "clang -emit-llvm-bc | opt -std-compile-opts". +optimized with "clang -emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// int g(int x) { return (x - 10) < 0; } Should combine to "x <= 9" (the sub has nsw). Currently not -optimized with "clang -emit-llvm-bc | opt -std-compile-opts". +optimized with "clang -emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// int g(int x) { return (x + 10) < 0; } Should combine to "x < -10" (the add has nsw). Currently not -optimized with "clang -emit-llvm-bc | opt -std-compile-opts". +optimized with "clang -emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// int f(int i, int j) { return i < j + 1; } int g(int i, int j) { return j > i - 1; } Should combine to "i <= j" (the add/sub has nsw). Currently not -optimized with "clang -emit-llvm-bc | opt -std-compile-opts". +optimized with "clang -emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// unsigned f(unsigned x) { return ((x & 7) + 1) & 15; } The & 15 part should be optimized away, it doesn't change the result. Currently -not optimized with "clang -emit-llvm-bc | opt -std-compile-opts". +not optimized with "clang -emit-llvm-bc | opt -O3". //===---------------------------------------------------------------------===// diff --git a/test/Analysis/BasicAA/2008-04-15-Byval.ll b/test/Analysis/BasicAA/2008-04-15-Byval.ll index 428189a8a87..2ea0314d5b6 100644 --- a/test/Analysis/BasicAA/2008-04-15-Byval.ll +++ b/test/Analysis/BasicAA/2008-04-15-Byval.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -std-compile-opts -S | FileCheck %s +; RUN: opt < %s -O3 -S | FileCheck %s ; ModuleID = 'small2.c' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin8" diff --git a/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll b/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll index f6a8bd1b932..5cb869d7b39 100644 --- a/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll +++ b/test/Assembler/2010-02-05-FunctionLocalMetadataBecomesNull.ll @@ -1,4 +1,4 @@ -; RUN: opt -std-compile-opts < %s | llvm-dis | not grep badref +; RUN: opt -O3 < %s | llvm-dis | not grep badref ; RUN: verify-uselistorder %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" diff --git a/test/CodeGen/PowerPC/ppcf128-1.ll b/test/CodeGen/PowerPC/ppcf128-1.ll index 1047fe5d3ba..2cec934c66f 100644 --- a/test/CodeGen/PowerPC/ppcf128-1.ll +++ b/test/CodeGen/PowerPC/ppcf128-1.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -std-compile-opts | llc > %t +; RUN: opt < %s -O3 | llc > %t ; ModuleID = 'ld3.c' target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128" target triple = "powerpc-apple-darwin8" diff --git a/test/CodeGen/Thumb2/2009-12-01-LoopIVUsers.ll b/test/CodeGen/Thumb2/2009-12-01-LoopIVUsers.ll index 524e5a6b7b6..89b7148f5ec 100644 --- a/test/CodeGen/Thumb2/2009-12-01-LoopIVUsers.ll +++ b/test/CodeGen/Thumb2/2009-12-01-LoopIVUsers.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -std-compile-opts | \ +; RUN: opt < %s -O3 | \ ; RUN: llc -mtriple=thumbv7-apple-darwin10 -mattr=+neon | FileCheck %s define void @fred(i32 %three_by_three, i8* %in, double %dt1, i32 %x_size, i32 %y_size, i8* %bp) nounwind { diff --git a/test/CodeGen/X86/asm-block-labels.ll b/test/CodeGen/X86/asm-block-labels.ll index 6dbfb16a6d5..93524386c6b 100644 --- a/test/CodeGen/X86/asm-block-labels.ll +++ b/test/CodeGen/X86/asm-block-labels.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -std-compile-opts | llc -no-integrated-as +; RUN: opt < %s -O3 | llc -no-integrated-as ; ModuleID = 'block12.c' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i686-apple-darwin8" diff --git a/test/CodeGen/X86/dllimport-x86_64.ll b/test/CodeGen/X86/dllimport-x86_64.ll index 666409fd4c0..839bca4f3c3 100644 --- a/test/CodeGen/X86/dllimport-x86_64.ll +++ b/test/CodeGen/X86/dllimport-x86_64.ll @@ -4,7 +4,7 @@ ; RUN: llc -mtriple x86_64-pc-mingw32 -O0 < %s | FileCheck %s -check-prefix=FAST ; PR6275 ; -; RUN: opt -mtriple x86_64-pc-win32 -std-compile-opts -S < %s | FileCheck %s -check-prefix=OPT +; RUN: opt -mtriple x86_64-pc-win32 -O3 -S < %s | FileCheck %s -check-prefix=OPT @Var1 = external dllimport global i32 @Var2 = available_externally dllimport unnamed_addr constant i32 1 diff --git a/test/CodeGen/X86/dllimport.ll b/test/CodeGen/X86/dllimport.ll index 695bfce821b..231ad65740b 100644 --- a/test/CodeGen/X86/dllimport.ll +++ b/test/CodeGen/X86/dllimport.ll @@ -4,7 +4,7 @@ ; RUN: llc -mtriple i386-pc-mingw32 -O0 < %s | FileCheck %s -check-prefix=FAST ; PR6275 ; -; RUN: opt -mtriple i386-pc-win32 -std-compile-opts -S < %s | FileCheck %s -check-prefix=OPT +; RUN: opt -mtriple i386-pc-win32 -O3 -S < %s | FileCheck %s -check-prefix=OPT @Var1 = external dllimport global i32 @Var2 = available_externally dllimport unnamed_addr constant i32 1 diff --git a/test/CodeGen/X86/nancvt.ll b/test/CodeGen/X86/nancvt.ll index 8036710b225..8a665fa79cf 100644 --- a/test/CodeGen/X86/nancvt.ll +++ b/test/CodeGen/X86/nancvt.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -std-compile-opts | llc > %t +; RUN: opt < %s -O3 | llc > %t ; RUN: grep 2147027116 %t | count 3 ; RUN: grep 2147228864 %t | count 3 ; RUN: grep 2146502828 %t | count 3 diff --git a/test/Feature/weak_constant.ll b/test/Feature/weak_constant.ll index fba7f12e1de..d331bf59e83 100644 --- a/test/Feature/weak_constant.ll +++ b/test/Feature/weak_constant.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -std-compile-opts -S > %t +; RUN: opt < %s -O3 -S > %t ; RUN: grep undef %t | count 1 ; RUN: grep 5 %t | count 1 ; RUN: grep 7 %t | count 1 diff --git a/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll b/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll index 598ea0e354e..d4b94fe62c7 100644 --- a/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll +++ b/test/Transforms/BranchFolding/2007-10-19-InlineAsmDirectives.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -std-compile-opts -o - | llc -no-integrated-as -o - | grep bork_directive | wc -l | grep 2 +; RUN: opt < %s -O3 -o - | llc -no-integrated-as -o - | grep bork_directive | wc -l | grep 2 ;; We don't want branch folding to fold asm directives. diff --git a/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll b/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll index fe935f96e9e..656fb34061d 100644 --- a/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll +++ b/test/Transforms/InstCombine/2007-10-10-EliminateMemCpy.ll @@ -1,5 +1,5 @@ ; RUN: opt < %s -instcombine -S | not grep call -; RUN: opt < %s -std-compile-opts -S | not grep xyz +; RUN: opt < %s -O3 -S | not grep xyz target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" @.str = internal constant [4 x i8] c"xyz\00" ; <[4 x i8]*> [#uses=1] diff --git a/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll b/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll index ea0d515498c..ea581d197e5 100644 --- a/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll +++ b/test/Transforms/Mem2Reg/2007-08-27-VolatileLoadsStores.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -std-compile-opts -S | grep volatile | count 3 +; RUN: opt < %s -O3 -S | grep volatile | count 3 ; PR1520 ; Don't promote load volatiles/stores. This is really needed to handle setjmp/lonjmp properly. diff --git a/tools/bugpoint/bugpoint.cpp b/tools/bugpoint/bugpoint.cpp index a575861ede2..d0bade507d2 100644 --- a/tools/bugpoint/bugpoint.cpp +++ b/tools/bugpoint/bugpoint.cpp @@ -62,10 +62,6 @@ UseValgrind("enable-valgrind", static cl::list PassList(cl::desc("Passes available:"), cl::ZeroOrMore); -static cl::opt -StandardCompileOpts("std-compile-opts", - cl::desc("Include the standard compile time optimizations")); - static cl::opt StandardLinkOpts("std-link-opts", cl::desc("Include the standard link time optimizations")); @@ -170,12 +166,6 @@ int main(int argc, char **argv) { if (D.addSources(InputFilenames)) return 1; AddToDriver PM(D); - if (StandardCompileOpts) { - PassManagerBuilder Builder; - Builder.OptLevel = 3; - Builder.Inliner = createFunctionInliningPass(); - Builder.populateModulePassManager(PM); - } if (StandardLinkOpts) { PassManagerBuilder Builder; diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index f1a945a6000..8a3362912c7 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -108,10 +108,6 @@ static cl::opt DisableOptimizations("disable-opt", cl::desc("Do not run any optimization passes")); -static cl::opt -StandardCompileOpts("std-compile-opts", - cl::desc("Include the standard compile time optimizations")); - static cl::opt StandardLinkOpts("std-link-opts", cl::desc("Include the standard link time optimizations")); @@ -233,26 +229,6 @@ static void AddOptimizationPasses(PassManagerBase &MPM,FunctionPassManager &FPM, Builder.populateModulePassManager(MPM); } -static void AddStandardCompilePasses(PassManagerBase &PM) { - PM.add(createVerifierPass()); // Verify that input is correct - - // If the -strip-debug command line option was specified, do it. - if (StripDebug) - addPass(PM, createStripSymbolsPass(true)); - - // Verify debug info only after it's (possibly) stripped. - PM.add(createDebugInfoVerifierPass()); - - if (DisableOptimizations) return; - - // -std-compile-opts adds the same module passes as -O3. - PassManagerBuilder Builder; - if (!DisableInline) - Builder.Inliner = createFunctionInliningPass(); - Builder.OptLevel = 3; - Builder.populateModulePassManager(PM); -} - static void AddStandardLinkPasses(PassManagerBase &PM) { PassManagerBuilder Builder; Builder.VerifyInput = true; @@ -479,21 +455,12 @@ int main(int argc, char **argv) { NoOutput = true; } - // If the -strip-debug command line option was specified, add it. If - // -std-compile-opts was also specified, it will handle StripDebug. - if (StripDebug && !StandardCompileOpts) + // If the -strip-debug command line option was specified, add it. + if (StripDebug) addPass(Passes, createStripSymbolsPass(true)); // Create a new optimization pass for each one specified on the command line for (unsigned i = 0; i < PassList.size(); ++i) { - // Check to see if -std-compile-opts was specified before this option. If - // so, handle it. - if (StandardCompileOpts && - StandardCompileOpts.getPosition() < PassList.getPosition(i)) { - AddStandardCompilePasses(Passes); - StandardCompileOpts = false; - } - if (StandardLinkOpts && StandardLinkOpts.getPosition() < PassList.getPosition(i)) { AddStandardLinkPasses(Passes); @@ -566,12 +533,6 @@ int main(int argc, char **argv) { Passes.add(createPrintModulePass(errs())); } - // If -std-compile-opts was specified at the end of the pass list, add them. - if (StandardCompileOpts) { - AddStandardCompilePasses(Passes); - StandardCompileOpts = false; - } - if (StandardLinkOpts) { AddStandardLinkPasses(Passes); StandardLinkOpts = false; diff --git a/utils/findmisopt b/utils/findmisopt index 88f991a634c..24052209428 100755 --- a/utils/findmisopt +++ b/utils/findmisopt @@ -74,8 +74,8 @@ echo "Unoptimized program: $prog" echo " Optimized program: $optprog" # Define the list of optimizations to run. This comprises the same set of -# optimizations that opt -std-compile-opts and gccld run, in the same order. -opt_switches=`llvm-as < /dev/null -o - | opt -std-compile-opts -disable-output -debug-pass=Arguments 2>&1 | sed 's/Pass Arguments: //'` +# optimizations that opt -O3 runs, in the same order. +opt_switches=`llvm-as < /dev/null -o - | opt -O3 -disable-output -debug-pass=Arguments 2>&1 | sed 's/Pass Arguments: //'` all_switches="$opt_switches" echo "Passes : $all_switches"