[bugpoint] Add a -Os option

llvm-svn: 277295
This commit is contained in:
David Majnemer 2016-07-31 19:25:16 +00:00
parent 0b2d71373b
commit 26bdcaf4d2
1 changed files with 6 additions and 2 deletions

View File

@ -74,6 +74,10 @@ static cl::opt<bool>
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);