[llvm] r277295 - [bugpoint] Add a -Os option
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 31 12:25:17 PDT 2016
Author: majnemer
Date: Sun Jul 31 14:25:16 2016
New Revision: 277295
URL: http://llvm.org/viewvc/llvm-project?rev=277295&view=rev
Log:
[bugpoint] Add a -Os option
Modified:
llvm/trunk/tools/bugpoint/bugpoint.cpp
Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=277295&r1=277294&r2=277295&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/bugpoint.cpp (original)
+++ llvm/trunk/tools/bugpoint/bugpoint.cpp Sun Jul 31 14:25:16 2016
@@ -75,6 +75,10 @@ OptLevelO2("O2",
cl::desc("Optimization level 2. Identical to 'opt -O2'"));
static cl::opt<bool>
+OptLevelOs("Os",
+ cl::desc("Like -O2 with extra optimizations for size. Similar to clang -Os"));
+
+static cl::opt<bool>
OptLevelO3("O3",
cl::desc("Optimization level 3. Identical to 'opt -O3'"));
@@ -176,8 +180,8 @@ int main(int argc, char **argv) {
PassManagerBuilder Builder;
if (OptLevelO1)
Builder.Inliner = createAlwaysInlinerPass();
- else if (OptLevelO2)
- Builder.Inliner = createFunctionInliningPass(225);
+ else if (OptLevelOs || OptLevelO2)
+ Builder.Inliner = createFunctionInliningPass(2, OptLevelOs ? 1 : 0);
else
Builder.Inliner = createFunctionInliningPass(275);
Builder.populateFunctionPassManager(PM);
More information about the llvm-commits
mailing list