Unroll loops by default, add --opt=disable-loop-unroll to disable.

Issue #78.
This commit is contained in:
Matt Pharr
2011-09-13 15:36:34 -07:00
parent 0c344b6755
commit 30f9dcd4f5
5 changed files with 33 additions and 11 deletions

View File

@@ -294,7 +294,7 @@ Optimize(llvm::Module *module, int optLevel) {
llvm::createStandardModulePasses(&optPM, 3,
false /* opt size */,
true /* unit at a time */,
false /* unroll loops */,
g->opt.unrollLoops,
true /* simplify lib calls */,
false /* may have exceptions */,
llvm::createFunctionInliningPass());
@@ -309,7 +309,7 @@ Optimize(llvm::Module *module, int optLevel) {
llvm::createStandardModulePasses(&optPM, 3,
false /* opt size */,
true /* unit at a time */,
false /* unroll loops */,
g->opt.unrollLoops,
true /* simplify lib calls */,
false /* may have exceptions */,
llvm::createFunctionInliningPass());
@@ -318,6 +318,8 @@ Optimize(llvm::Module *module, int optLevel) {
llvm::PassManagerBuilder builder;
builder.OptLevel = 3;
builder.Inliner = llvm::createFunctionInliningPass();
if (g->opt.unrollLoops == false)
builder.DisableUnrollLoops = true;
builder.populateFunctionPassManager(funcPM);
builder.populateModulePassManager(optPM);
optPM.add(CreateIsCompileTimeConstantPass(true));