Choose CompileOptions (optimization passes) to match llvm-gcc more

closely.

llvm-svn: 58361
This commit is contained in:
Daniel Dunbar 2008-10-29 03:42:18 +00:00
parent dc4030454d
commit a3730a23a2
2 changed files with 7 additions and 3 deletions

View File

@ -1142,7 +1142,11 @@ OptLevel("O", llvm::cl::Prefix,
static void InitializeCompileOptions(CompileOptions &Opts) {
Opts.OptimizationLevel = OptLevel;
Opts.OptimizeSize = OptSize;
// FIXME: Wire other options.
// FIXME: There are llvm-gcc options to control these selectively.
Opts.InlineFunctions = (Opts.OptimizationLevel > 1);
Opts.UnrollLoops = (Opts.OptimizationLevel > 1 && !OptSize);
Opts.SimplifyLibCalls = 1;
}
//===----------------------------------------------------------------------===//

View File

@ -34,8 +34,8 @@ public:
CompileOptions() {
OptimizationLevel = 0;
OptimizeSize = 0;
UnitAtATime = InlineFunctions = SimplifyLibCalls = 1;
UnrollLoops = 1;
UnitAtATime = 1;
InlineFunctions = SimplifyLibCalls = UnrollLoops = 0;
VerifyModule = 1;
}
};