PMBuilder: Expose an option to disable tail calls

Adds API to allow frontends to disable tail calls in PassManagerBuilder.

<rdar://problem/16050591>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206542 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2014-04-18 01:05:15 +00:00
parent cfe02c46dc
commit bf1d0f417e
2 changed files with 4 additions and 1 deletions

View File

@ -106,6 +106,7 @@ public:
/// added to the per-module passes.
Pass *Inliner;
bool DisableTailCalls;
bool DisableUnitAtATime;
bool DisableUnrollLoops;
bool BBVectorize;

View File

@ -58,6 +58,7 @@ PassManagerBuilder::PassManagerBuilder() {
SizeLevel = 0;
LibraryInfo = 0;
Inliner = 0;
DisableTailCalls = false;
DisableUnitAtATime = false;
DisableUnrollLoops = false;
BBVectorize = RunBBVectorization;
@ -183,7 +184,8 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
MPM.add(createInstructionCombiningPass()); // Combine silly seq's
MPM.add(createTailCallEliminationPass()); // Eliminate tail calls
if (!DisableTailCalls)
MPM.add(createTailCallEliminationPass()); // Eliminate tail calls
MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
MPM.add(createReassociatePass()); // Reassociate expressions
MPM.add(createLoopRotatePass()); // Rotate Loop