PMBuilder: Expose an option to disable tail calls

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

<rdar://problem/16050591>

llvm-svn: 206542
This commit is contained in:
Duncan P. N. Exon Smith 2014-04-18 01:05:15 +00:00
parent 1aa6cb4d88
commit 49f3ec80c2
2 changed files with 4 additions and 1 deletions

View File

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

View File

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